Title: [137250] trunk
- Revision
- 137250
- Author
- [email protected]
- Date
- 2012-12-10 22:44:15 -0800 (Mon, 10 Dec 2012)
Log Message
REGRESSION (r137006): CSS clip on solid color composited div broken
https://bugs.webkit.org/show_bug.cgi?id=104604
Patch by No'am Rosenthal <[email protected]> on 2012-12-10
Reviewed by Simon Fraser.
Source/WebCore:
Disable direct compositing of background color for clipping layers.
Test: compositing/geometry/clip-inside.html
* rendering/RenderLayerBacking.cpp:
(WebCore::supportsDirectBoxDecorationsComposition):
Never allow direct background composition if there is a clip.
LayoutTests:
Added a new test (by Simon Fraser) to make sure background color doesn't break clipping.
* compositing/geometry/clip-inside-expected.txt: Added.
* compositing/geometry/clip-inside.html: Added.
* compositing/geometry/clip-expected:
New result.
* platform/chromium/compositing/geometry/clip-inside-expected.txt
Adjust Chromium expected result for new test.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (137249 => 137250)
--- trunk/LayoutTests/ChangeLog 2012-12-11 06:07:15 UTC (rev 137249)
+++ trunk/LayoutTests/ChangeLog 2012-12-11 06:44:15 UTC (rev 137250)
@@ -1,3 +1,20 @@
+2012-12-10 No'am Rosenthal <[email protected]>
+
+ REGRESSION (r137006): CSS clip on solid color composited div broken
+ https://bugs.webkit.org/show_bug.cgi?id=104604
+
+ Reviewed by Simon Fraser.
+
+ Added a new test (by Simon Fraser) to make sure background color doesn't break clipping.
+
+ * compositing/geometry/clip-inside-expected.txt: Added.
+ * compositing/geometry/clip-inside.html: Added.
+ * compositing/geometry/clip-expected:
+ New result.
+
+ * platform/chromium/compositing/geometry/clip-inside-expected.txt
+ Adjust Chromium expected result for new test.
+
2012-12-10 Noel Gordon <[email protected]>
[chromium] Unreviewed gardening after http://trac.webkit.org/changeset/137243
Modified: trunk/LayoutTests/compositing/geometry/clip-expected.txt (137249 => 137250)
--- trunk/LayoutTests/compositing/geometry/clip-expected.txt 2012-12-11 06:07:15 UTC (rev 137249)
+++ trunk/LayoutTests/compositing/geometry/clip-expected.txt 2012-12-11 06:44:15 UTC (rev 137250)
@@ -15,7 +15,7 @@
(GraphicsLayer
(position 220.00 20.00)
(bounds 100.00 100.00)
- (backgroundColor #808080)
+ (drawsContent 1)
)
(GraphicsLayer
(position 215.00 15.00)
Copied: trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt (from rev 137249, trunk/LayoutTests/compositing/geometry/clip-expected.txt) (0 => 137250)
--- trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/geometry/clip-inside-expected.txt 2012-12-11 06:44:15 UTC (rev 137250)
@@ -0,0 +1,37 @@
+Test CSS clip with composited layers. Left and right sides should look the same.
+
+(GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 3
+ (GraphicsLayer
+ (position 25.00 35.00)
+ (anchor 0.50 0.44)
+ (bounds 90.00 80.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 225.00 35.00)
+ (bounds 90.00 80.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 225.00 35.00)
+ (bounds 90.00 80.00)
+ (children 1
+ (GraphicsLayer
+ (position -15.00 -25.00)
+ (bounds 120.00 120.00)
+ (backgroundColor #00000033)
+ (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])
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/compositing/geometry/clip-inside.html (0 => 137250)
--- trunk/LayoutTests/compositing/geometry/clip-inside.html (rev 0)
+++ trunk/LayoutTests/compositing/geometry/clip-inside.html 2012-12-11 06:44:15 UTC (rev 137250)
@@ -0,0 +1,60 @@
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .box {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ top: 20px;
+ left: 20px;
+ background-color: gray;
+ clip: rect(15px, 95px, 95px, 5px);
+ }
+
+ .inner {
+ position: relative;
+ width: 120px;
+ height: 120px;
+ top: -10px;
+ left: -10px;
+ background-color: rgba(0, 0, 0, 0.2);
+ }
+
+ .composited {
+ -webkit-transform: translateZ(1px);
+ }
+
+ p {
+ margin-top: 140px;
+ }
+ </style>
+ <script type="text/_javascript_" charset="utf-8">
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function doTest() {
+ if (window.testRunner) {
+ document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
+ testRunner.notifyDone();
+ }
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <div class="composited box">
+ <div class="inner">
+ </div>
+ </div>
+
+ <div class="box" style="left: 220px;">
+ <div class="composited inner">
+ </div>
+ </div>
+
+ <p>Test CSS clip with composited layers. Left and right sides should look the same.</p>
+ <pre id="layers">In DRT, layer tree goes here.</pre>
+</body>
+</html>
Copied: trunk/LayoutTests/platform/chromium/compositing/geometry/clip-inside-expected.txt (from rev 137249, trunk/LayoutTests/compositing/geometry/clip-expected.txt) (0 => 137250)
--- trunk/LayoutTests/platform/chromium/compositing/geometry/clip-inside-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/geometry/clip-inside-expected.txt 2012-12-11 06:44:15 UTC (rev 137250)
@@ -0,0 +1,37 @@
+Test CSS clip with composited layers. Left and right sides should look the same.
+
+(GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (children 3
+ (GraphicsLayer
+ (position 25.00 35.00)
+ (anchor 0.50 0.44)
+ (bounds 90.00 80.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 225.00 35.00)
+ (bounds 90.00 80.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 225.00 35.00)
+ (bounds 90.00 80.00)
+ (children 1
+ (GraphicsLayer
+ (position -15.00 -25.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/Source/WebCore/ChangeLog (137249 => 137250)
--- trunk/Source/WebCore/ChangeLog 2012-12-11 06:07:15 UTC (rev 137249)
+++ trunk/Source/WebCore/ChangeLog 2012-12-11 06:44:15 UTC (rev 137250)
@@ -1,3 +1,18 @@
+2012-12-10 No'am Rosenthal <[email protected]>
+
+ REGRESSION (r137006): CSS clip on solid color composited div broken
+ https://bugs.webkit.org/show_bug.cgi?id=104604
+
+ Reviewed by Simon Fraser.
+
+ Disable direct compositing of background color for clipping layers.
+
+ Test: compositing/geometry/clip-inside.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::supportsDirectBoxDecorationsComposition):
+ Never allow direct background composition if there is a clip.
+
2012-12-10 Simon Fraser <[email protected]>
REGRESSION (r137215): WebKit stretches and shrinks a part of screen on scroll
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (137249 => 137250)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2012-12-11 06:07:15 UTC (rev 137249)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2012-12-11 06:44:15 UTC (rev 137250)
@@ -1163,6 +1163,9 @@
if (!GraphicsLayer::supportsBackgroundColorContent())
return false;
+ if (renderer->hasClip())
+ return false;
+
if (hasBoxDecorationsOrBackgroundImage(renderer->style()))
return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes