OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 .scroller { | 3 .scroller { |
4 width: 100px; | 4 width: 100px; |
5 height: 30px; | 5 height: 30px; |
6 overflow: scroll; | 6 overflow: scroll; |
7 } | 7 } |
8 .scroller::-webkit-scrollbar { | 8 .scroller::-webkit-scrollbar { |
9 width: 10px; | 9 width: 10px; |
10 height: 10px; | 10 height: 10px; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 </div> | 74 </div> |
75 <div></div><div></div><div></div><div></div><div></div><div></div><div></div
> | 75 <div></div><div></div><div></div><div></div><div></div><div></div><div></div
> |
76 </div> | 76 </div> |
77 <script> | 77 <script> |
78 function invalidateScroller(testId, expectedCount) { | 78 function invalidateScroller(testId, expectedCount) { |
79 var testElement = document.getElementById(testId); | 79 var testElement = document.getElementById(testId); |
80 var scroller = testElement.querySelector(".scroller"); | 80 var scroller = testElement.querySelector(".scroller"); |
81 testElement.offsetTop; // Force recalc; | 81 testElement.offsetTop; // Force recalc; |
82 testElement.className = testId; | 82 testElement.className = testId; |
83 if (window.internals) { | 83 if (window.internals) { |
84 var count = internals.updateStyleAndReturnAffectedElementCount(); | 84 var count = internals.updateStyleAndLayoutAndReturnAffectedElementCount(
); |
85 if (count == expectedCount) | 85 if (count == expectedCount) |
86 scroller.innerText = "PASS"; | 86 scroller.innerText = "PASS"; |
87 else | 87 else |
88 scroller.innerText = "FAIL: "+count; | 88 scroller.innerText = "FAIL: "+count; |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 // Invalidation counts are 2 (#t<n> and .scroller) plus pseudo elements | 92 // Invalidation counts are 2 (#t<n> and .scroller) plus pseudo elements |
93 | 93 |
94 invalidateScroller("t1", 3); // pseudo count 2: 2 bars | 94 invalidateScroller("t1", 3); // pseudo count 2: 2 bars |
95 invalidateScroller("t2", 7); // pseudo count 6: 2 bars + 4 buttons | 95 invalidateScroller("t2", 7); // pseudo count 6: 2 bars + 4 buttons |
96 invalidateScroller("t3", 7); // pseudo count 6: 2 bars + 4 buttons | 96 invalidateScroller("t3", 7); // pseudo count 6: 2 bars + 4 buttons |
97 invalidateScroller("t4", 3); // pseudo count 6: 2 bars + 4 buttons | 97 invalidateScroller("t4", 3); // pseudo count 6: 2 bars + 4 buttons |
98 invalidateScroller("t5", 3); // pseudo count 2: 2 bars | 98 invalidateScroller("t5", 3); // pseudo count 2: 2 bars |
99 invalidateScroller("t6", 7); // pseudo count 6: 2 bars + 4 buttons | 99 invalidateScroller("t6", 7); // pseudo count 6: 2 bars + 4 buttons |
100 invalidateScroller("t7", 7); // pseudo count 6: 2 bars + 4 buttons | 100 invalidateScroller("t7", 7); // pseudo count 6: 2 bars + 4 buttons |
101 </script> | 101 </script> |
OLD | NEW |