You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mediaqueries-3/Overview.html
+38-3Lines changed: 38 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,8 @@ <h2 class="no-num no-toc" id=status>Status of this document</h2>
157
157
W3C Patent Policy</a>.</p>
158
158
<!--end-status-->
159
159
160
+
<divclass="correction"><ahref="https://www.w3.org/Consortium/Process/#candidate-correction">Candidate corrections</a> are marked in the document.</div>
161
+
160
162
<navid="toc">
161
163
<h2class="no-num no-toc" id=contents>Table of contents</h2>
Clarify that the keywords ‘<code>not</code>’, ‘<code>and</code>’, ‘<code>only</code>’, and ‘<code>or</code>’ should not be treated as unknown media types,
568
+
but as syntax errors when used in place of media types.
569
+
570
+
<p>The reasoning for this change can be found in <ahref="https://lists.w3.org/Archives/Public/www-style/2013May/0783.html">the minutes of the 2013-05-30 CSS WG teleconference</a>
571
+
and in the emails referenced therefrom.
572
+
<details>
573
+
<summary>This change has tests</summary>
574
+
<ahref="https://github.com/web-platform-tests/wpt/commit/ea1821d4bd24ed1e859db03571cca8e783dbf957">Tests for this change</a> have been added to <abbrtitle="Web Platform Tests">WPT</abbr>.
575
+
The results can be viewed at <ahref="https://wpt.fyi/results/css/mediaqueries?q=mq-invalid-media-type">wpt.fyi</a>.
576
+
</details>
577
+
</div>
578
+
563
579
<ul>
564
580
<li>
565
581
<p><strong>Unknown media types.</strong> Unknown media types evaluate to
566
582
false. Effectively, they are treated identically to known media types
567
-
that do not match the media type of the device.</p>
583
+
that do not match the media type of the device.
584
+
<inscite="#c1">However, an exception is made for media types ‘<code>not</code>’, ‘<code>and</code>’, ‘<code>only</code>’, and ‘<code>or</code>’.
585
+
Even though they do match the IDENT production,
586
+
they must not be treated as unknown media types,
587
+
but rather trigger the malformed query clause.</ins></p>
568
588
569
589
<divclass=example>
570
590
<p>The media query "<code>unknown</code>" will evaluate to false, unless
571
591
<code>unknown</code> is actually a supported media type. Similarly,
572
592
"<code>not unknown</code>" will evaluate to true.</p>
573
593
</div>
574
594
595
+
<inscite="#c1">
596
+
<divclass="example">
597
+
<p>The following is a malformed media query because it uses ‘<code>only</code>’ and ‘<code>or</code>’ as media types.</p>
598
+
<pre><code>@media only and or { … }</code></pre>
599
+
</div>
600
+
</ins>
601
+
575
602
<pclass=note>Unknown media types are distinct from media types that do
576
603
not actually match the IDENT production. Those fall under the malformed
<h3id=changes-2012><spanclass=secno>7.1. </span>Changes Since the 19 June 2012
1105
1132
Recommendation</h3>
1106
1133
1107
-
<p>A handful of editorial and markup corrections were made:
1134
+
<p>Candidate Corrections were introduced:
1135
+
<ul>
1136
+
<li><ahref="#c1">Candidate Change 1</a> in <ahref="#error-handling">Section 3.1</a>:
1137
+
Clarify that the keywords ‘<code>not</code>’, ‘<code>and</code>’, ‘<code>only</code>’, and ‘<code>or</code>’ should not be treated as unknown media types,
1138
+
but as syntax errors when used in place of media types.
1139
+
1140
+
</ul>
1141
+
1142
+
<p>A handful of editorial and markup corrections were also made:
1108
1143
1109
1144
<ul>
1110
1145
<li><ahref="#media0">Section 2</a>: Dropped a redundant attribute in an example.
0 commit comments