Skip to content

Commit 08ae951

Browse files
committed
[mediaqueries] Name the hover values.
1 parent d911cc3 commit 08ae951

2 files changed

Lines changed: 86 additions & 26 deletions

File tree

mediaqueries/Overview.html

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ <h4 class="heading settled heading" data-level=2.4.2 id=mq-boolean-context><span
720720
Only some of the <a data-link-type=dfn href=#media-feature title="media features">media features</a> that accept keywords are meaningful in a <a data-link-type=dfn href=#boolean-context title="boolean context">boolean context</a>.
721721

722722
<p> For example, <span class=css data-link-type=maybe title=(pointer)>(pointer)</span> is useful,
723-
as <a class=property data-link-type=propdesc href=#descdef-pointer title=pointer>pointer</a> has a <a class=css data-link-for=pointer data-link-type=maybe href=#valuedef-none title=none>none</a> value to indicate there’s no pointing device at all on the device.
723+
as <a class=property data-link-type=propdesc href=#descdef-pointer title=pointer>pointer</a> has a <a class=css data-link-for=pointer data-link-type=maybe href=#valuedef-none1 title=none>none</a> value to indicate there’s no pointing device at all on the device.
724724
On the other hand, <span class=css data-link-type=maybe title=(scan)>(scan)</span> is just always true, as there’s no value that means “false”.
725725
</div>
726726

@@ -1222,7 +1222,7 @@ <h3 class="heading settled heading" data-level=4.15 id=pointer><span class=secno
12221222
media query takes the following values:
12231223

12241224
<dl data-dfn-for=@media/pointer data-dfn-type=value>
1225-
<dt><dfn class=css-code data-dfn-for=@media/pointer data-dfn-type=value data-export="" id=valuedef-none>none<a class=self-link href=#valuedef-none></a></dfn>
1225+
<dt><dfn class=css-code data-dfn-for=@media/pointer data-dfn-type=value data-export="" id=valuedef-none1>none<a class=self-link href=#valuedef-none1></a></dfn>
12261226
<dd>The input mechanism of the device does not include a pointing device.
12271227

12281228
<dt><dfn class=css-code data-dfn-for=@media/pointer data-dfn-type=value data-export="" id=valuedef-coarse>coarse<a class=self-link href=#valuedef-coarse></a></dfn>
@@ -1278,7 +1278,7 @@ <h3 class="heading settled heading" data-level=4.15 id=pointer><span class=secno
12781278
</div>
12791279

12801280
<p> For accessibility reasons, even on devices whose pointing device can be
1281-
described as <a class=css data-link-type=maybe href=#valuedef-fine title=fine>fine</a>, the UA may give a value of <a class=css data-link-type=maybe href=#valuedef-coarse title=coarse>coarse</a> or <a class=css data-link-for=pointer data-link-type=maybe href=#valuedef-none title=none>none</a> to
1281+
described as <a class=css data-link-type=maybe href=#valuedef-fine title=fine>fine</a>, the UA may give a value of <a class=css data-link-type=maybe href=#valuedef-coarse title=coarse>coarse</a> or <a class=css data-link-for=pointer data-link-type=maybe href=#valuedef-none1 title=none>none</a> to
12821282
this media query, to indicate that the user has difficulties
12831283
manipulating the input device accurately or at all.
12841284

@@ -1296,24 +1296,50 @@ <h3 class="heading settled heading" data-level=4.15 id=pointer><span class=secno
12961296
<h3 class="heading settled heading" data-level=4.16 id=hover><span class=secno>4.16 </span><span class=content>
12971297
hover</span><a class=self-link href=#hover></a></h3>
12981298

1299-
<table class="definition descdef mq" data-dfn-for="<a at-rule>@media</a>"><tr><th>Name:<td><dfn class=css-code data-dfn-for="<a at-rule>@media</a>" data-dfn-type=descriptor data-export="" id=descdef-hover>hover<a class=self-link href=#descdef-hover></a></dfn><tr><th>For:<td><a class=css-code data-link-type=at-rule href=http://dev.w3.org/csswg/css-conditional-3/#at-ruledef-media title=@media>@media</a><tr><th>Value:<td><a class="production css-code" data-link-type=type href=#typedef-mq-boolean title="<mq-boolean>">&lt;mq-boolean&gt;</a><tr><th>Type:<td>discrete</table>
1299+
<table class="definition descdef mq" data-dfn-for="<a at-rule>@media</a>"><tr><th>Name:<td><dfn class=css-code data-dfn-for="<a at-rule>@media</a>" data-dfn-type=descriptor data-export="" id=descdef-hover>hover<a class=self-link href=#descdef-hover></a></dfn><tr><th>For:<td><a class=css-code data-link-type=at-rule href=http://dev.w3.org/csswg/css-conditional-3/#at-ruledef-media title=@media>@media</a><tr><th>Value:<td>none | on-demand | over<tr><th>Type:<td>discrete</table>
13001300
<p> The <a class=property data-link-type=propdesc href=#descdef-hover title=hover>hover</a> media feature is used to query whether primary pointing system
1301-
used on the output device can hover or not. If it can, the value will be 1.
1302-
Otherwise, the value will be 0.
1301+
used on the output device can hover or not.
1302+
1303+
<dl data-dfn-for=@media/hover data-dfn-type=value>
1304+
<dt><dfn class=css-code data-dfn-for=@media/hover data-dfn-type=value data-export="" id=valuedef-none>none<a class=self-link href=#valuedef-none></a></dfn>
1305+
<dd>
1306+
Indicates that the primary pointing system can’t hover,
1307+
or there is no pointing system.
1308+
1309+
<dt><dfn class=css-code data-dfn-for=@media/hover data-dfn-type=value data-export="" id=valuedef-on-demand>on-demand<a class=self-link href=#valuedef-on-demand></a></dfn>
1310+
<dd>
1311+
Indicates that the primary pointing system can hover,
1312+
but it requires a significant action on the user’s part.
1313+
For example, some devices can’t normally hover,
1314+
but will activate hover on a “long press”.
1315+
1316+
<dt><dfn class=css-code data-dfn-for=@media/hover data-dfn-type=value data-export="" id=valuedef-over>over<a class=self-link href=#valuedef-over></a></dfn>
1317+
<dd>
1318+
Indicates that the primary pointing system can easily hover over parts of the page.
1319+
</dl>
13031320

