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