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

Unified Diff: LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children.html

Issue 1114543004: Avoid creating ancestor clipping layers for scroll children (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding a layout test. Created 5 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
« no previous file with comments | « no previous file | LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children.html
diff --git a/LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children.html b/LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children.html
new file mode 100644
index 0000000000000000000000000000000000000000..b98c9101678a107d7686ba0d3c8b544bd8b8c079
--- /dev/null
+++ b/LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<style>
+#container {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ overflow: scroll;
+}
+.translated {
+ position: absolute;
+ right: 8px;
+ left: 8px;
+ height: 400px;
+}
+#cards {
+ width: 400px;
+ height: 8000px;
+ position: relative;
+}
+.scrolled {
+ position:absolute;
+ width:100%;
+ height:100%;
+ background:green;
+}
+</style>
+<div id="container">
+ <div id="cards">
+ <div class="translated">
+ <div class="scrolled"></div>
+ </div>
+ <div class="translated" style="transform: translate(0,430px)">
+ <div class="scrolled"></div>
+ </div>
+ </div>
+</div>
+
+<script src='../../resources/js-test.js'></script>
+
+<script>
+description('Verifies that scroll children do not create ancestor clipping ' +
+ 'layers in compositor.');
+
+if (window.internals)
+ internals.settings.setPreferCompositingToLCDTextEnabled(true);
+
+function scrollChildHasNoScrollClip(layer) {
+ if (layer.children) {
+ for (var i = 0; i < layer.children.length; i++) {
+ var child = layer.children[i];
+ // The only layer that should have a transform in this example is the
+ // scroll child. If this is not the case, we have a scroll clip.
+ if (child.transform && child.hasScrollParent)
+ return true;
+
+ if (scrollChildHasNoScrollClip(child))
+ return true;
+ }
+ }
+ return false;
+}
+
+onload = function() {
+ if (!window.internals)
+ return;
+ documentLayerTree = JSON.parse(window.internals.layerTreeAsText(
+ document, window.internals.LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS));
+ shouldBe('scrollChildHasNoScrollClip(documentLayerTree)', 'true');
+};
+</script>
« no previous file with comments | « no previous file | LayoutTests/compositing/overflow/avoid-ancestor-clip-for-scroll-children-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698