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