Skip to content

Commit fe206e2

Browse files
committed
[mediaqueries] Add custom MQs.
--HG-- extra : rebase_source : 17c7fb6ed0b78103b51278afb7e1b025e4e7ece1
1 parent 3676545 commit fe206e2

2 files changed

Lines changed: 14 additions & 21 deletions

File tree

mediaqueries/Overview.bs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Former Editor: Anne van Kesteren, Mozilla, annevk@annevk.nl
1515
!Issue Tracking: Inline, and <a href="http://www.w3.org/Style/CSS/Tracker/products/7">http://www.w3.org/Style/CSS/Tracker/products/7</a>
1616
Abstract: <a>Media Queries</a> allow authors to test and query values or features of the user agent or display device, independent of the document being rendered. They are used in the CSS @media rule to conditionally apply styles to a document, and in various other contexts and languages, such as HTML and Javascript.
1717
Abstract: Media Queries Level 4 describes the mechanism and syntax of media queries, media types, and media features. It extends and supersedes the features defined in Media Queries Level 3.
18-
Ignored Terms: min-resolution, max-resolution, none, view-mode
18+
Ignored Terms: min-resolution, max-resolution, none, view-mode, <extension-name>
1919
Link Defaults: css-break-3 (property) break-inside
2020
</pre>
2121

@@ -1704,14 +1704,11 @@ Custom Media Queries</h2>
17041704

17051705
A <dfn>custom media query</dfn> is defined with the ''@custom-media'' rule:
17061706

1707-
<pre class='prod'><dfn>@custom-media</dfn> = @custom-media <<custom-name>> <<media-query-list>> ;</pre>
1707+
<pre class='prod'><dfn>@custom-media</dfn> = @custom-media <<extension-name>> <<media-query-list>> ;</pre>
17081708

1709-
Where <dfn>&lt;custom-name></dfn> is an <a>identifier</a> which starts with two dashes (U+002D HYPHEN-MINUS),
1710-
like ''--foo''.
1709+
This defines that the <a>custom media query</a> named by the <<extension-name>> represents the given <<media-query-list>>.
17111710

1712-
This defines that the <a>custom media query</a> named by the <<custom-name>> represents the given <<media-query-list>>.
1713-
1714-
The <<custom-name>> can then be used in a <a>media feature</a>.
1711+
The <<extension-name>> can then be used in a <a>media feature</a>.
17151712
It <strong>must</strong> be used in a <a>boolean context</a>;
17161713
using them in a normal or <a>range context</a> is a syntax error.
17171714
The <a>custom media query</a> evaluates to true if the <<media-query-list>> it represents evaluates to true,
@@ -1782,7 +1779,7 @@ CSSOM</h3>
17821779
<dt><dfn>name</dfn>, of type <code>DOMString</code>
17831780
<dd>
17841781
The <a attribute>name</a> attribute on getting must return a <code>DOMString</code> object
1785-
that contains the serialization of the <<custom-name>> defined for the associated rule.
1782+
that contains the serialization of the <<extension-name>> defined for the associated rule.
17861783

17871784
On setting the <a attribute>name</a> attribute,
17881785
run the following steps:
@@ -1791,8 +1788,8 @@ CSSOM</h3>
17911788
<li><a>Parse a component value</a> from the value.
17921789

17931790
<li>
1794-
If the returned value is a <<custom-name>>,
1795-
replace the associated rule's name with the <<custom-name>>'s representation.
1791+
If the returned value is an <<extension-name>>,
1792+
replace the associated rule's name with the <<extension-name>>'s representation.
17961793

17971794
<li>
17981795
Otherwise, do nothing.

mediaqueries/Overview.html

Lines changed: 7 additions & 11 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=20140410>10 April 2014</span></span></span></h2>
63+
<span class=dt-updated><span class=value-title title=20140411>11 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>
@@ -2032,13 +2032,10 @@ <h2 class="heading settled heading" data-level=11 id=custom-mq><span class=secno
20322032

20332033
<p> A <dfn data-dfn-type=dfn data-noexport="" id=custom-media-query>custom media query<a class=self-link href=#custom-media-query></a></dfn> is defined with the <a class=css data-link-type=maybe href=#at-ruledef-custom-media title=@custom-media>@custom-media</a> rule:
20342034

2035-
<pre class=prod><dfn class=css-code data-dfn-type=at-rule data-export="" id=at-ruledef-custom-media>@custom-media<a class=self-link href=#at-ruledef-custom-media></a></dfn> = @custom-media <a class="production css-code" data-link-type=type href=#typedef-custom-name title="<custom-name>">&lt;custom-name&gt;</a> <a class="production css-code" data-link-type=type href=#typedef-media-query-list title="<media-query-list>">&lt;media-query-list&gt;</a> ;</pre>
2036-
<p> Where <dfn class=css-code data-dfn-type=type data-export="" id=typedef-custom-name>&lt;custom-name&gt;<a class=self-link href=#typedef-custom-name></a></dfn> is an <a data-link-type=dfn href=http://dev.w3.org/csswg/css-syntax-3/#identifier title=identifier>identifier</a> which starts with two dashes (U+002D HYPHEN-MINUS),
2037-
like <span class=css data-link-type=maybe title=--foo>--foo</span>.
2035+
<pre class=prod><dfn class=css-code data-dfn-type=at-rule data-export="" id=at-ruledef-custom-media>@custom-media<a class=self-link href=#at-ruledef-custom-media></a></dfn> = @custom-media <a class="production css-code" data-link-type=type title="<extension-name>">&lt;extension-name&gt;</a> <a class="production css-code" data-link-type=type href=#typedef-media-query-list title="<media-query-list>">&lt;media-query-list&gt;</a> ;</pre>
2036+
<p> This defines that the <a data-link-type=dfn href=#custom-media-query title="custom media query">custom media query</a> named by the <a class="production css-code" data-link-type=type title="<extension-name>">&lt;extension-name&gt;</a> represents the given <a class="production css-code" data-link-type=type href=#typedef-media-query-list title="<media-query-list>">&lt;media-query-list&gt;</a>.
20382037

