OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 | |
3 <html> | |
4 <head> | |
5 <style> | |
6 #container { | |
7 width: 200px; | |
8 height: 200px; | |
9 overflow: scroll; | |
10 margin: 20px; | |
11 border: 1px solid black; | |
12 background-color: #00FFFF; | |
13 } | |
14 | |
15 .scrolled { | |
16 width: 800px; | |
17 height: 30px; | |
18 margin: 10px; | |
19 top: 70px; | |
20 background-color: gray; | |
21 position: relative; | |
22 } | |
23 | |
24 .positioned { | |
25 width: 120px; | |
26 height: 240px; | |
27 position: absolute; | |
28 } | |
29 | |
30 #predecessor { | |
31 left: 20px; | |
32 top: 20px; | |
33 background-color: #990066; | |
34 } | |
35 </style> | |
36 <script src='resources/automatically-opt-into-composited-scrolling.js'></scr
ipt> | |
37 <script> | |
38 if (window.testRunner) | |
39 testRunner.dumpAsText(); | |
40 | |
41 if (window.internals) { | |
42 window.internals.settings.setAcceleratedCompositingForOverflowScroll
Enabled(true); | |
43 window.internals.settings.setCompositorDrivenAcceleratedScrollingEna
bled(false); | |
44 } | |
45 | |
46 function doTest() | |
47 { | |
48 if (!window.internals) | |
49 return; | |
50 | |
51 var predecessor = document.getElementById('predecessor'); | |
52 var container = document.getElementById('container'); | |
53 predecessor.style.display = 'none'; | |
54 window.internals.forceCompositingUpdate(document); | |
55 | |
56 var pass = true; | |
57 if (!didOptIn(container)) { | |
58 pass = false; | |
59 write('FAIL - did not opt in when our children are contiguous.')
; | |
60 } | |
61 | |
62 predecessor.style.display = ''; | |
63 window.internals.forceCompositingUpdate(document); | |
64 | |
65 if (didOptIn(container)) { | |
66 pass = false; | |
67 write('FAIL - opted in when our children are not contiguous.'); | |
68 } | |
69 | |
70 if (pass) | |
71 write('PASS'); | |
72 } | |
73 | |
74 window.addEventListener('load', doTest, false); | |
75 </script> | |
76 </head> | |
77 | |
78 <body> | |
79 <div> | |
80 <div class='positioned' id='predecessor'></div> | |
81 <div id='container'> | |
82 <div class='scrolled'></div> | |
83 </div> | |
84 </div> | |
85 <pre id='console'></pre> | |
86 </body> | |
87 </html> | |
OLD | NEW |