Chromium Code Reviews| 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.ForceCompositedScrollingOff); | |
| 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, |
|
Julien - ping for review
2013/05/06 22:56:59
AFAICT no one is calling setAcceleratedCompositing
Ian Vollick
2013/05/08 13:10:58
I think that the machinery coincidentally gets kic
| |
| 107 window.internals.ForceCompositedScrollingOn); | |
| 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 |
| 113 window.internals.setNeedsCompositedScrolling(container, | |
| 114 window.internals.DoNotForceCompositedScrolling); | |
| 108 // The getPaintOrder() function should return a pair of paint orders. | 115 // The getPaintOrder() function should return a pair of paint orders. |
| 109 // One before promotion and one after. This pair of lists should remain | 116 // One before promotion and one after. This pair of lists should remain |
| 110 // identical whether the element is actually currently promoted or not, | 117 // identical whether the element is actually currently promoted or not, |
| 111 // its purpose is to generate hypothetical pre- and post-lists to | 118 // its purpose is to generate hypothetical pre- and post-lists to |
| 112 // determine if the element is promotable. | 119 // determine if the element is promotable. |
| 113 if (!comparePaintOrderLists(oldPaintOrder, newPaintOrder)) | 120 if (!comparePaintOrderLists(oldPaintOrder, newPaintOrder)) |
| 114 write("iteration " + count + " FAIL - paint order lists not identical be fore/after promotion"); | 121 write("iteration " + count + " FAIL - paint order lists not identical be fore/after promotion"); |
| 115 | 122 |
| 116 if (!compareStackingOrderWithPaintOrder(oldStackingOrder, oldPaintOrder.be forePromote)) | 123 if (!compareStackingOrderWithPaintOrder(oldStackingOrder, oldPaintOrder.be forePromote)) |
| 117 write("iteration " + count + " FAIL - paint order list before promote do esn't match stacking order"); | 124 write("iteration " + count + " FAIL - paint order list before promote do esn't match stacking order"); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 134 permute(testPermutation); | 141 permute(testPermutation); |
| 135 } | 142 } |
| 136 | 143 |
| 137 window.addEventListener('load', doTest, false); | 144 window.addEventListener('load', doTest, false); |
| 138 </script> | 145 </script> |
| 139 </head> | 146 </head> |
| 140 | 147 |
| 141 <body> | 148 <body> |
| 142 </body> | 149 </body> |
| 143 </html> | 150 </html> |
| OLD | NEW |