From 6b8bd58dda94adaeb55e9f4386ed0638f9158ba3 Mon Sep 17 00:00:00 2001 From: "shivamidow@gmail.com" <shivamidow@gmail.com> Date: Mon, 15 Jun 2015 05:19:51 +0000 Subject: Where an ancestor has overflow style, a fixed child needs to be composited. A block child with fixed style is composited where frameview has an enough long height to scroll. But that does not cover the other case. Where an ancestor of the fixed child has a overflow style but frameview is not scrollable, we don't composite the fixed block. For the result, the fixed child is scrolled according to its ancestor block. We need to composite it in a separate composited layer for the case. BUG=490141 Review URL: https://codereview.chromium.org/1167073002 git-svn-id: svn://svn.chromium.org/blink/trunk@197099 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- .../fixed-position-in-fixed-overflow-expected.txt | 51 ++++++++++++++++++++++ .../fixed-position-in-fixed-overflow.html | 41 +++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt create mode 100644 third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow.html (limited to 'third_party/WebKit/LayoutTests/compositing/layer-creation') diff --git a/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt b/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt new file mode 100644 index 0000000..0244282 --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow-expected.txt @@ -0,0 +1,51 @@ +{ + "bounds": [800, 600], + "children": [ + { + "bounds": [800, 600], + "contentsOpaque": true, + "drawsContent": true, + "children": [ + { + "position": [8, 13], + "bounds": [800, 600], + "drawsContent": true, + "children": [ + { + "bounds": [785, 600], + "children": [ + { + "bounds": [785, 1000], + "drawsContent": true, + "children": [ + { + "children": [ + { + "position": [192, 0], + "bounds": [100, 100], + "contentsOpaque": true, + "drawsContent": true, + "backgroundColor": "#FFFF00" + } + ] + } + ] + } + ] + }, + { + "children": [ + { + "position": [785, 0], + "bounds": [15, 600], + "drawsContent": true + } + ] + } + ] + } + ] + } + ] +} + diff --git a/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow.html b/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow.html new file mode 100644 index 0000000..95e85dc --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/layer-creation/fixed-position-in-fixed-overflow.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<style> +.fixed { + position: fixed; +} +.overflow { + width: 100%; + height: 100%; + overflow-y: scroll; +} +.yellow { + left: 200px; + width: 100px; + height: 100px; + background-color: yellow; +} + +.blue { + width: 100px; + height: 1000px; + background-color: blue; +} +</style> +<div class="overflow fixed"> + <div class="yellow fixed"></div> + <div class="blue"></div> +</div> +<pre></pre> +<script src="../../resources/run-after-layout-and-paint.js"></script> +<script> +if (window.testRunner && window.internals) { + testRunner.dumpAsText(); + testRunner.waitUntilDone(); + internals.settings.setPreferCompositingToLCDTextEnabled(true); +} + +runAfterLayoutAndPaint(function() { + if (window.testRunner) + document.querySelector('pre').textContent = window.internals.layerTreeAsText(document); +}, true); +</script> -- cgit v1.1