CSS-supports-L5.html (1670B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS.supports() Level 5</title> 4 <link rel="help" href="https://drafts.csswg.org/css-conditional-5/#at-supports-ext"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script> 8 test(function() { 9 assert_equals(CSS.supports("font-format(opentype)"), true); 10 }, "font-format() function accepts a known format"); 11 12 test(function() { 13 assert_equals(CSS.supports("font-format(xyzzy)"), false); 14 }, "font-format() function doesn't accept an unknown format"); 15 16 test(function() { 17 assert_equals(CSS.supports("font-format(opentype, truetype)"), false); 18 }, "font-format() function doesn't accept a format list"); 19 20 test(function() { 21 assert_equals(CSS.supports("font-format('opentype')"), false); 22 }, "font-format() function doesn't accept a string."); 23 24 test(function() { 25 assert_equals(CSS.supports("font-tech(features-opentype)"), true); 26 }, "font-tech() function accepts a known technology"); 27 28 test(function() { 29 assert_equals(CSS.supports("font-tech(feature-opentype)"), false); 30 }, "font-tech() function doesn't accept singular feature-* form for technology"); 31 32 test(function() { 33 assert_equals(CSS.supports("font-tech(foobar)"), false); 34 }, "font-tech() function doesn't accept an unknown technology"); 35 36 test(function() { 37 assert_equals(CSS.supports("font-tech(features-opentype, color-COLRv0)"), false); 38 }, "font-tech() function doesn't accept a technology list"); 39 40 test(function() { 41 assert_equals(CSS.supports("font-tech('features-opentype')"), false); 42 }, "font-tech() function doesn't accept a string."); 43 </script>