diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/inspector/tests/test_supports.html | |
parent | Initial commit. (diff) | |
download | firefox-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 'layout/inspector/tests/test_supports.html')
-rw-r--r-- | layout/inspector/tests/test_supports.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/layout/inspector/tests/test_supports.html b/layout/inspector/tests/test_supports.html new file mode 100644 index 0000000000..9a698088dd --- /dev/null +++ b/layout/inspector/tests/test_supports.html @@ -0,0 +1,23 @@ +<!doctype html> +<title>Test for InspectorUtils.supports</title> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<script> +const InspectorUtils = SpecialPowers.InspectorUtils; + +ok(!CSS.supports("-moz-window-transform: unset"), "-moz-window-transform is only available to chrome and UA sheets"); +for (let chrome of [true, false]) { + is(InspectorUtils.supports("-moz-window-transform: unset", { chrome }), chrome, "InspectorUtils.supports should properly report to support chrome-only properties"); +} + +ok(!CSS.supports("-moz-top-layer: top"), "-moz-top-layer is only available to UA sheets"); +ok(!CSS.supports("selector(:-moz-inert)"), "-moz-inert is an UA-only pseudo-class"); +for (let userAgent of [true, false]) { + is(InspectorUtils.supports("-moz-top-layer: top", { userAgent }), userAgent, "InspectorUtils.supports should properly report to support UA properties"); + is(InspectorUtils.supports("selector(:-moz-inert)", { userAgent }), userAgent, "InspectorUtils.supports should properly report to support UA-only selectors"); +} + +ok(!CSS.supports("width: 100"), "width shouldn't allow unitless lengths in non-quirks, and in CSS.supports"); +for (let quirks of [true, false]) { + is(InspectorUtils.supports("width: 100", { quirks }), quirks, "InspectorUtils.supports should allow quirks if told to do so"); +} +</script> |