Chromium Code Reviews| Index: LayoutTests/compositing/overflow/out-of-flow-pos-descendants-should-affect-all-ancestors.html |
| diff --git a/LayoutTests/compositing/overflow/out-of-flow-pos-descendants-should-affect-all-ancestors.html b/LayoutTests/compositing/overflow/out-of-flow-pos-descendants-should-affect-all-ancestors.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6f0f434e1a1bb9488a4c8a51c282ce3f848903f1 |
| --- /dev/null |
| +++ b/LayoutTests/compositing/overflow/out-of-flow-pos-descendants-should-affect-all-ancestors.html |
| @@ -0,0 +1,102 @@ |
| +<!DOCTYPE html> |
| +<html> |
| + <head> |
| + <style> |
| + div { |
| + height: 500px; |
| + width: 500px; |
| + padding: 3px; |
| + border-style: solid; |
| + border-color: black; |
| + border-width: 1px; |
| + overflow: scroll; |
| + } |
| + |
| + .filler { |
| + position: relative; |
| + top: 1000px; |
| + } |
| + |
| + button { |
| + display: none; |
| + } |
| + </style> |
| + <script> |
| + // This test ensures that when an element's style changes in such a |
| + // way that it remains out-of-flow positioned, but its containing |
| + // block changes, we correctly update elements' has-unclipped- |
| + // descendant property. Since no layers will opt out due to stacking |
| + // issues, we can judge whether we're setting this state correctly |
| + // by which layers opt-in. |
|
Julien - ping for review
2013/05/09 23:26:41
Ideally this should be visible by someone opening
|
| + if (window.internals) |
| + window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(true); |
| + |
| + if (window.testRunner) |
| + window.testRunner.dumpAsText(); |
| + |
| + function doTest() |
| + { |
| + if (!window.internals) { |
| + document.getElementById('toggle1').style.display = 'block'; |
| + document.getElementById('toggle2').style.display = 'block'; |
| + document.body.offsetTop; |
| + return; |
| + } |
| + |
| + var result = window.internals.layerTreeAsText(document); |
| + var oofp1 = document.getElementById('oofp1'); |
| + var oofp2 = document.getElementById('oofp2'); |
| + |
| + oofp1.style.position = 'fixed'; |
| + document.body.offsetTop; |
| + result += window.internals.layerTreeAsText(document); |
| + |
| + oofp2.style.position = 'fixed'; |
| + document.body.offsetTop; |
| + result += window.internals.layerTreeAsText(document); |
| + |
| + oofp1.style.position = 'absolute'; |
| + document.body.offsetTop; |
| + result += window.internals.layerTreeAsText(document); |
| + |
| + oofp2.style.position = 'absolute'; |
| + document.body.offsetTop; |
| + result += window.internals.layerTreeAsText(document); |
| + |
| + document.getElementById('console').innerHTML = result; |
| + } |
| + |
| + window.addEventListener('load', doTest, false); |
| + </script> |
| + </head> |
| + <body> |
| + <div> |
| + <div style="width: 450px; height: 450px"> |
| + <div style="width: 400px; height: 400px"> |
| + <div style="width: 350px; height: 350px"> |
| + <div style="position: relative; width: 300px; height: 150px"> |
| + <div id="oofp1" style="position: absolute; background-color: red; height: 50px; width: 50px; left: 50px; overflow: hidden"> |
| + </div> |
| + <div class="filler"></div> |
| + </div> |
| + <div style="position: relative; width: 300px; height: 150px"> |
| + <div style="width: 250px; height: 100px"> |
| + <div id="oofp2" style="position: absolute; background-color: red; height: 50px; width: 50px; left: 50px; overflow: hidden"></div> |
| + <div class="filler"></div> |
| + </div> |
| + <div class="filler"></div> |
| + </div> |
| + <div class="filler"></div> |
| + </div> |
| + <div class="filler"></div> |
| + </div> |
| + <div class="filler"></div> |
| + </div> |
| + <div class="filler"></div> |
| + </div> |
| + <pre id='console'>This test requires window.internals</pre> |
| + |
| + <button id='toggle1' onClick="document.getElementById('oofp1').style.position = document.getElementById('oofp1').style.position === 'fixed' ? 'absolute' : 'fixed'">toggle 1</button> |
| + <button id='toggle2' onClick="document.getElementById('oofp2').style.position = document.getElementById('oofp2').style.position === 'fixed' ? 'absolute' : 'fixed'">toggle 2</button> |
| + </body> |
| +</html> |