Permalink
Switch branches/tags
merge_pr_14106 merge_pr_14105 merge_pr_14102 merge_pr_14098 merge_pr_14097 merge_pr_14096 merge_pr_14092 merge_pr_14086 merge_pr_14085 merge_pr_14084 merge_pr_14080 merge_pr_14079 merge_pr_14078 merge_pr_14077 merge_pr_14076 merge_pr_14075 merge_pr_14071 merge_pr_14068 merge_pr_14067 merge_pr_14065 merge_pr_14063 merge_pr_14062 merge_pr_14061 merge_pr_14058 merge_pr_14057 merge_pr_14056 merge_pr_14055 merge_pr_14053 merge_pr_14052 merge_pr_14051 merge_pr_14050 merge_pr_14049 merge_pr_14048 merge_pr_14047 merge_pr_14046 merge_pr_14045 merge_pr_14042 merge_pr_14040 merge_pr_14039 merge_pr_14038 merge_pr_14036 merge_pr_14035 merge_pr_14034 merge_pr_14032 merge_pr_14031 merge_pr_14030 merge_pr_14027 merge_pr_14026 merge_pr_14024 merge_pr_14023 merge_pr_14022 merge_pr_14021 merge_pr_14020 merge_pr_14019 merge_pr_14018 merge_pr_14017 merge_pr_14016 merge_pr_14015 merge_pr_14011 merge_pr_14010 merge_pr_14009 merge_pr_14008 merge_pr_14007 merge_pr_14006 merge_pr_14005 merge_pr_14004 merge_pr_14002 merge_pr_14001 merge_pr_14000 merge_pr_13997 merge_pr_13996 merge_pr_13995 merge_pr_13994 merge_pr_13993 merge_pr_13992 merge_pr_13991 merge_pr_13988 merge_pr_13987 merge_pr_13986 merge_pr_13985 merge_pr_13984 merge_pr_13983 merge_pr_13981 merge_pr_13980 merge_pr_13979 merge_pr_13978 merge_pr_13977 merge_pr_13974 merge_pr_13972 merge_pr_13969 merge_pr_13968 merge_pr_13967 merge_pr_13962 merge_pr_13961 merge_pr_13960 merge_pr_13959 merge_pr_13958 merge_pr_13957 merge_pr_13955 merge_pr_13954
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (42 sloc) 1.82 KB
<!--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>