Skip to content

Commit 5d820b7

Browse files
committed
let everything use the same algorithm; remove dependency on MQ (still there via CSSOM though...)
1 parent 2dc193b commit 5d820b7

2 files changed

Lines changed: 26 additions & 32 deletions

File tree

cssom-view/Overview.html

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ <h3 id=css-pixels><span class=secno>2.3. </span>CSS pixels</h3>
304304
<p class=note>This does not apply to e.g. <a
305305
href="#dom-stylemedia-matchmedium"><code
306306
title=dom-StyleMedia-matchMedium>matchMedium()</code></a> as the units are
307-
explicitly given there and defined by the Media Queries specification.
308-
[<cite><a href="#ref-mq">MQ</a></cite>]
307+
explicitly given there.
309308

310309
<h2 id=dom-features><span class=secno>3. </span>DOM Features</h2>
311310

@@ -512,20 +511,25 @@ <h3 id=the-stylemedia-interface><span class=secno>4.1. </span>The <code
512511

513512
<p>The <dfn id=dom-stylemedia-matchmedium
514513
title=dom-StyleMedia-matchMedium><code>matchMedium(<var
515-
title="">medium</var>)</code></dfn> method, when invoked, <em
516-
class=ct>must</em> return the result of the following algorithm:</p>
517-
<!-- should use "parse a media query" -->
514+
title="">medium</var>)</code></dfn> method <em class=ct>must</em> run
515+
these steps:
518516

519517
<ol>
520518
<li>
521-
<p>If <var title="">medium</var> can be parsed according to the rules
522-
given in the Media Queries specification and matches the state of the
523-
rendered <a href="#document"><code>Document</code></a> return
524-
<code>true</code> and terminate this algorithm. [<cite><a
525-
href="#ref-mq">MQ</a></cite>]
519+
<p>Let <var title="">m</var> be the result of <a
520+
href="#parse-a-media-query" title="parse a media query">parsing</a> the
521+
given value.
522+
523+
<li>
524+
<p>If <var title="">m</var> is null terminate these steps.
526525

527526
<li>
528-
<p>Otherwise, return <code>false</code>.
527+
<p>If <var title="">m</var> matches the state of the rendered <a
528+
href="#document"><code>Document</code></a> return true and terminate
529+
this algorithm.
530+
531+
<li>
532+
<p>Otherwise, return false.
529533
</ol>
530534

531535
<div class=example>
@@ -1523,12 +1527,6 @@ <h2 class=no-num id=references>References</h2>
15231527
href="http://www.whatwg.org/specs/web-apps/current-work/">HTML5</a></cite>
15241528
(work in progress), I. Hickson. WHATWG.
15251529

1526-
<dt>[<dfn id=ref-mq>MQ</dfn>]
1527-
1528-
<dd><cite><a href="http://www.w3.org/TR/css3-mediaqueries/">Media
1529-
Queries</a></cite>, H. Wium Lie T. &Ccedil;elik, D. Glazman, A. van
1530-
Kesteren. W3C.
1531-
15321530
<dt>[<dfn id=ref-rfc2119>RFC2119</dfn>]
15331531

15341532
<dd><cite><a href="http://ietf.org/rfc/rfc2119">Key words for use in RFCs

cssom-view/Overview.src.html

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ <h3>CSS pixels</h3>
175175

176176
<p class="note">This does not apply to e.g.
177177
<code title="dom-StyleMedia-matchMedium">matchMedium()</code> as the units
178-
are explicitly given there and defined by the Media Queries specification.
179-
[<cite><span>MQ</span></cite>]</p>
178+
are explicitly given there.</p>
180179

181180

182181
<h2 id="dom-features">DOM Features</h2>
@@ -374,17 +373,19 @@ <h3 id="the-stylemedia-interface">The <code title="">StyleMedia</code> Interface
374373

375374
<p>The
376375
<dfn id="dom-stylemedia-matchmedium" title="dom-StyleMedia-matchMedium"><code>matchMedium(<var title="">medium</var>)</code></dfn>
377-
method, when invoked, <em class="ct">must</em> return the result of the
378-
following algorithm:</p>
379-
<!-- should use "parse a media query" -->
376+
method <em class="ct">must</em> run these steps:</p>
380377

381378
<ol>
382-
<li><p>If <var title="">medium</var> can be parsed according to the
383-
rules given in the Media Queries specification and matches the state of
384-
the rendered <code>Document</code> return <code>true</code> and terminate
385-
this algorithm. [<cite><span>MQ</span></cite>]</p></li>
379+
<li><p>Let <var title="">m</var> be the result of
380+
<span title="parse a media query">parsing</span> the given
381+
value.</p></li>
382+
383+
<li><p>If <var title="">m</var> is null terminate these steps.</p></li>
386384

387-
<li><p>Otherwise, return <code>false</code>.</p></li>
385+
<li><p>If <var title="">m</var> matches the state of the rendered
386+
<code>Document</code> return true and terminate this algorithm.</p></li>
387+
388+
<li><p>Otherwise, return false.</p></li>
388389
</ol>
389390

390391
<div class="example">
@@ -1309,11 +1310,6 @@ <h2 class="no-num">References</h2>
13091310
(work in progress), I. Hickson. W3C.</dd>
13101311
<dd><cite><a href="http://www.whatwg.org/specs/web-apps/current-work/">HTML5</a></cite>
13111312
(work in progress), I. Hickson. WHATWG.</dd>
1312-
1313-
<dt>[<dfn id="ref-mq">MQ</dfn>]</dt>
1314-
<dd><cite><a href="http://www.w3.org/TR/css3-mediaqueries/">Media
1315-
Queries</a></cite>, H. Wium Lie T. &Ccedil;elik, D. Glazman, A. van
1316-
Kesteren. W3C.</dd>
13171313

13181314
<dt>[<dfn id="ref-rfc2119">RFC2119</dfn>]</dt>
13191315
<dd><cite><a href="http://ietf.org/rfc/rfc2119">Key words for use in RFCs to

0 commit comments

Comments
 (0)