Skip to content

Commit 2b1029b

Browse files
committed
[mediaqueries] 'not', 'only', 'and', 'or' are invalid media types
1 parent 6f2e422 commit 2b1029b

2 files changed

Lines changed: 71 additions & 30 deletions

File tree

mediaqueries/Overview.html

Lines changed: 62 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,33 @@
1111

1212
<meta content="Media Queries Level 4" name=dcterms.title>
1313
<meta content=text name=dcterms.type>
14-
<meta content=2012-12-12 name=dcterms.issued>
15-
<meta content="http://dev.w3.org/csswg/mediaqueries4/"
16-
name=dcterms.creator>
14+
<meta content=2013-06-14 name=dcterms.date>
15+
<meta content="Florian Rivoal" name=dcterms.creator>
1716
<meta content=W3C name=dcterms.publisher>
18-
<meta content="http://www.w3.org/TR/2012/ED-mediaqueries4-20121212/"
17+
<meta content="http://dev.w3.org/csswg/mediaqueries4/"
1918
name=dcterms.identifier>
2019
<link href="#contents" rel=contents>
2120
<link href="#index" rel=index>
2221
<link href="../default.css" rel=stylesheet type="text/css">
2322
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
2423
type="text/css">
2524
<style type="text/css">
25+
/* delete this block when you've cleared out all the .replaceme elements */
26+
.replaceme {
27+
border: solid red;
28+
padding: 0 0.5em;
29+
margin: 0 0.1em;
30+
background: yellow;
31+
color: green;
32+
}
33+
.replaceme:before {
34+
content: "FIXME(";
35+
color: black;
36+
}
37+
.replaceme:after {
38+
content: ")";
39+
color: black;
40+
}
2641
blockquote {
2742
background: #eef;
2843
padding: 0.5em;
@@ -40,12 +55,11 @@
4055

4156
<h1 id=media-queries>Media Queries Level 4</h1>
4257

43-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 12 December
44-
2012</h2>
58+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 14 June 2013</h2>
4559

4660
<dl>
4761
<dt>This version:
48-
<!-- <dd><a href="http://www.w3.org/TR/2012/ED-mediaqueries4-20121212/">http://www.w3.org/TR/2012/ED-mediaqueries4-20121212/</a> -->
62+
<!-- <dd><a href="http://dev.w3.org/csswg/mediaqueries4/">http://www.w3.org/TR/2013/ED-mediaqueries4-20130614/</a> -->
4963

5064
<dd><a
5165
href="http://dev.w3.org/csswg/mediaqueries4/">http://dev.w3.org/csswg/mediaqueries4/</a>
@@ -71,9 +85,11 @@ <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 12 December
7185
<dt>Feedback:
7286

7387
<dd><a
74-
href="http://lists.w3.org/Archives/Public/www-style/">www-style@w3.org</a>
88+
href="mailto:www-style@w3.org?subject=%5Bmediaqueries4%5D%20feedback">www-style@w3.org</a>
7589
with subject line “<kbd>[mediaqueries4] <var>… message topic
76-
</var></kbd>
90+
</var></kbd>” (<a
91+
href="http://lists.w3.org/Archives/Public/www-style/"
92+
rel=discussion>archives</a>)
7793

7894
<dt>Editors:
7995

@@ -104,13 +120,14 @@ <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 12 December
104120
<!--begin-copyright-->
105121
<p class=copyright><a
106122
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
107-
rel=license>Copyright</a> © 2012 <a href="http://www.w3.org/"><abbr
123+
rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
108124
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
109125
href="http://www.csail.mit.edu/"><abbr
110126
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
111127
href="http://www.ercim.eu/"><abbr
112128
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
113-
<a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
129+
<a href="http://www.keio.ac.jp/">Keio</a>, <a
130+
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
114131
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
115132
<a
116133
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
@@ -162,20 +179,22 @@ <h2 class="no-num no-toc" id=status>Status of this document</h2>
162179
“mediaqueries4” in the subject, preferably like this:
163180
“[<!---->mediaqueries4<!---->] <em>…summary of comment…</em>
164181

165-
<p>This document was produced by the <a href="/Style/CSS/members">CSS
166-
Working Group</a> (part of the <a href="/Style/">Style Activity</a>).
182+
<p>This document was produced by the <a
183+
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
184+
the <a href="http://www.w3.org/Style/">Style Activity</a>).
167185

168186
<p>This document was produced by a group operating under the <a
169-
href="/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent
170-
Policy</a>. W3C maintains a <a href="/2004/01/pp-impl/32061/status"
187+
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
188+
2004 W3C Patent Policy</a>. W3C maintains a <a
189+
href="http://www.w3.org/2004/01/pp-impl/32061/status"
171190
rel=disclosure>public list of any patent disclosures</a> made in
172191
connection with the deliverables of the group; that page also includes
173192
instructions for disclosing a patent. An individual who has actual
174193
knowledge of a patent which the individual believes contains <a
175-
href="/Consortium/Patent-Policy-20040205/#def-essential">Essential
194+
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
176195
Claim(s)</a> must disclose the information in accordance with <a
177-
href="/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
178-
W3C Patent Policy</a>.</p>
196+
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
197+
6 of the W3C Patent Policy</a>.</p>
179198
<!--end-status-->
180199

