From 968f40912f7fe99860a8df40971f165b3eb8c95b Mon Sep 17 00:00:00 2001 From: Sebastian Zartner Date: Thu, 4 Sep 2025 11:02:43 +0200 Subject: [PATCH] [mediaqueries-5][editorial] Fixed a bunch of Bikeshed issues --- mediaqueries-5/Overview.bs | 633 ++++++++++++++++++------------------- 1 file changed, 313 insertions(+), 320 deletions(-) diff --git a/mediaqueries-5/Overview.bs b/mediaqueries-5/Overview.bs index b4c5bb058144..99c35b39d9b1 100644 --- a/mediaqueries-5/Overview.bs +++ b/mediaqueries-5/Overview.bs @@ -36,7 +36,11 @@ spec:css-values-4; text: type:dfn; text:relative length spec:dom; type:dfn; text:origin - +spec:html; + type:dfn; for:/; text:browsing context + type:dfn; for:/; text:joint session history +spec:infra; type:dfn; text:user agent +spec:selectors-4; type:selector; text::fullscreen
@@ -348,7 +352,7 @@ Media Types
 	but the definition of media types as mutually exclusive
 	makes it difficult to use them in a reasonable manner;
 	instead, their exclusive aspects are better expressed as media features
-	such as '@media/grid' or 'scan'.
+	such as '@media/grid' or '@media/scan'.
 
 	As such, the following media types are defined for use in media queries:
 
@@ -447,9 +451,9 @@ Media Features
 	the media feature must always evaluate to false.
 
 	
- The media feature ''device-aspect-ratio'' only applies to + The media feature '@media/device-aspect-ratio' only applies to visual devices. On an ''speech'' device, expressions involving - ''device-aspect-ratio'' will therefore always be false: + '@media/device-aspect-ratio' will therefore always be false:
 			<link media="speech and (device-aspect-ratio: 16/9)"
@@ -463,7 +467,7 @@ Media Feature Types: “range” and “discrete”
 	Every media feature defines its “type” as either “range” or “discrete” in its definition table.
 
 	“Discrete” media features,
-	like 'pointer'
+	like '@media/pointer'
 	take their values from a set.
 	The values may be keywords
 	or boolean numbers (0 and 1),
@@ -519,7 +523,7 @@ Evaluating Media Features in a Boolean Context
 	
Some media features are designed to be written like this. - For example, 'update' is typically written as ''(update)'' to test if any kind of updating is available, + For example, '@media/update' is typically written as ''(update)'' to test if any kind of updating is available, or ''not (update)'' to check for the opposite. It can still be given an explicit value as well, @@ -540,7 +544,7 @@ Evaluating Media Features in a Boolean Context Only some of the media features that accept keywords are meaningful in a boolean context. For example, ''(pointer)'' is useful, - as 'pointer' has a ''pointer/none'' value to indicate there's no pointing device at all on the device. + as '@media/pointer' has a ''@media/pointer/none'' value to indicate there's no pointing device at all on the device. On the other hand, ''(scan)'' is just always true or always false (depending on whether it applies at all to the device), as there's no value that means “false”. @@ -1025,7 +1029,7 @@ Error Handling
@media (min-orientation:portrait) { … }
- The 'orientation' feature does not accept prefixes, + The '@media/orientation' feature does not accept prefixes, so this is considered an unknown media feature, and turned into ''not all''.
@@ -1140,7 +1144,7 @@ Aspect-Ratio: the aspect-ratio feature

-Orientation: the 'orientation' feature

+Orientation: the '@media/orientation' feature
 	Name: orientation
@@ -1151,11 +1155,11 @@ Orientation: the 'orientation' feature
 
 	
portrait -
The 'orientation' media feature is ''portrait'' +
The '@media/orientation' media feature is ''portrait'' when the value of the '@media/height' media feature is greater than or equal to the value of the '@media/width' media feature.
landscape -
Otherwise 'orientation' is ''landscape''. +
Otherwise '@media/orientation' is ''landscape''.
@@ -1254,13 +1258,13 @@ Horizontal Viewport Segments: the '@media/horizontal-viewport-segments' feature<
The '@media/horizontal-viewport-segments' media feature describes the number of logical segments of - the viewport in the horizontal direction. + the viewport in the horizontal direction. - The '@media/horizontal-viewport-segments' media feature is false in the negative range. + The '@media/horizontal-viewport-segments' media feature is false in the negative range. - When the viewport is split by one or more hardware features (such as a fold or a hinge between - separate displays) that act as a logical divider, segments are the regions of the viewport that - can be treated as logically distinct by the page. + When the viewport is split by one or more hardware features (such as a fold or a hinge between + separate displays) that act as a logical divider, segments are the regions of the viewport that + can be treated as logically distinct by the page.

