Title: [135921] trunk
Revision
135921
Author
ach...@adobe.com
Date
2012-11-27 14:23:24 -0800 (Tue, 27 Nov 2012)

Log Message

[CSS Regions] Elements using transforms are not repainted correctly when rendered in a region
https://bugs.webkit.org/show_bug.cgi?id=102826

Reviewed by David Hyatt.

Source/WebCore:

When the page is composited, all the elements will have a composited repaint container. In that case we will
never catch the repaints in the RenderFlowThread, but they will go directly to the RenderView.
There's a single case when the parent composited layer of an element inside the RenderFlowThread will get
its own repaints. That case only happens when the parent composited layer is also part of the same flow thread.
Right now compositing is disabled for elements inside the RenderFlowThread, so that case doesn't even happen yet.
That will be fixed in https://bugs.webkit.org/show_bug.cgi?id=84900.

Test: fast/repaint/region-painting-in-composited-view.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::containerForRepaint):

LayoutTests:

Added test file to check for repainting inside a RenderFlowThread when the page is in composited mode.

* fast/repaint/region-painting-in-composited-view-expected.html: Added.
* fast/repaint/region-painting-in-composited-view.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135920 => 135921)


--- trunk/LayoutTests/ChangeLog	2012-11-27 22:17:28 UTC (rev 135920)
+++ trunk/LayoutTests/ChangeLog	2012-11-27 22:23:24 UTC (rev 135921)
@@ -1,3 +1,15 @@
+2012-11-27  Alexandru Chiculita  <ach...@adobe.com>
+
+        [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region
+        https://bugs.webkit.org/show_bug.cgi?id=102826
+
+        Reviewed by David Hyatt.
+
+        Added test file to check for repainting inside a RenderFlowThread when the page is in composited mode.
+
+        * fast/repaint/region-painting-in-composited-view-expected.html: Added.
+        * fast/repaint/region-painting-in-composited-view.html: Added.
+
 2012-11-27  Tony Chang  <t...@chromium.org>
 
         Unreviewed, updating TestExpectations after input slider change.

Added: trunk/LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html (0 => 135921)


--- trunk/LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/region-painting-in-composited-view-expected.html	2012-11-27 22:23:24 UTC (rev 135921)
@@ -0,0 +1,39 @@
+<!doctype html>
+<head>
+<title>Test for https://bugs.webkit.org/show_bug.cgi?id=102826</title>
+<style type="text/css">
+#region1, #region2 {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    width: 100px;
+    height: 50px;
+}
+
+#region1 {
+    left: 120px;
+    background-color: red;
+    /* We need a composited layer, to make the output 
+       exactly the same as the test file. */
+    -webkit-transform: translate3d(0,0,0);
+}
+
+#region2 {
+    background-color: green;
+}
+
+</style>
+<script src="" type="text/_javascript_"></script>
+<script>
+function repaintTest()
+{
+    // Using the same repaint behavior, so that we get the same repaint area.
+    document.getElementById('region1').style.backgroundColor = 'green';
+}
+</script>
+</head>
+<body _onload_="runRepaintTest();">
+    <div id="region1"></div>
+    <div id="region2"></div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/repaint/region-painting-in-composited-view.html (0 => 135921)


--- trunk/LayoutTests/fast/repaint/region-painting-in-composited-view.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/region-painting-in-composited-view.html	2012-11-27 22:23:24 UTC (rev 135921)
@@ -0,0 +1,58 @@
+<!doctype html>
+<head>
+<title>Test for https://bugs.webkit.org/show_bug.cgi?id=102826</title>
+<script>
+    if (window.testRunner)
+        window.testRunner.overridePreference("WebKitCSSRegionsEnabled", "1");
+</script>
+<style type="text/css">
+#content {
+    -webkit-flow-into: flow1;
+}
+
+#target { 
+    background: red; 
+    width: 100px; 
+    height: 50px;
+}
+
+#region1, #region2 {
+    position: absolute;
+    top: 0px;
+    width: 100px;
+    height: 50px;
+    -webkit-flow-from: flow1;
+}
+
+#region1 {
+    /* Make sure that the content of the first region will display in a totally
+       different place than it would have been displayed if regions were not used. */
+    left: 120px;
+    /* Force the composited mode on the current page. */
+    -webkit-transform: translate3d(0,0,0);
+}
+
+#region2 {
+    left: 0px;
+    background-color: green;
+}
+
+</style>
+<script src="" type="text/_javascript_"></script>
+<script>
+function repaintTest()
+{
+    document.getElementById('target').style.backgroundColor = 'green';
+}
+</script>
+</head>
+<body _onload_="runRepaintTest();">
+    <!-- Testing that the repaint goes through the RenderRegions and not 
+    directly to the viewport. You should see two green rectangles. -->
+    <div id="content">
+        <div id="target"></div>
+    </div>
+    <div id="region1"></div>
+    <div id="region2"></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (135920 => 135921)


--- trunk/Source/WebCore/ChangeLog	2012-11-27 22:17:28 UTC (rev 135920)
+++ trunk/Source/WebCore/ChangeLog	2012-11-27 22:23:24 UTC (rev 135921)
@@ -1,3 +1,22 @@
+2012-11-27  Alexandru Chiculita  <ach...@adobe.com>
+
+        [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region
+        https://bugs.webkit.org/show_bug.cgi?id=102826
+
+        Reviewed by David Hyatt.
+
+        When the page is composited, all the elements will have a composited repaint container. In that case we will
+        never catch the repaints in the RenderFlowThread, but they will go directly to the RenderView. 
+        There's a single case when the parent composited layer of an element inside the RenderFlowThread will get 
+        its own repaints. That case only happens when the parent composited layer is also part of the same flow thread.
+        Right now compositing is disabled for elements inside the RenderFlowThread, so that case doesn't even happen yet.
+        That will be fixed in https://bugs.webkit.org/show_bug.cgi?id=84900.
+
+        Test: fast/repaint/region-painting-in-composited-view.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::containerForRepaint):
+
 2012-11-27  Tony Chang  <t...@chromium.org>
 
         Unreviewed, win compile fix take 2.

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (135920 => 135921)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2012-11-27 22:17:28 UTC (rev 135920)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2012-11-27 22:23:24 UTC (rev 135921)
@@ -1290,12 +1290,15 @@
 #endif
 
     // If we have a flow thread, then we need to do individual repaints within the RenderRegions instead.
-    // Return the flow thread as a repaint container in order to create a chokepoint that allows us to change
+    // Return the flow thread as a repaint container in order to create a checkpoint that allows us to change
     // repainting to do individual region repaints.
-    // FIXME: Composited layers inside a flow thread will bypass this mechanism and will malfunction. It's not
-    // clear how to address this problem for composited descendants of a RenderFlowThread.
-    if (!repaintContainer && inRenderFlowThread())
-        repaintContainer = enclosingRenderFlowThread();
+    if (inRenderFlowThread()) {
+        RenderFlowThread* parentRenderFlowThread = enclosingRenderFlowThread();
+        // If we have already found a repaint container then we will repaint into that container only if it is part of the same
+        // flow thread. Otherwise we will need to catch the repaint call and send it to the flow thread.
+        if (!(repaintContainer && repaintContainer->inRenderFlowThread() && repaintContainer->enclosingRenderFlowThread() == parentRenderFlowThread))
+            repaintContainer = parentRenderFlowThread;
+    }
     return repaintContainer;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to