OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <style> | 5 <style> |
6 .container { | 6 .container { |
7 width: 200px; | 7 width: 200px; |
8 height: 200px; | 8 height: 200px; |
9 overflow: scroll; | 9 overflow: scroll; |
10 margin: 20px; | 10 margin: 20px; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // not to opt in to get our first stacking order list. To do this, we need | 77 // not to opt in to get our first stacking order list. To do this, we need |
78 // to disable compositing for overflow scroll entirely. | 78 // to disable compositing for overflow scroll entirely. |
79 // | 79 // |
80 // Unfortunately this operation won't dirty any style bits, and we will | 80 // Unfortunately this operation won't dirty any style bits, and we will |
81 // need to perform a full style recalc both here and below when we force | 81 // need to perform a full style recalc both here and below when we force |
82 // to promote, so that we reevaluate whether or not container can be | 82 // to promote, so that we reevaluate whether or not container can be |
83 // composited. To ensure that we perform the full style recalc, we need to | 83 // composited. To ensure that we perform the full style recalc, we need to |
84 // change a style property so the style is dirty, and force the style to | 84 // change a style property so the style is dirty, and force the style to |
85 // be cleaned with document.body.offsetTop (inside getStackingOrder()). | 85 // be cleaned with document.body.offsetTop (inside getStackingOrder()). |
86 window.internals.setNeedsCompositedScrolling(container, | 86 window.internals.setNeedsCompositedScrolling(container, |
87 window.internals.CompositedScrollingAlwaysOff); | 87 window.internals.COMPOSITED_SCROLLING_ALWAYS_OFF); |
88 container.style.webkitTransform = ''; | 88 container.style.webkitTransform = ''; |
89 | 89 |
90 var oldStackingOrder = getStackingOrder(container); | 90 var oldStackingOrder = getStackingOrder(container); |
91 | 91 |
92 window.internals.setNeedsCompositedScrolling(container, | 92 window.internals.setNeedsCompositedScrolling(container, |
93 window.internals.CompositedScrollingAlwaysOn); | 93 window.internals.COMPOSITED_SCROLLING_ALWAYS_ON); |
94 container.style.webkitTransform = 'translateZ(0px)'; | 94 container.style.webkitTransform = 'translateZ(0px)'; |
95 | 95 |
96 var newStackingOrder = getStackingOrder(container); | 96 var newStackingOrder = getStackingOrder(container); |
97 | 97 |
98 window.internals.setNeedsCompositedScrolling(container, | 98 window.internals.setNeedsCompositedScrolling(container, |
99 window.internals.settings.DoNotForceCompositedScrolling); | 99 window.internals.settings.DO_NOT_FORCE_COMPOSITED_SCROLLING); |
100 | 100 |
101 var shouldOptIn = oldStackingOrder.length === newStackingOrder.length; | 101 var shouldOptIn = oldStackingOrder.length === newStackingOrder.length; |
102 for (var i = 0; i < oldStackingOrder.length; ++i) { | 102 for (var i = 0; i < oldStackingOrder.length; ++i) { |
103 if (oldStackingOrder[i] !== newStackingOrder[i]) { | 103 if (oldStackingOrder[i] !== newStackingOrder[i]) { |
104 shouldOptIn = false; | 104 shouldOptIn = false; |
105 break; | 105 break; |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 container.style.webkitTransform = ''; | 109 container.style.webkitTransform = ''; |
(...skipping 26 matching lines...) Expand all Loading... |
136 permute(testPermutation); | 136 permute(testPermutation); |
137 } | 137 } |
138 | 138 |
139 window.addEventListener('load', doTest, false); | 139 window.addEventListener('load', doTest, false); |
140 </script> | 140 </script> |
141 </head> | 141 </head> |
142 | 142 |
143 <body> | 143 <body> |
144 </body> | 144 </body> |
145 </html> | 145 </html> |
OLD | NEW |