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

Unified Diff: third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-with-scale-transform.html

Issue 1835833005: Don't squash layers with non-translation transforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/squashing/dont-squash-with-scale-transform.html
diff --git a/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-with-scale-transform.html b/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-with-scale-transform.html
new file mode 100644
index 0000000000000000000000000000000000000000..77ac31a86286266089466a4adb992b4935cff7af
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-with-scale-transform.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<style>
+.scale-transform {
+ transform: scale(0.75);
+}
+.translate-transform {
+ transform: translateX(5px);
+}
+</style>
+<div style="will-change: transform; width: 200px; height: 200px; background: lightgray;"></div>
+<div class="scale-transform" style="position: absolute; width: 200px; height: 200px; top: 100px; left: 100px; background: lightblue"></div>
+<div class="translate-transform" style="position: absolute; width: 200px; height: 200px; top: 100px; left: 100px; background: lightblue"></div>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+onload = function() {
+ if (window.internals) {
+ var layers = JSON.parse(internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_DEBUG_INFO));
+
+ // The scale-transform layer can't be squashed
+ assert_true(layers.children[0].children[1].children[0].compositingReasons[1] == "Layer was separately composited because it could not be squashed.");
+ assert_true(layers.children[0].children[1].children[0].squashingDisallowedReasons[0] == "Cannot squash layers with transforms that are not identity or translation.");
+
+ // ...but the translate-transform one can.
+ assert_true(layers.children[0].children[1].children[1].compositingReasons[0] == "Secondary layer, home for a group of squashable content");
+ }
+};
+</script>

Powered by Google App Engine
This is Rietveld 408576698