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> |