Skip to content

Commit a89b4af

Browse files
committed
[mediaqueries] Make boolean evaluation slightly more intuitive when a feature can match multiple values.
1 parent 5631d74 commit a89b4af

2 files changed

Lines changed: 8 additions & 16 deletions

File tree

mediaqueries/Overview.bs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,17 +513,13 @@ Evaluating Media Features in a Boolean Context</h4>
513513
like ''(color)''.
514514

515515
When written like this, the <a>media feature</a> is evaluated in a <dfn export>boolean context</dfn>.
516-
If the feature would be true for the number ''0'',
517-
a dimension with the value ''0'',
516+
If the feature would be true for any value
517+
<em>other than</em> the number ''0'',
518+
a <a spec=css-values>dimension</a> with the value ''0'',
518519
or the keyword ''none'',
519-
the <a>media feature</a> evaluates to false.
520-
If it would be true for any values <strong>other than</strong> the above,
521-
it evaluates to true.
520+
the <a>media feature</a> evaluates to true.
522521
Otherwise, it evaluates to false.
523522

524-
Note: The “trichotomy” above allows for correct handling of MQs as false when on devices where they don't apply at all,
525-
such as 'scan' on a speech device.
526-
527523
<div class='example'>
528524
Some <a>media features</a> are designed to be written like this.
529525

mediaqueries/Overview.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -803,17 +803,13 @@ <h4 class="heading settled" data-level=2.4.2 id=mq-boolean-context><span class=s
803803
like <span class=css>(color)</span>.</p>
804804

805805
<p>When written like this, the <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> is evaluated in a <dfn data-dfn-type=dfn data-export="" id=boolean-context>boolean context<a class=self-link href=#boolean-context></a></dfn>.
806-
If the feature would be true for the number <span class=css>0</span>,
807-
a dimension with the value <span class=css>0</span>,
806+
If the feature would be true for any value
807+
<em>other than</em> the number <span class=css>0</span>,
808+
a <a data-link-spec=css-values data-link-type=dfn href=http://www.w3.org/TR/css3-values/#dimension title=dimension>dimension</a> with the value <span class=css>0</span>,
808809
or the keyword <a class=css data-link-type=maybe href=#valdef-media-update-frequency-none title=none>none</a>,
809-
the <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> evaluates to false.
810-
If it would be true for any values <strong>other than</strong> the above,
811-
it evaluates to true.
810+
the <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> evaluates to true.
812811
Otherwise, it evaluates to false.</p>
813812

814-
<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,
815-
such as <a class=property data-link-type=propdesc href=#descdef-media-scan title=scan>scan</a> on a speech device.</p>
816-
817813
<div class=example>
818814
Some <a data-link-type=dfn href=#media-feature title="media features">media features</a> are designed to be written like this.
819815

0 commit comments

Comments
 (0)