Bug 1646415 [wpt PR 24197] - Support for the prefers-reduced-data media query feature, a=testonly
authorAdam Argyle <argyle@chromium.org>
Mon, 22 Jun 2020 10:43:22 +0000
changeset 536852 d81c68861c425e0533177eafce43a740813e9585
parent 536851 8043413835a77cbe4c203c1e42472bf25a5b4cfc
child 536853 7446debba5ecc55de7e2110e1952fee0a6dfbbce
push id119680
push userwptsync@mozilla.com
push dateTue, 23 Jun 2020 11:08:22 +0000
treeherderautoland@7ca3d4bada73 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1646415, 24197, 1051189, 2083838, 779564
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1646415 [wpt PR 24197] - Support for the prefers-reduced-data media query feature, a=testonly Automatic update from web-platform-tests Support for the prefers-reduced-data media query feature Intent to prototype: https://groups.google.com/a/chromium.org/d/msg/blink-dev/oNJTem41LBs/CA4Nx05aAwAJ Bug: 1051189 Change-Id: I2ff88a70858cf322725f50e40f979c9596f45b0b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2083838 Commit-Queue: Adam Argyle <argyle@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#779564} -- wpt-commits: c799fc8610f0ef1baef40e2afd200ccc4d97eb9a wpt-pr: 24197
testing/web-platform/tests/css/mediaqueries/prefers-reduced-data.html
--- a/testing/web-platform/tests/css/mediaqueries/prefers-reduced-data.html
+++ b/testing/web-platform/tests/css/mediaqueries/prefers-reduced-data.html
@@ -23,16 +23,19 @@ query_should_be_js_parseable("(prefers-r
 query_should_not_be_js_parseable("(prefers-reduced-data: 0)");
 query_should_not_be_js_parseable("(prefers-reduced-data: none)");
 query_should_not_be_js_parseable("(prefers-reduced-data: 10px)");
 query_should_not_be_js_parseable("(prefers-reduced-data: no-preference reduce)");
 query_should_not_be_js_parseable("(prefers-reduced-data: reduced)");
 query_should_not_be_js_parseable("(prefers-reduced-data: no-preference/reduce)");
 
 test(() => {
-  // What this is saying is that 'no-preference' is not the default, so
-  // irregardless of the current OS settings, (prefers-reduced-data).matches
-  // should not be equivalent to (prefers-reduced-data: no-preference).matches.
+  // https://drafts.csswg.org/mediaqueries-5/#boolean-context
   let booleanContext = window.matchMedia("(prefers-reduced-data)");
   let noPreference = window.matchMedia("(prefers-reduced-data: no-preference)");
   assert_equals(booleanContext.matches, !noPreference.matches);
 }, "Check that no-preference evaluates to false in the boolean context");
+
+test(() => {
+  let invalid = window.matchMedia("(prefers-reduced-data: 10px)");
+  assert_equals(invalid.matches, false);
+}, "Check that invalid evaluates to false");
 </script>