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

Unified Diff: LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable.html

Issue 22694003: Ignore should-scroll-on-main-thread if main frame is not scrollable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable.html
diff --git a/LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable.html b/LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable.html
new file mode 100644
index 0000000000000000000000000000000000000000..cb1b6936a9937e91f2cde5b1803086a0b7b2a0f0
--- /dev/null
+++ b/LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable.html
@@ -0,0 +1,112 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.non-layer-viewport-constrained {
+ position: fixed;
+}
+
+.box {
+ width: 50px;
+ height: 50px;
+}
+
+.container {
+ overflow: scroll;
+ border: 1px solid black;
+}
+
+.container-element {
+ position: relative;
+ background-color: blue;
+ margin: 10px;
+}
+
+#sibling {
+ top: 220px;
+ left: 10px;
+ background-color: green;
+}
+
+#parent {
+ position: absolute;
+ left: 10px;
+ top: 10px;
+ width: 200px;
+ height: 200px;
+}
+
+#description {
+ position: absolute;
+ top: 300px;
+ left: 10px;
+}
+
+#console {
+ position: absolute;
+ top: 290px;
+ left: 10px;
+}
+
+</style>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.testRunner) {
+ // Our fixed position element must not be composited; this is a trigger for
+ // forcing main thread compositing.
+ window.internals.settings.setForceCompositingMode(true);
+ window.internals.settings.setAcceleratedCompositingForFixedPositionEnabled(false);
+ window.internals.settings.setAcceleratedCompositingForOverflowScrollEnabled(true);
+}
+
+// (Barely) modified version of shouldBeUndefined from js-test-pre.js.
+function isUndefined(value)
+{
+ var exception;
+ var _av;
+ try {
+ _av = eval(value);
+ } catch (e) {
+ exception = e;
+ }
+
+ if (exception)
+ return false;
+
+ if (typeof _av == "undefined")
+ return true;
+
+ return false;
+}
+
+function runTest() {
+ if (window.internals) {
+ var reasons = internals.mainThreadScrollingReasons(document);
+ if (isUndefined(reasons))
+ testPassed("Main thread scrolling reasons were undefined.");
+ else
+ testFailed("Main thread scrolling reasons should have been undefined. " +
+ "Instead, they were '" + reasons + "'.");
+ } else {
+ debug("This test requires window.internals.");
+ description("This test ensures that when the main frame cannot be " +
+ "scrolled, we ignore reasons for scrolling on the main " +
+ "thread that only matter when the main frame scrolls");
+ }
+}
+
+window.onload = runTest;
+</script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+ <div class="non-layer-viewport-constrained box" id="sibling"></div>
+ <div class="container" id="parent">
+ <div class="box container-element"></div>
+ <div class="box container-element"></div>
+ <div class="box container-element"></div>
+ <div class="box container-element"></div>
+ <div class="box container-element"></div>
+ </div>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698