Title: [149914] trunk
- Revision
- 149914
- Author
- [email protected]
- Date
- 2013-05-10 17:31:59 -0700 (Fri, 10 May 2013)
Log Message
Garbage down left side of nytimes.com page (if subscriber)
https://bugs.webkit.org/show_bug.cgi?id=115839
Source/WebCore:
Reviewed by Antti Koivisto.
RenderLayer::backgroundIsKnownToBeOpaqueInRect() would incorrectly return true
for layers where the given rect wasn't contained in the background rect, but
where some child layer obscured the rect, even though clipping hid part
of that child layer.
So bail from RenderLayer::backgroundIsKnownToBeOpaqueInRect() if we have
any overflow clipping. This could be enhanced in future to test whether child
layers obscure the clipping rect, but that would be more expensive.
Test: compositing/contents-opaque/overflow-hidden-child-layers.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):
LayoutTests:
Reviewed by Antti Koivisto.
* compositing/contents-opaque/overflow-hidden-child-layers-expected.txt: Added.
* compositing/contents-opaque/overflow-hidden-child-layers.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (149913 => 149914)
--- trunk/LayoutTests/ChangeLog 2013-05-10 23:42:07 UTC (rev 149913)
+++ trunk/LayoutTests/ChangeLog 2013-05-11 00:31:59 UTC (rev 149914)
@@ -1,3 +1,13 @@
+2013-05-10 Simon Fraser <[email protected]>
+
+ Garbage down left side of nytimes.com page (if subscriber)
+ https://bugs.webkit.org/show_bug.cgi?id=115839
+
+ Reviewed by Antti Koivisto.
+
+ * compositing/contents-opaque/overflow-hidden-child-layers-expected.txt: Added.
+ * compositing/contents-opaque/overflow-hidden-child-layers.html: Added.
+
2013-05-10 Eric Carlson <[email protected]>
In-band captions not visible immediately after track mode change
Added: trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers-expected.txt (0 => 149914)
--- trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers-expected.txt 2013-05-11 00:31:59 UTC (rev 149914)
@@ -0,0 +1,17 @@
+(GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 30.00 22.00)
+ (bounds 156.00 156.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
Property changes on: trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers-expected.txt
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Added: trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers.html (0 => 149914)
--- trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers.html 2013-05-11 00:31:59 UTC (rev 149914)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .box {
+ height: 100px;
+ width: 100px;
+ margin: 50px;
+ background-color: blue;
+ box-shadow: 0 0 20px black;
+ overflow: hidden;
+ -webkit-transform: translateZ(0);
+ }
+
+ .child {
+ position: relative;
+ top: -30px;
+ left: -30px;
+ width: 300px;
+ height: 300px;
+ background-color: silver;
+ }
+ </style>
+ <script type="text/_javascript_">
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function doTest() {
+ if (window.testRunner && window.internals)
+ document.getElementById('layertree').innerText = window.internals.layerTreeAsText(document);
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+
+ <div class="box">
+ <div class="child">
+ </div>
+ </div>
+ <pre id="layertree"></pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/contents-opaque/overflow-hidden-child-layers.html
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (149913 => 149914)
--- trunk/Source/WebCore/ChangeLog 2013-05-10 23:42:07 UTC (rev 149913)
+++ trunk/Source/WebCore/ChangeLog 2013-05-11 00:31:59 UTC (rev 149914)
@@ -1,3 +1,24 @@
+2013-05-10 Simon Fraser <[email protected]>
+
+ Garbage down left side of nytimes.com page (if subscriber)
+ https://bugs.webkit.org/show_bug.cgi?id=115839
+
+ Reviewed by Antti Koivisto.
+
+ RenderLayer::backgroundIsKnownToBeOpaqueInRect() would incorrectly return true
+ for layers where the given rect wasn't contained in the background rect, but
+ where some child layer obscured the rect, even though clipping hid part
+ of that child layer.
+
+ So bail from RenderLayer::backgroundIsKnownToBeOpaqueInRect() if we have
+ any overflow clipping. This could be enhanced in future to test whether child
+ layers obscure the clipping rect, but that would be more expensive.
+
+ Test: compositing/contents-opaque/overflow-hidden-child-layers.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):
+
2013-05-10 Eric Carlson <[email protected]>
In-band captions not visible immediately after track mode change
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (149913 => 149914)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2013-05-10 23:42:07 UTC (rev 149913)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2013-05-11 00:31:59 UTC (rev 149914)
@@ -5585,8 +5585,15 @@
// FIXME: We currently only check the immediate renderer,
// which will miss many cases.
- return renderer()->backgroundIsKnownToBeOpaqueInRect(localRect)
- || listBackgroundIsKnownToBeOpaqueInRect(posZOrderList(), localRect)
+ if (renderer()->backgroundIsKnownToBeOpaqueInRect(localRect))
+ return true;
+
+ // We can't consult child layers if we clip, since they might cover
+ // parts of the rect that are clipped out.
+ if (renderer()->hasOverflowClip())
+ return false;
+
+ return listBackgroundIsKnownToBeOpaqueInRect(posZOrderList(), localRect)
|| listBackgroundIsKnownToBeOpaqueInRect(negZOrderList(), localRect)
|| listBackgroundIsKnownToBeOpaqueInRect(normalFlowList(), localRect);
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes