8000 make a bunch of editorial changes to the draft · w3c/csswg-drafts@1e41e32 · GitHub
Skip to content

Commit 1e41e32

Browse files
committed
make a bunch of editorial changes to the draft
1 parent fcdf56f commit 1e41e32

2 files changed

Lines changed: 128 additions & 111 deletions

File tree

css3-mediaqueries/Overview.html

Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424

2525
<h1 id=media-queries>Media Queries</h1>
2626

27-
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft 29 March 2008</h2>
27+
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft 4 April 2008</h2>
2828

2929
<dl>
3030
<dt>This version:
3131

3232
<dd><a
33-
href="http://www.w3.org/TR/2008/ED-css3-mediaqueries-20080329/">http://www.w3.org/TR/2008/ED-css3-mediaqueries-20080329/</a>
33+
href="http://www.w3.org/TR/2008/ED-css3-mediaqueries-20080404/">http://www.w3.org/TR/2008/ED-css3-mediaqueries-20080404/</a>
3434

3535
<dt>Latest version:
3636

@@ -85,17 +85,17 @@ <h2 class="no-num no-toc" id=w3c-working>Editor's Draft 29 March 2008</h2>
8585

8686
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
8787

88-
<p>HTML4 and CSS 2.1 currently support media-dependent style sheets
89-
tailored for different <em>media types</em>. For example, a document may
90-
use sans-serif fonts when displayed on a screen and serif fonts when
91-
printed. "Screen" and "print" are two media types that have been defined.
92-
<em>Media Queries</em> extend the functionality of media types by allowing
93-
more precise labeling of style sheets.
88+
<p>HTML4 and CSS2 currently support media-dependent style sheets tailored
89+
for different <em>media types</em>. For example, a document may use
90+
sans-serif fonts when displayed on a screen and serif fonts when printed.
91+
"Screen" and "print" are two media types that have been defined. <em>Media
92+
queries</em> extend the functionality of media types by allowing more
93+
precise labeling of style sheets.
9494

95-
<p>A Media Query consists of a media type and one or more expressions to
95+
<p>A media query consists of a media type and one or more expressions to
9696
limit the scope of style sheets. Among the <em>media features</em> that
9797
can be used in media queries are "width", "height", and "color". By using
98-
Media Queries, presentations can be tailored to a specific range of output
98+
media queries, presentations can be tailored to a specific range of output
9999
devices without changing the content itself.
100100

101101
<h2 class="no-num no-toc" id=status>Status of this document</h2>
@@ -237,7 +237,7 @@ <h2 id=background><span class=secno>1. </span>Background</h2>
237237
<p>(This section is not normative.)
238238

239239
<p>HTML4 <a href="#HTML401" rel=biblioentry>[HTML401]<!--{{HTML401}}--></a>
240-
and CSS 2.1 <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
240+
and CSS2 <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
241241
currently support media-dependent style sheets tailored for different
242242
media types. For example, a document may use different style sheets for
243243
screen and print. In HTML4, this can be written as:
@@ -262,11 +262,9 @@ <h2 id=background><span class=secno>1. </span>Background</h2>
262262

263263
<p>The "print" and "screen" media types are defined in HTML4. The complete
264264
list of media types in HTML4 is: "aural", "braille", "handheld", "print",
265-
"projection", "screen", "tty", "tv". CSS 2.1 defines the same list with
266-
the addition of "embossed" to differentiate between braille tactile
267-
feedback devices and braille printers. CSS 2.1 uses "speech" instead of
268-
"aural". Also, "all" is used to indicate that the style sheet applies to
269-
all media types.
265+
"projection", "screen", "tty", "tv". CSS2 defines the same list, removes
266+
"aural" and adds "embossed" and "speech". Also, "all" is used to indicate
267+
that the style sheet applies to all media types.
270268

271269
<p>Media-specific style sheets are supported by several user agents. The
272270
most commonly used feature is to distinguish between "screen" and "print".
@@ -313,17 +311,23 @@ <h2 id=background><span class=secno>1. </span>Background</h2>
313311
</ol>
314312
</blockquote>
315313

316-
<p>Media Queries, as described in this specification, build on the
317-
mechanism outlined in HTML4. The syntax of Media Queries fit into the
314+
<p>Media queries, as described in this specification, build on the
315+
mechanism outlined in HTML4. The syntax of media queries fit into the
318316
media type syntax reserved in HTML4. The <code class=html>media</code>
319317
attribute of HTML4 also exists in XHTML and generic XML. The same syntax
320318
can also be used inside in the ''@media'' and ''@import'' rules of CSS.
321319

320+
<p>However, the parsing rules for media queries are incompatible with those
321+
of HTML4 so that they are consistent with those of media queries used in
322+
CSS. It is expected that future versions of HTML refer to the media
323+
queries specification directly so that this difference is resolved.
324+
322325
<h2 id=media0><span class=secno>2. </span>Media Queries</h2>
323326

324-
<p>A Media Query consists of a media type and one or more <span class=index
327+
<p>A media query consists of a media type and one or more <span class=index
325328
id=expressions>expressions</span> involving <span class=index
326-
id=media>media features</span>.
329+
id=media>media features</span>. If the media type is omitted it is assumed
330+
to be "all".
327331

328332
<div class=example>
329333
<p>Here is a simple example written in HTML:</p>
@@ -335,6 +339,12 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
335339
<p>This example expresses that a certain style sheet
336340
(<code>example.css</code>) applies to devices of a certain media type
337341
(''screen'') with certain feature (it must be a color screen).</p>
342+
343+
<p>Here is a simple example written in HTML that applies to all devices
344+
that support colors:</p>
345+
346+
<pre><span class=html-example>&lt;link rel="stylesheet" media="(color)" href="example.css" /&gt;</span>
347+
</pre>
338348
</div>
339349

340350
<div class=example>
@@ -345,17 +355,17 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
345355
</pre>
346356
</div>
347357

348-
<p>A Media Query is a logical expression that is either true or false. A
349-
Media Query is true if the media type of the Media Query matches the media
358+
<p>A media query is a logical expression that is either true or false. A
359+
media query is true if the media type of the media query matches the media
350360
type of the device where the user agent is running, and all expressions in
351-
the Media Query are true. Also, a Media Query which is otherwise false
361+
the media query are true. Also, a media query which is otherwise false
352362
becomes true if the "not" keyword is present.
353363

354-
<p>When a Media Query is true, the corresponding style sheet is applied as
364+
<p>When a media query is true, the corresponding style sheet is applied as
355365
per the normal cascading rules.
356366

357-
<p>Several Media Queries can be combined in a comma-separated list. If one
358-
or more of the Media Queries in the comma-separated list is true, the
367+
<p>Several media queries can be combined in a comma-separated list. If one
368+
or more of the media queries in the comma-separated list is true, the
359369
associated style sheet is applied, otherwise the associated style sheet is
360370
ignored.
361371

@@ -368,7 +378,7 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
368378
</pre>
369379
</div>
370380

371-
<p>In the Media Queries syntax, the comma expresses a logical OR, while the
381+
<p>In the media queries syntax, the comma expresses a logical OR, while the
372382
''and'' keyword expresses a logical AND.
373383

374384
<p>The logical NOT can be expressed through the ''not'' keyword.
@@ -380,7 +390,7 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
380390
</div>
381391

382392
<p>The presence of the keyword ''not'' at the beginning of the query
383-
negates the result. I.e., if the Media Query had been true without the
393+
negates the result. I.e., if the media query had been true without the
384394
''not'' keyword it will become false, and vice versa. User agents that
385395
only support media types (as described in HTML4) will not recognize the
386396
''not'' keyword and the associated style sheet is therefore not applied.
@@ -395,7 +405,7 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
395405
</pre>
396406
</div>
397407

398-
<p>The Media Queries syntax can be used with HTML, XHTML, XML <a
408+
<p>The media queries syntax can be used with HTML, XHTML, XML <a
399409
href="#XMLSTYLE" rel=biblioentry>[XMLSTYLE]<!--{{XMLSTYLE}}--></a> and the
400410
@import and @media rules of CSS.
401411

@@ -481,9 +491,10 @@ <h2 id=media0><span class=secno>2. </span>Media Queries</h2>
481491
<h2 id=syntax><span class=secno>3. </span>Syntax</h2>
482492

