Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giow] (2) The parser should have mutation observers.
Affected topics: HTML, HTML Syntax and Parsing

git-svn-id: http://svn.whatwg.org/webapps@7484 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 23, 2012
1 parent 963db9e commit b2a9286
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 93 deletions.
55 changes: 24 additions & 31 deletions complete.html
Expand Up @@ -92147,13 +92147,10 @@ <h4 id=tree-construction><span class=secno>12.2.5 </span><dfn>Tree construction<
<td>One <code><a href=#text>Text</a></code> node before the table, containing "A&nbsp;BC" (A-space-B-C), and one <code><a href=#text>Text</a></code> node inside the table (as a child of a <code><a href=#the-tbody-element>tbody</a></code>) with a single space character. (Space characters separated from non-space characters by non-character tokens are not affected by <a href=#foster-parent title="foster parent">foster parenting</a>, even if those other tokens then get ignored.)
</table></div>

<p id=mutation-during-parsing>DOM mutation events and mutation
observers must not fire for changes caused by the UA parsing the
document. (Conceptually, the parser is not mutating the DOM, it is
constructing it.) This includes the parsing of any content inserted
using <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> and
<code title=dom-document-writeln><a href=#dom-document-writeln>document.writeln()</a></code> calls.
<a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
<p id=mutation-during-parsing>DOM mutation events must not fire for changes caused by the UA
parsing the document. This includes the parsing of any content inserted using <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> and <code title=dom-document-writeln><a href=#dom-document-writeln>document.writeln()</a></code> calls. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>

<p>However, mutation observers <em>do</em> fire, as required by the DOM Core specification.</p>

<p class=note>Not all of the tag names mentioned below are
conformant tag names in this specification; many are included to
Expand Down Expand Up @@ -94365,6 +94362,8 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
<dt id=scriptEndTag>An end tag whose tag name is "script"</dt>
<dd>

<p><a href=#perform-a-microtask-checkpoint>Perform a microtask checkpoint</a>.</p>

<p><a href=#provide-a-stable-state>Provide a stable state</a>.</p>

<p>Let <var title="">script</var> be the <a href=#current-node>current node</a>
Expand Down Expand Up @@ -96884,17 +96883,14 @@ <h3 id=parsing-xhtml-documents><span class=secno>13.2 </span>Parsing XHTML docum
<code><a href=#document>Document</a></code> object when it is created, or creates one
implicitly.</p>

<p>This <code><a href=#document>Document</a></code> must then be populated with DOM nodes
that represent the tree structure of the input passed to the parser,
as defined by the XML specification, the Namespaces in XML
specification, and the DOM Core specification. DOM mutation events
must not fire for the operations that the <a href=#xml-parser>XML parser</a>
performs on the <code><a href=#document>Document</a></code>'s tree, but the user agent
must act as if elements and attributes were individually appended
and set respectively so as to trigger rules in this specification
regarding what happens when an element is inserted into a document
or has its attributes set. <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsDOMCORE>[DOMCORE]</a>
<a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
<p>This <code><a href=#document>Document</a></code> must then be populated with DOM nodes that represent the tree
structure of the input passed to the parser, as defined by the XML specification, the Namespaces
in XML specification, and the DOM Core specification. DOM mutation events must not fire for the
operations that the <a href=#xml-parser>XML parser</a> performs on the <code><a href=#document>Document</a></code>'s tree, but the
user agent must act as if elements and attributes were individually appended and set respectively
so as to trigger rules in this specification regarding what happens when an element is inserted
into a document or has its attributes set, and the DOM Core specification's requirements regarding
mutation observers mean that mutation observers <em>are</em> fired (unlike mutation events). <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsDOMCORE>[DOMCORE]</a> <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>

<p>Between the time an element's start tag is parsed and the time
either the element's end tag is parsed or the parser detects a
Expand Down Expand Up @@ -96933,17 +96929,14 @@ <h3 id=parsing-xhtml-documents><span class=secno>13.2 </span>Parsing XHTML docum
an interoperable fashion without requiring any network access for
handling external subsets. <a href=#refsXML>[XML]</a></p>

