11 border: 1px solid black;
18 background-color: gray;
40 background-color: green;
44 background-color: blue;
48 <script src="resources/automatically-opt-into-composited-scrolling.js"></script>
50 if (window.testRunner)
51 testRunner.dumpAsText();
54 window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(true);
58 var predecessor = document.getElementById('predecessor');
59 var ancestor = document.getElementById('ancestor');
60 var container = document.getElementById('container');
61 var firstChild = document.getElementById('firstChild');
62 var secondChild = document.getElementById('secondChild');
64 // Force a synchronous style recalc and layout.
65 document.body.offsetTop;
67 if (window.internals) {
68 window.internals.forceCompositingUpdate(document);
70 if (didOptIn(container))
71 write('Passed - correctly opted into composited scrolling with a positioned ancestor.')
73 write('FAILED - did not opt into composited scrolling with a positioned ancestor when it would safe.')
77 window.addEventListener('load', doTest, false);
82 <div class="positioned" id="predecessor"></div>
83 <div class="positioned" id="ancestor">
84 <div class="container" id="container">
85 <div class="scrolled" id="firstChild"></div>
86 <div class="scrolled" id="secondChild"></div>
89 <pre id="console"></pre>