|
16 | 16 |
|
17 | 17 | <h1>CSSOM View Module</h1> |
18 | 18 |
|
19 | | - <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 28 November 2014</h2> |
| 19 | + <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 2 December 2014</h2> |
20 | 20 |
|
21 | 21 | <dl> |
22 | 22 |
|
@@ -83,7 +83,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2> |
83 | 83 | can be found in the <a href="http://www.w3.org/TR/">W3C technical reports |
84 | 84 | index at http://www.w3.org/TR/.</a></em> |
85 | 85 |
|
86 | | -<p>This is the 28 November 2014 Editor's Draft of CSSOM View. Please send |
| 86 | +<p>This is the 2 December 2014 Editor's Draft of CSSOM View. Please send |
87 | 87 | comments to |
88 | 88 | <a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a> |
89 | 89 | (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) |
@@ -861,20 +861,28 @@ <h3 id="the-mediaquerylist-interface"><span class="secno">5.2 </span>The <code t |
861 | 861 | <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 |
862 | 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> |
863 | 863 |
|
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> |
| 864 | +<!--XXX update the matches state when flushing layout (offsetWidth et al), without firing a change event. --> |
| 865 | + |
| 866 | +<p>When asked to <dfn id="evaluate-media-queries-and-report-changes">evaluate media queries and report changes</dfn> for a <code class="external" data-anolis-spec="dom"><a href="https://dom.spec.whatwg.org/#document">Document</a></code> <var>doc</var>, run these steps: |
865 | 867 |
|
866 | 868 | <ol> |
867 | 869 |
|
868 | | - <li><p>Let <var>target</var> be the <code><a href="#mediaquerylist">MediaQueryList</a></code> object.</li> |
| 870 | + <li> |
| 871 | + |
| 872 | + <p>For each <code><a href="#mediaquerylist">MediaQueryList</a></code> object <var>target</var> that has <var>doc</var> as its <a href="#concept-mediaquerylist-document" title="concept-MediaQueryList-document">document</a>, |
| 873 | + in the order they were created, oldest first, run these substeps: |
869 | 874 |
|
870 | | - <li><p>Let <var>event</var> be a new <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-event" title="concept-event">event</a> |
871 | | - using the <code><a href="#mediaquerylistevent">MediaQueryListEvent</a></code> interface, |
872 | | - with its <code class="external" data-anolis-spec="dom" title="dom-Event-type"><a href="https://dom.spec.whatwg.org/#dom-event-type">type</a></code> attribute initialized to <code title="">change</code>, |
873 | | - its <code class="external" data-anolis-spec="dom" title="dom-Event-isTrusted"><a href="https://dom.spec.whatwg.org/#dom-event-istrusted">isTrusted</a></code> attribute initialized to true, |
874 | | - its <code title="dom-MediaQueryListEvent-media"><a href="#dom-mediaquerylistevent-media">media</a></code> attribute initialized to <var>target</var>'s <a href="#concept-mediaquerylist-media" title="concept-MediaQueryList-media">media</a>, |
875 | | - and its <code title="dom-MediaQueryListEvent-matches"><a href="#dom-mediaquerylistevent-matches">matches</a></code> attribute initialized to <var>target</var>'s <a href="#concept-mediaquerylist-matches" title="concept-MediaQueryList-matches">matches state</a>. <!--fingerprint--></li> |
| 875 | + <ol> |
| 876 | + |
| 877 | + <li><p>If <var>target</var>'s <a href="#concept-mediaquerylist-matches" title="concept-MediaQueryList-matches">matches state</a> has changed since the last time these steps were run, |
| 878 | + <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-event-dispatch" title="concept-event-dispatch">dispatch</a> a new <a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-event" title="concept-event">event</a> to <var>target</var> |
| 879 | + using the <code><a href="#mediaquerylistevent">MediaQueryListEvent</a></code> interface, |
| 880 | + with its <code class="external" data-anolis-spec="dom" title="dom-Event-type"><a href="https://dom.spec.whatwg.org/#dom-event-type">type</a></code> attribute initialized to <code title="">change</code>, |
| 881 | + its <code class="external" data-anolis-spec="dom" title="dom-Event-isTrusted"><a href="https://dom.spec.whatwg.org/#dom-event-istrusted">isTrusted</a></code> attribute initialized to true, |
| 882 | + its <code title="dom-MediaQueryListEvent-media"><a href="#dom-mediaquerylistevent-media">media</a></code> attribute initialized to <var>target</var>'s <a href="#concept-mediaquerylist-media" title="concept-MediaQueryList-media">media</a>, |
| 883 | + and its <code title="dom-MediaQueryListEvent-matches"><a href="#dom-mediaquerylistevent-matches">matches</a></code> attribute initialized to <var>target</var>'s <a href="#concept-mediaquerylist-matches" title="concept-MediaQueryList-matches">matches state</a>. <!--fingerprint--> |
876 | 884 |
|
877 | | - <li><p><a class="external" data-anolis-spec="dom" href="https://dom.spec.whatwg.org/#concept-event-dispatch" title="concept-event-dispatch">Dispatch</a> <var>event</var> to <var>target</var>.</li> |
| 885 | + </ol> |
878 | 886 |
|
879 | 887 | </ol> |
880 | 888 |
|
|
0 commit comments