13041321
<p> If a device has multiple pointing devices, some of which support hovering
13051322
and some of which not, it is recommended that the UA reports the hovering
13061323
ability of the least capable of the primary pointing devices.
13071324

1308-
<p class=note> Note: The value of the <a class=property data-link-type=propdesc href=#descdef-hover title=hover>hover</a> media feature should for example be 0 on a touch screen
1309-
device that can also be controlled via an optional mouse. Authors should
1310-
therefore be careful not to assume that the ':hover' pseudo class will never
1311-
match on device where 'hover:0' is true, but they should design layouts
1312-
that do not depend on hovering to be fully usable.
1325+
<div class=example>
1326+
For example, on a touch screen device that can also be controlled by an optional mouse,
1327+
the <a class=property data-link-type=propdesc href=#descdef-hover title=hover>hover</a> <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> should match <a class=css data-link-for=hover data-link-type=maybe href=#valuedef-none title=none>none</a>,
1328+
as the primary interaction mode (touching the screen) can’t hover.
1329+
1330+
<p> Authors should therefore be careful not to assume that the ':hover' pseudo class
1331+
will never match on device where 'hover:none' is true,
1332+
but they should design layouts that do not depend on hovering to be fully usable.
1333+
</div>
1334+
1335+
<p class=issue id=issue-d8ce9763><a class=self-link href=#issue-d8ce9763></a>
1336+
Rob Coulburn points out that Mac devices turn off scrollbars when you plug in a mouse,
1337+
which means that it *does* react to changing input devices.
1338+
But is this just because it considers a plugged-in mouse to be "primary"?
13131339

13141340
<p> For accessibility reasons, even on devices that do support hovering,
1315-
the UA may give a value of 0 to this media query, to opt into layouts that work
1316-
well without hovering.
1341+
the UA may give a value of <a class=css data-link-type=propdesc href=#descdef-hover title=hover>hover: none</a> to this media query,
1342+
to opt into layouts that work well without hovering.
13171343

13181344
<div class=example>
13191345
<pre>/* Only use a hover-activated drop down menu on devices that can hover. */
@@ -1612,11 +1638,14 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
16121638
<li>monochrome, <a href=#descdef-monochrome title="section 4.10">4.10</a>
16131639
<li>&lt;mq-boolean&gt;, <a href=#typedef-mq-boolean title="section 1.2">1.2</a>
16141640
<li>none<ul><li>value for @media/script, <a href=#valuedef-none0 title="section 4.14">4.14</a>
1615-
<li>value for @media/pointer, <a href=#valuedef-none title="section 4.15">4.15</a>
1641+
<li>value for @media/pointer, <a href=#valuedef-none1 title="section 4.15">4.15</a>
1642+
<li>value for @media/hover, <a href=#valuedef-none title="section 4.16">4.16</a>
16161643
</ul><li>normal, <a href=#valuedef-normal title="section 4.17">4.17</a>
16171644
<li>not, <a href=#valuedef-not title="section 2.2.1">2.2.1</a>
1645+
<li>on-demand, <a href=#valuedef-on-demand title="section 4.16">4.16</a>
16181646
<li>only, <a href=#valuedef-only title="section 2.2.2">2.2.2</a>
16191647
<li>orientation, <a href=#descdef-orientation title="section 4.5">4.5</a>
1648+
<li>over, <a href=#valuedef-over title="section 4.16">4.16</a>
16201649
<li>pointer, <a href=#descdef-pointer title="section 4.15">4.15</a>
16211650
<li>print, <a href=#valuedef-print title="section 2.3">2.3</a>
16221651
<li>projection, <a href=#valuedef-projection title="section 2.3">2.3</a>
@@ -1650,14 +1679,19 @@ <h2 class="no-num no-ref heading settled heading" id=property-index><span class=
16501679
<tr><th scope-row=""><a data-property="">grid</a><td>&lt;mq-boolean&gt;<td><td>discrete
16511680
<tr><th scope-row=""><a data-property="">script</a><td>none | enabled<td><td>discrete
16521681
<tr><th scope-row=""><a data-property="">pointer</a><td>none | coarse | fine<td><td>discrete
1653-
<tr><th scope-row=""><a data-property="">hover</a><td>&lt;mq-boolean&gt;<td><td>discrete
1682+
<tr><th scope-row=""><a data-property="">hover</a><td>none | on-demand | over<td><td>discrete
16541683
<tr><th scope-row=""><a data-property="">luminosity</a><td>dim | normal | washed<td><td>discrete</table></div>
16551684

