Skip to content

Commit 1d9885a

Browse files
committed
change the error handling rules slightly
1 parent c9ee28c commit 1d9885a

2 files changed

Lines changed: 34 additions & 51 deletions

File tree

css3-mediaqueries/Overview.html

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -638,39 +638,41 @@ <h3 id=error-handling><span class=secno>3.1. </span>Error Handling</h3>
638638
media query clause.</p>
639639

640640
<li>
641-
<p><strong>Unknown media features.</strong> User agents are to ignore a
642-
media query when one of the specified media features is unknown.</p>
641+
<p><strong>Unknown media features.</strong> User agents are to represent
642+
a media query as "<code>not all</code>" when one of the specified media
643+
features is not known.</p>
643644

644645
<div class=example>
645646
<pre><span class=html-example>&lt;link rel="stylesheet" media="screen and (max-weight: 3kg) and (color), (color)" href="example.css" /&gt;</span></pre>
646647

647-
<p>In this example, the first media query is rejected due to an unknown
648-
media feature and unknown value, but the second media query is
649-
evaluated as if the first had not been specified.</p>
648+
<p>In this example, the first media query will be represented as
649+
"<code>not all</code>" and evaluate to false and the second media query
650+
is evaluated as if the first had not been specified, effectively.</p>
650651
</div>
651652

652653
<div class=example>
653654
<pre>@media (min-orientation:portrait) { ... }</pre>
654655

655-
<p>Is dropped because the &lsquo;<code
656+
<p>Is represented as "<code>not all</code>" because the &lsquo;<code
656657
class=css>orientation</code>&rsquo; feature does not accept the
657-
&lsquo;<code class=css>min-</code>&rsquo; prefix.
658+
&lsquo;<code class=css>min-</code>&rsquo; prefix.</p>
658659
</div>
659660

660661
<li>
661662
<p><strong>Unknown media feature values.</strong> As with unknown media
662-
features, user agents are to ignore a media query when one of the
663-
specified media feature values is unknown.</p>
663+
features, user agents are to represent a media query as "<code>not
664+
all</code>" when one of the specified media feature values is not known.</p>
664665

665666
<div class=example>
666667
<p>The media query <code>(color:20example)</code> specifies an unknown
667668
value for the &lsquo;<code class=css>color</code>&rsquo; media feature
668-
and is therefore ignored.</p>
669+
and is therefore represented as "<code>not all</code>".</p>
669670
</div>
670671

671672
<div class=example>
672-
<p>This media query is invalid because negative lengths are not allowed
673-
for the &lsquo;<code class=css>width</code>&rsquo; media feature:
673+
<p>This media query is represented as "<code>not all</code>" because
674+
negative lengths are not allowed for the &lsquo;<code
675+
class=css>width</code>&rsquo; media feature:</p>
674676

675677
<pre>@media (min-width: -100px) { ... }</pre>
676678
</div>
@@ -681,8 +683,9 @@ <h3 id=error-handling><span class=secno>3.1. </span>Error Handling</h3>
681683
until the end of the media query, while observing <a
682684
href="http://www.w3.org/TR/CSS21/syndata.html#block">the rules for
683685
matching pairs</a> of (), [], {}, "", and '', and correctly handling
684-
escapes. Media queries with unexpected tokens are ignored. <a
685-
href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
686+
escapes. Media queries with unexpected tokens are represented as
687+
"<code>not all</code>". <a href="#CSS21"
688+
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
686689

687690
<div class=example>
688691
<pre>@media (example, all,), speech { /* only applicable to speech devices */ }
@@ -697,18 +700,6 @@ <h3 id=error-handling><span class=secno>3.1. </span>Error Handling</h3>
697700
<pre>@media all and(color) { ... }</pre>
698701
</div>
699702

