| 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>
|
|
|