Diff
Modified: trunk/LayoutTests/ChangeLog (88579 => 88580)
--- trunk/LayoutTests/ChangeLog 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/ChangeLog 2011-06-11 00:22:29 UTC (rev 88580)
@@ -1,3 +1,33 @@
+2011-06-10 Simon Fraser <[email protected]>
+
+ Reviewed by Dan Bernstein.
+
+ Keep overlap testing logic until real 3d transforms are being used
+ https://bugs.webkit.org/show_bug.cgi?id=49857
+
+ New tests:
+ * compositing/layer-creation/rotate3d-overlap-expected.txt: Added.
+ * compositing/layer-creation/rotate3d-overlap.html: Added.
+ * compositing/layer-creation/translatez-overlap-expected.txt: Added.
+ * compositing/layer-creation/translatez-overlap.html: Added.
+
+ Changed to use a non-zero z offset to preserve old behavior:
+ * compositing/geometry/ancestor-overflow-change-expected.txt:
+ * compositing/geometry/ancestor-overflow-change.html:
+ * compositing/geometry/clip-expected.txt:
+ * compositing/geometry/clip.html:
+ * compositing/geometry/foreground-layer-expected.txt:
+ * compositing/geometry/foreground-layer.html:
+ * compositing/iframes/invisible-nested-iframe-show-expected.txt:
+ * compositing/iframes/invisible-nested-iframe-show.html:
+ * compositing/overflow/clip-descendents-expected.txt:
+ * compositing/overflow/clip-descendents.html:
+
+ New results with extra layers, but will be fixed via bug 50192.
+ * compositing/tiling/huge-layer-add-remove-child-expected.txt:
+ * compositing/tiling/huge-layer-expected.txt:
+ * compositing/tiling/huge-layer-resize-expected.txt:
+
2011-06-10 David Levin <[email protected]>
Reviewed by Dmitry Titov.
Modified: trunk/LayoutTests/compositing/geometry/ancestor-overflow-change-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/geometry/ancestor-overflow-change-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/geometry/ancestor-overflow-change-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -9,6 +9,7 @@
(position 8.00 8.00)
(bounds 104.00 104.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
(GraphicsLayer
(position 8.00 121.00)
Modified: trunk/LayoutTests/compositing/geometry/ancestor-overflow-change.html (88579 => 88580)
--- trunk/LayoutTests/compositing/geometry/ancestor-overflow-change.html 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/geometry/ancestor-overflow-change.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -20,7 +20,7 @@
width: 100px;
height: 100px;
background-color: green;
- -webkit-transform: translateZ(0);
+ -webkit-transform: translateZ(1px);
}
#indicator {
Modified: trunk/LayoutTests/compositing/geometry/clip-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/geometry/clip-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/geometry/clip-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -10,6 +10,7 @@
(position 10.00 10.00)
(bounds 120.00 120.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
(GraphicsLayer
(position 220.00 20.00)
@@ -24,6 +25,7 @@
(position -5.00 -5.00)
(bounds 120.00 120.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
)
)
Modified: trunk/LayoutTests/compositing/geometry/clip.html (88579 => 88580)
--- trunk/LayoutTests/compositing/geometry/clip.html 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/geometry/clip.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -24,7 +24,7 @@
}
.composited {
- -webkit-transform: translateZ(0);
+ -webkit-transform: translateZ(1px);
}
p {
Modified: trunk/LayoutTests/compositing/geometry/foreground-layer-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/geometry/foreground-layer-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/geometry/foreground-layer-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -13,6 +13,7 @@
(GraphicsLayer
(position 60.00 60.00)
(bounds 50.00 50.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
(GraphicsLayer
(bounds 320.00 320.00)
@@ -31,6 +32,7 @@
(children 2
(GraphicsLayer
(bounds 50.00 50.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
(GraphicsLayer
(bounds 200.00 200.00)
Modified: trunk/LayoutTests/compositing/geometry/foreground-layer.html (88579 => 88580)
--- trunk/LayoutTests/compositing/geometry/foreground-layer.html 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/geometry/foreground-layer.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -22,7 +22,7 @@
width: 150px;
height: 150px;
padding: 20px;
- -webkit-transform: translateZ(0);
+ -webkit-transform: translateZ(1px);
}
.negative {
Modified: trunk/LayoutTests/compositing/iframes/invisible-nested-iframe-show-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/iframes/invisible-nested-iframe-show-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/iframes/invisible-nested-iframe-show-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -78,6 +78,7 @@
(position 18.00 202.00)
(bounds 210.00 210.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
)
)
Modified: trunk/LayoutTests/compositing/iframes/invisible-nested-iframe-show.html (88579 => 88580)
--- trunk/LayoutTests/compositing/iframes/invisible-nested-iframe-show.html 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/iframes/invisible-nested-iframe-show.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -16,7 +16,7 @@
margin: 10px;
padding: 5px;
background-color: blue;
- -webkit-transform: translateZ(0);
+ -webkit-transform: translateZ(1px);
overflow:hidden;
}
.box:hover {
Added: trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap-expected.txt (0 => 88580)
--- trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -0,0 +1,35 @@
+
+
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 4
+ (GraphicsLayer
+ (position 25.00 25.00)
+ (bounds 106.00 106.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 169.00 25.00)
+ (bounds 106.00 106.00)
+ (drawsContent 1)
+ (transform [0.97 0.26 0.00 0.00] [-0.26 0.97 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
+ )
+ (GraphicsLayer
+ (position 313.00 25.00)
+ (bounds 106.00 106.00)
+ (drawsContent 1)
+ (transform [0.71 0.71 0.00 0.00] [-0.71 0.71 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
+ )
+ (GraphicsLayer
+ (position 313.00 145.00)
+ (bounds 106.00 106.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
Property changes on: trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap-expected.txt
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Added: trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap.html (0 => 88580)
--- trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap.html (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .box {
+ position: relative;
+ width: 100px;
+ height: 100px;
+ background-color: blue;
+ margin: 20px;
+ box-shadow: 0 0 3px black; /* make the compositing layers a little bigger */
+ }
+
+ .container {
+ display: inline-block;
+ }
+ </style>
+ <script type="text/_javascript_" charset="utf-8">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function doTest()
+ {
+ if (window.layoutTestController) {
+ document.getElementById('results').innerText = window.layoutTestController.layerTreeAsText();
+ layoutTestController.notifyDone();
+ }
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <div class="container">
+ <div class="box" style="-webkit-transform: translateZ(0);"></div>
+ <!-- The second box should not be composited. -->
+ <div class="box"></div>
+ </div>
+
+ <div class="container">
+ <div class="composited box" style="-webkit-transform: rotate3d(0, 0, 1, 15deg);"></div>
+ <!-- The second box should not be composited. -->
+ <div class="box"></div>
+ </div>
+
+ <div class="container">
+ <div class="composited box" style="-webkit-transform: rotate3d(0, 0, 1, 45deg);"></div>
+ <!-- The second box should be composited. -->
+ <div class="box"></div>
+ </div>
+
+ <pre id="results">Layer tree goes here in DRT.</pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/layer-creation/rotate3d-overlap.html
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Added: trunk/LayoutTests/compositing/layer-creation/translatez-overlap-expected.txt (0 => 88580)
--- trunk/LayoutTests/compositing/layer-creation/translatez-overlap-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/translatez-overlap-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -0,0 +1,16 @@
+(GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 100.00 100.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
Property changes on: trunk/LayoutTests/compositing/layer-creation/translatez-overlap-expected.txt
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Added: trunk/LayoutTests/compositing/layer-creation/translatez-overlap.html (0 => 88580)
--- trunk/LayoutTests/compositing/layer-creation/translatez-overlap.html (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/translatez-overlap.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .box {
+ position: relative;
+ width: 100px;
+ height: 100px;
+ background-color: blue;
+ margin: 10px;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+ </style>
+ <script type="text/_javascript_" charset="utf-8">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function doTest()
+ {
+ if (window.layoutTestController) {
+ document.getElementById('results').innerText = window.layoutTestController.layerTreeAsText();
+ layoutTestController.notifyDone();
+ }
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <div class="composited box"></div>
+ <!-- The second box should not be composited. -->
+ <div class="box"></div>
+ <pre id="results">Layer tree goes here in DRT.</pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/layer-creation/translatez-overlap.html
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Modified: trunk/LayoutTests/compositing/overflow/clip-descendents-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/overflow/clip-descendents-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/overflow/clip-descendents-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -14,6 +14,7 @@
(position 2.00 12.00)
(bounds 100.00 150.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
)
)
@@ -41,6 +42,7 @@
(position 2.00 12.00)
(bounds 100.00 150.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
)
)
@@ -57,6 +59,7 @@
(position 2.00 12.00)
(bounds 100.00 150.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
)
)
@@ -75,6 +78,7 @@
(position 2.00 12.00)
(bounds 100.00 150.00)
(drawsContent 1)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
)
)
)
Modified: trunk/LayoutTests/compositing/overflow/clip-descendents.html (88579 => 88580)
--- trunk/LayoutTests/compositing/overflow/clip-descendents.html 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/overflow/clip-descendents.html 2011-06-11 00:22:29 UTC (rev 88580)
@@ -24,7 +24,7 @@
width: 100px;
height: 150px;
background-color: gray;
- -webkit-transform: translateZ(0);
+ -webkit-transform: translateZ(1px);
}
pre {
Modified: trunk/LayoutTests/compositing/tiling/huge-layer-add-remove-child-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/tiling/huge-layer-add-remove-child-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/tiling/huge-layer-add-remove-child-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -31,6 +31,13 @@
(bounds 502.00 5002.00)
(usingTiledLayer 1)
(drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 51.00 401.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
)
)
)
Modified: trunk/LayoutTests/compositing/tiling/huge-layer-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/tiling/huge-layer-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/tiling/huge-layer-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -11,6 +11,18 @@
(bounds 502.00 5002.00)
(usingTiledLayer 1)
(drawsContent 1)
+ (children 2
+ (GraphicsLayer
+ (position 51.00 101.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 51.00 4701.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
)
)
)
Modified: trunk/LayoutTests/compositing/tiling/huge-layer-resize-expected.txt (88579 => 88580)
--- trunk/LayoutTests/compositing/tiling/huge-layer-resize-expected.txt 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/LayoutTests/compositing/tiling/huge-layer-resize-expected.txt 2011-06-11 00:22:29 UTC (rev 88580)
@@ -11,6 +11,13 @@
(position 8.00 68.00)
(bounds 502.00 502.00)
(drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 51.00 101.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
)
)
)
@@ -30,6 +37,13 @@
(bounds 502.00 5002.00)
(usingTiledLayer 1)
(drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 51.00 101.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
)
)
)
@@ -48,6 +62,13 @@
(position 8.00 68.00)
(bounds 502.00 502.00)
(drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 51.00 101.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
)
)
)
Modified: trunk/Source/WebCore/ChangeLog (88579 => 88580)
--- trunk/Source/WebCore/ChangeLog 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/Source/WebCore/ChangeLog 2011-06-11 00:22:29 UTC (rev 88580)
@@ -1,3 +1,24 @@
+2011-06-10 Simon Fraser <[email protected]>
+
+ Reviewed by Dan Bernstein.
+
+ Keep overlap testing logic until real 3d transforms are being used
+ https://bugs.webkit.org/show_bug.cgi?id=49857
+
+ For pages that use the translateZ(0) hack to force compositing layers, it's
+ advantageous to keep overlap testing, to avoid putting too many other
+ elements into layers.
+
+ Only turn off overlap testing if non-identity 3D transforms are used.
+
+ Tests: compositing/layer-creation/rotate3d-overlap.html
+ compositing/layer-creation/translatez-overlap.html
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateBacking):
+ (WebCore::RenderLayerCompositor::hasNonIdentity3DTransform):
+ * rendering/RenderLayerCompositor.h:
+
2011-06-10 David Levin <[email protected]>
Reviewed by Dmitry Titov.
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (88579 => 88580)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2011-06-11 00:22:29 UTC (rev 88580)
@@ -328,8 +328,8 @@
if (needsToBeComposited(layer)) {
enableCompositingMode();
- // 3D transforms turn off the testing of overlap.
- if (requiresCompositingForTransform(layer->renderer()))
+ // Non-identity 3D transforms turn off the testing of overlap.
+ if (hasNonIdentity3DTransform(layer->renderer()))
setCompositingConsultsOverlap(false);
if (!layer->backing()) {
@@ -1412,6 +1412,20 @@
#endif
}
+bool RenderLayerCompositor::hasNonIdentity3DTransform(RenderObject* renderer) const
+{
+ if (!renderer->hasTransform())
+ return false;
+
+ if (renderer->style()->hasPerspective())
+ return true;
+
+ if (TransformationMatrix* transform = toRenderBoxModelObject(renderer)->layer()->transform())
+ return !transform->isAffine();
+
+ return false;
+}
+
// If an element has negative z-index children, those children render in front of the
// layer background, so we need an extra 'contents' layer for the foreground of the layer
// object.
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (88579 => 88580)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2011-06-11 00:21:23 UTC (rev 88579)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h 2011-06-11 00:22:29 UTC (rev 88580)
@@ -232,6 +232,7 @@
void removeCompositedChildren(RenderLayer*);
bool layerHas3DContent(const RenderLayer*) const;
+ bool hasNonIdentity3DTransform(RenderObject*) const;
void ensureRootPlatformLayer();
void destroyRootPlatformLayer();