483493
<p>The media query syntax is described in terms of the <a
484-
href="http://www.w3.org/TR/CSS21/grammar.html">CSS 2.1 grammar</a>. The
494+
href="http://www.w3.org/TR/CSS21/grammar.html">CSS2 grammar</a> and <a
495+
href="http://www.w3.org/TR/CSS21/syndata.html#syntax">CSS2 syntax</a>. The
485496
<code>media_query_list</code> production defined below replaces the
486-
<code>medium</code> production from CSS 2.1. <a href="#CSS21"
497+
<code>medium</code> production from CSS2. <a href="#CSS21"
487498
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
488499

489500
<pre>media_query_list
@@ -497,13 +508,13 @@ <h2 id=syntax><span class=secno>3. </span>Syntax</h2>
497508
: IDENT S*
498509
;
499510
expression
500-
: '(' S* media_feature [':' S* expr]? ')' S*
511+
: '(' S* media_feature [':' S* value]? ')' S*
501512
;
502513
media_feature
503514
: IDENT S*
504515
;</pre>
505516

506-
<p>the following new definitions are introduced:
517+
<p>The following new definitions are introduced:
507518

508519
<pre>
509520
L l|\\0{0,4}(4c|6c)(\r\n|[ \t\r\n\f])?|\\l
@@ -518,13 +529,14 @@ <h2 id=syntax><span class=secno>3. </span>Syntax</h2>
518529
{num}{D}{P}{I} {return RESOLUTION;}
519530
{num}{D}{P}{C}{M} {return RESOLUTION;}</pre>
520531

521-
<p><code>RESOLUTION</code> is to be added to the CSS 2.1 <code>term</code>
532+
<p><code>RESOLUTION</code> is to be added to the CSS2 <code>term</code>
522533
production equivalently to other units.
523534

524535
<p>CSS style sheets are generally case-insensitive, and this is also the
525-
case for Media Queries.
536+
case for media queries.
526537

527-
<p>Media queries involving unknown media types are ignored.
538+
<p>Media queries involving unknown media types are always false, even when
539+
negated.
528540

529541
<div class=example>
530542
<p>Both these examples involve unknown media types and they are therefore
@@ -535,12 +547,12 @@ <h2 id=syntax><span class=secno>3. </span>Syntax</h2>
535547
<span class=html-example>&lt;link rel="stylesheet" media="<em>not 3d and (color)</em>" href="example.css" /&gt;</span>
536548
</pre>
537549

538-
<p>Because "3d" is an unknown type, the media query is ignored and the
550+
<p>Because "3d" is an unknown type, the media query is false and the
539551
associated style sheet will not be applied.</p>
540552
</div>
541553
<!--
542554
<div class="example">
543-
<p>In a comma-separated list of Media Queries, only those Media
555+
<p>In a comma-separated list of media queries, only those Media
544556
Queries that involve unknown media types are ignored. In this example,
545557
the first media query is ignored, but the second is not::</p>
546558
@@ -577,7 +589,7 @@ <h2 id=syntax><span class=secno>3. </span>Syntax</h2>
577589
as if the first had not been specified.</p>
578590
</div>
579591
<!--
580-
<p>For a definition of values used in Media Queries, see <a href=
592+
<p>For a definition of values used in media queries, see <a href=
581593
"http://www.w3.org/TR/REC-CSS2/syndata.html#values">CSS2, section
582594
4.3: Values and Units</a> {{!CSS21}}.</p>
583595
-->
@@ -629,13 +641,13 @@ <h3 id=width><span class=secno>4.1 </span>width</h3>
629641

