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 if (!window.internals) | |
84 return; | |
85 | |
83 var container = document.getElementById('container'); | 86 var container = document.getElementById('container'); |
84 // Here we want to compare paint order lists before and after promotion | 87 // 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 | 88 // 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 | 89 // 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 | 90 // stacking order lists. We then force the element to opt in, and |
88 // generate the paint and stacking order lists after opt-in. | 91 // generate the paint and stacking order lists after opt-in. |
89 // | 92 // |
90 // The paint order lists should exactly match the stacking order lists | 93 // The paint order lists should exactly match the stacking order lists |
91 // (modulo children that fall outside of the hit-testing area | 94 // (modulo children that fall outside of the hit-testing area |
92 // on-screen), both before and after promotion. | 95 // on-screen), both before and after promotion. |
93 container.style.webkitTransform = 'translateZ(0px)'; | 96 container.style.webkitTransform = 'translateZ(0px)'; |
94 document.body.offsetTop; | 97 document.body.offsetTop; |
95 | 98 |
96 window.internals.settings.setAcceleratedCompositingForOverflowScrollEnable d(false); | 99 window.internals.setNeedsCompositedScrolling(container, |
100 window.internals.FORCE_COMPOSITED_SCROLLING_OFF); | |
hartmanng
2013/05/02 14:04:01
and here, am I missing something or is this just a
| |
97 container.style.webkitTransform = ''; | 101 container.style.webkitTransform = ''; |
98 | 102 |
99 var oldStackingOrder = getStackingOrder(container); | 103 var oldStackingOrder = getStackingOrder(container); |
100 var oldPaintOrder = getPaintOrder(container); | 104 var oldPaintOrder = getPaintOrder(container); |
101 | 105 |
102 window.internals.settings.setAcceleratedCompositingForOverflowScrollEnable d(true); | 106 window.internals.setNeedsCompositedScrolling(container, |
107 window.internals.FORCE_COMPOSITED_SCROLLING_ON); | |
103 container.style.webkitTransform = 'translateZ(0px)'; | 108 container.style.webkitTransform = 'translateZ(0px)'; |
104 | 109 |
105 var newStackingOrder = getStackingOrder(container); | 110 var newStackingOrder = getStackingOrder(container); |
106 var newPaintOrder = getPaintOrder(container); | 111 var newPaintOrder = getPaintOrder(container); |
107 | 112 |
108 // The getPaintOrder() function should return a pair of paint orders. | 113 // The getPaintOrder() function should return a pair of paint orders. |
109 // One before promotion and one after. This pair of lists should remain | 114 // One before promotion and one after. This pair of lists should remain |
110 // identical whether the element is actually currently promoted or not, | 115 // identical whether the element is actually currently promoted or not, |
111 // its purpose is to generate hypothetical pre- and post-lists to | 116 // its purpose is to generate hypothetical pre- and post-lists to |
112 // determine if the element is promotable. | 117 // determine if the element is promotable. |
(...skipping 21 matching lines...) Expand all Loading... | |
134 permute(testPermutation); | 139 permute(testPermutation); |
135 } | 140 } |
136 | 141 |
137 window.addEventListener('load', doTest, false); | 142 window.addEventListener('load', doTest, false); |
138 </script> | 143 </script> |
139 </head> | 144 </head> |
140 | 145 |
141 <body> | 146 <body> |
142 </body> | 147 </body> |
143 </html> | 148 </html> |
OLD | NEW |