8000 [mediaqueries] Specify that whitespace must be used around () charact… · w3c/csswg-drafts@6750c78 · GitHub
Skip to content

Commit 6750c78

Browse files
committed
[mediaqueries] Specify that whitespace must be used around () characters.
1 parent 6af7872 commit 6750c78

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

mediaqueries/Overview.bs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ Syntax</h2>
656656

657657
No whitespace is allowed between the "<" or ">" <<delim-token>>s and the following "=" <<delim-token>>,
658658
if it's present.
659+
Whitespace <em>must</em> be present between a ')' character and a ''not'', ''and'', or ''or'' keyword,
660+
and between a ''not'', ''and'', or ''or'' keyword and a '(' character.
659661

660662
When parsing the <<media-in-parens>> production,
661663
the <<general-enclosed>> branch must only be chosen if the input does not match either of the preceding branches.

mediaqueries/Overview.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
</p>
6161
<h1 class="p-name no-ref" id=title>Media Queries Level 4</h1>
6262
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
63-
<span class=dt-updated><span class=value-title title=20140414>14 April 2014</span></span></span></h2>
63+
<span class=dt-updated><span class=value-title title=20140416>16 April 2014</span></span></span></h2>
6464
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/csswg/mediaqueries4/>http://dev.w3.org/csswg/mediaqueries4/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/csswg/mediaqueries4/>http://dev.w3.org/csswg/mediaqueries4/</a>
6565
<dt>Feedback:</dt>
6666
<dd><a href="mailto:www-style@w3.org?subject=%5Bmediaqueries%5D%20feedback">www-style@w3.org</a>
@@ -123,8 +123,8 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
123123
<li><a href=#mq-list><span class=secno>2.1</span> Combining Media Queries</a>
124124
<li><a href=#mq-prefix><span class=secno>2.2</span> Media Query Modifiers</a>
125125
<ul class=toc>
126-
<li><a href=#mq-not><span class=secno>2.2.1</span> Negating a Media Query: the <a class=css data-link-type=maybe href=#valuedef-not title=not>not</a> keyword</a>
127-
<li><a href=#mq-only><span class=secno>2.2.2</span> Hiding a Media Query From Legacy User Agents: the <a class=css data-link-type=maybe href=#valuedef-only title=only>only</a> keyword</a></ul>
126+
<li><a href=#mq-not><span class=secno>2.2.1</span> Negating a Media Query: the <span class=css data-link-type=maybe title=not>not</span> keyword</a>
127+
<li><a href=#mq-only><span class=secno>2.2.2</span> Hiding a Media Query From Legacy User Agents: the <span class=css data-link-type=maybe title=only>only</span> keyword</a></ul>
128128
<li><a href=#media-types><span class=secno>2.3</span> Media Types</a>
129129
<li><a href=#mq-features><span class=secno>2.4</span> Media Features</a>
130130
<ul class=toc>
@@ -786,7 +786,7 @@ <h4 class="heading settled heading" data-level=2.4.1 id=mq-ranges><span class=se
786786
it matches when the feature is greater than/less than/equal to the given value.
787787

788788
<div class=example>
789-
A <span class=css data-link-type=maybe title="(width >= 600px)">(width &gt;= 600px)</span> <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> is true
789+
A <span class=css data-link-type=maybe>(width &gt;= 600px)</span> <a data-link-type=dfn href=#media-feature title="media feature">media feature</a> is true
790790
when the viewport’s width is <span class=css data-link-type=maybe title=600px>600px</span> <em>or more</em>.
791791

792792
<p> On the other hand, <span class=css data-link-type=maybe title="(width: 600px)">(width: 600px)</span> by itself is only true
@@ -1086,11 +1086,11 @@ <h4 class="heading settled heading" data-level=2.4.4 id=mq-min-max><span class=s
10861086
<p> <ul>
10871087
<li>
10881088
Using a “min-” prefix on a feature name is equivalent to using the “&gt;=” operator.
1089-
For example, <span class=css data-link-type=maybe title="(min-height: 600px)">(min-height: 600px)</span> is equivalent to <span class=css data-link-type=maybe title="(height >= 600px)">(height &gt;= 600px)</span>.
1089+
For example, <span class=css data-link-type=maybe title="(min-height: 600px)">(min-height: 600px)</span> is equivalent to <span class=css data-link-type=maybe>(height &gt;= 600px)</span>.
10901090

