Skip to content

Commit 06b76b7

Browse files
author
Simon Pieters
committed
[cssom-view] Associate MediaQueryList with a document so it stops working after navigation
1 parent fe5e6b5 commit 06b76b7

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

cssom-view/Overview.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<h1>CSSOM View Module</h1>
1818

19-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 20 November 2014</h2>
19+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 28 November 2014</h2>
2020

2121
<dl>
2222

@@ -83,7 +83,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
8383
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
8484
index at http://www.w3.org/TR/.</a></em>
8585

86-
<p>This is the 20 November 2014 Editor's Draft of CSSOM View. Please send
86+
<p>This is the 28 November 2014 Editor's Draft of CSSOM View. Please send
8787
comments to
8888
<a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
8989
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
@@ -529,7 +529,7 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
529529
};
530530

531531
partial interface <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> {
532-
<a href="#mediaquerylist">MediaQueryList</a> <a href="#dom-window-matchmedia" title="dom-Window-matchMedia">matchMedia</a>(DOMString query);
532+
[NewObject] <a href="#mediaquerylist">MediaQueryList</a> <a href="#dom-window-matchmedia" title="dom-Window-matchMedia">matchMedia</a>(DOMString query);
533533
[SameObject] readonly attribute <a href="#screen">Screen</a> <a href="#dom-window-screen" title="dom-Window-screen">screen</a>;
534534

535535
// browsing context
@@ -567,10 +567,11 @@ <h2 id="extensions-to-the-window-interface"><span class="secno">5 </span>Extensi
567567
<li><p>Let <var>parsed media query list</var> be the result of
568568
<a class="external" data-anolis-spec="cssom" href="http://dev.w3.org/csswg/cssom/#parse-a-media-query-list" title="parse a media query list">parsing</a>
569569
<var>query</var>.</li>
570-
<li><p>Return a <em>new</em> <code><a href="#mediaquerylist">MediaQueryList</a></code> object,
571-
associated with the <code class="external" data-anolis-spec="html"><a href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a></code> object, with
572-
<var>parsed media query list</var> as its associated
573-
media query list.</li>
570+
<li><p>Return a new <code><a href="#mediaquerylist">MediaQueryList</a></code> object,
571+
with the <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#context-object">context object</a>'s
572+
<a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-document-window" title="concept-document-window">associated <code title="">Document</code></a>
573+
as the <a href="#concept-mediaquerylist-document" title="concept-MediaQueryList-document">document</a>,
574+
with <var>parsed media query list</var> as its associated <a href="#media-query-list">media query list</a>.</li>
574575
</ol>
575576

576577
<p>The <dfn id="dom-window-screen" title="dom-Window-screen"><code>screen</code></dfn> attribute must return the <code><a href="#screen">Screen</a></code> object
@@ -851,15 +852,16 @@ <h4 id="the-features-argument-to-the-open()-method"><span class="secno">5.1 </sp
851852

852853
<h3 id="the-mediaquerylist-interface"><span class="secno">5.2 </span>The <code title="">MediaQueryList</code> Interface</h3>
853854

854-
<p>A <code><a href="#mediaquerylist">MediaQueryList</a></code> object has an associated media query list set on creation.</p>
855+
<p>A <code><a href="#mediaquerylist">MediaQueryList</a></code> object has an associated <dfn id="media-query-list">media query list</dfn>
856+
and an associated <dfn id="concept-mediaquerylist-document" title="concept-MediaQueryList-document">document</dfn> set on creation.</p>
855857

856858
<p>A <code><a href="#mediaquerylist">MediaQueryList</a></code> object has an associated <dfn id="concept-mediaquerylist-media" title="concept-MediaQueryList-media">media</dfn> which is the
857-
<a class="external" data-anolis-spec="cssom" href="http://dev.w3.org/csswg/cssom/#serialize-a-media-query-list" title="serialize a media query list">serialized</a> form of the associated media query list.</p>
859+
<a class="external" data-anolis-spec="cssom" href="http://dev.w3.org/csswg/cssom/#serialize-a-media-query-list" title="serialize a media query list">serialized</a> form of the associated <a href="#media-query-list">media query list</a>.</p>
858860

859861
<p>A <code><a href="#mediaquerylist">MediaQueryList</a></code> object has an associated <dfn id="concept-mediaquerylist-matches" title="concept-MediaQueryList-matches">matches state</dfn> which is
860-
true if the associated media query list matches the state of the rendered <code class="external" data-anolis-spec="dom"><a href="https://dom.spec.whatwg.org/#document">Document</a></code>, and false otherwise.</p>
862+
true if the associated <a href="#media-query-list">media query list</a> matches the state of the <a href="#concept-mediaquerylist-document" title="concept-MediaQueryList-document">document</a>, and false otherwise.</p>
861863

862-
<p>If the associated media query list changes in evaluation, the user agent must <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">queue a task</a> to run these steps:</p>
864+
<p>If the associated <a href="#media-query-list">media query list</a> changes in evaluation, the user agent must <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-task">queue a task</a> to run these steps:</p>
863865

864866
<ol>
865867

cssom-view/Overview.src.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
485485
};
486486