Vertical Viewport Segments: the '@media/vertical-viewport-segments' feature

@@ -1273,9 +1277,9 @@ Vertical Viewport Segments: the '@media/vertical-viewport-segments' feature
The '@media/vertical-viewport-segments' media feature describes the number of logical segments of - the viewport in the vertical direction. + the viewport in the vertical direction. - The '@media/vertical-viewport-segments' media feature is false in the negative range. + The '@media/vertical-viewport-segments' media feature is false in the negative range.
This media query detects a viewport that has exactly two segments that are side-by-side. @@ -1284,7 +1288,7 @@ Vertical Viewport Segments: the '@media/vertical-viewport-segments' feature

-Display Modes: the ''display-mode'' media feature

+Display Modes: the '@media/display-mode' media feature
 	Name: display-mode
@@ -1367,7 +1371,7 @@ Display Modes: the ''display-mode'' media feature 
 		The [=display mode/fullscreen=] [=display mode=] is distinct from the
 		[[FULLSCREEN|Fullscreen API]].
 
-		The ''fullscreen'' value for [=display-mode=] is not directly related
+		The ''fullscreen'' value for '@media/display-mode' is not directly related
 		to the CSS '':fullscreen'' pseudo-class.
 		The '':fullscreen'' pseudo-class matches an element
 		exclusively when that element is put into the fullscreen element stack.
@@ -1414,7 +1418,7 @@ Display Modes: the ''display-mode'' media feature 
 Display Quality Media Features
 
 

-Display Resolution: the 'resolution' feature

+Display Resolution: the '@media/resolution' feature
 	Name: resolution
@@ -1423,13 +1427,13 @@ Display Resolution: the 'resolution' feature
 	Type: range
 	
- The 'resolution' media feature describes the resolution of the output + The '@media/resolution' media feature describes the resolution of the output device, i.e. the density of the pixels, taking into account the page zoom but assuming a pinch zoom of 1.0. - The 'resolution' media feature is false in the negative range + The '@media/resolution' media feature is false in the negative range - When querying media with non-square pixels, 'resolution' queries the density in the vertical dimension. + When querying media with non-square pixels, '@media/resolution' queries the density in the vertical dimension. For printers, this corresponds to the screening resolution (the resolution for printing dots of arbitrary color). @@ -1479,7 +1483,7 @@ Display Resolution: the 'resolution' feature

-Display Type: the 'scan' feature

+Display Type: the '@media/scan' feature
 	Name: scan
@@ -1488,7 +1492,7 @@ Display Type: the 'scan' feature
 	Type: discrete
 	
- The 'scan' media feature describes the scanning process of some output devices. + The '@media/scan' media feature describes the scanning process of some output devices.
interlace @@ -1558,7 +1562,7 @@ Detecting Console Displays: the '@media/grid' feature Note: At the time of writing, all known implementations match grid: 0 rather than grid: 1.

-Display Update Frequency: the 'update' feature

+Display Update Frequency: the '@media/update' feature
 	Name: update
@@ -1567,7 +1571,7 @@ Display Update Frequency: the 'update' feature
 	Type: discrete
 	
- The 'update' media feature is used to query the ability of the output device + The '@media/update' media feature is used to query the ability of the output device to modify the appearance of content once it has been rendered. It accepts the following values: @@ -1606,56 +1610,56 @@ Display Update Frequency: the 'update' feature

-Detecting the display technology: the 'environment-blending' feature

+Detecting the display technology: the '@media/environment-blending' feature -
-    Name: environment-blending
-    Value: opaque | additive | subtractive
-    For: @media
-    Type: discrete
-    
+
+	Name: environment-blending
+	Value: opaque | additive | subtractive
+	For: @media
+	Type: discrete
+	
- The 'environment-blending' media feature is used to query the characteristics of the user's display - so the author can adjust the style of the document. - An author might choose to adjust the visuals and/or layout of the page depending on the display - technology to increase the appeal or improve legibility. + The '@media/environment-blending' media feature is used to query the characteristics of the user's display + so the author can adjust the style of the document. + An author might choose to adjust the visuals and/or layout of the page depending on the display + technology to increase the appeal or improve legibility. - The following values are valid: + The following values are valid: -
-
opaque -
- The document is rendered on an opaque medium, such as a traditional monitor or paper. - Black is dark and white is 100% light. +
+
opaque +
+ The document is rendered on an opaque medium, such as a traditional monitor or paper. + Black is dark and white is 100% light. -
additive -
- The display blends the colors of the canvas with the real world using additive mixing. - Black is fully transparent and white is 100% light. +
additive +
+ The display blends the colors of the canvas with the real world using additive mixing. + Black is fully transparent and white is 100% light. - For example: a head-up display in a car. + For example: a head-up display in a car. -
subtractive -
- The display blends the colors of the canvas with the real world using subtractive mixing. - White is fully transparent and dark colors have the most contrast. +
subtractive +
+ The display blends the colors of the canvas with the real world using subtractive mixing. + White is fully transparent and dark colors have the most contrast. - For example: an LCD display embedded in a bathroom mirror. -
+ For example: an LCD display embedded in a bathroom mirror. +
- Issue: Is there a need for the ''subtractive'' value? + Issue: Is there a need for the ''subtractive'' value? -
-
-        body { background-color: white; }
-        p { color: black; }
+	
+
+		body { background-color: white; }
+		p { color: black; }
 
-        @media(environment-blending: additive) {
-            body { background-color: black; }
-            p { color: white; font-size: 16px; font-weight: 1000; }
-        }
-        
-
+ @media(environment-blending: additive) { + body { background-color: black; } + p { color: white; font-size: 16px; font-weight: 1000; } + } +
+

User Preference Media Features

-Detecting the desire for less motion on the page: the 'prefers-reduced-motion' feature

+Detecting the desire for less motion on the page: the '@media/prefers-reduced-motion' feature
 	Name: prefers-reduced-motion
@@ -2764,7 +2768,7 @@ Detecting the desire for less motion on the page: the 'prefers-reduced-motion' f
 	Type: discrete
 	
- The 'prefers-reduced-motion' media feature is used to detect if the user + The '@media/prefers-reduced-motion' media feature is used to detect if the user has requested the system minimize the amount of non-essential motion it uses. @@ -2785,7 +2789,7 @@ Detecting the desire for less motion on the page: the 'prefers-reduced-motion' f

-Detecting the desire for reduced transparency on the page: the 'prefers-reduced-transparency' feature

+Detecting the desire for reduced transparency on the page: the '@media/prefers-reduced-transparency' feature
 	Name: prefers-reduced-transparency
@@ -2794,7 +2798,7 @@ Detecting the desire for reduced transparency on the page: the 'prefers-reduced-
 	Type: discrete
 	
- The 'prefers-reduced-transparency' media feature is used to detect if the user + The '@media/prefers-reduced-transparency' media feature is used to detect if the user has requested the system minimize the amount of transparent or translucent layer effects it uses. @@ -2816,7 +2820,7 @@ Detecting the desire for reduced transparency on the page: the 'prefers-reduced- They're not about transparency, but they also interfere with shape recognition.

-Detecting the desire for increased or decreased color contrast from elements on the page: the 'prefers-contrast' feature

+Detecting the desire for increased or decreased color contrast from elements on the page: the '@media/prefers-contrast' feature
 	Name: prefers-contrast
@@ -2825,7 +2829,7 @@ Detecting the desire for increased or decreased color contrast from elements on
 	Type: discrete
 	
- The 'prefers-contrast' media feature is used to detect + The '@media/prefers-contrast' media feature is used to detect if the user has requested more or less contrast in the page. This could be responded to, for example, by adjusting the contrast ratio between adjacent colors, @@ -2930,7 +2934,7 @@ Detecting the desire for increased or decreased color contrast from elements on

-Detecting Forced Colors Mode: the 'forced-colors' feature

+Detecting Forced Colors Mode: the '@media/forced-colors' feature
 	Name: forced-colors
@@ -2968,7 +2972,7 @@ Detecting Forced Colors Mode: the 'forced-colors' feature
 
 			Similarly,
 			if the forced color palette chosen by the user
-			fits within one of the color schemes described by 'prefers-color-scheme',
+			fits within one of the color schemes described by '@media/prefers-color-scheme',
 			the corresponding value must also match.
 
 		
none @@ -2985,7 +2989,7 @@ Detecting Forced Colors Mode: the 'forced-colors' feature

-Detecting the desire for light or dark color schemes: the 'prefers-color-scheme' feature

+Detecting the desire for light or dark color schemes: the '@media/prefers-color-scheme' feature
 	Name: prefers-color-scheme
@@ -2994,7 +2998,7 @@ Detecting the desire for light or dark color schemes: the 'prefers-color-scheme'
 	Type: discrete
 	
- The 'prefers-color-scheme' media feature reflects the user's + The '@media/prefers-color-scheme' media feature reflects the user's desire that the page use a light or dark color theme.
@@ -3029,7 +3033,7 @@ Detecting the desire for light or dark color schemes: the 'prefers-color-scheme' and/or because inked text on blank paper prints better than blank letterforms knocked out of an inked background). UAs are expected to take such variances into consideration - so that 'prefers-color-scheme' reflects preferences appropriate to the medium + so that '@media/prefers-color-scheme' reflects preferences appropriate to the medium rather than preferences taken out of context. If evaluated in an embedded SVG document @@ -3074,7 +3078,7 @@ Detecting the desire for light or dark color schemes: the 'prefers-color-scheme'

-Detecting the desire for reduced data usage when loading a page: the 'prefers-reduced-data' feature

+Detecting the desire for reduced data usage when loading a page: the '@media/prefers-reduced-data' feature Issue(10076): This feature may be an undesired source of fingerprinting, with a bias towards low income with limited data. @@ -3086,7 +3090,7 @@ Detecting the desire for reduced data usage when loading a page: the 'prefers-re Type: discrete
- The 'prefers-reduced-data' media feature is used to detect if the user + The '@media/prefers-reduced-data' media feature is used to detect if the user has a preference for being served alternate content that uses less data for the page to be rendered. @@ -3105,9 +3109,9 @@ Detecting the desire for reduced data usage when loading a page: the 'prefers-re The method by which the user expresses their preference can vary. It might be a system-wide setting exposed by the Operating System, - or a setting controlled by the user agent. User agents may consider - setting this based on the same user or system preference as they use to - set the Save-Data + or a setting controlled by the user agent. User agents may consider + setting this based on the same user or system preference as they use to + set the Save-Data HTTP request header. Note: User agents are encouraged to use their own user centered discretion @@ -3168,7 +3172,7 @@ Automatic handling of User Preferences For instance, liquid crystal displays can be washed out and very hard to read in brightly lit environments. A device with such a screen and with an ambient light sensor - could automatically switch 'prefers-contrast' to ''prefers-contrast/more'' + could automatically switch '@media/prefers-contrast' to ''prefers-contrast/more'' when it detects conditions that would make the screen difficult to read. A user agent on a device with an e-ink display would not make the same adjustment, @@ -3177,8 +3181,8 @@ Automatic handling of User Preferences In the opposite situation, user agents running of device with a light-emitting screen (LCD, OLED, etc.) and an ambient light sensor - could automatically switch 'prefers-contrast' to ''prefers-contrast/less'' - and 'prefers-color-scheme' to ''prefers-color-scheme/dark'' + could automatically switch '@media/prefers-contrast' to ''prefers-contrast/less'' + and '@media/prefers-color-scheme' to ''prefers-color-scheme/dark'' when used in a dim environment where excessive contrast and brightness would be distracting or uncomfortable to the reader. @@ -3189,8 +3193,8 @@ Automatic handling of User Preferences allows for unlimited data or is on a metered plan. -

-Script Control of User Preferences

+

+Script Control of User Preferences

It is common for website authors to want to respect the user's system preferences while also allowing those preferences to be overridden. To help with this, this specification defines a way for authors to @@ -3198,17 +3202,17 @@ override the [[#mf-user-preferences]] using the {{PreferenceManager}} interface. This override allows the preference to integrate with various platform features that are affected by these preferences. -

+

-

+

{{preferences}} attribute

When getting the {{preferences}} attribute always return the same instance of the {{PreferenceManager}} object. @@ -3218,15 +3222,15 @@ When getting the {{preferences}} attribute always return the same instance of th -

+

{{colorScheme}} attribute

The {{colorScheme}} attribute is a {{PreferenceObject}} used to override the user's preference for the color scheme of the site. @@ -3248,7 +3252,7 @@ If an override is set for this preference: - The user agent MUST also use this override when sending [[USER-PREFERENCE-MEDIA-FEATURES-HEADERS#sec-ch-prefers-color-scheme]]. - The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-color-scheme]]. -

+

{{contrast}} attribute

The {{contrast}} attribute is a {{PreferenceObject}} used to override the user's preference for the contrast of the site. @@ -3272,7 +3276,7 @@ If an override is set for this preference: Note: Unlike the media feature this preference is NOT able to be set to ''@media/prefers-contrast/custom'' as this is tightly coupled to the [[#forced-colors]]. -

+

{{reducedMotion}} attribute

The {{reducedMotion}} attribute is a {{PreferenceObject}} used to override the user's preference for reduced motion on the site. @@ -3295,7 +3299,7 @@ If an override is set for this preference: Note: An example of a UA feature that is affected by this preference could be disabling smooth scrolling, or pausing marquee elements. -

+

{{reducedTransparency}} attribute

The {{reducedTransparency}} attribute is a {{PreferenceObject}} used to override the user's preference for reduced transparency on the site. @@ -3316,7 +3320,7 @@ If an override is set for this preference: - The user agent MUST also use this override when sending [[USER-PREFERENCE-MEDIA-FEATURES-HEADERS#sec-ch-prefers-reduced-transparency]]. - The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-reduced-transparency]]. -

+

{{reducedData}} attribute

The {{reducedData}} attribute is a {{PreferenceObject}} used to override the user's preference for reduced data usage on the site. @@ -3338,24 +3342,24 @@ If an override is set for this preference: - The user agent MUST also use this override when calculating the [[SAVEDATA#savedata-attribute]]. - The user agent MUST also use this override for any UA features that are normally affected by [[#prefers-reduced-data]]. -

+

{{PreferenceObject}} interface

