Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / overflow / selection-gaps-after-removing-scrolling-contents.html
blobd6c5eeb1dc1ba1dbc314a544d403d4bcdcda1773
1 <!DOCTYPE html>
2 <style>
3 #container {
4 height: 500px;
5 width: 300px;
6 overflow: scroll;
9 .scrolled {
10 height: 50px;
11 width: 100px;
12 background: orange;
13 margin: 15px;
14 transform: translateZ(0);
16 </style>
17 <script>
18 if (window.testRunner)
19 testRunner.dumpAsText();
21 if (window.internals)
22 window.internals.settings.setPreferCompositingToLCDTextEnabled(true);
24 var iteration = 1;
26 function dumpLayerTree() {
27 var pre = document.getElementById("console");
29 if (window.internals) {
30 var layerTreeAsText = internals.layerTreeAsText(document);
31 pre.innerHTML += '\n\n*** iteration ' + iteration + ': ***\n\n';
32 pre.innerHTML += layerTreeAsText;
35 iteration++;
38 onload = function()
40 var container = document.getElementById('container');
41 container.style.backgroundColor = 'blue';
43 dumpLayerTree();
45 var selection = getSelection();
46 var range = document.createRange();
47 range.selectNode(document.getElementById("selection"));
48 selection.addRange(range);
50 dumpLayerTree();
52 container.style.backgroundColor = '';
54 dumpLayerTree();
56 selection.removeAllRanges();
58 dumpLayerTree();
60 </script>
62 This test passes if the container's scrolling contents layer (the first child of the GraphicsLayer with 4 children)
63 draws content only on iterations 1 and 2, and its scrolling block selection layer (the child of the scrolling
64 contents layer) draws content only on iteration 3. The scrolling block selection layer should also be much smaller
65 than the scrolling contents layer.
67 <div id="container">
68 <div class="scrolled">Lorem Ipsum</div>
69 <div class="scrolled">Lorem Ipsum</div>
70 <div class="scrolled" id="selection">Lorem Ipsum</div>
71 <div class="scrolled">Lorem Ipsum</div>
72 <div class="scrolled">Lorem Ipsum</div>
73 <div class="scrolled">Lorem Ipsum</div>
74 <div class="scrolled">Lorem Ipsum</div>
75 <div class="scrolled">Lorem Ipsum</div>
76 <div class="scrolled">Lorem Ipsum</div>
77 <div class="scrolled">Lorem Ipsum</div>
78 </div>
79 <pre id="console"></pre>