16561685

16571686
<h2 class="no-num heading settled" id=issues-index><span class=content>Issues Index</span><a class=self-link href=#issues-index></a></h2><div style="counter-reset: issue"><div class=issue>
16581687
Another media feature should probably be added to deal with the type of resolution authors want to know to deal with monochrome printing.
16591688

16601689
<a href=#issue-f5f73c8d></a></div><div class=issue>
1690+
Rob Coulburn points out that Mac devices turn off scrollbars when you plug in a mouse,
1691+
which means that it *does* react to changing input devices.
1692+
But is this just because it considers a plugged-in mouse to be "primary"?
1693+
1694+
<a href=#issue-d8ce9763></a></div><div class=issue>
16611695
Using this media feature for accessibility purposes overlaps
16621696
a lot with the high-contrast media feature proposed by Microsoft:
16631697
<a href=http://msdn.microsoft.com/en-us/library/windows/apps/hh465764.aspx>http://msdn.microsoft.com/en-us/library/windows/apps/hh465764.aspx</a>.

mediaqueries/Overview.src.html

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,34 +1192,60 @@ <h3 id="hover">
11921192

11931193
<pre class='descdef mq'>
11941194
Name: hover
1195-
Value: <<mq-boolean>>
1195+
Value: none | on-demand | over
11961196
For: @media
11971197
Type: discrete
11981198
</pre>
11991199

12001200
The 'hover' media feature is used to query whether primary pointing system
1201-
used on the output device can hover or not. If it can, the value will be 1.
1202-
Otherwise, the value will be 0.
1201+
used on the output device can hover or not.
1202+
1203+
<dl dfn-type=value dfn-for="@media/hover">
1204+
<dt><dfn>none</dfn>
1205+
<dd>
1206+
Indicates that the primary pointing system can't hover,
1207+
or there is no pointing system.
1208+
1209+
<dt><dfn>on-demand</dfn>
1210+
<dd>
1211+
Indicates that the primary pointing system can hover,
1212+
but it requires a significant action on the user's part.
1213+
For example, some devices can't normally hover,
1214+
but will activate hover on a “long press”.
1215+
1216+
<dt><dfn>over</dfn>
1217+
<dd>
1218+
Indicates that the primary pointing system can easily hover over parts of the page.
1219+
</dl>
12031220

12041221
If a device has multiple pointing devices, some of which support hovering
12051222
and some of which not, it is recommended that the UA reports the hovering
12061223
ability of the least capable of the primary pointing devices.
12071224

1208-
Note: The value of the 'hover' media feature should for example be 0 on a touch screen
1209-
device that can also be controlled via an optional mouse. Authors should
1210-
therefore be careful not to assume that the ':hover' pseudo class will never
1211-
match on device where 'hover:0' is true, but they should design layouts
1212-
that do not depend on hovering to be fully usable.
1225+
<div class='example'>
1226+
For example, on a touch screen device that can also be controlled by an optional mouse,
1227+
the 'hover' <a>media feature</a> should match ''hover/none'',
1228+
as the primary interaction mode (touching the screen) can't hover.
1229+
1230+
Authors should therefore be careful not to assume that the ':hover' pseudo class
1231+
will never match on device where 'hover:none' is true,
1232+
but they should design layouts that do not depend on hovering to be fully usable.
1233+
</div>
1234+
1235+
<p class='issue'>
1236+
Rob Coulburn points out that Mac devices turn off scrollbars when you plug in a mouse,
1237+
which means that it *does* react to changing input devices.
1238+
But is this just because it considers a plugged-in mouse to be "primary"?
12131239

12141240
For accessibility reasons, even on devices that do support hovering,
1215-
the UA may give a value of 0 to this media query, to opt into layouts that work
1216-
well without hovering.
1241+
the UA may give a value of ''hover: none'' to this media query,
1242+
to opt into layouts that work well without hovering.
12171243

12181244
<div class="example">
12191245
<pre>
12201246
/* Only use a hover-activated drop down menu on devices that can hover. */
12211247
@media (hover) {
1222-
.menu &gt; li {display:inline-block;}
1248+
.menu > li {display:inline-block;}
12231249
.menu ul {display:none; position:absolute;}
12241250
.menu li:hover ul {display:block; list-style:none; padding:0;}
12251251
/* ... */

0 commit comments

Comments
 (0)