-
+
{{override}} attribute
@@ -3367,7 +3371,7 @@ interface PreferenceObject : EventTarget { 1. Return |override|.
-
+
{{PreferenceObject/value}} attribute
@@ -3380,7 +3384,7 @@ interface PreferenceObject : EventTarget { 1. Return |value|.
-
+
{{validValues}} attribute
@@ -3402,9 +3406,10 @@ interface PreferenceObject : EventTarget {
"{{reducedData}}"
Return the result of [=get valid values for reducedData=].
+
-
+
{{onchange}} event handler attribute
The onchange attribute is an [=event handler IDL attribute=] for @@ -3422,7 +3427,7 @@ update steps: 1. If |document| is null or |document| is not [=Document/fully active=], terminate this algorithm. 1. Fire an event named change at |preference|. -
+
{{requestOverride()}} method
@@ -3471,7 +3476,7 @@ Issue: Is TypeError correct here? Note: The `change` event is fired when the computed value changes, but when a new override is set it is also fired if the value hasn't changed. -
+
{{clearOverride()}} method
@@ -3482,7 +3487,7 @@ Note: The `change` event is fired when the computed value changes, but when a ne 1. If an override for |preference| exists, set |override| to the value of that override. 1. If |override| is null, then return. 1. Clear the override for |preference|. - 1. Let |newValue| be the preference object's |value|. + 1. Let |newValue| be the preference object's value. 1. If |newValue| is equal to |override|, then: 1. Fire an event named change at [=this=].
@@ -3565,8 +3570,8 @@ Appendix A: Deprecated Media Features

To query for the size of the viewport (or the page box on page media), the '@media/width', '@media/height' and aspect-ratio media features - should be used, rather than 'device-width', 'device-height' and - 'device-aspect-ratio', which refer to the physical size of the device + should be used, rather than '@media/device-width', '@media/device-height' and + '@media/device-aspect-ratio', which refer to the physical size of the device regardless of how much space is available for the document being laid out. The device-* media features are also sometimes used as a proxy to detect mobile devices. Instead, authors should use media features that better @@ -3582,7 +3587,7 @@ device-width Type: range

- The 'device-width' media feature describes the width of the rendering surface of the output device. + The '@media/device-width' media feature describes the width of the rendering surface of the output device. For [=continuous media=], this is the width of the Web-exposed screen area. For [=paged media=], this is the width of the page sheet size. @@ -3611,7 +3616,7 @@ device-height Type: range - The 'device-height' media feature describes the height of the rendering surface of the output device. + The '@media/device-height' media feature describes the height of the rendering surface of the output device. For [=continuous media=], this is the height of the Web-exposed screen area. For [=paged media=], this is the height of the page sheet size. @@ -3636,9 +3641,9 @@ device-aspect-ratio Type: range - The 'device-aspect-ratio media feature is defined as the ratio of - the value of the 'device-width' media feature to - the value of the 'device-height media feature. + The '@media/device-aspect-ratio' media feature is defined as the ratio of + the value of the '@media/device-width' media feature to + the value of the '@media/device-height' media feature.
For example, if a screen device with square pixels @@ -3654,79 +3659,6 @@ device-aspect-ratio
-

-Appendix B: Privacy Considerations

- - This section is not normative. - -
- - Issue: this section is incomplete - - Many media features enable fingerprinting of users - based on the display and interaction characteristics of their device: - - * Colors: {{color}}, {{color-index}}, {{monochrome}}, {{color-gamut}} and {{dynamic-range}} - * Display quality: {{resolution}}, {{scan}}, {{grid}}, {{update}} and {{environment-blending}} - * Interaction devices: {{pointer}}, {{hover}}, {{any-pointer}} and {{any-hover}}. - - The {{environment-blending}} feature is of particular concern - because it suggests where a user may be located, - and is likely present in a small set of devices. - Uncommon device properties are stronger fingerprinting features - because they help segment devices into smaller sets. - - Media features that reflect operating system preferences are a fingerprinting risk - because such preferences are correlated with characteristics of the user themselves: - - * The {{prefers-reduced-data}} media feature may be correlated with low income and limited data. - * The {{prefers-reduced-motion}}, {{prefers-color-scheme}}, {{prefers-reduced-transparency}}, - {{forced-colors}} and {{inverted-colors}} queries reflect affordances for a range of special needs. - - Properties dependent on one of the above media queries may be accessed by script: - - * Colors and other property values may be directly accessed through computed style, - though user agents may elect to return constants for some colors - (see, for example, CSS Color 4). - * Layout affecting properties (such as font size) influence lengths, positions and sizes available to script. - - User agents may disable these media features when users have expressed sensitivity to tracking. - Alternatively, user agents may limit the combination of features within a single page - to reduce the fingerprinting power of the page. - - The {{PreferenceManager}} object allows querying some user-preference [=media features=]. This - is not a privacy leak, as that information is already trivially - available by using [=media features=] themselves. - - The {{PreferenceManager}} object also allows overriding these user-preference [=media features=]; this - is also neither a privacy nor accessibility regression, as the [=media features=] were already ignorable by simply - not querying them. - -
- -

- Appendix C: Security Considerations

- - This section is not normative. - -
- - Issue: this section is incomplete - - The {{display-mode}} media feature allows an origin - access to aspects of a user’s local computing environment and, - particularly when used together with an [=application manifest=] [=manifest/display=] member [[APPMANIFEST]], - allows an origin some measure of control over a user agent’s native UI. - Through a CSS media query, a script can know the display mode of a web application. - An attacker could, in such a case, - exploit the fact that an application is being displayed in fullscreen - to mimic the user interface of another application. - -
-

Changes

@@ -3741,11 +3673,11 @@ In addition to editorial changes and minor clarifications, the following changes and additions were made to this module since the 2021-12-18 Working Draft: -* Moved 'display mode' definition back to [[APPMANIFEST]] ('display-mode' media feature remains +* Moved 'display mode' definition back to [[APPMANIFEST]] ('@media/display-mode' media feature remains here). (See Issue 7306) * Establish a normative reference for [[Display-P3]] * Disallow use of ''layer'' as a media type, rather than merely treat it as an unknown one, for compatibility with [=cascade layers=]. -* Clarify intent of 'prefers-reduced-motion' +* Clarify intent of '@media/prefers-reduced-motion' * Added further discussion of fingerprinting vectors

video-height, and video-resolution. (See Issue 5044) - * Renamed 'prefers-contrast' values high and low + * Renamed '@media/prefers-contrast' values high and low to ''prefers-contrast/more'' and ''prefers-contrast'' less. (See Issue 2943) - * Rework the interaction between 'prefers-contrast' and 'forced-colors', + * Rework the interaction between '@media/prefers-contrast' and '@media/forced-colors', retiring prefers-contrast: forced and introducing ''prefers-contrast/custom''. (See Issue 5433) and Issue 6036) - * Added the 'horizontal-viewport-segments' and 'vertical-viewport-segments' media feature. + * Added the '@media/horizontal-viewport-segments' and '@media/vertical-viewport-segments' media feature. (See Issue 6234) - * Added the 'nav-controls' media feature. + * Added the '@media/nav-controls' media feature. (See Issue 6234) - * Make it possible for multiple values of 'dynamic-range' to match at the same time. + * Make it possible for multiple values of '@media/dynamic-range' to match at the same time. (See Issue 6793) @@ -3787,7 +3719,7 @@ The following additions were made to this module since the
  • - Added a UA style sheet rule for 'inverted-colors'. + Added a UA style sheet rule for '@media/inverted-colors'.
  • Added the ''prefers-contrast: forced'' value. @@ -3824,7 +3756,7 @@ The following additions were made to this module since the
    • - Added 'video-*' and 'dynamic-range' media features + Added 'video-*' and '@media/dynamic-range' media features
    • Removed 'prefers-color-scheme: no-preference' @@ -3849,19 +3781,17 @@ The following additions were made to create the First Public Working Draft of th
      • - Reinstate the light-level, 'inverted-colors', and Custom Media Queries sections + Reinstate the light-level, '@media/inverted-colors', and Custom Media Queries sections from earlier Media Queries Level 4 drafts.
      • - Added 'prefers-reduced-motion', - 'prefers-reduced-transparency', - 'prefers-contrast', - 'prefers-color-scheme', - and 'forced-colors' media features. + Added '@media/prefers-reduced-motion', + '@media/prefers-reduced-transparency', + '@media/prefers-contrast', + '@media/prefers-color-scheme', + and '@media/forced-colors' media features.
      - -

      Acknowledgments

      @@ -3871,61 +3801,124 @@ This specification is the product of the W3C Working Group on Cascading Style Sheets. Comments from - Adam Argyle, - Amelia Bellamy-Royds, - Andreas Lind, - Andres Galante, - Arve Bersvendsen, - Björn Höhrmann, - Chen Hui Jing, - Chris Lilley, - Chris Rebert, - Christian Biesinger, - Christoph Päper, - Elika J. Etemad (fantasai), - Emilio Cobos Álvarez, - François Remy, - Frédéric Wang, - Fuqiao Xue, - Greg Whitworth, - Ian Pouncey, - James Craig, - Jay Harris, - Jinfeng Ma, - Kivi Shapiro, - L. David Baron, - Masataka Yakura, - Matt Giuca, - Melinda Grant, - Michael Smith, - Nicholas C. Zakas - Patrick H. Lauke, - Philipp Hoschka, - Rick Byers, - Rijk van Geijtenbeek, - Rik Cabanier, - Roger Gimson, - Rossen Atanassov, - Sam Sneddon, - Sigurd Lerstad, - Simon Kissane, - Simon Pieters, - Stephen Chenney, - Steven Pemberton, - Susan Lesch, - Tantek Çelik, - Thomas Wisniewski, - Vi Nguyen, - Xidorn Quan, - Yves Lafon, - akklesed, - and 張俊芝 +Adam Argyle, +Amelia Bellamy-Royds, +Andreas Lind, +Andres Galante, +Arve Bersvendsen, +Björn Höhrmann, +Chen Hui Jing, +Chris Lilley, +Chris Rebert, +Christian Biesinger, +Christoph Päper, +Elika J. Etemad (fantasai), +Emilio Cobos Álvarez, +François Remy, +Frédéric Wang, +Fuqiao Xue, +Greg Whitworth, +Ian Pouncey, +James Craig, +Jay Harris, +Jinfeng Ma, +Kivi Shapiro, +L. David Baron, +Masataka Yakura, +Matt Giuca, +Melinda Grant, +Michael Smith, +Nicholas C. Zakas +Patrick H. Lauke, +Philipp Hoschka, +Rick Byers, +Rijk van Geijtenbeek, +Rik Cabanier, +Roger Gimson, +Rossen Atanassov, +Sam Sneddon, +Sigurd Lerstad, +Simon Kissane, +Simon Pieters, +Stephen Chenney, +Steven Pemberton, +Susan Lesch, +Tantek Çelik, +Thomas Wisniewski, +Vi Nguyen, +Xidorn Quan, +Yves Lafon, +akklesed, +and 張俊芝 improved this specification.

      Privacy Considerations

      -No new privacy considerations have been reported on this specification. + This section is not normative. + +
      + + Issue: this section is incomplete + + Many media features enable fingerprinting of users + based on the display and interaction characteristics of their device: + + * Colors: '@media/color', '@media/color-index', '@media/monochrome', '@media/color-gamut' and '@media/dynamic-range' + * Viewport characteristics: '@media/aspect-ratio', '@media/orientation', + '@media/horizontal-viewport-segments' and + '@media/vertical-viewport-segments' + * Display quality: '@media/resolution', '@media/scan', '@media/grid', '@media/update' and '@media/environment-blending' + * Interaction devices: '@media/pointer', '@media/hover', '@media/any-pointer' and '@media/any-hover'. + + The '@media/environment-blending' feature is of particular concern + because it suggests where a user may be located, + and is likely present in a small set of devices. + Uncommon device properties are stronger fingerprinting features + because they help segment devices into smaller sets. + + Media features that reflect operating system preferences are a fingerprinting risk + because such preferences are correlated with characteristics of the user themselves: + + * The '@media/prefers-reduced-data' media feature may be correlated with low income and limited data. + * The '@media/prefers-reduced-motion', '@media/prefers-color-scheme', '@media/prefers-reduced-transparency', + '@media/forced-colors' and '@media/inverted-colors' queries reflect affordances for a range of special needs. + + Properties dependent on one of the above media queries may be accessed by script: + + * Colors and other property values may be directly accessed through computed style, + though user agents may elect to return constants for some colors + (see, for example, CSS Color 4). + * Layout affecting properties (such as font size) influence lengths, positions and sizes available to script. + + User agents may disable these media features when users have expressed sensitivity to tracking. + Alternatively, user agents may limit the combination of features within a single page + to reduce the fingerprinting power of the page. + + The {{PreferenceManager}} object allows querying some user-preference [=media features=]. This + is not a privacy leak, as that information is already trivially + available by using [=media features=] themselves. + + The {{PreferenceManager}} object also allows overriding these user-preference [=media features=]; this + is also neither a privacy nor accessibility regression, as the [=media features=] were already ignorable by simply + not querying them. + +

      Security Considerations

      -No new security considerations have been reported on this specification. + This section is not normative. + +
      + + Issue: this section is incomplete + + The '@media/display-mode' media feature allows an origin + access to aspects of a user’s local computing environment and, + particularly when used together with an [=application manifest=] [=manifest/display=] member [[APPMANIFEST]], + allows an origin some measure of control over a user agent’s native UI. + Through a CSS media query, a script can know the display mode of a web application. + An attacker could, in such a case, + exploit the fact that an application is being displayed in fullscreen + to mimic the user interface of another application. + +