8 background-color: purple;
14 if (window
.testRunner
) {
15 testRunner
.dumpAsText();
16 testRunner
.waitUntilDone();
19 window
.onload = function() {
21 var finalIteration
= 6;
22 var startTrackingRectIteration
= 3; // We need to put out a few frames before reproducing the bug.
23 var testedLocations
= [];
26 if (i
> startTrackingRectIteration
) {
27 testedLocations
.push(x
);
29 internals
.startTrackingRepaints(document
);
32 box
.style
.transform
= "translate(" + x
+ "px, 0px)";
33 if (++i
< finalIteration
) {
34 requestAnimationFrame(tick
);
36 if (window
.internals
) {
37 var layerTree
= internals
.layerTreeAsText(document
, internals
.LAYER_TREE_INCLUDES_REPAINT_RECTS
);
38 window
.internals
.stopTrackingRepaints(document
);
39 document
.getElementById("result").textContent
= "Tested locations: " + testedLocations
+ '\n' + layerTree
;
41 if (window
.testRunner
)
42 testRunner
.notifyDone();
46 requestAnimationFrame(tick
);
50 This test checks that changing the transform on an element triggers a correct invalidation.
<br>
51 The paint invalidations below should match the transformed element's coordinates.
52 <pre id=
"result"></pre>