630642
<p>The ''width'' media feature describes the width of the rendering surface
631643
of the output device. For continuous media, this is the width of the
632-
viewport (as described by CSS 2.1, section 9.1.1 <a href="#CSS21"
644+
viewport (as described by CSS2, section 9.1.1 <a href="#CSS21"
633645
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>). For paged media, this is
634-
the width of the page box (as described by CSS 2.1, section 13.2 <a
646+
the width of the page box (as described by CSS2, section 13.2 <a
635647
href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>).
636648

637649
<div class=example>
638-
<p>For example, this Media Query expresses that the style sheet is usable
650+
<p>For example, this media query expresses that the style sheet is usable
639651
on printed output wider than 25cm:</p>
640652

641653
<pre>
@@ -644,7 +656,7 @@ <h3 id=width><span class=secno>4.1 </span>width</h3>
644656
</div>
645657

646658
<div class=example>
647-
<p>This Media Query expresses that the style sheet is usable on devices
659+
<p>This media query expresses that the style sheet is usable on devices
648660
with viewport (the part of the screen/paper where the document is
649661
rendered) widths between 400 and 700 pixels:</p>
650662

@@ -654,7 +666,7 @@ <h3 id=width><span class=secno>4.1 </span>width</h3>
654666
</div>
655667

656668
<div class=example>
657-
<p>This Media Query expresses that style sheet is usable on screen and
669+
<p>This media query expresses that style sheet is usable on screen and
658670
handheld devices if the width of the viewport is greater than 20em.</p>
659671

660672
<pre>
@@ -831,7 +843,7 @@ <h3 id=color><span class=secno>4.8 </span>color</h3>
831843
</div>
832844

833845
<div class=example>
834-
<p>This Media Query expresses that a style sheet applies to color devices
846+
<p>This media query expresses that a style sheet applies to color devices
835847
with 2 or more bits per color component:</p>
836848

837849
<pre>
@@ -880,7 +892,7 @@ <h3 id=color-index><span class=secno>4.9 </span>color-index</h3>
880892
</div>
881893

882894
<div class=example>
883-
<p>This Media Query expresses that a style sheet applies to a color index
895+
<p>This media query expresses that a style sheet applies to a color index
884896
device with 256 or more entries:</p>
885897

886898
<pre>
@@ -947,7 +959,7 @@ <h3 id=resolution><span class=secno>4.11 </span>resolution</h3>
947959
non-square pixels.
948960

949961
<div class=example>
950-
<p>For example, this Media Query expresses that a style sheet is usable on
962+
<p>For example, this media query expresses that a style sheet is usable on
951963
devices with resolution greater than 300 dots per inch:</p>
952964

953965
<pre>
@@ -956,7 +968,7 @@ <h3 id=resolution><span class=secno>4.11 </span>resolution</h3>
956968
</div>
957969

958970
<div class=example>
959-
<p>This Media Query expresses that a style sheet is usable on devices with
971+
<p>This media query expresses that a style sheet is usable on devices with
960972
resolution greater than 118 dots per centimeter:</p>
961973

962974
<pre>
@@ -976,7 +988,7 @@ <h3 id=scan><span class=secno>4.12 </span>scan</h3>
976988
devices.
977989

978990
<div class=example>
979-
<p>For example, this Media Query expresses that a style sheet is usable on
991+
<p>For example, this media query expresses that a style sheet is usable on
980992
tv devices with progressive scanning:</p>
981993

982994
<pre>
@@ -1013,13 +1025,13 @@ <h3 id=grid><span class=secno>4.13 </span>grid</h3>
10131025

10141026
<h2 id=units><span class=secno>5. </span>Units</h2>
10151027

1016-
<p>The units used in Media Queries are the same as in other parts of CSS.
1028+
<p>The units used in media queries are the same as in other parts of CSS.
10171029
For example, the pixel unit represents CSS pixels and not physical pixels.
10181030

10191031
<p>Note, however, that the ''em'' unit has a special meaning on grid output
10201032
devices, as discussed above.
10211033

1022-
<p>Relative units in Media Queries are based on the initial value. For
1034+
<p>Relative units in media queries are based on the initial value. For
10231035
example, in HTML, the ''em'' unit is relative to the initial value of
10241036
'font-size'.
10251037

@@ -1047,9 +1059,9 @@ <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
10471059
Style Sheets.
10481060

10491061
<p>Comments from Christoph P&auml;per, Simon Pieters, Rijk van Geijtenbeek,
1050-
Anne van Kesteren, Sigurd Lerstad, Arve Bersvendsen, Susan Lesch, Philipp
1051-
Hoschka, Roger Gimson, Steven Pemberton, Simon Kissane, Melinda Grant, and
1052-
L. David Baron improved this specification.
1062+
Sigurd Lerstad, Arve Bersvendsen, Susan Lesch, Philipp Hoschka, Roger
1063+
Gimson, Steven Pemberton, Simon Kissane, Melinda Grant, and L. David Baron
1064+
improved this specification.
10531065

10541066
<h2 class=no-num id=references>References</h2>
10551067

0 commit comments

Comments
 (0)