Diff
Modified: branches/safari-537-branch/LayoutTests/ChangeLog (153683 => 153684)
--- branches/safari-537-branch/LayoutTests/ChangeLog 2013-08-03 00:51:14 UTC (rev 153683)
+++ branches/safari-537-branch/LayoutTests/ChangeLog 2013-08-03 00:54:19 UTC (rev 153684)
@@ -1,5 +1,22 @@
2013-08-02 Lucas Forschler <[email protected]>
+ Merge r153681
+
+ 2013-08-02 Dean Jackson <[email protected]>
+
+ Force elements with perspective or preserve-3d to disallow direct composited backgrounds
+ https://bugs.webkit.org/show_bug.cgi?id=119462
+ <rdar://problem/14607548>
+
+ Reviewed by Simon Fraser.
+
+ * compositing/background-color/no-composited-background-color-when-perspective-expected.html: Added.
+ * compositing/background-color/no-composited-background-color-when-perspective.html: Added.
+ * compositing/geometry/preserve-3d-switching-expected.txt: Rebaselined.
+ * compositing/overflow-trumps-transform-style-expected.txt: Rebaselined.
+
+2013-08-02 Lucas Forschler <[email protected]>
+
Merge r153649
2013-08-02 Brady Eidson <[email protected]>
Copied: branches/safari-537-branch/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective-expected.html (from rev 153681, trunk/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective-expected.html) (0 => 153684)
--- branches/safari-537-branch/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective-expected.html (rev 0)
+++ branches/safari-537-branch/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective-expected.html 2013-08-03 00:54:19 UTC (rev 153684)
@@ -0,0 +1,28 @@
+<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
+<style>
+body {
+ margin: 0;
+}
+
+div {
+ position: absolute;
+ height: 200px;
+ width: 200px;
+}
+
+#container {
+ /* Force box decorations so no direct composited background */
+ /* This is just a black image */
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAMAAAC6sdbXAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAZQTFRFAAAA////pdmf3QAAAA5JREFUeNpiYMAHAAIMAAAeAAHMILKLAAAAAElFTkSuQmCC");
+ background-color: black;
+ -webkit-perspective: 400;
+}
+
+#face {
+ -webkit-transform: rotateX(45deg);
+ background-color: red;
+}
+</style>
+<div id="container">
+ <div id="face"></div>
+</div>
Copied: branches/safari-537-branch/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective.html (from rev 153681, trunk/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective.html) (0 => 153684)
--- branches/safari-537-branch/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective.html (rev 0)
+++ branches/safari-537-branch/LayoutTests/compositing/background-color/no-composited-background-color-when-perspective.html 2013-08-03 00:54:19 UTC (rev 153684)
@@ -0,0 +1,25 @@
+<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
+<style>
+body {
+ margin: 0;
+}
+
+div {
+ position: absolute;
+ height: 200px;
+ width: 200px;
+}
+
+#container {
+ background-color: black;
+ -webkit-perspective: 400;
+}
+
+#face {
+ -webkit-transform: rotateX(45deg);
+ background-color: red;
+}
+</style>
+<div id="container">
+ <div id="face"></div>
+</div>
Modified: branches/safari-537-branch/LayoutTests/compositing/geometry/preserve-3d-switching-expected.txt (153683 => 153684)
--- branches/safari-537-branch/LayoutTests/compositing/geometry/preserve-3d-switching-expected.txt 2013-08-03 00:51:14 UTC (rev 153683)
+++ branches/safari-537-branch/LayoutTests/compositing/geometry/preserve-3d-switching-expected.txt 2013-08-03 00:54:19 UTC (rev 153684)
@@ -19,6 +19,7 @@
(opacity 0.80)
(contentsOpaque 1)
(preserves3D 1)
+ (drawsContent 1)
(transform [0.77 -0.56 -0.32 0.00] [0.00 0.50 -0.87 0.00] [0.64 0.66 0.38 0.00] [0.00 0.00 0.00 1.00])
(children 1
(GraphicsLayer
Modified: branches/safari-537-branch/LayoutTests/compositing/overflow-trumps-transform-style-expected.txt (153683 => 153684)
--- branches/safari-537-branch/LayoutTests/compositing/overflow-trumps-transform-style-expected.txt 2013-08-03 00:51:14 UTC (rev 153683)
+++ branches/safari-537-branch/LayoutTests/compositing/overflow-trumps-transform-style-expected.txt 2013-08-03 00:54:19 UTC (rev 153684)
@@ -12,6 +12,7 @@
(bounds 100.00 100.00)
(contentsOpaque 1)
(preserves3D 1)
+ (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
Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (153683 => 153684)
--- branches/safari-537-branch/Source/WebCore/ChangeLog 2013-08-03 00:51:14 UTC (rev 153683)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog 2013-08-03 00:54:19 UTC (rev 153684)
@@ -1,5 +1,29 @@
2013-08-02 Lucas Forschler <[email protected]>
+ Merge r153681
+
+ 2013-08-02 Dean Jackson <[email protected]>
+
+ Force elements with perspective or preserve-3d to disallow direct composited backgrounds
+ https://bugs.webkit.org/show_bug.cgi?id=119462
+ <rdar://problem/14607548>
+
+ Reviewed by Simon Fraser.
+
+ Bug 119461 (http://wkb.ug/119461) describes how a directly composited
+ background color can intersect with its children. It's not clear exactly
+ what the best way to fix that is, but for the moment we should disallow
+ any element that has perspective or a preserve-3d transform style from
+ getting a directly composited background.
+
+ Test: compositing/background-color/no-composited-background-color-when-perspective.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::hasPerspectiveOrPreserves3D): New static helper.
+ (WebCore::supportsDirectBoxDecorationsComposition): Return false if the above function is true.
+
+2013-08-02 Lucas Forschler <[email protected]>
+
Merge r153672
2013-08-02 Andreas Kling <[email protected]>
Modified: branches/safari-537-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (153683 => 153684)
--- branches/safari-537-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2013-08-03 00:51:14 UTC (rev 153683)
+++ branches/safari-537-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2013-08-03 00:54:19 UTC (rev 153684)
@@ -1389,6 +1389,11 @@
return !GraphicsLayer::supportsContentsTiling() || !canCreateTiledImage(style);
}
+static bool hasPerspectiveOrPreserves3D(const RenderStyle* style)
+{
+ return style->hasPerspective() || style->preserves3D();
+}
+
Color RenderLayerBacking::rendererBackgroundColor() const
{
RenderObject* backgroundRenderer = renderer();
@@ -1504,6 +1509,14 @@
if (hasBoxDecorationsOrBackgroundImage(renderer->style()))
return false;
+ // FIXME: We can't create a directly composited background if this
+ // layer will have children that intersect with the background layer.
+ // A better solution might be to introduce a flattening layer if
+ // we do direct box decoration composition.
+ // https://bugs.webkit.org/show_bug.cgi?id=119461
+ if (hasPerspectiveOrPreserves3D(renderer->style()))
+ return false;
+
// FIXME: we should be able to allow backgroundComposite; However since this is not a common use case it has been deferred for now.
if (renderer->style()->backgroundComposite() != CompositeSourceOver)
return false;