test_supports.html (1330B)
1 <!doctype html> 2 <title>Test for InspectorUtils.supports</title> 3 <script src="/tests/SimpleTest/SimpleTest.js"></script> 4 <script> 5 const InspectorUtils = SpecialPowers.InspectorUtils; 6 7 ok(!CSS.supports("-moz-window-transform: unset"), "-moz-window-transform is only available to chrome and UA sheets"); 8 for (let chrome of [true, false]) { 9 is(InspectorUtils.supports("-moz-window-transform: unset", { chrome }), chrome, "InspectorUtils.supports should properly report to support chrome-only properties"); 10 } 11 12 ok(!CSS.supports("-moz-top-layer: auto"), "-moz-top-layer is only available to UA sheets"); 13 ok(!CSS.supports("selector(:-moz-inert)"), "-moz-inert is an UA-only pseudo-class"); 14 for (let userAgent of [true, false]) { 15 is(InspectorUtils.supports("-moz-top-layer: auto", { userAgent }), userAgent, "InspectorUtils.supports should properly report to support UA properties"); 16 is(InspectorUtils.supports("selector(:-moz-inert)", { userAgent }), userAgent, "InspectorUtils.supports should properly report to support UA-only selectors"); 17 } 18 19 ok(!CSS.supports("width: 100"), "width shouldn't allow unitless lengths in non-quirks, and in CSS.supports"); 20 for (let quirks of [true, false]) { 21 is(InspectorUtils.supports("width: 100", { quirks }), quirks, "InspectorUtils.supports should allow quirks if told to do so"); 22 } 23 </script>