Index: LayoutTests/compositing/overflow/build-paint-order-list-where-opt-in-decisions-can-affect-each-other.html |
diff --git a/LayoutTests/compositing/overflow/build-paint-order-list-where-opt-in-decisions-can-affect-each-other.html b/LayoutTests/compositing/overflow/build-paint-order-list-where-opt-in-decisions-can-affect-each-other.html |
index 0742db2f4f1fd1e48e59eb335edaac71bff10aad..95aef180510d08f06dfb06487116efa20c37db56 100644 |
--- a/LayoutTests/compositing/overflow/build-paint-order-list-where-opt-in-decisions-can-affect-each-other.html |
+++ b/LayoutTests/compositing/overflow/build-paint-order-list-where-opt-in-decisions-can-affect-each-other.html |
@@ -99,68 +99,71 @@ |
var parentscrollinglayer = document.getElementById('parentscrollinglayer'); |
var childscrollinglayer = document.getElementById('childscrollinglayer'); |
- if (window.internals) { |
- var failure = false; |
- |
- // Here we want to compare paint order lists before and after promotion |
- // to the actual stacking order as determined by hit-testing. So we |
- // first force the element not to promote, then compute its paint and |
- // stacking order lists. We then force the element to opt in, and |
- // generate the paint and stacking order lists after opt-in. |
- // |
- // The paint order lists should exactly match the stacking order lists |
- // (modulo children that fall outside of the hit-testing area |
- // on-screen), both before and after promotion. |
- parentscrollinglayer.style.webkitTransform = 'translateZ(0px)'; |
- document.body.offsetTop; |
- |
- window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(false); |
- parentscrollinglayer.style.webkitTransform = ''; |
- |
- var oldStackingOrder = getStackingOrder(); |
- var oldPaintOrder = getPaintOrder(childscrollinglayer); |
- |
- window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(true); |
- parentscrollinglayer.style.webkitTransform = 'translateZ(0px)'; |
- |
- var newStackingOrder = getStackingOrder(); |
- var newPaintOrder = getPaintOrder(childscrollinglayer); |
- |
- // The getPaintOrder() function should return a pair of paint orders. |
- // One before promotion and one after. This pair of lists should remain |
- // identical whether the element is actually currently promoted or not, |
- // its purpose is to generate hypothetical pre- and post-lists to |
- // determine if the element is promotable. |
- if (!comparePaintOrderLists(oldPaintOrder, newPaintOrder)) { |
- failure = true; |
- write("FAIL - paint order lists not identical before/after promotion"); |
- } |
- |
- if (!compareStackingOrderWithPaintOrder(oldStackingOrder, oldPaintOrder.beforePromote)) { |
- failure = true; |
- write("FAIL - paint order list before promote doesn't match stacking order"); |
- } |
- |
- if (!compareStackingOrderWithPaintOrder(newStackingOrder, oldPaintOrder.afterPromote)) { |
- failure = true; |
- write("FAIL - paint order list after promote doesn't match stacking order"); |
- } |
- |
- var childScrollingLayerOccurrences = countOccurrencesOfElementInPaintOrderList(oldPaintOrder.beforePromote, childscrollinglayer); |
- if (childScrollingLayerOccurrences !== 1) { |
- failure = true; |
- write("FAIL - paint order list before promote contains " + childScrollingLayerOccurrences + " occurrences of child scrolling layer. Should be exactly 1."); |
- } |
- |
- childScrollingLayerOccurrences = countOccurrencesOfElementInPaintOrderList(oldPaintOrder.afterPromote, childscrollinglayer); |
- if (childScrollingLayerOccurrences !== 1) { |
- failure = true; |
- write("FAIL - paint order list after promote contains " + childScrollingLayerOccurrences + " occurrences of child scrolling layer. Should be exactly 1."); |
- } |
- |
- if(!failure) |
- write("PASS - did not crash."); |
+ if (window.internals) |
+ return; |
+ |
+ var failure = false; |
+ |
+ // Here we want to compare paint order lists before and after promotion |
+ // to the actual stacking order as determined by hit-testing. So we |
+ // first force the element not to promote, then compute its paint and |
+ // stacking order lists. We then force the element to opt in, and |
+ // generate the paint and stacking order lists after opt-in. |
+ // |
+ // The paint order lists should exactly match the stacking order lists |
+ // (modulo children that fall outside of the hit-testing area |
+ // on-screen), both before and after promotion. |
+ parentscrollinglayer.style.webkitTransform = 'translateZ(0px)'; |
+ document.body.offsetTop; |
+ |
+ window.internals.setNeedsCompositedScrolling(parentscrollinglayer, |
+ window.internals.FORCE_COMPOSITED_SCROLLING_OFF); |
+ parentscrollinglayer.style.webkitTransform = ''; |
+ |
+ var oldStackingOrder = getStackingOrder(); |
+ var oldPaintOrder = getPaintOrder(childscrollinglayer); |
+ |
+ window.internals.setNeedsCompositedScrolling(parentscrollinglayer, |
+ window.internals.FORCE_COMPOSITED_SCROLLING_ON); |
+ parentscrollinglayer.style.webkitTransform = 'translateZ(0px)'; |
+ |
+ var newStackingOrder = getStackingOrder(); |
+ var newPaintOrder = getPaintOrder(childscrollinglayer); |
+ |
+ // The getPaintOrder() function should return a pair of paint orders. |
+ // One before promotion and one after. This pair of lists should remain |
+ // identical whether the element is actually currently promoted or not, |
+ // its purpose is to generate hypothetical pre- and post-lists to |
+ // determine if the element is promotable. |
+ if (!comparePaintOrderLists(oldPaintOrder, newPaintOrder)) { |
+ failure = true; |
+ write("FAIL - paint order lists not identical before/after promotion"); |
+ } |
+ |
+ if (!compareStackingOrderWithPaintOrder(oldStackingOrder, oldPaintOrder.beforePromote)) { |
+ failure = true; |
+ write("FAIL - paint order list before promote doesn't match stacking order"); |
} |
+ |
+ if (!compareStackingOrderWithPaintOrder(newStackingOrder, oldPaintOrder.afterPromote)) { |
+ failure = true; |
+ write("FAIL - paint order list after promote doesn't match stacking order"); |
+ } |
+ |
+ var childScrollingLayerOccurrences = countOccurrencesOfElementInPaintOrderList(oldPaintOrder.beforePromote, childscrollinglayer); |
+ if (childScrollingLayerOccurrences !== 1) { |
+ failure = true; |
+ write("FAIL - paint order list before promote contains " + childScrollingLayerOccurrences + " occurrences of child scrolling layer. Should be exactly 1."); |
+ } |
+ |
+ childScrollingLayerOccurrences = countOccurrencesOfElementInPaintOrderList(oldPaintOrder.afterPromote, childscrollinglayer); |
+ if (childScrollingLayerOccurrences !== 1) { |
+ failure = true; |
+ write("FAIL - paint order list after promote contains " + childScrollingLayerOccurrences + " occurrences of child scrolling layer. Should be exactly 1."); |
+ } |
+ |
+ if(!failure) |
+ write("PASS - did not crash."); |
} |
window.addEventListener('load', doTest, false); |