13 -webkit-transform: translateX(
0);
16 #nonFastRegion
> div {
19 background: linear-gradient(to bottom, red, white);
23 <div id='nonFastRegion'
><div>This should be covered by a green overlay.
</div></div>
25 <p>A single square should be visible covered by a green overlay.
</p>
26 <div id=
"console"></div>
28 <script src=
"../resources/js-test.js"></script>
29 <script src=
"../resources/run-after-layout-and-paint.js"></script>
30 <script src=
"resources/non-fast-scrollable-region-testing.js"></script>
33 // print result lazily to avoid layouts during the test
34 setPrintTestResultsLazily();
35 description('This test ensures that transforming a non-fast scrollable area ' +
36 'correctly updates list of non-fast scrollable rects ' +
37 '(See http://crbug.com/417345).');
40 runAfterLayoutAndPaint(runTests
);
44 nonFastScrollableRects
= internals
.nonFastScrollableRects(document
);
45 shouldBe('nonFastScrollableRects.length', '1');
46 shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[0, 0, 222, 222]');
48 document
.body
.style
.padding
= "10px";
49 debug("Trigger style update");
50 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
51 debug("Verifying layout hasn't been triggered");
52 shouldBe("internals.needsLayoutCount()", "3");
54 // Updating transforms hits an optimized layout path which is root cause of
55 // http://crbug.com/417345
56 debug("Update non-fast element's transform");
57 document
.getElementById('nonFastRegion').style
.webkitTransform
= 'translateX(100px)';
59 debug("Trigger style update");
60 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
61 debug("Verifying layout still hasn't been triggered");
62 shouldBe("internals.needsLayoutCount()", "3");
63 debug("Verifying non-fast regions have been updated");
64 nonFastScrollableRects
= internals
.nonFastScrollableRects(document
);
65 shouldBe('nonFastScrollableRects.length', '1');
66 shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[100, 0, 222, 222]');
68 setTimeout(function() {
69 // Add green overlays to help visualize the test
70 drawNonFastScrollableRegionOverlays();