annevk avatar annevk committed addc946

Comments (0)

Files changed (3)

 <!--end-logo-->
 </div>
  <h1>DOM4</h1>
- <h2 class="no-num no-toc" id="editor's-draft-3-april-2012">
-  <span class="w3conly">Editor's Draft 3 April 2012</span>
+ <h2 class="no-num no-toc" id="editor's-draft-5-april-2012">
+  <span class="w3conly">Editor's Draft 5 April 2012</span>
   </h2>
 
  <dl>
 <p class="dontpublish copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
 To the extent possible under law, the editors have waived all copyright and
 related or neighboring rights to this work. In addition, as of
-3 April 2012, the editors have made this specification available
+5 April 2012, the editors have made this specification available
 under the
 <a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
 which is available at
 interface <dfn id="mutationobserver">MutationObserver</dfn> {
   void <a href="#dom-mutationobserver-observe" title="dom-MutationObserver-observe">observe</a>(<a href="#node">Node</a> <var>target</var>, <a href="#mutationobserverinit">MutationObserverInit</a> <var>options</var>);
   void <a href="#dom-mutationobserver-disconnect" title="dom-MutationObserver-disconnect">disconnect</a>();
+  sequence&lt;<a href="#mutationrecord">MutationRecord</a>&gt; <a href="#dom-mutationobserver-takerecords" title="dom-MutationObserver-takeRecords">takeRecords</a>();
 };
 
-callback <dfn id="mutationcallback">MutationCallback</dfn> = void (<a href="#mutationrecord">MutationRecord</a>[] <var>mutations</var>, <a href="#mutationobserver">MutationObserver</a> <var>observer</var>);
+callback <dfn id="mutationcallback">MutationCallback</dfn> = void (sequence&lt;<a href="#mutationrecord">MutationRecord</a>&gt; <var>mutations</var>, <a href="#mutationobserver">MutationObserver</a> <var>observer</var>);
 
 dictionary <dfn id="mutationobserverinit">MutationObserverInit</dfn> {
   boolean <span title="dom-MutationObserverInit-childList">childList</span>;
 };</pre>
 
 <p>A <code><a href="#mutationobserver">MutationObserver</a></code> object can be used to observe mutations
-to  the <a href="#concept-tree" title="concept-tree">tree</a> of
+to the <a href="#concept-tree" title="concept-tree">tree</a> of
 <a href="#concept-node" title="concept-node">nodes</a>.
 
 <p>Each <code><a href="#mutationobserver">MutationObserver</a></code> object has these associated concepts:
  Until the <code title="dom-MutationObserver-observe"><a href="#dom-mutationobserver-observe">observe()</a></code> method
  is used again, <var title="">observer</var>'s
  <a href="#concept-mo-callback" title="concept-MO-callback">callback</a> will not be invoked.
+
+ <dt><code><var title="">observer</var> . <a href="#dom-mutationobserver-takerecords" title="dom-MutationObserver-takeRecords">takeRecords</a>()</code>
+ <dd><p>Empties the <a href="#concept-mo-queue" title="concept-MO-queue">record queue</a> and
+ returns what was in there.
 </dl>
 
 <p>The
 empty <a href="#context-object">context object</a>'s
 <a href="#concept-mo-queue" title="concept-MO-queue">record queue</a>.
 
+<p>The
+<dfn id="dom-mutationobserver-takerecords" title="dom-MutationObserver-takeRecords"><code>takeRecords()</code></dfn>
+method must return a copy of the
+<a href="#concept-mo-queue" title="concept-MO-queue">record queue</a> and then empty the
+<a href="#concept-mo-queue" title="concept-MO-queue">record queue</a>.
+
 
 <h4 id="interface-mutationrecord"><span class="secno">5.2.5 </span>Interface <code><a href="#mutationrecord">MutationRecord</a></code></h4>
 

Overview.src.html

 interface <dfn>MutationObserver</dfn> {
   void <span title=dom-MutationObserver-observe>observe</span>(<span>Node</span> <var>target</var>, <span>MutationObserverInit</span> <var>options</var>);
   void <span title=dom-MutationObserver-disconnect>disconnect</span>();
+  sequence&lt;<span>MutationRecord</span>> <span title=dom-MutationObserver-takeRecords>takeRecords</span>();
 };
 
-callback <dfn>MutationCallback</dfn> = void (<span>MutationRecord</span>[] <var>mutations</var>, <span>MutationObserver</span> <var>observer</var>);
+callback <dfn>MutationCallback</dfn> = void (sequence&lt;<span>MutationRecord</span>> <var>mutations</var>, <span>MutationObserver</span> <var>observer</var>);
 
 dictionary <dfn>MutationObserverInit</dfn> {
   boolean <span title=dom-MutationObserverInit-childList>childList</span>;
 };</pre>
 
 <p>A <code>MutationObserver</code> object can be used to observe mutations