2039-
<p> This defines that the <a data-link-type=dfn href=#custom-media-query title="custom media query">custom media query</a> named by the <a class="production css-code" data-link-type=type href=#typedef-custom-name title="<custom-name>">&lt;custom-name&gt;</a> represents the given <a class="production css-code" data-link-type=type href=#typedef-media-query-list title="<media-query-list>">&lt;media-query-list&gt;</a>.
2040-
2041-
<p> The <a class="production css-code" data-link-type=type href=#typedef-custom-name title="<custom-name>">&lt;custom-name&gt;</a> can then be used in a <a data-link-type=dfn href=#media-feature title="media feature">media feature</a>.
2038+
<p> The <a class="production css-code" data-link-type=type title="<extension-name>">&lt;extension-name&gt;</a> can then be used in a <a data-link-type=dfn href=#media-feature title="media feature">media feature</a>.
20422039
It <strong>must</strong> be used in a <a data-link-type=dfn href=#boolean-context title="boolean context">boolean context</a>;
20432040
using them in a normal or <a data-link-type=dfn href=#range-context title="range context">range context</a> is a syntax error.
20442041
The <a data-link-type=dfn href=#custom-media-query title="custom media query">custom media query</a> evaluates to true if the <a class="production css-code" data-link-type=type href=#typedef-media-query-list title="<media-query-list>">&lt;media-query-list&gt;</a> it represents evaluates to true,
@@ -2101,7 +2098,7 @@ <h3 class="heading settled heading" data-level=11.2 id=custom-mq-cssom><span cla
21012098
<dt><dfn class=idl-code data-dfn-for=CSSCustomMediaRule data-dfn-type=attribute data-export="" id=dom-csscustommediarule-name>name<a class=self-link href=#dom-csscustommediarule-name></a></dfn>, of type <code>DOMString</code>
21022099
<dd>
21032100
The <a class=idl-code data-link-type=attribute href=#dom-csscustommediarule-name title=name>name</a> attribute on getting must return a <code>DOMString</code> object
2104-
that contains the serialization of the <a class="production css-code" data-link-type=type href=#typedef-custom-name title="<custom-name>">&lt;custom-name&gt;</a> defined for the associated rule.
2101+
that contains the serialization of the <a class="production css-code" data-link-type=type title="<extension-name>">&lt;extension-name&gt;</a> defined for the associated rule.
21052102

21062103
<p> On setting the <a class=idl-code data-link-type=attribute href=#dom-csscustommediarule-name title=name>name</a> attribute,
21072104
run the following steps:
@@ -2110,8 +2107,8 @@ <h3 class="heading settled heading" data-level=11.2 id=custom-mq-cssom><span cla
21102107
<li><a data-link-type=dfn href=http://dev.w3.org/csswg/css-syntax-3/#parse-a-component-value0 title="parse a component value">Parse a component value</a> from the value.
21112108

21122109
<li>
2113-
If the returned value is a <a class="production css-code" data-link-type=type href=#typedef-custom-name title="<custom-name>">&lt;custom-name&gt;</a>,
2114-
replace the associated rule’s name with the <a class="production css-code" data-link-type=type href=#typedef-custom-name title="<custom-name>">&lt;custom-name&gt;</a>'s representation.
2110+
If the returned value is an <a class="production css-code" data-link-type=type title="<extension-name>">&lt;extension-name&gt;</a>,
2111+
replace the associated rule’s name with the <a class="production css-code" data-link-type=type title="<extension-name>">&lt;extension-name&gt;</a>'s representation.
21152112

21162113
<li>
21172114
Otherwise, do nothing.
@@ -2331,7 +2328,6 @@ <h2 class="no-num no-ref heading settled heading" id=index><span class=content>
23312328
<li>@custom-media, <a href=#at-ruledef-custom-media title="section 11">11</a>
23322329
<li>custom media query, <a href=#custom-media-query title="section 11">11</a>
23332330
<li>CUSTOM_MEDIA_RULE, <a href=#dom-cssrule-custom_media_rule title="section 11.2">11.2</a>
2334-
<li>&lt;custom-name&gt;, <a href=#typedef-custom-name title="section 11">11</a>
23352331
<li>device-aspect-ratio, <a href=#descdef-device-aspect-ratio title="section 4.7">4.7</a>
23362332
<li>device-height, <a href=#descdef-device-height title="section 4.6">4.6</a>
23372333
<li>device-width, <a href=#descdef-device-width title="section 4.5">4.5</a>

0 commit comments

Comments
 (0)