Title: [144674] trunk
Revision
144674
Author
[email protected]
Date
2013-03-04 14:16:46 -0800 (Mon, 04 Mar 2013)

Log Message

Canvas and DOM go out of sync
https://bugs.webkit.org/show_bug.cgi?id=107701

Patch by Alexis Hetu <[email protected]> on 2013-03-04
Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/canvas/canvas-overflow-hidden-animation.html

Added an update of the current compositor from the layer's stacking
container when the layer itself isn't a stacking container.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
Added an update of the stacking container of the owning layer of the
layer backing when the owning layer isn't a stacking container itself.

LayoutTests:

Added a new layout test for moving an object (a div) within a div that
has the "overflow:hidden" property.

* fast/canvas/canvas-overflow-hidden-animation-expected.html: Added.
* fast/canvas/canvas-overflow-hidden-animation.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (144673 => 144674)


--- trunk/LayoutTests/ChangeLog	2013-03-04 22:15:04 UTC (rev 144673)
+++ trunk/LayoutTests/ChangeLog	2013-03-04 22:16:46 UTC (rev 144674)
@@ -1,3 +1,16 @@
+2013-03-04  Alexis Hetu  <[email protected]>
+
+        Canvas and DOM go out of sync
+        https://bugs.webkit.org/show_bug.cgi?id=107701
+
+        Reviewed by Simon Fraser.
+
+        Added a new layout test for moving an object (a div) within a div that
+        has the "overflow:hidden" property.
+
+        * fast/canvas/canvas-overflow-hidden-animation-expected.html: Added.
+        * fast/canvas/canvas-overflow-hidden-animation.html: Added.
+
 2013-03-04  Tom Sepez  <[email protected]>
 
         XSSAuditor bypass with --> comment syntax.

Added: trunk/LayoutTests/fast/canvas/canvas-overflow-hidden-animation-expected.html (0 => 144674)


--- trunk/LayoutTests/fast/canvas/canvas-overflow-hidden-animation-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/canvas-overflow-hidden-animation-expected.html	2013-03-04 22:16:46 UTC (rev 144674)
@@ -0,0 +1,63 @@
+<!doctype html>
+<html>
+  <head>
+  <style>
+#canvas {
+  width: 300px;
+  height: 300px;
+  position: absolute;
+  left: 0px;
+  top: 0px;
+}
+
+#overlay {
+  width: 300px;
+  height: 300px;
+  position: absolute;
+  left: 0px;
+  top: 0px;
+  overflow: hidden;
+}
+
+#follower {
+  position: absolute;
+  left: 0px;
+  top: 0px;
+  width: 50px;
+  height: 50px;
+  background-color: #00FF00;
+}
+  </style>
+  </head>
+  <body>
+  <canvas id="canvas"></canvas>
+  <div id="overlay"><div id="follower"></div></div>
+    <script>
+if (window.testRunner) {
+  testRunner.waitUntilDone();
+}
+
+var canvas = document.getElementById("canvas");
+canvas.width = 300;
+canvas.height = 300;
+
+var ctx = canvas.getContext("2d");
+ctx.fillStyle = "#FF0000";
+
+var follower = document.getElementById("follower");
+
+drawLoop = function() {
+  // draw the object
+  ctx.clearRect(0, 0, 300, 300);
+  ctx.fillRect(0, 0, 50, 50);
+
+  if (window.testRunner) {
+    testRunner.notifyDone();
+  }
+};
+
+window.setTimeout(drawLoop, 0);
+    </script>
+  </body>
+</html>
+

Added: trunk/LayoutTests/fast/canvas/canvas-overflow-hidden-animation.html (0 => 144674)


--- trunk/LayoutTests/fast/canvas/canvas-overflow-hidden-animation.html	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/canvas-overflow-hidden-animation.html	2013-03-04 22:16:46 UTC (rev 144674)
@@ -0,0 +1,67 @@
+<!doctype html>
+<html>
+  <head>
+  <style>
+#canvas {
+  width: 300px;
+  height: 300px;
+  position: absolute;
+  left: 0px;
+  top: 0px;
+}
+
+#overlay {
+  width: 300px;
+  height: 300px;
+  position: absolute;
+  left: 0px;
+  top: 0px;
+  overflow: hidden;
+}
+
+#follower {
+  position: absolute;
+  left: 50px;
+  top: 50px;
+  width: 50px;
+  height: 50px;
+  background-color: #00FF00;
+}
+  </style>
+  </head>
+  <body>
+  <canvas id="canvas"></canvas>
+  <div id="overlay"><div id="follower"></div></div>
+    <script>
+if (window.testRunner) {
+  testRunner.waitUntilDone();
+}
+
+var canvas = document.getElementById("canvas");
+canvas.width = 300;
+canvas.height = 300;
+
+var ctx = canvas.getContext("2d");
+ctx.fillStyle = "#FF0000";
+
+var follower = document.getElementById("follower");
+
+drawLoop = function() {
+  // update the follower
+  follower.style.left = "0px";
+  follower.style.top  = "0px";
+  
+  // draw the object
+  ctx.clearRect(0, 0, 300, 300);
+  ctx.fillRect(0, 0, 50, 50);
+
+  if (window.testRunner) {
+    testRunner.notifyDone();
+  }
+};
+
+window.setTimeout(drawLoop, 0);
+    </script>
+  </body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (144673 => 144674)


--- trunk/Source/WebCore/ChangeLog	2013-03-04 22:15:04 UTC (rev 144673)
+++ trunk/Source/WebCore/ChangeLog	2013-03-04 22:16:46 UTC (rev 144674)
@@ -1,3 +1,20 @@
+2013-03-04  Alexis Hetu  <[email protected]>
+
+        Canvas and DOM go out of sync
+        https://bugs.webkit.org/show_bug.cgi?id=107701
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/canvas/canvas-overflow-hidden-animation.html
+
+        Added an update of the current compositor from the layer's stacking
+        container when the layer itself isn't a stacking container.
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateAfterLayout):
+        Added an update of the stacking container of the owning layer of the
+        layer backing when the owning layer isn't a stacking container itself.
+
 2013-03-04  Alexey Proskuryakov  <[email protected]>
 
         Small BlobResourceHandle cleanup

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (144673 => 144674)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2013-03-04 22:15:04 UTC (rev 144673)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2013-03-04 22:16:46 UTC (rev 144674)
@@ -464,6 +464,9 @@
         if (flags & IsUpdateRoot) {
             updateGraphicsLayerGeometry();
             layerCompositor->updateRootLayerPosition();
+            RenderLayer* stackingContainer = m_owningLayer->enclosingStackingContainer();
+            if (!layerCompositor->compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != m_owningLayer))
+                layerCompositor->updateCompositingDescendantGeometry(stackingContainer, stackingContainer, flags & CompositingChildrenOnly);
         }
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to