Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: LayoutTests/compositing/overflow/opt-into-composited-scrolling-positioned-ancestor.html

Issue 13722015: Update automatically-opt-into-composited-scrolling.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698