Title: [185019] trunk
Revision
185019
Author
[email protected]
Date
2015-05-29 16:53:24 -0700 (Fri, 29 May 2015)

Log Message

Text disappears shortly after page load on Nexus 7 site.
https://bugs.webkit.org/show_bug.cgi?id=145467
rdar://problem/18327239

Reviewed by Simon Fraser.

This patch ensures that overlap testing for composited layers works properly when the sibling
layer gets composited through its child.

When a layer gets composited through its child content, the recursive overlap testing should build up the
overlapmap stack so that sibling content is intersected both against the child and its parent bounds.

Source/WebCore:

Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
       compositing/sibling-layer-does-not-get-composited-transform-case.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.

LayoutTests:

* compositing/sibling-layer-does-not-get-composited-overflow-hidden-case-expected.html: Added.
* compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html: Added.
* compositing/sibling-layer-does-not-get-composited-transform-case-expected.html: Added.
* compositing/sibling-layer-does-not-get-composited-transform-case.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (185018 => 185019)


--- trunk/LayoutTests/ChangeLog	2015-05-29 23:51:51 UTC (rev 185018)
+++ trunk/LayoutTests/ChangeLog	2015-05-29 23:53:24 UTC (rev 185019)
@@ -1,3 +1,22 @@
+2015-05-29  Zalan Bujtas  <[email protected]>
+
+        Text disappears shortly after page load on Nexus 7 site.
+        https://bugs.webkit.org/show_bug.cgi?id=145467
+        rdar://problem/18327239
+
+        Reviewed by Simon Fraser.
+
+        This patch ensures that overlap testing for composited layers works properly when the sibling
+        layer gets composited through its child.
+
+        When a layer gets composited through its child content, the recursive overlap testing should build up the
+        overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
+
+        * compositing/sibling-layer-does-not-get-composited-overflow-hidden-case-expected.html: Added.
+        * compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html: Added.
+        * compositing/sibling-layer-does-not-get-composited-transform-case-expected.html: Added.
+        * compositing/sibling-layer-does-not-get-composited-transform-case.html: Added.
+
 2015-05-29  Chris Dumez  <[email protected]>
 
         Consider throttling DOM timers in iframes outside the viewport

Added: trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-overflow-hidden-case-expected.html (0 => 185019)


--- trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-overflow-hidden-case-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-overflow-hidden-case-expected.html	2015-05-29 23:53:24 UTC (rev 185019)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that that sibling container gets composited when composition of the inner content is forced by its child container.</title>
+<style>
+  .container {
+    transform: translateZ(0);
+  	height: 200px;
+  	width: 200px;
+  }
+
+  .inner {
+    transform: translateZ(0);
+  	position: absolute;
+  	width: 200px;
+  	height: 200px;
+  	background-color: silver;
+  }
+  
+  .inner-most {
+    transform: translateZ(0);
+    display: inline-block;
+    width: 100px;
+    height: 100px;
+  	border: 1px solid green;
+  	margin-top: 60px;  
+  }
+
+  .sibling {
+    transform: translateZ(0);
+  	position: relative;
+  	width: 200px;
+  	height: 40px;
+	background-color: green;
+  }
+</style>
+<body>
+<div class=container>
+  <div class=inner>
+	<div class=inner-most>composited</div>
+  </div>
+  <div class=sibling></div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html (0 => 185019)


--- trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html	2015-05-29 23:53:24 UTC (rev 185019)
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that that sibling container gets composited when composition of the inner content is forced by its child container.</title>
+<style>
+  .container {
+    transform: translateZ(0);
+  	height: 200px;
+  	width: 200px;
+  }
+
+  .inner {
+  	z-index: 1;
+  	overflow: hidden;
+  	position: absolute;
+  	width: 200px;
+  	height: 200px;
+  	background-color: silver;
+  }
+  
+  .inner-most {
+    transform: translateZ(0);
+    display: inline-block;
+    width: 100px;
+    height: 100px;
+  	border: 1px solid green;
+  	margin-top: 60px;  
+  }
+
+  .sibling {
+  	z-index: 1;
+  	position: relative;
+  	width: 200px;
+  	height: 40px;
+	background-color: green;
+  }
+</style>
+<body>
+<div class=container>
+  <div class=inner>
+	<div class=inner-most>composited</div>
+  </div>
+  <div class=sibling></div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-transform-case-expected.html (0 => 185019)


--- trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-transform-case-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-transform-case-expected.html	2015-05-29 23:53:24 UTC (rev 185019)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that that sibling container gets composited when composition of the inner content is forced by its child container.</title>
+<style>
+  .container {
+    transform: translateZ(0);
+  	height: 200px;
+  	width: 200px;
+  }
+
+  .inner {
+    transform: translateZ(0);
+  	position: absolute;
+  	width: 200px;
+  	height: 200px;
+  	background-color: silver;
+  }
+  
+  .inner-most {
+    transform: translateZ(0);
+    display: inline-block;
+    width: 100px;
+    height: 100px;
+  	border: 1px solid green;
+  	margin-top: 60px;  
+  }
+
+  .sibling {
+    transform: translateZ(0);
+  	position: relative;
+  	width: 200px;
+  	height: 40px;
+	background-color: green;
+  }
+</style>
+<body>
+<div class=container>
+  <div class=inner>
+	<div class=inner-most>composited</div>
+  </div>
+  <div class=sibling></div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-transform-case.html (0 => 185019)


--- trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-transform-case.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/sibling-layer-does-not-get-composited-transform-case.html	2015-05-29 23:53:24 UTC (rev 185019)
@@ -0,0 +1,45 @@
+<html>
+<head>
+<title>This tests that that sibling container gets composited when composition of the inner content is forced by its child container.</title>
+<style>
+  .container {
+  	transform: translateZ(0);
+  	height: 200px;
+  	width: 200px;
+  }
+
+  .inner {
+  	transform: translateX(0);
+  	background-color: silver;
+  	height: 200px;
+  	width: 200px;
+  }
+
+  .inner-most {
+    transform: translateZ(0);
+    display: inline-block;
+    width: 100px;
+    height: 100px;
+  	border: 1px solid green;
+  	margin-top: 60px;  
+  }
+
+  .sibling {
+  	position: relative;
+	top: -200px;
+  	width: 200px;
+  	height: 40px;
+	background-color: green;
+  }
+    
+</style>
+<body>
+          
+<div class=container>
+  <div class=inner>
+    <div class=inner-most>composited</div>
+  </div>
+  <div class=sibling></div>
+</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (185018 => 185019)


--- trunk/Source/WebCore/ChangeLog	2015-05-29 23:51:51 UTC (rev 185018)
+++ trunk/Source/WebCore/ChangeLog	2015-05-29 23:53:24 UTC (rev 185019)
@@ -1,3 +1,24 @@
+2015-05-29  Zalan Bujtas  <[email protected]>
+
+        Text disappears shortly after page load on Nexus 7 site.
+        https://bugs.webkit.org/show_bug.cgi?id=145467
+        rdar://problem/18327239
+
+        Reviewed by Simon Fraser.
+
+        This patch ensures that overlap testing for composited layers works properly when the sibling
+        layer gets composited through its child.
+
+        When a layer gets composited through its child content, the recursive overlap testing should build up the
+        overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
+
+        Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
+               compositing/sibling-layer-does-not-get-composited-transform-case.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
+        (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
+
 2015-05-29  Brady Eidson  <[email protected]>
 
         Review feedback followup for r185003.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (185018 => 185019)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2015-05-29 23:51:51 UTC (rev 185018)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2015-05-29 23:53:24 UTC (rev 185019)
@@ -144,29 +144,24 @@
         pushCompositingContainer();
     }
 
-    void add(const RenderLayer* layer, const LayoutRect& bounds)
+    void add(const LayoutRect& bounds)
     {
         // Layers do not contribute to overlap immediately--instead, they will
         // contribute to overlap as soon as their composited ancestor has been
         // recursively processed and popped off the stack.
         ASSERT(m_overlapStack.size() >= 2);
         m_overlapStack[m_overlapStack.size() - 2].add(bounds);
-        m_layers.add(layer);
+        m_isEmpty = false;
     }
 
-    bool contains(const RenderLayer* layer)
-    {
-        return m_layers.contains(layer);
-    }
-
     bool overlapsLayers(const LayoutRect& bounds) const
     {
         return m_overlapStack.last().overlapsLayers(bounds);
     }
 
-    bool isEmpty()
+    bool isEmpty() const
     {
-        return m_layers.isEmpty();
+        return m_isEmpty;
     }
 
     void pushCompositingContainer()
@@ -214,8 +209,8 @@
     };
 
     Vector<OverlapMapContainer> m_overlapStack;
-    HashSet<const RenderLayer*> m_layers;
     RenderGeometryMap m_geometryMap;
+    bool m_isEmpty { true };
 };
 
 struct RenderLayerCompositor::CompositingState {
@@ -1201,12 +1196,12 @@
         clipRect.scale(pageScaleFactor());
 #endif
     clipRect.intersect(extent.bounds);
-    overlapMap.add(&layer, clipRect);
+    overlapMap.add(clipRect);
 }
 
 void RenderLayerCompositor::addToOverlapMapRecursive(OverlapMap& overlapMap, const RenderLayer& layer, const RenderLayer* ancestorLayer)
 {
-    if (!canBeComposited(layer) || overlapMap.contains(&layer))
+    if (!canBeComposited(layer))
         return;
 
     // A null ancestorLayer is an indication that 'layer' has already been pushed.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to