Skip to content

Commit bb374c4

Browse files
committed
empty media query list per comment 7 / 20 in disposition; min-orientation example (invalid); resolution is in device pixels
1 parent 63bd852 commit bb374c4

2 files changed

Lines changed: 67 additions & 24 deletions

File tree

css3-mediaqueries/Overview.html

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ <h2 id=background><span class=secno>1. </span>Background</h2>
322322
applies to all media types.
323323

324324
<p>Media-specific style sheets are supported by several user agents. The
325-
most commonly used feature is to distinguish between "screen" and "print".
325+
most commonly used feature is to distinguish between &lsquo;<code
326+
class=css>screen</code>&rsquo; and &lsquo;<code
327+
class=css>print</code>&rsquo;.
326328

327329
<p>There have been requests for ways to describe in more detail what type
328330
of output devices a style sheet applies to. Fortunately HTML4 foresaw
@@ -410,16 +412,17 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
410412
media query is true if the media type of the media query matches the media
411413
type of the device where the user agent is running (as defined in the
412414
"Applies to" line), and all expressions in the media query are true. Also,
413-
a media query which is otherwise false becomes true if the "not" keyword
414-
is present.
415+
a media query which is otherwise false becomes true if the &lsquo;<code
416+
class=css>not</code>&rsquo; keyword is present.
415417

416418
<p>When a media query is true, the corresponding style sheet is applied as
417419
per the normal cascading rules.
418420

419421
<p>Several media queries can be combined in a comma-separated list. If one
420422
or more of the media queries in the comma-separated list is true, the
421423
associated style sheet is applied, otherwise the associated style sheet is
422-
ignored.
424+
ignored. If the comma-separated list is the emtpy list it is assumed to
425+
specify the media query &lsquo;<code class=css>all</code>&rsquo;.
423426

424427
<div class=example>
425428
<p>Here is an example of several media queries in a comma-separated list
@@ -430,6 +433,15 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
430433
</pre>
431434
</div>
432435

436+
<div class=example>
437+
<p>Here are two examples of the empty media query list in HTML:</p>
438+
439+
<pre>
440+
<span class=html-example>&lt;link rel="stylesheet" href="example.css" media=""/></span>
441+
<span class=html-example>&lt;link rel="stylesheet" href="example.css" media=" "/></span>
442+
</pre>
443+
</div>
444+
433445
<p>In the media queries syntax, the comma expresses a logical OR, while the
434446
&lsquo;<code class=css>and</code>&rsquo; keyword expresses a logical AND.
435447

@@ -549,7 +561,7 @@ <h2 id=syntax><span class=secno>3. </span>Syntax</h2>
549561
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
550562

551563
<pre>media_query_list
552-
: S* media_query [ ',' S* media_query]*
564+
: S* media_query [ ',' S* media_query]* | S*
553565
;
554566
media_query
555567
: [ONLY | NOT]? S* media_type S* [ AND S* expression ]*
@@ -635,6 +647,14 @@ <h3 id=error><span class=secno>3.1 </span>Error Handling</h3>
635647
evaluated as if the first had not been specified.</p>
636648
</div>
637649

650+
<div class=example>
651+
<pre>@media (min-orientation:portrait) { ... }</pre>
652+
653+
<p>Is dropped because the &lsquo;<code
654+
class=css>orientation</code>&rsquo; feature does not accept the
655+
&lsquo;<code class=css>min-</code>&rsquo; prefix.</p>
656+
</div>
657+
638658
<li>
639659
<p><strong>Unknown media feature values.</strong> As with unknown media
640660
features, user agents are to ignore a media query when one of the
@@ -668,8 +688,8 @@ <h3 id=error><span class=secno>3.1 </span>Error Handling</h3>
668688

669689
<div class=example>
670690
<p>The following is an malformed media query because having no space
671-
between "and" and the expression is not allowed. (That is reserved for
672-
the functional notation syntax.)</p>
691+
between &lsquo;<code class=css>and</code>&rsquo; and the expression is
692+
not allowed. (That is reserved for the functional notation syntax.)</p>
673693

674694
<pre>@media all and(color) { ... }</pre>
675695
</div>
@@ -700,11 +720,13 @@ <h2 id=media1><span class=secno>4. </span>Media features</h2>
700720
how to present a document. Media features are used in
701721
<em>expressions</em> to describe requirements of the output device.
702722

703-
<li>Most media features accept optional "min-" or "max-" prefixes to
704-
express "greater or equal to" and "smaller or equal to" constraints. This
705-
syntax is used to avoid "&lt;" and "&gt;" characters which may conflict
706-
with HTML and XML. Those media features that accept prefixes will most
707-
often be used with prefixes, but can also be used alone.
723+
<li>Most media features accept optional &lsquo;<code
724+
class=css>min-</code>&rsquo; or &lsquo;<code class=css>max-</code>&rsquo;
725+
prefixes to express "greater or equal to" and "smaller or equal to"
726+
constraints. This syntax is used to avoid "&lt;" and "&gt;" characters
727+
which may conflict with HTML and XML. Those media features that accept
728+
prefixes will most often be used with prefixes, but can also be used
729+
alone.
708730

709731
<li>Properties always require a value to form a declaration. Media
710732
features, on the other hand, can also be used without a value. For a
@@ -1174,7 +1196,8 @@ <h3 id=resolution0><span class=secno>5.1 </span>Resolution</h3>
11741196

