Skip to content
Permalink
Browse files

[] (0) Update media query requirements to treat '' as 'all'.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7646

git-svn-id: http://svn.whatwg.org/webapps@3926 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 21, 2009
1 parent a72cee2 commit 8f2a18354b219de458c1bb35a917a4ec275a6373
Showing with 99 additions and 50 deletions.
  1. +48 −23 index
  2. +51 −27 source
71 index
@@ -249,7 +249,8 @@
<li><a href=#space-separated-tokens><span class=secno>2.4.7 </span>Space-separated tokens</a></li>
<li><a href=#comma-separated-tokens><span class=secno>2.4.8 </span>Comma-separated tokens</a></li>
<li><a href=#reversed-dns-identifiers><span class=secno>2.4.9 </span>Reversed DNS identifiers</a></li>
<li><a href=#syntax-references><span class=secno>2.4.10 </span>References</a></ol></li>
<li><a href=#syntax-references><span class=secno>2.4.10 </span>References</a></li>
<li><a href=#mq><span class=secno>2.4.11 </span>Media queries</a></ol></li>
<li><a href=#urls><span class=secno>2.5 </span>URLs</a>
<ol>
<li><a href=#terminology-0><span class=secno>2.5.1 </span>Terminology</a></li>
@@ -2265,7 +2266,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

</dd>

<dt id=mq>Media Queries</dt>
<dt>Media Queries</dt>

<dd>

@@ -4666,6 +4667,21 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
</ol></div>


<h4 id=mq><span class=secno>2.4.11 </span>Media queries</h4>

<p>A string is a <dfn id=valid-media-query>valid media query</dfn> if it matches the
<code title="">media_query_list</code> production of the Media
Queries specification. <a href=#refsMQ>[MQ]</a></p>

<p>A string <dfn id=matches-the-environment>matches the environment</dfn> of a view if it is
the empty string, a string consisting of only <a href=#space-character title="space
character">space characters</a>, or is a media query that matches
that view's environment according to the definitions given in the
Media Queries specification. <a href=#refsMQ>[MQ]</a></p>




<h3 id=urls><span class=secno>2.5 </span>URLs</h3>

<h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>

<p>The <dfn id=attr-link-media title=attr-link-media><code>media</code></dfn>
attribute says which media the resource applies to. The value must
be a valid <a href=#mq>media query</a>. <a href=#refsMQ>[MQ]</a></p>
be a <a href=#valid-media-query>valid media query</a>.</p>

<div class=impl>


<p>However, if the link is an <a href=#external-resource-link>external resource link</a>,
then the <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute is
prescriptive. The user agent must apply the external resource to
<a href=#view title=view>views</a> while their state match the listed
media and the other relevant conditions apply, and must not apply
them otherwise.</p><!-- note similar text in <style> section -->
prescriptive. The user agent must apply the external resource to a
<a href=#view>view</a> when the <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute's value <a href=#matches-the-environment>matches
the environment</a> of that view and the other relevant
conditions apply, and must not apply it otherwise.</p><!-- note
similar text in <style> section -->

<p class=note>The external resource might have further
restrictions defined within that limit its applicability. For

</div>

<p id=default-media>The default, if the <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute is omitted, is
<code>all</code>, meaning that by default links apply to all
<p id=default-media>The default, if the <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute is omitted, is "<code title="">all</code>", meaning that by default links apply to all
media.</p>

<p>The <dfn id=attr-link-hreflang title=attr-link-hreflang><code>hreflang</code></dfn>

</div>

<p>However, if the link is an <a href=#external-resource-link>external resource link</a>,
then the <code title=attr-link-media><a href=#attr-link-media>media</a></code> attribute is
prescriptive.

<p>The <dfn id=attr-style-media title=attr-style-media><code>media</code></dfn>
attribute says which media the styles apply to. The value must be a
valid <a href=#mq>media query</a>. <a href=#refsMQ>[MQ]</a>
<span class=impl>User agents must apply the styles to <a href=#view title=view>views</a> while their state match the listed media,
and must not apply them otherwise.</span></p><!-- note similar text
in <link> section -->
<a href=#valid-media-query>valid media query</a>. <span class=impl>The user agent
must apply the styles to a <a href=#view>view</a> when the <code title=attr-style-media><a href=#attr-style-media>media</a></code> attribute's value
<a href=#matches-the-environment>matches the environment</a> of that view and the other
relevant conditions apply, and must not apply them
otherwise.</span></p><!-- note similar text in <link> section -->

