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 border: 1px solid black; | 10 border: 1px solid black; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 if (stackingOrder[i] === paintOrder[paintOrder.length - j - 1]) | 73 if (stackingOrder[i] === paintOrder[paintOrder.length - j - 1]) |
74 j++; | 74 j++; |
75 | 75 |
76 if (debugMode) | 76 if (debugMode) |
77 write(stackingOrder.length + " " + i + " " + paintOrder.length + " " + j
); | 77 write(stackingOrder.length + " " + i + " " + paintOrder.length + " " + j
); |
78 | 78 |
79 return j == paintOrder.length; | 79 return j == paintOrder.length; |
80 } | 80 } |
81 | 81 |
82 function testPermutation(count) { | 82 function testPermutation(count) { |
| 83 // PATCH 1 (and below) |
| 84 if (!window.internals) |
| 85 return; |
| 86 |
83 var container = document.getElementById('container'); | 87 var container = document.getElementById('container'); |
84 // Here we want to compare paint order lists before and after promotion | 88 // Here we want to compare paint order lists before and after promotion |
85 // to the actual stacking order as determined by hit-testing. So we | 89 // to the actual stacking order as determined by hit-testing. So we |
86 // first force the element not to promote, then compute its paint and | 90 // first force the element not to promote, then compute its paint and |
87 // stacking order lists. We then force the element to opt in, and | 91 // stacking order lists. We then force the element to opt in, and |
88 // generate the paint and stacking order lists after opt-in. | 92 // generate the paint and stacking order lists after opt-in. |
89 // | 93 // |
90 // The paint order lists should exactly match the stacking order lists | 94 // The paint order lists should exactly match the stacking order lists |
91 // (modulo children that fall outside of the hit-testing area | 95 // (modulo children that fall outside of the hit-testing area |
92 // on-screen), both before and after promotion. | 96 // on-screen), both before and after promotion. |
93 container.style.webkitTransform = 'translateZ(0px)'; | 97 container.style.webkitTransform = 'translateZ(0px)'; |
94 document.body.offsetTop; | 98 document.body.offsetTop; |
95 | 99 |
96 window.internals.settings.setAcceleratedCompositingForOverflowScrollEnable
d(false); | 100 window.internals.setNeedsCompositedScrolling(container, |
| 101 window.internals.FORCE_COMPOSITED_SCROLLING_OFF); |
97 container.style.webkitTransform = ''; | 102 container.style.webkitTransform = ''; |
98 | 103 |
99 var oldStackingOrder = getStackingOrder(container); | 104 var oldStackingOrder = getStackingOrder(container); |
100 var oldPaintOrder = getPaintOrder(container); | 105 var oldPaintOrder = getPaintOrder(container); |
101 | 106 |
102 window.internals.settings.setAcceleratedCompositingForOverflowScrollEnable
d(true); | 107 window.internals.setNeedsCompositedScrolling(container, |
| 108 window.internals.FORCE_COMPOSITED_SCROLLING_ON); |
103 container.style.webkitTransform = 'translateZ(0px)'; | 109 container.style.webkitTransform = 'translateZ(0px)'; |
104 | 110 |
105 var newStackingOrder = getStackingOrder(container); | 111 var newStackingOrder = getStackingOrder(container); |
106 var newPaintOrder = getPaintOrder(container); | 112 var newPaintOrder = getPaintOrder(container); |
107 | 113 |
108 // The getPaintOrder() function should return a pair of paint orders. | 114 // The getPaintOrder() function should return a pair of paint orders. |
109 // One before promotion and one after. This pair of lists should remain | 115 // One before promotion and one after. This pair of lists should remain |
110 // identical whether the element is actually currently promoted or not, | 116 // identical whether the element is actually currently promoted or not, |
111 // its purpose is to generate hypothetical pre- and post-lists to | 117 // its purpose is to generate hypothetical pre- and post-lists to |
112 // determine if the element is promotable. | 118 // determine if the element is promotable. |
(...skipping 21 matching lines...) Expand all Loading... |
134 permute(testPermutation); | 140 permute(testPermutation); |
135 } | 141 } |
136 | 142 |
137 window.addEventListener('load', doTest, false); | 143 window.addEventListener('load', doTest, false); |
138 </script> | 144 </script> |
139 </head> | 145 </head> |
140 | 146 |
141 <body> | 147 <body> |
142 </body> | 148 </body> |
143 </html> | 149 </html> |
OLD | NEW |