OLD | NEW |
| (Empty) |
1 <!-- Based on compositing/overflow/updating-scrolling-content.html --> | |
2 <!DOCTYPE html> | |
3 | |
4 <!-- | |
5 This test checks that the contents of accelerated scrolling layers are properly | |
6 updated also outside the current overflow clip. See | |
7 https://bugs.webkit.org/show_bug.cgi?id=100524. | |
8 --> | |
9 | |
10 <html> | |
11 <head> | |
12 <style type="text/css"> | |
13 #scroller { | |
14 overflow: scroll; | |
15 -webkit-overflow-scrolling: touch; | |
16 width: 200px; | |
17 height: 200px; | |
18 } | |
19 | |
20 #indicator { | |
21 background: red; | |
22 height: 200px; | |
23 } | |
24 | |
25 #content { | |
26 height: 1000px; | |
27 } | |
28 </style> | |
29 <script src="resources/paint-invalidation-test.js"></script> | |
30 <script type="text/javascript"> | |
31 if (window.testRunner) | |
32 testRunner.dumpAsText(); | |
33 if (window.internals) | |
34 window.internals.settings.setPreferCompositingToLCDTextEnabled(true); | |
35 | |
36 window.addEventListener('load', function() { | |
37 var scroller = document.getElementById('scroller'); | |
38 var indicator = document.getElementById('indicator'); | |
39 | |
40 // Make sure the scrolling content is painted before we start. | |
41 scroller.offsetTop; | |
42 | |
43 // Scroll all the way to the bottom and change the color of the | |
44 // indicator (which is now outside the overflow clip). | |
45 scroller.scrollTop = 1000; | |
46 | |
47 runPaintInvalidationTest(); | |
48 }); | |
49 | |
50 function paintInvalidationTest() { | |
51 var scroller = document.getElementById('scroller'); | |
52 var indicator = document.getElementById('indicator'); | |
53 | |
54 indicator.style.background = 'green'; | |
55 | |
56 // Scroll back up so that the updated (green) indicator is visible. | |
57 scroller.scrollTop = 0; | |
58 } | |
59 </script> | |
60 </head> | |
61 <body> | |
62 <div id="scroller"> | |
63 <div id="indicator"></div> | |
64 <div id="content"></div> | |
65 </div> | |
66 </body> | |
67 </html> | |
OLD | NEW |