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

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 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
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..2c4136094d6a05d7f7185826280bef8fb335a9aa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/containment/contain-parse-and-apply.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<style>
+#none { contain: none; }
+#style { contain: style; }
+#layout { contain: layout; }
+#paint { contain: paint; }
+#strict { contain: strict; }
alancutter (OOO until 2018) 2015/12/02 02:48:17 There should be tests that use combinations of sty
leviw_travelin_and_unemployed 2015/12/03 00:01:59 Added a bunch of cases below.
+</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>
+<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");
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698