11751197
<p>The &lsquo;<code class=css>dpi</code>&rsquo; and &lsquo;<code
11761198
class=css>dpcm</code>&rsquo; units describe the resolution of an output
1177-
device, i.e., the density of pixels. Resolution unit identifiers are:
1199+
device, i.e., the density of device pixels. Resolution unit identifiers
1200+
are:
11781201

11791202
<dl>
11801203
<dt>dpi

css3-mediaqueries/Overview.src.html

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h2>Background</h2>
189189

190190
<p>Media-specific style sheets are supported by several user
191191
agents. The most commonly used feature is to distinguish between
192-
"screen" and "print".</p>
192+
''screen'' and ''print''.</p>
193193

194194
<p>There have been requests for ways to describe in more detail
195195
what type of output devices a style sheet applies to. Fortunately
@@ -281,7 +281,7 @@ <h2 id="media0">Media Queries</h2>
281281
false. A media query is true if the media type of the media query
282282
matches the media type of the device where the user agent is running (as defined in the "Applies to" line),
283283
and all expressions in the media query are true. Also, a media query
284-
which is otherwise false becomes true if the "not" keyword is
284+
which is otherwise false becomes true if the ''not'' keyword is
285285
present.</p>
286286

287287
<p>When a media query is true, the corresponding style sheet is
@@ -290,7 +290,8 @@ <h2 id="media0">Media Queries</h2>
290290
<p>Several media queries can be combined in a comma-separated list.
291291
If one or more of the media queries in the comma-separated list is
292292
true, the associated style sheet is applied, otherwise the
293-
associated style sheet is ignored. </p>
293+
associated style sheet is ignored. If the comma-separated list is the emtpy
294+
list it is assumed to specify the media query ''all''.</p>
294295

295296
<div class="example">
296297

@@ -303,8 +304,19 @@ <h2 id="media0">Media Queries</h2>
303304

304305
</div>
305306

306-
<p>In the media queries syntax, the comma expresses a logical OR, while the ''and'' keyword
307-
expresses a logical AND.</p>
307+
<div class="example">
308+
309+
<p>Here are two examples of the empty media query list in HTML:</p>
310+
311+
<pre>
312+
<span class="html-example">&lt;link rel="stylesheet" href="example.css" media=""/></span>
313+
<span class="html-example">&lt;link rel="stylesheet" href="example.css" media=" "/></span>
314+
</pre>
315+
316+
</div>
317+
318+
<p>In the media queries syntax, the comma expresses a logical OR, while the
319+
''and'' keyword expresses a logical AND.</p>
308320

309321
<p>The logical NOT can be expressed through the ''not'' keyword. </p>
310322

@@ -412,7 +424,7 @@ <h2>Syntax</h2>
412424
<code>medium</code> production from CSS2. [[!CSS21]]</p>
413425

414426
<pre>media_query_list
415-
: S* media_query [ ',' S* media_query]*
427+
: S* media_query [ ',' S* media_query]* | S*
416428
;
417429
media_query
418430
: [ONLY | NOT]? S* media_type S* [ AND S* expression ]*
@@ -495,6 +507,13 @@ <h3>Error Handling</h3>
495507
media feature and unknown value, but the second media query is evaluated
496508
as if the first had not been specified.</p>
497509
</div>
510+
511+
<div class="example">
512+
<pre>@media (min-orientation:portrait) { ... }</pre>
513+
514+
<p>Is dropped because the ''orientation'' feature does not accept the
515+
''min-'' prefix.
516+
</div>
498517

499518
<li>
500519
<p><strong>Unknown media feature values.</strong> As with unknown media
@@ -528,7 +547,7 @@ <h3>Error Handling</h3>
528547

529548
<div class="example">
530549
<p>The following is an malformed media query because having no space
531-
between "and" and the expression is not allowed. (That is reserved for
550+
between ''and'' and the expression is not allowed. (That is reserved for
532551
the functional notation syntax.)</p>
533552
<pre>@media all and(color) { ... }</pre>
534553
</div>
@@ -560,7 +579,7 @@ <h2 id="media1">Media features</h2>
560579
used in <em>expressions</em> to describe requirements of the output
561580
device.</li>
562581

563-
<li>Most media features accept optional "min-" or "max-" prefixes
582+
<li>Most media features accept optional ''min-'' or ''max-'' prefixes
564583
to express "greater or equal to" and "smaller or equal to"
565584
constraints. This syntax is used to avoid "&lt;" and "&gt;"
566585
characters which may conflict with HTML and XML. Those media features
@@ -587,8 +606,8 @@ <h2 id="media1">Media features</h2>
587606
</ul>
588607

589608
<div class="example">
590-
<p>For example, the ''color'' media feature can form expressions without a value
591-
(''(color)''), or with a value (''(min-color: 1)'').</p>
609+
<p>For example, the ''color'' media feature can form expressions without a
610+
value (''(color)''), or with a value (''(min-color: 1)'').</p>
592611
</div>
593612

594613

@@ -1069,7 +1088,8 @@ <h2 id="units">Units</h2>
10691088
<h3>Resolution</h3>
10701089

10711090
<p>The ''dpi'' and ''dpcm'' units describe the resolution of an output
1072-
device, i.e., the density of pixels. Resolution unit identifiers are:</p>
1091+
device, i.e., the density of device pixels. Resolution unit identifiers
1092+
are:</p>
10731093

10741094
<dl>
10751095
<dt>dpi</dt>

0 commit comments

Comments
 (0)