Skip to content

Commit 98f4946

Browse files
patrickhlauketabatkins
authored andcommitted
[mediaqueries-4] More explicit clarification for any-* 'none' (w3c#842)
Adds more explicit clarification about the possibly non-intuitive way in which `any-pointer:none`/`any-hover:none` work. Splits out the initial mention (that "ALL pointing devices need to match") into its own line, and provides two sets of notes/examples that clarify scenarios where this may not be completely obvious. Additionally, this explicitly highlights the situation that currently cannot be detected: having more than one pointing device where at least one is non-hover-capable (as touched on in w3c#737 (comment) )
1 parent fd4fbf7 commit 98f4946

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

mediaqueries/Overview.bs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,11 +1759,42 @@ All Available Interaction Capabilities: the 'any-pointer' and 'any-hover' featur
17591759

17601760
The 'any-pointer' and 'any-hover' media features are identical to the 'pointer' and 'hover' media features,
17611761
but they correspond to the union of capabilities of all the pointing devices available to the user.
1762-
More than one of their values can match,
1762+
In the case of 'any-pointer', more than one of the values can match,
17631763
if different pointing devices have different characteristics.
1764-
They must only match ''none'' if <em>all</em> of the pointing devices would match ''none'' for the corresponding query,
1764+
1765+
'any-pointer' and 'any-hover' must only match ''none'' if <em>all</em> of the pointing devices would match ''none'' for the corresponding query,
17651766
or there are no pointing devices at all.
17661767

1768+
<div class="note">
1769+
'any-pointer' is used to query the presence and accuracy of pointing devices.
1770+
It does not take into account any additional non-pointing device inputs,
1771+
and can not be used to test for the presence of other input mechanisms,
1772+
such as d-pads or keyboard-only controls,
1773+
that don't move an on-screen pointer.
1774+
'any-pointer:none' will only evaluate to true if there are no pointing devices at all present.
1775+
</div>
1776+
1777+
<div class="example">
1778+
On a traditional desktop environment with a mouse and keyboard,
1779+
'any-pointer:none' will be false (due to the presence of the mouse),
1780+
even though a non-pointer input (the keyboard) is also present.
1781+
</div>
1782+
1783+
<div class="note">
1784+
'any-hover:none' will only evaluate to true if there are no pointing devices,
1785+
or if all the pointing devices present lack hover capabilities.
1786+
As such, it should not be understood as a query to test if any hover-capable pointing devices are present,
1787+
rather than whether or not any of the pointing devices is not hover-capable.
1788+
The latter scenario can currently not be determined using 'any-hover' or any other interaction media feature.
1789+
</div>
1790+
1791+
<div class="example">
1792+
On a touch-enabled laptop with a mouse and a touchscreen,
1793+
'any-hover:none' will evaluate to false (due to the presence of the hover-capable mouse),
1794+
even though a non-hover-capable pointing device (the touchscreen) is also present.
1795+
It is currently not possible to provide different styles for cases where different pointing devices have different hover capabilities.
1796+
</div>
1797+
17671798
<div class="note">
17681799
While 'pointer' and 'hover' can be used to design the main style and interaction
17691800
mode of the page to suit the primary input mechanism, 'any-pointer' and 'any-hover'

0 commit comments

Comments
 (0)