<div class=impl>

</div>

<p id=style-default-media>The default, if the <code title=attr-style-media><a href=#attr-style-media>media</a></code> attribute is omitted, is
<code>all</code>, meaning that by default styles apply to all
media.</p>
"<code title="">all</code>", meaning that by default styles apply to
all media.</p>

<p>The <dfn id=attr-style-scoped title=attr-style-scoped><code>scoped</code></dfn>
attribute is a <a href=#boolean-attribute>boolean attribute</a>. If set, it indicates
attribute gives the intended media type of the <a href=#media-resource>media
resource</a>, to help the user agent determine if this
<a href=#media-resource>media resource</a> is useful to the user before fetching
it. Its value must be a valid <a href=#mq>media query</a>. <a href=#refsMQ>[MQ]</a></p>
it. Its value must be a <a href=#valid-media-query>valid media query</a>.</p>

<p id=source-default-media>The default, if the <code title=attr-srouce-media>media</code> attribute is omitted, is
"<code title="">all</code>", meaning that by default styles apply to
all media.</p>

<div class=impl>

that the user agent knows it cannot render</a>, then end the
<a href=#synchronous-section>synchronous section</a>, and jump down to the <i title="">failed</i> step below.</li>

<li><p>&#8987; If <var title="">candidate</var> has a <code title=attr-source-media><a href=#attr-source-media>media</a></code> attribute whose value,
when processed according to the rules for <a href=#mq>media
queries</a>, does not match the current environment, then end the
<a href=#synchronous-section>synchronous section</a>, and jump down to the <i title="">failed</i> step below. <a href=#refsMQ>[MQ]</a></li>
<li><p>&#8987; If <var title="">candidate</var> has a <code title=attr-source-media><a href=#attr-source-media>media</a></code> attribute whose value does
not <a href=#matches-the-environment title="matches the environment">match the
environment</a> of the <a href=#default-view>default view</a>, then end the
<a href=#synchronous-section>synchronous section</a>, and jump down to the <i title="">failed</i> step below.</li>

<li><p>End the <a href=#synchronous-section>synchronous section</a>, continuing the
remaining steps asynchronously.</li>

<p>The <dfn id=attr-hyperlink-media title=attr-hyperlink-media><code>media</code></dfn>
attribute describes for which media the target document was
designed. It is purely advisory. The value must be a valid <a href=#mq>media query</a>. <a href=#refsMQ>[MQ]</a> The default,
if the <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code> attribute is
omitted, is <code>all</code>.</p>
designed. It is purely advisory. The value must be a <a href=#valid-media-query>valid
media query</a>. The default, if the <code title=attr-hyperlink-media><a href=#attr-hyperlink-media>media</a></code> attribute is omitted, is
"<code title="">all</code>".</p>

<p>The <dfn id=attr-hyperlink-hreflang title=attr-hyperlink-hreflang><code>hreflang</code></dfn>
attribute on hyperlink elements, if present, gives the language of
78 source
@@ -1300,7 +1300,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

</dd>

<dt id="mq">Media Queries</dt>
<dt>Media Queries</dt>

<dd>

@@ -4262,6 +4262,21 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
</div>


<h4 id="mq">Media queries</h4>

<p>A string is a <dfn>valid media query</dfn> if it matches the
<code title="">media_query_list</code> production of the Media
Queries specification. <a href="#refsMQ">[MQ]</a></p>

<p>A string <dfn>matches the environment</dfn> of a view if it is
the empty string, a string consisting of only <span title="space
character">space characters</span>, or is a media query that matches
that view's environment according to the definitions given in the
Media Queries specification. <a href="#refsMQ">[MQ]</a></p>




<h3>URLs</h3>

<h4>Terminology</h4>
@@ -11031,8 +11046,7 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>

<p>The <dfn title="attr-link-media"><code>media</code></dfn>
attribute says which media the resource applies to. The value must
be a valid <a href="#mq">media query</a>. <a
href="#refsMQ">[MQ]</a></p>
be a <span>valid media query</span>.</p>

<div class="impl">

@@ -11043,10 +11057,12 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>