487487
partial interface <span data-anolis-spec=html>Window</span> {
488-
<span>MediaQueryList</span> <span title=dom-Window-matchMedia>matchMedia</span>(DOMString query);
488+
[NewObject] <span>MediaQueryList</span> <span title=dom-Window-matchMedia>matchMedia</span>(DOMString query);
489489
[SameObject] readonly attribute <span>Screen</span> <span title=dom-Window-screen>screen</span>;
490490

491491
// browsing context
@@ -523,10 +523,11 @@ <h2>Extensions to the <code title>Window</code> Interface</h2>
523523
<li><p>Let <var>parsed media query list</var> be the result of
524524
<span title='parse a media query list' data-anolis-spec=cssom>parsing</span>
525525
<var>query</var>.</p></li>
526-
<li><p>Return a <em>new</em> <code>MediaQueryList</code> object,
527-
associated with the <code data-anolis-spec=html>Window</code> object, with
528-
<var>parsed media query list</var> as its associated
529-
media query list.</p></li>
526+
<li><p>Return a new <code>MediaQueryList</code> object,
527+
with the <span data-anolis-spec=dom>context object</span>'s
528+
<span data-anolis-spec=html title=concept-document-window>associated <code title>Document</code></span>
529+
as the <span title=concept-MediaQueryList-document>document</span>,
530+
with <var>parsed media query list</var> as its associated <span>media query list</span>.</p></li>
530531
</ol>
531532

532533
<p>The <dfn title=dom-Window-screen><code>screen</code></dfn> attribute must return the <code>Screen</code> object
@@ -807,15 +808,16 @@ <h4>The <var>features</var> argument to the <code title>open()</code> method</h4
807808

808809
<h3>The <code title>MediaQueryList</code> Interface</h3>
809810

810-
<p>A <code>MediaQueryList</code> object has an associated media query list set on creation.</p>
811+
<p>A <code>MediaQueryList</code> object has an associated <dfn>media query list</dfn>
812+
and an associated <dfn title=concept-MediaQueryList-document>document</dfn> set on creation.</p>
811813

812814
<p>A <code>MediaQueryList</code> object has an associated <dfn title=concept-MediaQueryList-media>media</dfn> which is the
813-
<span title='serialize a media query list' data-anolis-spec=cssom>serialized</span> form of the associated media query list.</p>
815+
<span title='serialize a media query list' data-anolis-spec=cssom>serialized</span> form of the associated <span>media query list</span>.</p>
814816

815817
<p>A <code>MediaQueryList</code> object has an associated <dfn title=concept-MediaQueryList-matches>matches state</dfn> which is
816-
true if the associated media query list matches the state of the rendered <code data-anolis-spec=dom>Document</code>, and false otherwise.</p>
818+
true if the associated <span>media query list</span> matches the state of the <span title=concept-MediaQueryList-document>document</span>, and false otherwise.</p>
817819

818-
<p>If the associated media query list changes in evaluation, the user agent must <span data-anolis-spec=html>queue a task</span> to run these steps:</p>
820+
<p>If the associated <span>media query list</span> changes in evaluation, the user agent must <span data-anolis-spec=html>queue a task</span> to run these steps:</p>
819821

820822
<ol>
821823

0 commit comments

Comments
 (0)