|
54 | 54 | </p> |
55 | 55 | <h1 class="p-name no-ref" id=title>Media Queries Level 4</h1> |
56 | 56 | <h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft, |
57 | | - <span class=dt-updated><span class=value-title title=20131110>10 November 2013</span></span></span></h2> |
| 57 | + <span class=dt-updated><span class=value-title title=20131112>12 November 2013</span></span></span></h2> |
58 | 58 | <div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/mediaqueries4/>http://dev.w3.org/csswg/mediaqueries4/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/mediaqueries4/>http://dev.w3.org/csswg/mediaqueries4/</a> |
59 | 59 | <dt>Feedback:</dt> |
60 | 60 | <dd><a href="mailto:www-style@w3.org?subject=%5Bmediaqueries%5D%20feedback">www-style@w3.org</a> |
@@ -117,7 +117,8 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class |
117 | 117 | Negating a Media Query: the <span class=css data-link-type=maybe title=not>not</span> keyword</a><li><a href=#mq-only><span class=secno>2.2.2</span> |
118 | 118 | Hiding a Media Query From Legacy User Agents: the <span class=css data-link-type=maybe title=only>only</span> keyword</a></ul><li><a href=#media-types><span class=secno>2.3</span> |
119 | 119 | Media Types</a><li><a href=#mq-features><span class=secno>2.4</span> |
120 | | -Media Features</a><ul class=toc><li><a href=#mq-boolean-context><span class=secno>2.4.1</span> |
| 120 | +Media Features</a><ul class=toc><li><a href=#mq-ranges><span class=secno>2.4.1</span> |
| 121 | +Media Feature Types: “range” and “discrete”</a><li><a href=#mq-boolean-context><span class=secno>2.4.2</span> |
121 | 122 | Evaluating A Media Feature in a Boolean Context</a></ul></ul><li><a href=#mq-syntax><span class=secno>3</span> |
122 | 123 | Syntax</a><ul class=toc><li><a href=#error-handling><span class=secno>3.1</span> |
123 | 124 | Error Handling</a></ul><li><a href=#media-features><span class=secno>4</span> |
@@ -592,7 +593,45 @@ <h3 class="heading settled heading" data-level=2.4 id=mq-features><span class=se |
592 | 593 | rel="stylesheet" href="example.css"> |
593 | 594 | </pre> </div> |
594 | 595 |
|
595 | | -<h4 class="heading settled heading" data-level=2.4.1 id=mq-boolean-context><span class=secno>2.4.1 </span><span class=content> |
| 596 | +<h4 class="heading settled heading" data-level=2.4.1 id=mq-ranges><span class=secno>2.4.1 </span><span class=content> |
| 597 | +Media Feature Types: “range” and “discrete”</span><a class=self-link href=#mq-ranges></a></h4> |
| 598 | + |
| 599 | +<p> Every media feature defines its “type” as either “range” or “discrete” in its definition table. |
| 600 | + |
| 601 | +<p> “Discrete” media features, |
| 602 | + like <a class=property data-link-type=propdesc href=#descdef-luminosity title=luminosity>luminosity</a> or <a class=property data-link-type=propdesc href=#descdef-script title=script>script</a>, |
| 603 | + take their values from a set. |
| 604 | + The values may be keywords |
| 605 | + or boolean numbers (0 and 1), |
| 606 | + but the common factor is that there’s no intrinsic “order” to them—<wbr></wbr>none of the values are “less than” or “greater than” each other. |
| 607 | + |
| 608 | +<p> “Range” media features like <a class=property data-link-type=propdesc href=#descdef-width title=width>width</a>, on the other hand, |
| 609 | + take their values from a range. |
| 610 | + Any two values can be compared to see which is lesser and which is greater. |
| 611 | + |
| 612 | +<p> The only significant difference between the two types is that “range” <a data-link-type=dfn href=#media-feature title="media features">media features</a> |
| 613 | + accept “min-” and “max-” prefixes on their name. |
| 614 | + Adding one of these prefixes changes the meaning—<wbr></wbr>rather than the <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> being true when the feature exactly matches the given value, |
| 615 | + it matches when the feature is greater/less than or equal to the given value. |
| 616 | + |
| 617 | + <div class=example> |
| 618 | + A <span class=css data-link-type=maybe title="(min-width: 600px)">(min-width: 600px)</span> <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> is true |
| 619 | + when the viewport’s width is <span class=css data-link-type=maybe title=600px>600px</span> <em>or more</em>. |
| 620 | + |
| 621 | +<p> On the other hand, <span class=css data-link-type=maybe title="(width: 600px)">(width: 600px)</span> by itself is only true |
| 622 | + when the viewport’s width is <em>exactly</em> <span class=css data-link-type=maybe title=600px>600px</span>. |
| 623 | + If it’s less or greater than <span class=css data-link-type=maybe title=600px>600px</span>, it’ll be false. |
| 624 | + </div> |
| 625 | + |
| 626 | + <div class=example> |
| 627 | + On the other hand, |
| 628 | + <span class=css data-link-type=maybe title="(min-script: 1)">(min-script: 1)</span> is invalid, |
| 629 | + because <a class=property data-link-type=propdesc href=#descdef-script title=script>script</a> is a “discrete” <a data-link-type=dfn href=#media-feature title="media feature">media feature</a>, |
| 630 | + and so doesn’t accept the prefixes. |
| 631 | + (Even though the <a class=property data-link-type=propdesc href=#descdef-script title=script>script</a> <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> appears to be numeric.) |
| 632 | + </div> |
| 633 | + |
| 634 | +<h4 class="heading settled heading" data-level=2.4.2 id=mq-boolean-context><span class=secno>2.4.2 </span><span class=content> |
596 | 635 | Evaluating A Media Feature in a Boolean Context</span><a class=self-link href=#mq-boolean-context></a></h4> |
597 | 636 |
|
598 | 637 | <p> While <a data-link-type=dfn href=#media-feature title="media features">media features</a> normally have a syntax similar to CSS properties, |
@@ -1460,7 +1499,7 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content> |
1460 | 1499 | <li>all, <a href=#valuedef-all title="section 2.3">2.3</a> |
1461 | 1500 | <li>aspect-ratio, <a href=#descdef-aspect-ratio title="section 4.6">4.6</a> |
1462 | 1501 | <li>aural, <a href=#valuedef-aural title="section 2.3">2.3</a> |
1463 | | -<li>boolean context, <a href=#boolean-context title="section 2.4.1">2.4.1</a> |
| 1502 | +<li>boolean context, <a href=#boolean-context title="section 2.4.2">2.4.2</a> |
1464 | 1503 | <li>braille, <a href=#valuedef-braille title="section 2.3">2.3</a> |
1465 | 1504 | <li>coarse, <a href=#valuedef-coarse title="section 4.15">4.15</a> |
1466 | 1505 | <li>color, <a href=#descdef-color title="section 4.8">4.8</a> |
|
0 commit comments