Index: LayoutTests/fast/repaint/requestAnimation-translation-leave-traces.html |
diff --git a/LayoutTests/fast/repaint/requestAnimation-translation-leave-traces.html b/LayoutTests/fast/repaint/requestAnimation-translation-leave-traces.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..376ba3e6fcf9344fbf082017ff8740a205eacd43 |
--- /dev/null |
+++ b/LayoutTests/fast/repaint/requestAnimation-translation-leave-traces.html |
@@ -0,0 +1,57 @@ |
+<!DOCTYPE html> |
+<html> |
dsinclair
2014/08/07 18:14:13
nit: Don't need html, head and body
Xianzhu
2014/08/07 18:32:40
Done.
|
+<head> |
+<style> |
+body { |
+ margin: 0px; |
+} |
+ |
+#box { |
+ background-color: purple; |
+ height: 100px; |
+ width: 100px; |
+} |
+</style> |
+<script src="resources/text-based-repaint.js" type="text/javascript"></script> |
+<script> |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+window.onload=function(){ |
+var i = 0; |
dsinclair
2014/08/07 18:14:13
nit: indenting?
Xianzhu
2014/08/07 18:32:40
Done.
|
+var finalIteration = 6; |
+var startTrackingRectIteration = 3; // We need to put out a few frames before reproducing the bug. |
+function tick(t) { |
+ if ((i > startTrackingRectIteration) && window.internals) |
+ internals.startTrackingRepaints(document); |
+ |
+ var x = 300 * i; |
+ box.style.transform = "translate(" + x + "px, 0px)"; |
+ if (++i < finalIteration) { |
+ requestAnimationFrame(tick); |
+ } else { |
+ if (window.internals) { |
+ var layerTree = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
+ window.internals.stopTrackingRepaints(document); |
+ document.getElementById("result").innerHTML = layerTree; |
+ } |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ |
+ |
+}; |
+ |
+requestAnimationFrame(tick); |
+} |
+</script> |
+</head> |
+<body> |
+ <div id="box"></div> |
+ This test checks that changing the transform on an element triggers a correct invalidation.<br> |
+ The paint invalidations below should match the transformed element's coordinates. |
dsinclair
2014/08/07 18:14:12
Should we spit out the transform coordinates (if p
Xianzhu
2014/08/07 18:32:40
Done.
|
+ <pre id="result"></pre> |
+</body> |
+</html> |