summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/quirks/supports.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /testing/web-platform/tests/quirks/supports.html
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/quirks/supports.html')
-rw-r--r--testing/web-platform/tests/quirks/supports.html48
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/web-platform/tests/quirks/supports.html b/testing/web-platform/tests/quirks/supports.html
new file mode 100644
index 0000000000..913f7d9f73
--- /dev/null
+++ b/testing/web-platform/tests/quirks/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>