Compute image background size when testing for background visibility
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2013 05:11:06 +0000 (05:11 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2013 05:11:06 +0000 (05:11 +0000)
commitac93d5ef1c7ae5cee2d0397ef8f78a4df438ab2b
tree52161c997c99ad518bd28b92eb211af698b6dc3c
parent24641dd13b2f345db948f9d10bc34542a6e0740c
Compute image background size when testing for background visibility
https://bugs.webkit.org/show_bug.cgi?id=112313

Reviewed by Simon Fraser.

Source/WebCore:

We can catch more cases where background is fully obscured.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBackground):

    Use early returns.

(WebCore::RenderBox::backgroundPaintedExtent):

    Compute the bounds for image backgrounds.

(WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
(WebCore::RenderBox::backgroundIsKnownToBeObscured):

    Rename to make clear that the answers are certain to one direction only.

* rendering/RenderBox.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::boxShadowShouldBeAppliedToBackground):
(WebCore::RenderImage::backgroundIsKnownToBeObscured):
* rendering/RenderImage.h:

LayoutTests:

* fast/repaint/obscured-background-no-repaint.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/repaint/obscured-background-no-repaint.html
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h