summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/mediaqueries/scripting.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/mediaqueries/scripting.html')
-rw-r--r--testing/web-platform/tests/css/mediaqueries/scripting.html26
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/mediaqueries/scripting.html b/testing/web-platform/tests/css/mediaqueries/scripting.html
new file mode 100644
index 0000000000..de047cb463
--- /dev/null
+++ b/testing/web-platform/tests/css/mediaqueries/scripting.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/mediaqueries-5/#scripting">
+<script type="text/javascript" src="/resources/testharness.js"></script>
+<script type="text/javascript" src="/resources/testharnessreport.js"></script>
+<script type="text/javascript" src="resources/matchmedia-utils.js"></script>
+
+<script>
+query_should_be_known("(scripting)");
+query_should_be_known("(scripting: enabled)");
+query_should_be_known("(scripting: initial-only)");
+query_should_be_known("(scripting: none)");
+
+query_should_be_unknown("(scripting: 0)");
+query_should_be_unknown("(scripting: 10px)");
+query_should_be_unknown("(scripting: invalid)");
+
+test(() => {
+ let match_enabled = window.matchMedia("(scripting: enabled)");
+ assert_true(match_enabled.matches);
+}, "Check that scripting currently matches 'enabled'");
+
+test(() => {
+ let booleanContext = window.matchMedia("(scripting)");
+ assert_true(booleanContext.matches);
+}, "Check that scripting currently evaluates to true in the boolean context");
+</script>