<p>However, if the link is an <span>external resource link</span>,
then the <code title="attr-link-media">media</code> attribute is
prescriptive. The user agent must apply the external resource to
<span title="view">views</span> while their state match the listed
media and the other relevant conditions apply, and must not apply
them otherwise.</p><!-- note similar text in <style> section -->
prescriptive. The user agent must apply the external resource to a
<span>view</span> when the <code
title="attr-link-media">media</code> attribute's value <span>matches
the environment</span> of that view and the other relevant
conditions apply, and must not apply it otherwise.</p><!-- note
similar text in <style> section -->

<p class="note">The external resource might have further
restrictions defined within that limit its applicability. For
@@ -11058,8 +11074,8 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>
</div>

<p id="default-media">The default, if the <code
title="attr-link-media">media</code> attribute is omitted, is
<code>all</code>, meaning that by default links apply to all
title="attr-link-media">media</code> attribute is omitted, is "<code
title="">all</code>", meaning that by default links apply to all
media.</p>

<p>The <dfn title="attr-link-hreflang"><code>hreflang</code></dfn>
@@ -12194,13 +12210,18 @@ people expect to have work and what is necessary.

</div>

<p>However, if the link is an <span>external resource link</span>,
then the <code title="attr-link-media">media</code> attribute is
prescriptive.

<p>The <dfn title="attr-style-media"><code>media</code></dfn>
attribute says which media the styles apply to. The value must be a
valid <a href="#mq">media query</a>. <a href="#refsMQ">[MQ]</a>
<span class="impl">User agents must apply the styles to <span
title="view">views</span> while their state match the listed media,
and must not apply them otherwise.</span></p><!-- note similar text
in <link> section -->
<span>valid media query</span>. <span class="impl">The user agent
must apply the styles to a <span>view</span> when the <code
title="attr-style-media">media</code> attribute's value
<span>matches the environment</span> of that view and the other
relevant conditions apply, and must not apply them
otherwise.</span></p><!-- note similar text in <link> section -->

<div class="impl">

@@ -12214,8 +12235,8 @@ people expect to have work and what is necessary.

<p id="style-default-media">The default, if the <code
title="attr-style-media">media</code> attribute is omitted, is
<code>all</code>, meaning that by default styles apply to all
media.</p>
"<code title="">all</code>", meaning that by default styles apply to
all media.</p>

<p>The <dfn title="attr-style-scoped"><code>scoped</code></dfn>
attribute is a <span>boolean attribute</span>. If set, it indicates
attribute gives the intended media type of the <span>media
resource</span>, to help the user agent determine if this
<span>media resource</span> is useful to the user before fetching
it. Its value must be a valid <a href="#mq">media query</a>. <a
href="#refsMQ">[MQ]</a></p>
it. Its value must be a <span>valid media query</span>.</p>

<p id="source-default-media">The default, if the <code
title="attr-srouce-media">media</code> attribute is omitted, is
"<code title="">all</code>", meaning that by default styles apply to
all media.</p>

<div class="impl">

title="">failed</i> step below.</p></li>

<li><p>&#x231B; If <var title="">candidate</var> has a <code
title="attr-source-media">media</code> attribute whose value,
when processed according to the rules for <a href="#mq">media
queries</a>, does not match the current environment, then end the
title="attr-source-media">media</code> attribute whose value does
not <span title="matches the environment">match the
environment</span> of the <span>default view</span>, then end the
<span>synchronous section</span>, and jump down to the <i
title="">failed</i> step below. <a
href="#refsMQ">[MQ]</a></p></li>
title="">failed</i> step below.</p></li>

<li><p>End the <span>synchronous section</span>, continuing the
remaining steps asynchronously.</p></li>

<p>The <dfn title="attr-hyperlink-media"><code>media</code></dfn>
attribute describes for which media the target document was
designed. It is purely advisory. The value must be a valid <a
href="#mq">media query</a>. <a href="#refsMQ">[MQ]</a> The default,
if the <code title="attr-hyperlink-media">media</code> attribute is
omitted, is <code>all</code>.</p>
designed. It is purely advisory. The value must be a <span>valid
media query</span>. The default, if the <code
title="attr-hyperlink-media">media</code> attribute is omitted, is
"<code title="">all</code>".</p>

<p>The <dfn
title="attr-hyperlink-hreflang"><code>hreflang</code></dfn>

0 comments on commit 8f2a183

Please sign in to comment.
You can’t perform that action at this time.