HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/7009

SVNBugCommentTime (UTC)
7009[Gecko] [Internet Explorer] [Opera] [Webkit] Add support for MutationObservers. (Also, add a minor internal note in the canvas section unrelated to this.) (Also, automated update of the CLDR which resulted in removing separate support for el-POLYTON.)2012-02-29 21:24
Index: source
===================================================================
--- source	(revision 7008)
+++ source	(revision 7009)
@@ -2804,11 +2804,15 @@
      <li>The distinction between <dfn>XML documents</dfn> and <dfn>HTML documents</dfn></li>
      <li>The terms <dfn>quirks mode</dfn>, <dfn>limited-quirks mode</dfn>, and <dfn>no-quirks mode</dfn></li>
      <li>The algorithm to <dfn title="concept-node-clone">clone</dfn> a <code>Node</code>, and the concept of <dfn title="concept-node-clone-ext">cloning steps</dfn> used by that algorithm</li>
-     <li>The concept of <dfn>base URL change steps</dfn> and the definition of what happens when an element is <dfn>affected by a base URL change</dfn>.</li>
-     <li>The concept of an element's <dfn title="concept-id">unique identifier (ID)</dfn>.</li>
+     <li>The concept of <dfn>base URL change steps</dfn> and the definition of what happens when an element is <dfn>affected by a base URL change</dfn></li>
+     <li>The concept of an element's <dfn title="concept-id">unique identifier (ID)</dfn></li>
 
      <li>The concept of a DOM <dfn title="concept-range">range</dfn>.</li>
 
+     <li><dfn><code>MutationObserver</code></dfn> interface</li>
+     <li>The <dfn><code>MutationObserver</code> <var title="">scripting environment</var></dfn> concept</li>
+     <li>The <dfn title="concept-mo-invoke">invoke <code>MutationObserver</code> objects</dfn> algorith,</li>
+
     </ul>
 
     <p>The term <dfn>throw</dfn> in this specification is used as
@@ -42642,6 +42646,7 @@
    Jordan OSETE suggests:
     * support ways of extending the clipping region (union instead of intersection)
        - also "add", "subtract", "replace", "intersect" and "xor"
+       - maybe just support creating unions, intersections, and other -ions of paths
     * support ways of resetting the clipping region without save/restore
   -->
 
@@ -71885,9 +71890,22 @@
   is no <span>entry script</span>. It is changed by the <span>jump to
   a code entry-point</span> algorithm.</p>
 
-  <p class="note">There is at most one <span>event loop</span> per
-  <span>unit of related similar-origin browsing contexts</span>.</p>
+  <p>Each <span>unit of related similar-origin browsing
+  contexts</span> also has a <dfn>running mutation observers</dfn>
+  flag, which must initially be false. It is used to prevent reentrant
+  invocation of the algorithm to <span
+  title="concept-mo-invoke">invoke <code>MutationObserver</code>
+  objects</span>. For the purposes of <code>MutationObserver</code>
+  objects, each <span>unit of related similar-origin browsing
+  contexts</span> is a distinct <var title="MutationObserver scripting
+  environment">scripting environment</var>.</p>
 
+  <p class="note">There is also at most one <span>event loop</span>
+  per <span>unit of related similar-origin browsing contexts</span>
+  (though several <span title="unit of related similar-origin browsing
+  contexts">units of related similar-origin browsing contexts</span>
+  can have a shared <span>event loop</span>).</p>
+
   </div>
 
 
@@ -79247,6 +79265,8 @@
    <li><p>Set the <span>entry script</span> back to whatever it was
    when this algorithm started.</p></li>
 
+   <li><p><span>Perform a microtask checkpoint</span>.</p></li>
+
   </ol>
 
   <p>This algorithm is not invoked by one script calling another.</p>
@@ -79668,6 +79688,8 @@
 
    <li><p>Remove that task from its <span>task queue</span>.</p></li>
 
+   <li><p><span>Perform a microtask checkpoint</span>.</p></li>
+
    <li><p><span>Provide a stable state</span>.</p></li>
 
    <li><p>If necessary, update the rendering or user interface of any
@@ -79681,6 +79703,38 @@
 
   <hr>
 
+  <p>When a user agent is to <dfn>perform a microtask
+  checkpoint</dfn>, if the <var title="">running mutation
+  observers</var> flag is false, then the user agent must run the
+  following steps:</p>
+
+  <ol>
+
+   <li><p>Let <var title="">running mutation observers</var> be
+   true.</p></li>
+
+   <li>
+
+    <p><span title="concept-mo-invoke">Invoke
+    <code>MutationObserver</code> objects</span> for the <span>unit
+    of related similar-origin browsing contexts</span> to which the
+    <span>script's browsing context</span> belongs.</p>
+
+    <p class="note">This will typically fire scripted callbacks, which
+    calls the <span>jump to a code entry-point</span> algorithm, which
+    calls this <span>perform a microtask checkpoint</span> algorithm
+    again, which is why we use the <var>running mutation
+    observers</var> flag to avoid reentrancy.</p>
+
+   </li>
+
+   <li><p>Let <var title="">running mutation observers</var> be
+   false.</p></li>
+
+  </ol>
+
+  <hr>
+
   <p>When the user agent is to <dfn>provide a stable state</dfn>, if
   any asynchronously-running algorithms are <dfn title="await a stable
   state">awaiting a stable state</dfn>, then the user agent must run

|