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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/quirks-mode/supports.html

Issue 1974833002: Import quirks-mode tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add separate Release and Debug entries Created 4 years, 7 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/imported/wpt/quirks-mode/supports.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/quirks-mode/supports.html b/third_party/WebKit/LayoutTests/imported/wpt/quirks-mode/supports.html
new file mode 100644
index 0000000000000000000000000000000000000000..68c478ab85afba3f85515ae88539ed0125eacf6e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/quirks-mode/supports.html
@@ -0,0 +1,48 @@
+<!-- quirks -->
+<title>Syntax quirks in @supports/CSS.supports</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<link rel=help href=https://drafts.csswg.org/css-conditional/#at-supports>
+<link rel=help href=https://drafts.csswg.org/css-conditional/#the-css-interface>
+<link rel=help href=https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk>
+<link rel=help href=https://quirks.spec.whatwg.org/#the-unitless-length-quirk>
+<style>
+ /* sanity check */
+ @supports (background-color: lime) { #a { background-color: lime } }
+ @supports (background-position: 1px 1px) { #a { background-position: 1px 1px } }
+ /* test */
+ @supports (background-color: 00ff00) { #b { background-color: 00ff00 } }
+ @supports (background-position: 1 1) { #b { background-position: 1 1 } }
+</style>
+<div id=a></div>
+<div id=b></div>
+<div id=c></div> <!-- c unstyled -->
+<script>
+var a = document.getElementById('a');
+var b = document.getElementById('b');
+var c = document.getElementById('c');
+
+test(function() {
+ assert_not_equals(getComputedStyle(a).backgroundColor, getComputedStyle(c).backgroundColor);
+}, 'Sanity check @supports color');
+
+test(function() {
+ assert_equals(getComputedStyle(b).backgroundColor, getComputedStyle(a).backgroundColor);
+}, '@supports quirky color');
+
+test(function() {
+ assert_false(CSS.supports('background-color', '00ff00'));
+}, 'CSS.supports() quirky color');
+
+test(function() {
+ assert_not_equals(getComputedStyle(a).backgroundPosition, getComputedStyle(c).backgroundPosition);
+}, 'Sanity check @supports length');
+
+test(function() {
+ assert_equals(getComputedStyle(b).backgroundPosition, getComputedStyle(a).backgroundPosition);
+}, '@supports quirky length');
+
+test(function() {
+ assert_false(CSS.supports('background-position', '1 1'));
+}, 'CSS.supports() quirky length');
+</script>

Powered by Google App Engine
This is Rietveld 408576698