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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply.html

Issue 1485973005: Add CSS support for Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test expectation Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply.html b/third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply.html
new file mode 100644
index 0000000000000000000000000000000000000000..5c1bd257fbec23d9d506c8a1bde861475e36baf3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<style>
+#none { contain: none; }
+#style { contain: style; }
+#layout { contain: layout; }
+#paint { contain: paint; }
+#strict { contain: strict; }
+</style>
+<body>
+<div id="none"><div></div></div>
+<div id="style"><div></div></div>
+<div id="layout"><div></div></div>
+<div id="paint"><div></div></div>
+<div id="strict"><div></div></div>
+<div id="test"></div>
+<script src="../../../resources/js-test.js"></script>
+<script>
+function computedContainValue(element) {
+ return window.getComputedStyle(element).contain;
+}
+function getContainValue(query)
+{
+ var element = document.querySelector(query);
+ return computedContainValue(element);
+}
+
+shouldBeEqualToString("getContainValue('#none')", "none");
+shouldBeEqualToString("getContainValue('#style')", "style");
+shouldBeEqualToString("getContainValue('#layout')", "layout");
+shouldBeEqualToString("getContainValue('#paint')", "paint");
+shouldBeEqualToString("getContainValue('#strict')", "strict");
+
+var children = document.querySelectorAll("div > div");
+for (var i = 0; i < children.length; i++) {
+ shouldBeEqualToString("computedContainValue(children[i])", "none");
+}
+
+var test = document.querySelector('#test');
+
+test.style.setProperty("contain", "layout paint style");
+shouldBeEqualToString("getContainValue('#test')", "strict");
+
+test.style.setProperty("contain", "layout paint");
+shouldBeEqualToString("getContainValue('#test')", "layout paint");
+
+test.style.setProperty("contain", "strict");
+shouldBeEqualToString("getContainValue('#test')", "strict");
+
+test.style.setProperty("contain", "none");
+shouldBeEqualToString("getContainValue('#test')", "none");
+
+test.style.setProperty("contain", "layout layout");
+shouldBeEqualToString("getContainValue('#test')", "none");
+
+test.style.setProperty("contain", "strict layout");
+shouldBeEqualToString("getContainValue('#test')", "none");
+
+test.style.setProperty("contain", "paint strict");
+shouldBeEqualToString("getContainValue('#test')", "none");
+
+test.style.setProperty("contain", "paint layout style paint");
+shouldBeEqualToString("getContainValue('#test')", "none");
+
+test.style.setProperty("contain", "style paint");
+shouldBeEqualToString("getContainValue('#test')", "style paint");
+
+test.style.setProperty("contain", "none strict");
+shouldBeEqualToString("getContainValue('#test')", "style paint");
+
+test.style.setProperty("contain", "strict strict");
+shouldBeEqualToString("getContainValue('#test')", "style paint");
+
+test.style.setProperty("contain", "strict none");
+shouldBeEqualToString("getContainValue('#test')", "style paint");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698