Skip to content

Commit aae9194

Browse files
committed
[mediaqueries] Clarify boolean context to make it clearer that MQs are false in non-applicable contexts.
1 parent 01a2c53 commit aae9194

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

mediaqueries/Overview.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,13 @@ <h4 class="heading settled heading" data-level=2.4.2 id=mq-boolean-context><span
774774
If the feature would be true for the number <span class=css data-link-type=maybe title=0>0</span>,
775775
a dimension with the value <span class=css data-link-type=maybe title=0>0</span>,
776776
or the keyword <a class=css data-link-type=maybe href=#valuedef-none0 title=none>none</a>,
777-
the <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> is false.
778-
Otherwise, it’s true.
777+
the <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> evaluates to false.
778+
If it would be true for any values <strong>other than</strong> the above,
779+
it evaluates to true.
780+
Otherwise, it evaluates to false.
781+
782+
<p class=note> Note: The “trichotomy” above allows for correct handling of MQs as false when on devices where they don’t apply at all,
783+
such as <a class=property data-link-type=propdesc href=#descdef-scan title=scan>scan</a> on a speech device.
779784

780785
<div class=example>
781786
Some <a data-link-type=dfn href=#media-feature title="media features">media features</a> are designed to be written like this,
@@ -803,7 +808,9 @@ <h4 class="heading settled heading" data-level=2.4.2 id=mq-boolean-context><span
803808

804809
<p> For example, <span class=css data-link-type=maybe title=(pointer)>(pointer)</span> is useful,
805810
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-none0 title=none>none</a> value to indicate there’s no pointing device at all on the device.
806-
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”.
811+
On the other hand, <span class=css data-link-type=maybe title=(scan)>(scan)</span> is just always true or always false
812+
(depending on whether it applies at all to the device),
813+
as there’s no value that means “false”.
807814
</div>
808815

809816

mediaqueries/Overview.src.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,13 @@ <h4 id='mq-boolean-context'>
471471
If the feature would be true for the number ''0'',
472472
a dimension with the value ''0'',
473473
or the keyword ''none'',
474-
the <a>media feature</a> is false.
475-
Otherwise, it's true.
474+
the <a>media feature</a> evaluates to false.
475+
If it would be true for any values <strong>other than</strong> the above,
476+
it evaluates to true.
477+
Otherwise, it evaluates to false.
478+
479+
Note: The “trichotomy” above allows for correct handling of MQs as false when on devices where they don't apply at all,
480+
such as 'scan' on a speech device.
476481

477482
<div class='example'>
478483
Some <a>media features</a> are designed to be written like this,
@@ -500,7 +505,9 @@ <h4 id='mq-boolean-context'>
500505

501506
For example, ''(pointer)'' is useful,
502507
as 'pointer' has a ''pointer/none'' value to indicate there's no pointing device at all on the device.
503-
On the other hand, ''(scan)'' is just always true, as there's no value that means “false”.
508+
On the other hand, ''(scan)'' is just always true or always false
509+
(depending on whether it applies at all to the device),
510+
as there's no value that means “false”.
504511
</div>
505512

506513

0 commit comments

Comments
 (0)