Chromium Code Reviews| 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..7e5c911d6ddb1a7852756ebe2f38d12fa2929769 |
| --- /dev/null |
| +++ b/LayoutTests/compositing/overflow/ignore-main-thread-scroll-reasons-when-main-frame-not-scrollable.html |
| @@ -0,0 +1,86 @@ |
| +<!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> |
|
jamesr
2013/08/26 18:17:16
did you forget to include -post.js?
|
| +<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); |
| +} |
| + |
| +function runTest() { |
| + if (window.internals) { |
| + shouldBeUndefined(internals.mainThreadScrollingReasons(document)); |
| + } 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> |
| +</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> |