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

Side by Side Diff: third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent.html

Issue 2259493004: Fix Compositing of Opaque Scrolling Layers and Add Tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the tests. Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/run-after-layout-and-paint.js"></script>
5 <script>
6 if (window.internals)
7 internals.runtimeFlags.compositeOpaqueScrollersEnabled = true;
8
9 if (window.testRunner) {
10 testRunner.dumpAsTextWithPixelResults();
11 testRunner.waitUntilDone();
12 }
13
14 function hasOpaqueCompositedScrollingContentsLayer(layer) {
15 if (layer.name == "Scrolling Contents Layer")
16 return layer.contentsOpaque;
17 if (layer.children) {
18 for (var i = 0; i < layer.children.length; i++) {
19 if (hasOpaqueCompositedScrollingContentsLayer(layer.children[i]) )
20 return true;
21 }
22 }
23 return false;
24 }
25
26 onload = function() {
27 if (!window.testRunner || !window.internals)
28 return;
29
30 var result = "Should have opaque composited scrolling contents layer: ";
31 if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internal s.layerTreeAsText(document))))
32 result += "Pass.\n";
33 else
34 result += "Fail.\n";
35 document.getElementById("test-1-output").innerHTML = result;
36
37 scrollerElement = document.getElementById("scroller");
38 scrollerElement.style.background = "transparent local content-box";
39
40 runAfterLayoutAndPaint(function() {
41 var result = "Should not have opaque composited scrolling contents l ayer: ";
42 if (!hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.int ernals.layerTreeAsText(document))))
flackr 2016/08/30 21:14:49 The negation of hasOpaqueCompositedScrollingConten
Stephen Chennney 2016/08/31 20:50:20 Done. Added hasCompositedScrollingContentsLayer an
43 result += "Pass.\n";
44 else
45 result += "Fail.\n";
46 document.getElementById("test-2-output").innerHTML = result;
47 runAfterLayoutAndPaint(function() { testRunner.notifyDone(); });
48 });
49 }
50 </script>
51 <style>
52 #scroller {
53 background: red local content-box;
54 border: 10px solid rgba(0, 255, 0, 0.5);
55 overflow: scroll;
56 width: 200px;
57 height: 200px;
58 }
59 .spacer {
60 height: 300px;
61 }
62 </style>
63 </head>
64 <body>
65 <!-- The scroller's Scrolling Contents Layer should be opaque due to the opaque
66 color background. Even though the background has a content-box clip there
67 is no gap because the scroller has no padding. This means that we will be
68 able to draw text with subpixel anti-aliasing.
flackr 2016/08/30 21:14:49 This comments seems out of date - doesn't mention
Stephen Chennney 2016/08/31 20:50:20 Done.
69 -->
70 <div id="scroller"><div class="spacer"></div></div>
71 <p>Scroller background should be white</p>
72 <p id="test-1-output"></p>
73 <p id="test-2-output"></p>
74 </body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698