700-
<p>When all media queries in a media query list are ignored it is the
701-
same as if "<code>not all</code>" was specified.</p>
702-
703-
<div class=example>
704-
<p>The following lists of media queries would all end up as "<code>not
705-
all</code>":</p>
706-
707-
<pre>@media test, @test { ... }
708-
@media example { ... }
709-
@media screen and (min-example), example { ...}</pre>
710-
</div>
711-
712703
<p>Media queries are expected to follow the error handling rules of the
713704
host language as well.</p>
714705

css3-mediaqueries/Overview.src.html

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -493,37 +493,40 @@ <h3>Error Handling</h3>
493493
media query clause.</p>
494494

495495
<li>
496-
<p><strong>Unknown media features.</strong> User agents are to ignore a
497-
media query when one of the specified media features is unknown.</p>
496+
<p><strong>Unknown media features.</strong> User agents are to represent a
497+
media query as "<code>not all</code>" when one of the specified media
498+
features is not known.</p>
498499

499500
<div class="example">
500501
<pre><span class="html-example">&lt;link rel="stylesheet" media="screen and (max-weight: 3kg) and (color), (color)" href="example.css" /&gt;</span></pre>
501502

502-
<p>In this example, the first media query is rejected due to an unknown
503-
media feature and unknown value, but the second media query is evaluated
504-
as if the first had not been specified.</p>
503+
<p>In this example, the first media query will be represented as
504+
"<code>not all</code>" and evaluate to false and the second media query
505+
is evaluated as if the first had not been specified, effectively.</p>
505506
</div>
506507

507508
<div class="example">
508509
<pre>@media (min-orientation:portrait) { ... }</pre>
509510

510-
<p>Is dropped because the ''orientation'' feature does not accept the
511-
''min-'' prefix.
511+
<p>Is represented as "<code>not all</code>" because the ''orientation''
512+
feature does not accept the ''min-'' prefix.</p>
512513
</div>
513514

514515
<li>
515516
<p><strong>Unknown media feature values.</strong> As with unknown media
516-
features, user agents are to ignore a media query when one of the
517-
specified media feature values is unknown.</p>
517+
features, user agents are to represent a media query as
518+
"<code>not all</code>" when one of the specified media feature values is
519+
not known.</p>
518520

519521
<div class="example">
520522
<p>The media query <code>(color:20example)</code> specifies an unknown
521-
value for the ''color'' media feature and is therefore ignored.</p>
523+
value for the ''color'' media feature and is therefore represented as
524+
"<code>not all</code>".</p>
522525
</div>
523526

524527
<div class="example">
525-
<p>This media query is invalid because negative lengths are not allowed
526-
for the ''width'' media feature:
528+
<p>This media query is represented as "<code>not all</code>" because
529+
negative lengths are not allowed for the ''width'' media feature:</p>
527530

528531
<pre>@media (min-width: -100px) { ... }</pre>
529532
</div>
@@ -534,7 +537,8 @@ <h3>Error Handling</h3>
534537
the end of the media query, while observing
535538
<a href="http://www.w3.org/TR/CSS21/syndata.html#block">the rules for
536539
matching pairs</a> of (), [], {}, "", and &#39;&#39;, and correctly handling
537-
escapes. Media queries with unexpected tokens are ignored. [[!CSS21]]
540+
escapes. Media queries with unexpected tokens are represented as
541+
"<code>not all</code>". [[!CSS21]]
538542

539543
<div class="example">
540544
<pre>@media (example, all,), speech { /* only applicable to speech devices */ }
@@ -548,18 +552,6 @@ <h3>Error Handling</h3>
548552
<pre>@media all and(color) { ... }</pre>
549553
</div>
550554

551-
<p>When all media queries in a media query list are ignored it is the same
552-
as if "<code>not all</code>" was specified.</p>
553-
554-
<div class="example">
555-
<p>The following lists of media queries would all end up as "<code>not
556-
all</code>":</p>
557-
558-
<pre>@media test, @test { ... }
559-
@media example { ... }
560-
@media screen and (min-example), example { ...}</pre>
561-
</div>
562-
563555
<p>Media queries are expected to follow the error handling rules of the
564556
host language as well.</p>
565557

0 commit comments

Comments
 (0)