| Index: LayoutTests/compositing/overflow/opt-into-composited-scrolling-positioned-ancestor.html
|
| diff --git a/LayoutTests/compositing/overflow/opt-into-composited-scrolling-positioned-ancestor.html b/LayoutTests/compositing/overflow/opt-into-composited-scrolling-positioned-ancestor.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f07a87f49478740d4e1d9cc8b5f9c5bc95a4ab29
|
| --- /dev/null
|
| +++ b/LayoutTests/compositing/overflow/opt-into-composited-scrolling-positioned-ancestor.html
|
| @@ -0,0 +1,104 @@
|
| +<!DOCTYPE html>
|
| +
|
| +<html>
|
| +<head>
|
| + <style type="text/css" media="screen">
|
| + .container {
|
| + width: 200px;
|
| + height: 200px;
|
| + overflow: scroll;
|
| + margin: 20px;
|
| + border: 1px solid black;
|
| + }
|
| +
|
| + .scrolled {
|
| + width: 180px;
|
| + height: 90px;
|
| + margin: 10px;
|
| + background-color: gray;
|
| + position: relative;
|
| + }
|
| +
|
| + .positioned {
|
| + width: 120px;
|
| + height: 240px;
|
| + position: absolute;
|
| + }
|
| +
|
| + #firstChild {
|
| + z-index: 1;
|
| + }
|
| +
|
| + #secondChild {
|
| + z-index: 2;
|
| + }
|
| +
|
| + #predecessor {
|
| + left: 20px;
|
| + top: 20px;
|
| + z-index: 0;
|
| + background-color: green;
|
| + }
|
| +
|
| + #ancestor {
|
| + background-color: blue;
|
| + }
|
| +
|
| + </style>
|
| + <script type="text/javascript" charset="utf-8">
|
| + var debugMode = false;
|
| +
|
| + if (window.testRunner)
|
| + testRunner.dumpAsText();
|
| +
|
| + if (window.internals)
|
| + window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(true);
|
| +
|
| + function write(str)
|
| + {
|
| + var pre = document.getElementById('console');
|
| + var text = document.createTextNode(str + '\n');
|
| + pre.appendChild(text);
|
| + }
|
| +
|
| + function doTest()
|
| + {
|
| + var predecessor = document.getElementById('predecessor');
|
| + var ancestor = document.getElementById('ancestor');
|
| + var container = document.getElementById('container');
|
| + var firstChild = document.getElementById('firstChild');
|
| + var secondChild = document.getElementById('secondChild');
|
| +
|
| + // Force a style recalc.
|
| + document.body.offsetTop;
|
| +
|
| + if (window.internals) {
|
| + // Force a layout.
|
| + window.internals.boundingBox(container);
|
| + var layerTree = window.internals.layerTreeAsText(document);
|
| +
|
| + if (!layerTree)
|
| + write('FAILED - did not opt into composited scrolling with a positioned ancestor when it would safe.')
|
| + else
|
| + write('Passed - correctly opted into composited scrolling with a positioned ancestor.')
|
| +
|
| + if (layerTree && debugMode)
|
| + write(layerTree);
|
| + }
|
| + } // function doTest
|
| +
|
| + window.addEventListener('load', doTest, false);
|
| + </script>
|
| +</head>
|
| +
|
| +<body>
|
| + <div class="positioned" id="predecessor"></div>
|
| + <div class="positioned" id="ancestor">
|
| + <div class="container" id="container">
|
| + <div class="scrolled" id="firstChild"></div>
|
| + <div class="scrolled" id="secondChild"></div>
|
| + </div>
|
| + </div>
|
| + <pre id="console"></pre>
|
| +</body>
|
| +</html>
|
|
|