10911091
<li>
10921092
Using a “max-” prefix on a feature name is equivalent to using the “&lt;=” operator.
1093-
For example, <span class=css data-link-type=maybe title="(max-width: 40em)">(max-width: 40em)</span> is equivalent to <span class=css data-link-type=maybe title="(width <= 40em)">(width &lt;= 40em)</span>.
1093+
For example, <span class=css data-link-type=maybe title="(max-width: 40em)">(max-width: 40em)</span> is equivalent to <span class=css data-link-type=maybe>(width &lt;= 40em)</span>.
10941094
</ul>
10951095

10961096
<p> “Discrete” type properties do not accept “min-” or “max-” prefixes.
@@ -1149,6 +1149,8 @@ <h2 class="heading settled heading" data-level=3 id=mq-syntax><span class=secno>
11491149

11501150
<p> No whitespace is allowed between the "&lt;" or "&gt;" <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-syntax-3/#typedef-delim-token title="<delim-token>">&lt;delim-token&gt;</a>s and the following "=" <a class="production css-code" data-link-type=type href=http://dev.w3.org/csswg/css-syntax-3/#typedef-delim-token title="<delim-token>">&lt;delim-token&gt;</a>,
11511151
if it’s present.
1152+
Whitespace <em>must</em> be present between a ')' character and a <a class=css data-link-type=maybe href=#valuedef-not title=not>not</a>, <span class=css data-link-type=maybe title=and>and</span>, or <span class=css data-link-type=maybe title=or>or</span> keyword,
1153+
and between a <a class=css data-link-type=maybe href=#valuedef-not title=not>not</a>, <span class=css data-link-type=maybe title=and>and</span>, or <span class=css data-link-type=maybe title=or>or</span> keyword and a '(' character.
11521154

11531155
<p> When parsing the <a class="production css-code" data-link-type=type href=#typedef-media-in-parens title="<media-in-parens>">&lt;media-in-parens&gt;</a> production,
11541156
the <a class="production css-code" data-link-type=type href=#typedef-general-enclosed title="<general-enclosed>">&lt;general-enclosed&gt;</a> branch must only be chosen if the input does not match either of the preceding branches.
@@ -1436,7 +1438,7 @@ <h3 class="heading settled heading" data-level=5.1 id=resolution><span class=sec
14361438
and in <a class=property data-link-type=propdesc title=max-resolution>max-resolution</a> queries the most-dense dimensions must be compared instead.
14371439
A <a class=property data-link-type=propdesc href=#descdef-resolution title=resolution>resolution</a> query that’s not evaluated in a <a data-link-type=dfn href=#range-context title="range context">range context</a> never matches a device with non-square pixels.
14381440

1439-
<p class=issue id=issue-0e6ffa6f><a class=self-link href=#issue-0e6ffa6f></a>
1441+
<p class=issue id=issue-82c28e24><a class=self-link href=#issue-82c28e24></a>
14401442
Figure out how to make the above work properly for &lt;/&gt; syntax.
14411443
Just translate it over directly?
14421444
That prevents you from doing a "less than/greater than" dichotomy without using <a class=css data-link-type=maybe href=#valuedef-not title=not>not</a>.
@@ -2446,7 +2448,7 @@ <h2 class="no-num heading settled" id=issues-index><span class=content>Issues In
24462448
That prevents you from doing a "less than/greater than" dichotomy without using <a class=css data-link-type=maybe href=#valuedef-not title=not>not</a>.
24472449
Hmm.
24482450

2449-
<a href=#issue-0e6ffa6f></a></div><div class=issue>
2451+
<a href=#issue-82c28e24></a></div><div class=issue>
24502452
Another media feature should probably be added to deal with the type of resolution authors want to know to deal with monochrome printing.
24512453

24522454
<a href=#issue-7ddcf400></a></div><div class=issue>

0 commit comments

Comments
 (0)