Title: [149918] trunk
Revision
149918
Author
[email protected]
Date
2013-05-10 17:59:25 -0700 (Fri, 10 May 2013)

Log Message

REGRESSION (r145680): No box shadow rendered on element with positioned child that obscures it
https://bugs.webkit.org/show_bug.cgi?id=115840

Source/WebCore:

Reviewed by Antti Koivisto.

In r107836, we moved some box-shadow painting into the paintFillLayer code for performance.
However, in r145680 we started to skip background painting when we know the background is
obscured. This broke shadow painting in some cases.

Fix by always painting the background fill layers if we know that they will also
paint the shadow.

Test: fast/box-shadow/box-shadow-obscured-backgrounds.html

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

LayoutTests:

Reviewed by Antti Koivisto.

* fast/box-shadow/box-shadow-obscured-backgrounds-expected.html: Added.
* fast/box-shadow/box-shadow-obscured-backgrounds.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (149917 => 149918)


--- trunk/LayoutTests/ChangeLog	2013-05-11 00:52:02 UTC (rev 149917)
+++ trunk/LayoutTests/ChangeLog	2013-05-11 00:59:25 UTC (rev 149918)
@@ -1,5 +1,15 @@
 2013-05-10  Simon Fraser  <[email protected]>
 
+        REGRESSION (r145680): No box shadow rendered on element with positioned child that obscures it
+        https://bugs.webkit.org/show_bug.cgi?id=115840
+
+        Reviewed by Antti Koivisto.
+
+        * fast/box-shadow/box-shadow-obscured-backgrounds-expected.html: Added.
+        * fast/box-shadow/box-shadow-obscured-backgrounds.html: Added.
+
+2013-05-10  Simon Fraser  <[email protected]>
+
         REGRESSION (r143626): Element shows as garbage in image gallery
         https://bugs.webkit.org/show_bug.cgi?id=115946
 

Added: trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds-expected.html (0 => 149918)


--- trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds-expected.html	2013-05-11 00:59:25 UTC (rev 149918)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .box {
+            position: absolute;
+            top: 50px;
+            left: 50px;
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+            box-shadow: 0 0 20px black;
+        }
+    </style>
+</head>
+<body>
+    <div class="box"></div>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds-expected.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds.html (0 => 149918)


--- trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds.html	                        (rev 0)
+++ trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds.html	2013-05-11 00:59:25 UTC (rev 149918)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <style>
+        .box {
+            position: absolute;
+            top: 50px;
+            left: 50px;
+            height: 100px;
+            width: 100px;
+            background-color: blue;
+            box-shadow: 0 0 20px black;
+        }
+        
+        .child {
+            position: absolute;
+            top: 0px;
+            left: 0px;
+            width: 100px;
+            height: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body>
+    <div class="box">
+        <div class="child"></div>
+    </div>
+</body>
+</html>
Property changes on: trunk/LayoutTests/fast/box-shadow/box-shadow-obscured-backgrounds.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (149917 => 149918)


--- trunk/Source/WebCore/ChangeLog	2013-05-11 00:52:02 UTC (rev 149917)
+++ trunk/Source/WebCore/ChangeLog	2013-05-11 00:59:25 UTC (rev 149918)
@@ -1,5 +1,24 @@
 2013-05-10  Simon Fraser  <[email protected]>
 
+        REGRESSION (r145680): No box shadow rendered on element with positioned child that obscures it
+        https://bugs.webkit.org/show_bug.cgi?id=115840
+
+        Reviewed by Antti Koivisto.
+        
+        In r107836, we moved some box-shadow painting into the paintFillLayer code for performance.
+        However, in r145680 we started to skip background painting when we know the background is
+        obscured. This broke shadow painting in some cases.
+        
+        Fix by always painting the background fill layers if we know that they will also
+        paint the shadow.
+
+        Test: fast/box-shadow/box-shadow-obscured-backgrounds.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintBackground):
+
+2013-05-10  Simon Fraser  <[email protected]>
+
         REGRESSION (r143626): Element shows as garbage in image gallery
         https://bugs.webkit.org/show_bug.cgi?id=115946
 

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (149917 => 149918)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2013-05-11 00:52:02 UTC (rev 149917)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2013-05-11 00:59:25 UTC (rev 149918)
@@ -1140,7 +1140,7 @@
     }
     if (isBody() && skipBodyBackground(this))
         return;
-    if (backgroundIsKnownToBeObscured())
+    if (backgroundIsKnownToBeObscured() && !boxShadowShouldBeAppliedToBackground(bleedAvoidance))
         return;
     paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), paintRect, bleedAvoidance);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to