181200
<h2 class="no-num no-toc" id=contents> Table of contents</h2>
@@ -636,7 +655,12 @@ <h3 id=error-handling><span class=secno>3.1. </span>Error Handling</h3>
636655
<li>
637656
<p><strong>Unknown media types.</strong> Unknown media types evaluate to
638657
false. Effectively, they are treated identically to known media types
639-
that do not match the media type of the device.
658+
that do not match the media type of the device. However, an exception is
659+
made for media types ‘<code class=css>not</code>’, ‘<code
660+
class=css>and</code>’, ‘<code class=css>only</code>’ and ‘<code
661+
class=css>or</code>’. Even though they do match the IDENT production,
662+
they must not be treated as unknown media types, but rather trigger the
663+
malformed query clause.
640664

641665
<div class=example>
642666
<p>The media query "<code>unknown</code>" will evaluate to false, unless
@@ -711,6 +735,14 @@ <h3 id=error-handling><span class=secno>3.1. </span>Error Handling</h3>
711735
<pre><code>@media all and(color) { … }</code></pre>
712736
</div>
713737

738+
<div class=example>
739+
<p>The following is a malformed media query because it uses ‘<code
740+
class=css>only</code>’ and ‘<code class=property>or</code>’ as
741+
media types.
742+
743+
<pre><code>@media only and or { … }</code></pre>
744+
</div>
745+
714746
<p>Media queries are expected to follow the error handling rules of the
715747
host language as well.
716748

@@ -1519,26 +1551,26 @@ <h3 class=no-num id=normative-references> Normative references</h3>
15191551
<!-- Sorted by label -->
15201552

15211553
<dl class=bibliography>
1522-
<dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
1554+
<dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
15231555
<!---->
15241556

15251557
<dt id=CSS21>[CSS21]
15261558

15271559
<dd>Bert Bos; et al. <a
1528-
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/"><cite>Cascading Style
1560+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607"><cite>Cascading Style
15291561
Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 June
15301562
2011. W3C Recommendation. URL: <a
1531-
href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a>
1563+
href="http://www.w3.org/TR/2011/REC-CSS2-20110607">http://www.w3.org/TR/2011/REC-CSS2-20110607</a>
15321564
</dd>
15331565
<!---->
15341566

15351567
<dt id=CSS3VAL>[CSS3VAL]
15361568

15371569
<dd>Håkon Wium Lie; Tab Atkins; Elika J. Etemad. <a
1538-
href="http://www.w3.org/TR/2012/CR-css3-values-20120828/"><cite>CSS
1539-
Values and Units Module Level 3.</cite></a> 28 August 2012. W3C Candidate
1570+
href="http://www.w3.org/TR/2013/CR-css3-values-20130404/"><cite>CSS
1571+
Values and Units Module Level 3.</cite></a> 4 April 2013. W3C Candidate
15401572
Recommendation. (Work in progress.) URL: <a
1541-
href="http://www.w3.org/TR/2012/CR-css3-values-20120828/">http://www.w3.org/TR/2012/CR-css3-values-20120828/</a>
1573+
href="http://www.w3.org/TR/2013/CR-css3-values-20130404/">http://www.w3.org/TR/2013/CR-css3-values-20130404/</a>
15421574
</dd>
15431575
<!---->
15441576

@@ -1567,7 +1599,7 @@ <h3 class=no-num id=other-references> Other references</h3>
15671599
<!-- Sorted by label -->
15681600

15691601
<dl class=bibliography>
1570-
<dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
1602+
<dd style="display: none"><!-- keeps the doc valid if the DL is empty -->
15711603
<!---->
15721604

15731605
<dt id=HTML401>[HTML401]
@@ -1582,9 +1614,10 @@ <h3 class=no-num id=other-references> Other references</h3>
15821614
<dt id=HTML5>[HTML5]
15831615

15841616
<dd>Ian Hickson. <a
1585-
href="http://www.w3.org/TR/2011/WD-html5-20110525/"><cite>HTML5.</cite></a>
1586-
25 May 2011. W3C Working Draft. (Work in progress.) URL: <a
1587-
href="http://www.w3.org/TR/2011/WD-html5-20110525/">http://www.w3.org/TR/2011/WD-html5-20110525/</a>
1617+
href="http://www.w3.org/TR/2012/CR-html5-20121217/"><cite>HTML5.</cite></a>
1618+
17 December 2012. W3C Candidate Recommendation. (Work in progress.) URL:
1619+
<a
1620+
href="http://www.w3.org/TR/2012/CR-html5-20121217/">http://www.w3.org/TR/2012/CR-html5-20121217/</a>
15881621
</dd>
15891622
<!---->
15901623

mediaqueries/Overview.src.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,10 @@ <h3>Error Handling</h3>
444444
<li>
445445
<p><strong>Unknown media types.</strong> Unknown media types evaluate to
446446
false. Effectively, they are treated identically to known media types
447-
that do not match the media type of the device.</p>
447+
that do not match the media type of the device. However, an exception is made
448+
for media types ''not'', ''and'', ''only'' and ''or''. Even though they do
449+
match the IDENT production, they must not be treated as unknown media types,
450+
but rather trigger the malformed query clause.</p>
448451

449452
<div class="example">
450453
<p>The media query "<code>unknown</code>" will evaluate to false, unless
@@ -516,6 +519,11 @@ <h3>Error Handling</h3>
516519
<pre><code>@media all and(color) { &hellip; }</code></pre>
517520
</div>
518521

522+
<div class="example">
523+
<p>The following is a malformed media query because it uses ''only'' and 'or' as media types.</p>
524+
<pre><code>@media only and or { &hellip; }</code></pre>
525+
</div>
526+
519527
<p>Media queries are expected to follow the error handling rules of the
520528
host language as well.</p>
521529

0 commit comments

Comments
 (0)