-to  the <span title=concept-tree>tree</span> of
+to the <span title=concept-tree>tree</span> of
 <span title=concept-node>nodes</span>.
 
 <p>Each <code>MutationObserver</code> object has these associated concepts:
  Until the <code title=dom-MutationObserver-observe>observe()</code> method
  is used again, <var title>observer</var>'s
  <span title=concept-MO-callback>callback</span> will not be invoked.
+
+ <dt><code><var title>observer</var> . <span title=dom-MutationObserver-takeRecords>takeRecords</span>()</code>
+ <dd><p>Empties the <span title=concept-MO-queue>record queue</span> and
+ returns what was in there.
 </dl>
 
 <p>The
 empty <span>context object</span>'s
 <span title=concept-MO-queue>record queue</span>.
 
+<p>The
+<dfn title=dom-MutationObserver-takeRecords><code>takeRecords()</code></dfn>
+method must return a copy of the
+<span title=concept-MO-queue>record queue</span> and then empty the
+<span title=concept-MO-queue>record queue</span>.
+
 
 <h4>Interface <code>MutationRecord</code></h4>
 
 
 <div class="head">
 <h1>DOM4</h1>
- <h2 class="no-num no-toc" id="free-editor's-draft-3-april-2012">
-  <span class="now3c">Free Editor's Draft 3 April 2012</span>
+ <h2 class="no-num no-toc" id="free-editor's-draft-5-april-2012">
+  <span class="now3c">Free Editor's Draft 5 April 2012</span>
  </h2>
 
  <dl>
 <p class="dontpublish copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
 To the extent possible under law, the editors have waived all copyright and
 related or neighboring rights to this work. In addition, as of
-3 April 2012, the editors have made this specification available
+5 April 2012, the editors have made this specification available
 under the
 <a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
 which is available at
 interface <dfn id="mutationobserver">MutationObserver</dfn> {
   void <a href="#dom-mutationobserver-observe" title="dom-MutationObserver-observe">observe</a>(<a href="#node">Node</a> <var>target</var>, <a href="#mutationobserverinit">MutationObserverInit</a> <var>options</var>);
   void <a href="#dom-mutationobserver-disconnect" title="dom-MutationObserver-disconnect">disconnect</a>();
+  sequence&lt;<a href="#mutationrecord">MutationRecord</a>&gt; <a href="#dom-mutationobserver-takerecords" title="dom-MutationObserver-takeRecords">takeRecords</a>();
 };
 
-callback <dfn id="mutationcallback">MutationCallback</dfn> = void (<a href="#mutationrecord">MutationRecord</a>[] <var>mutations</var>, <a href="#mutationobserver">MutationObserver</a> <var>observer</var>);
+callback <dfn id="mutationcallback">MutationCallback</dfn> = void (sequence&lt;<a href="#mutationrecord">MutationRecord</a>&gt; <var>mutations</var>, <a href="#mutationobserver">MutationObserver</a> <var>observer</var>);
 
 dictionary <dfn id="mutationobserverinit">MutationObserverInit</dfn> {
   boolean <span title="dom-MutationObserverInit-childList">childList</span>;
 };</pre>
 
 <p>A <code><a href="#mutationobserver">MutationObserver</a></code> object can be used to observe mutations
-to  the <a href="#concept-tree" title="concept-tree">tree</a> of
+to the <a href="#concept-tree" title="concept-tree">tree</a> of
 <a href="#concept-node" title="concept-node">nodes</a>.
 
 <p>Each <code><a href="#mutationobserver">MutationObserver</a></code> object has these associated concepts:
  Until the <code title="dom-MutationObserver-observe"><a href="#dom-mutationobserver-observe">observe()</a></code> method
  is used again, <var title="">observer</var>'s
  <a href="#concept-mo-callback" title="concept-MO-callback">callback</a> will not be invoked.
+
+ <dt><code><var title="">observer</var> . <a href="#dom-mutationobserver-takerecords" title="dom-MutationObserver-takeRecords">takeRecords</a>()</code>
+ <dd><p>Empties the <a href="#concept-mo-queue" title="concept-MO-queue">record queue</a> and
+ returns what was in there.
 </dl>
 
 <p>The
 empty <a href="#context-object">context object</a>'s
 <a href="#concept-mo-queue" title="concept-MO-queue">record queue</a>.
 
+<p>The
+<dfn id="dom-mutationobserver-takerecords" title="dom-MutationObserver-takeRecords"><code>takeRecords()</code></dfn>
+method must return a copy of the
+<a href="#concept-mo-queue" title="concept-MO-queue">record queue</a> and then empty the
+<a href="#concept-mo-queue" title="concept-MO-queue">record queue</a>.
+
 
 <h4 id="interface-mutationrecord"><span class="secno">5.2.5 </span>Interface <code><a href="#mutationrecord">MutationRecord</a></code></h4>
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.