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

Unified 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: New tests. Created 4 years, 4 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
Index: third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent.html
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent.html
similarity index 53%
copy from third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
copy to third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent.html
index ac1de10ab5c0fa8c5306df080fcb1fd207d66297..89d41a1d2c6789f8d0ab8eac9c64ebe092ea3fd7 100644
--- a/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-with-opaque-background.html
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/overflow-scroll-background-opaque-to-transparent.html
@@ -1,6 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/run-after-layout-and-paint.js"></script>
<script>
-if (window.testRunner)
- window.testRunner.dumpAsText();
+if (window.internals)
+ internals.runtimeFlags.compositeOpaqueScrollersEnabled = true;
function hasOpaqueCompositedScrollingContentsLayer(layer) {
if (layer.name == "Scrolling Contents Layer")
@@ -14,35 +18,53 @@ function hasOpaqueCompositedScrollingContentsLayer(layer) {
return false;
}
+function postChangeTest() {
+ var result = "Should not have opaque composited scrolling contents layer: ";
+ if (!hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.layerTreeAsText(document))))
+ result += "Pass.\n";
+ else
+ result += "Fail.\n";
+ document.getElementById("test-2-output").innerHTML = result;
+}
+
onload = function() {
if (!window.testRunner || !window.internals)
return;
- var result = "";
- result += "Should have opaque composited scrolling contents layer: ";
+ var result = "Should have opaque composited scrolling contents layer: ";
if (hasOpaqueCompositedScrollingContentsLayer(JSON.parse(window.internals.layerTreeAsText(document))))
result += "Pass.\n";
else
result += "Fail.\n";
- window.testRunner.setCustomTextOutput(result);
+ document.getElementById("test-1-output").innerHTML = result;
+
+ scrollerElement = document.getElementById("scroller");
+ scrollerElement.style.background = "transparent local content-box";
+
+ runAfterLayoutAndPaint(postChangeTest(), false);
}
</script>
<style>
#scroller {
- background: white local content-box;
+ background: red local content-box;
border: 10px solid rgba(0, 255, 0, 0.5);
overflow: scroll;
width: 200px;
height: 200px;
- will-change: transform;
}
.spacer {
height: 300px;
}
</style>
+</head>
+<body>
<!-- The scroller's Scrolling Contents Layer should be opaque due to the opaque
color background. Even though the background has a content-box clip there
is no gap because the scroller has no padding. This means that we will be
able to draw text with subpixel anti-aliasing.
-->
<div id="scroller"><div class="spacer"></div></div>
+<p>Scroller background should be white</p>
+<p id="test-1-output"></p>
+<p id="test-2-output"></p>
+</body></html>

Powered by Google App Engine
This is Rietveld 408576698