<p id=scriptTagXML>When an <a href=#xml-parser>XML parser</a> creates a
<code><a href=#the-script-element>script</a></code> element, it must be marked as being
<a href=#parser-inserted>"parser-inserted"</a> and its <a href=#force-async>"force-async"</a>
flag must be unset. If the parser was originally created for the
<a href=#xml-fragment-parsing-algorithm>XML fragment parsing algorithm</a>, then the element must
be marked as <a href=#already-started>"already started"</a> also. When the element's
end tag is parsed, the user agent must <a href=#provide-a-stable-state>provide a stable
state</a>, and then <a href=#prepare-a-script title="prepare a script">prepare</a>
the <code><a href=#the-script-element>script</a></code> element. If this causes there to be a
<a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>, then the user agent
must run the following steps:</p>
<p id=scriptTagXML>When an <a href=#xml-parser>XML parser</a> creates a <code><a href=#the-script-element>script</a></code> element, it
must be marked as being <a href=#parser-inserted>"parser-inserted"</a> and its <a href=#force-async>"force-async"</a> flag
must be unset. If the parser was originally created for the <a href=#xml-fragment-parsing-algorithm>XML fragment parsing
algorithm</a>, then the element must be marked as <a href=#already-started>"already started"</a> also. When the
element's end tag is parsed, the user agent must <a href=#perform-a-microtask-checkpoint>perform a microtask checkpoint</a>,
<a href=#provide-a-stable-state>provide a stable state</a>, and then <a href=#prepare-a-script title="prepare a script">prepare</a> the
<code><a href=#the-script-element>script</a></code> element. If this causes there to be a <a href=#pending-parsing-blocking-script>pending parsing-blocking
script</a>, then the user agent must run the following steps:</p>

<ol><li><p>Block this instance of the <a href=#xml-parser>XML parser</a>, such
that the <a href=#event-loop>event loop</a> will not run <a href=#concept-task title=concept-task>tasks</a> that invoke it.</li>
Expand Down Expand Up @@ -103234,8 +103227,8 @@ <h3 class=no-num id=elements-1>Elements</h3>
<code title=attr-tdth-colspan><a href=#attr-tdth-colspan>colspan</a></code>;
<code title=attr-tdth-rowspan><a href=#attr-tdth-rowspan>rowspan</a></code>;
<code title=attr-tdth-headers><a href=#attr-tdth-headers>headers</a></code>;
<code title=attr-th-scope><a href=#attr-th-scope>scope</a></code></td>;
<code title=attr-th-abbr><a href=#attr-th-abbr>abbr</a></code>
<code title=attr-th-scope><a href=#attr-th-scope>scope</a></code>;
<code title=attr-th-abbr><a href=#attr-th-abbr>abbr</a></code></td>
<td><code><a href=#htmltableheadercellelement>HTMLTableHeaderCellElement</a></code></td>
<tr><th><code><a href=#the-thead-element>thead</a></code></th>
<td>Group of heading rows in a table</td>
Expand Down
55 changes: 24 additions & 31 deletions index
Expand Up @@ -92147,13 +92147,10 @@ document.body.appendChild(text);
<td>One <code><a href=#text>Text</a></code> node before the table, containing "A&nbsp;BC" (A-space-B-C), and one <code><a href=#text>Text</a></code> node inside the table (as a child of a <code><a href=#the-tbody-element>tbody</a></code>) with a single space character. (Space characters separated from non-space characters by non-character tokens are not affected by <a href=#foster-parent title="foster parent">foster parenting</a>, even if those other tokens then get ignored.)
</table></div>

<p id=mutation-during-parsing>DOM mutation events and mutation
observers must not fire for changes caused by the UA parsing the
document. (Conceptually, the parser is not mutating the DOM, it is
constructing it.) This includes the parsing of any content inserted
using <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> and
<code title=dom-document-writeln><a href=#dom-document-writeln>document.writeln()</a></code> calls.
<a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
<p id=mutation-during-parsing>DOM mutation events must not fire for changes caused by the UA
parsing the document. This includes the parsing of any content inserted using <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> and <code title=dom-document-writeln><a href=#dom-document-writeln>document.writeln()</a></code> calls. <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>

<p>However, mutation observers <em>do</em> fire, as required by the DOM Core specification.</p>

<p class=note>Not all of the tag names mentioned below are
conformant tag names in this specification; many are included to
Expand Down Expand Up @@ -94365,6 +94362,8 @@ document.body.appendChild(text);
<dt id=scriptEndTag>An end tag whose tag name is "script"</dt>
<dd>

<p><a href=#perform-a-microtask-checkpoint>Perform a microtask checkpoint</a>.</p>

<p><a href=#provide-a-stable-state>Provide a stable state</a>.</p>

<p>Let <var title="">script</var> be the <a href=#current-node>current node</a>
Expand Down Expand Up @@ -96884,17 +96883,14 @@ document.body.appendChild(text);
<code><a href=#document>Document</a></code> object when it is created, or creates one
implicitly.</p>

