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

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: final rebase for landing 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..dd8920ef24394df35a62aaebbc318d505dc81b37
--- /dev/null
+++ b/LayoutTests/compositing/overflow/opt-into-composited-scrolling-positioned-ancestor.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .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 src="resources/automatically-opt-into-composited-scrolling.js"></script>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ if (window.internals)
+ window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(true);
+
+ 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 synchronous style recalc and layout.
+ document.body.offsetTop;
+
+ if (window.internals) {
+ if (didOptIn(container))
+ write('Passed - correctly opted into composited scrolling with a positioned ancestor.')
+ else
+ write('FAILED - did not opt into composited scrolling with a positioned ancestor when it would safe.')
+ }
+ } // 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