<p>This <code><a href=#document>Document</a></code> must then be populated with DOM nodes
that represent the tree structure of the input passed to the parser,
as defined by the XML specification, the Namespaces in XML
specification, and the DOM Core specification. DOM mutation events
must not fire for the operations that the <a href=#xml-parser>XML parser</a>
performs on the <code><a href=#document>Document</a></code>'s tree, but the user agent
must act as if elements and attributes were individually appended
and set respectively so as to trigger rules in this specification
regarding what happens when an element is inserted into a document
or has its attributes set. <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsDOMCORE>[DOMCORE]</a>
<a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>
<p>This <code><a href=#document>Document</a></code> must then be populated with DOM nodes that represent the tree
structure of the input passed to the parser, as defined by the XML specification, the Namespaces
in XML specification, and the DOM Core specification. DOM mutation events must not fire for the
operations that the <a href=#xml-parser>XML parser</a> performs on the <code><a href=#document>Document</a></code>'s tree, but the
user agent must act as if elements and attributes were individually appended and set respectively
so as to trigger rules in this specification regarding what happens when an element is inserted
into a document or has its attributes set, and the DOM Core specification's requirements regarding
mutation observers mean that mutation observers <em>are</em> fired (unlike mutation events). <a href=#refsXML>[XML]</a> <a href=#refsXMLNS>[XMLNS]</a> <a href=#refsDOMCORE>[DOMCORE]</a> <a href=#refsDOMEVENTS>[DOMEVENTS]</a></p>

<p>Between the time an element's start tag is parsed and the time
either the element's end tag is parsed or the parser detects a
Expand Down Expand Up @@ -96933,17 +96929,14 @@ document.body.appendChild(text);
an interoperable fashion without requiring any network access for
handling external subsets. <a href=#refsXML>[XML]</a></p>

<p id=scriptTagXML>When an <a href=#xml-parser>XML parser</a> creates a
<code><a href=#the-script-element>script</a></code> element, it must be marked as being
<a href=#parser-inserted>"parser-inserted"</a> and its <a href=#force-async>"force-async"</a>
flag must be unset. If the parser was originally created for the
<a href=#xml-fragment-parsing-algorithm>XML fragment parsing algorithm</a>, then the element must
be marked as <a href=#already-started>"already started"</a> also. When the element's
end tag is parsed, the user agent must <a href=#provide-a-stable-state>provide a stable
state</a>, and then <a href=#prepare-a-script title="prepare a script">prepare</a>
the <code><a href=#the-script-element>script</a></code> element. If this causes there to be a
<a href=#pending-parsing-blocking-script>pending parsing-blocking script</a>, then the user agent
must run the following steps:</p>
<p id=scriptTagXML>When an <a href=#xml-parser>XML parser</a> creates a <code><a href=#the-script-element>script</a></code> element, it
must be marked as being <a href=#parser-inserted>"parser-inserted"</a> and its <a href=#force-async>"force-async"</a> flag
must be unset. If the parser was originally created for the <a href=#xml-fragment-parsing-algorithm>XML fragment parsing
algorithm</a>, then the element must be marked as <a href=#already-started>"already started"</a> also. When the
element's end tag is parsed, the user agent must <a href=#perform-a-microtask-checkpoint>perform a microtask checkpoint</a>,
<a href=#provide-a-stable-state>provide a stable state</a>, and then <a href=#prepare-a-script title="prepare a script">prepare</a> the
<code><a href=#the-script-element>script</a></code> element. If this causes there to be a <a href=#pending-parsing-blocking-script>pending parsing-blocking
script</a>, then the user agent must run the following steps:</p>

<ol><li><p>Block this instance of the <a href=#xml-parser>XML parser</a>, such
that the <a href=#event-loop>event loop</a> will not run <a href=#concept-task title=concept-task>tasks</a> that invoke it.</li>
Expand Down Expand Up @@ -103234,8 +103227,8 @@ if (s = prompt('What is your name?')) {
<code title=attr-tdth-colspan><a href=#attr-tdth-colspan>colspan</a></code>;
<code title=attr-tdth-rowspan><a href=#attr-tdth-rowspan>rowspan</a></code>;
<code title=attr-tdth-headers><a href=#attr-tdth-headers>headers</a></code>;
<code title=attr-th-scope><a href=#attr-th-scope>scope</a></code></td>;
<code title=attr-th-abbr><a href=#attr-th-abbr>abbr</a></code>
<code title=attr-th-scope><a href=#attr-th-scope>scope</a></code>;
<code title=attr-th-abbr><a href=#attr-th-abbr>abbr</a></code></td>
<td><code><a href=#htmltableheadercellelement>HTMLTableHeaderCellElement</a></code></td>
<tr><th><code><a href=#the-thead-element>thead</a></code></th>
<td>Group of heading rows in a table</td>
Expand Down

0 comments on commit b2a9286

Please sign in to comment.