Permalink
Browse files

[] (0) Revamp how the foreign lands are defined to make it easier to …

…add the U+0000 handling. This checkin should have no normative effect. If there are any normative changes in this patch, that's a bug, pleasel let me know ASAP.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=9659

git-svn-id: http://svn.whatwg.org/webapps@5563 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 30, 2010
1 parent 7d8c6fe commit 965728b784e9e21826a585dc50dad70488f9ff2a
Showing with 376 additions and 370 deletions.
  1. +120 −119 complete.html
  2. +120 −119 index
  3. +136 −132 source
@@ -214,7 +214,7 @@

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1>Web Applications 1.0</h1>
<h2 class="no-num no-toc">Draft Standard &mdash; 29 September 2010</h2>
<h2 class="no-num no-toc">Draft Standard &mdash; 30 September 2010</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -82953,7 +82953,29 @@ <h5 id=parsing-main-inselect><span class=secno>12.2.5.19 </span>The "<dfn title=
mode: in foreign content">in foreign content</a>", tokens must be
handled as follows:</p>

<dl class=switch><dt>A character token</dt>
<dl class=switch><dt>Any token, if the <a href=#current-node>current node</a> is an element in the <a href=#html-namespace-0>HTML namespace</a></dt>
<dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <a href=#current-node>current node</a> is a <a href=#mathml-text-integration-point>MathML text integration point</a></dt>
<dt>A start tag whose tag name is "svg", if the <a href=#current-node>current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is an <a href=#html-integration-point>HTML integration point</a></dt>
<dt>A character token, if the <a href=#current-node>current node</a> is an <a href=#html-integration-point>HTML integration point</a></dt>
<dt>An end-of-file token</dt>
<dd>

<ol><li><p>Process the token <a href=#using-the-rules-for>using the rules for</a> the
"<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>"
<a href=#insertion-mode>insertion mode</a>, except that if those rules say to
reprocess the token, these steps must be finished first (i.e. the
insertion mode is reset by the following step before the token is
reprocessed).</li>

<li><p>If, after doing so, the <a href=#insertion-mode>insertion mode</a> is
still "<a href=#parsing-main-inforeign title="insertion mode: in foreign content">in
foreign content</a>", <a href=#reset-the-insertion-mode-appropriately>reset the insertion mode
appropriately</a>.</li>

</ol></dd>

<dt>A character token</dt>
<dd>

<p><a href=#insert-a-character title="insert a character">Insert the token's
@@ -82978,107 +83000,6 @@ <h5 id=parsing-main-inselect><span class=secno>12.2.5.19 </span>The "<dfn title=
<p><a href=#parse-error>Parse error</a>. Ignore the token.</p>
</dd>

<dt id=scriptForeignEndTag>An end tag whose tag name is "script", if the <a href=#current-node>current node</a> is a <code title="">script</code> element in the <a href=#svg-namespace>SVG namespace</a></dt>
<dd>

<p>Pop the <a href=#current-node>current node</a> off the <a href=#stack-of-open-elements>stack of open
elements</a>.</p>

<p>Let the <var title="">old insertion point</var> have the
same value as the current <a href=#insertion-point>insertion point</a>. Let
the <a href=#insertion-point>insertion point</a> be just before the <a href=#next-input-character>next
input character</a>.</p>

<p>Increment the parser's <a href=#script-nesting-level>script nesting level</a> by
one. Set the <a href=#parser-pause-flag>parser pause flag</a> to true.</p>

<p><a href=http://www.w3.org/TR/SVGMobile12/script.html#ScriptContentProcessing>Process
the <code title="">script</code> element</a> according to the SVG
rules, if the user agent supports SVG. <a href=#refsSVG>[SVG]</a></p>

<p class=note>Even if this causes <a href=#dom-document-write title=dom-document-write>new characters to be inserted into the
tokenizer</a>, the parser will not be executed reentrantly,
since the <a href=#parser-pause-flag>parser pause flag</a> is true.</p>

<p>Decrement the parser's <a href=#script-nesting-level>script nesting level</a> by
one. If the parser's <a href=#script-nesting-level>script nesting level</a> is zero,
then set the <a href=#parser-pause-flag>parser pause flag</a> to false.</p>

<p>Let the <a href=#insertion-point>insertion point</a> have the value of the <var title="">old insertion point</var>. (In other words, restore the
<a href=#insertion-point>insertion point</a> to its previous value. This value
might be the "undefined" value.)</p>

</dd>

<dt>An end tag, if the <a href=#current-node>current node</a> is not an element in the <a href=#html-namespace-0>HTML namespace</a></dt>

<dd>

<p>Run these steps:</p>

<ol><li><p>Initialize <var title="">node</var> to be the <a href=#current-node>current
node</a> (the bottommost node of the stack).</li>

<li><p>If <var title="">node</var> is not an element with the
same tag name as the token, then this is a <a href=#parse-error>parse
error</a>.</li>

<li><p><i>Loop</i>: If <var title="">node</var>'s tag name,
<a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, is the same as as the
tag name of the token, pop elements from the <a href=#stack-of-open-elements>stack of open
elements</a> until <var title="">node</var> has been popped
from the stack, and then jump to the last step of this list of
steps.</li>

<li><p>Set <var title="">node</var> to the previous entry in the
<a href=#stack-of-open-elements>stack of open elements</a>.</li>

<li><p>If <var title="">node</var> is not an element in the
<a href=#html-namespace-0>HTML namespace</a>, return to the step labeled
<i>loop</i>.</li>

<li><p>Otherwise, process the token <a href=#using-the-rules-for>using the rules
for</a> the "<a href=#parsing-main-inbody title="insertion mode: in body">in
body</a>" <a href=#insertion-mode>insertion mode</a>, except that if those
rules say to reprocess the token, these steps must be finished
first (i.e. the insertion mode is reset by the following step
before the token is reprocessed).</li>

<li><p>If the <a href=#insertion-mode>insertion mode</a> is still "<a href=#parsing-main-inforeign title="insertion mode: in foreign content">in foreign
content</a>", <a href=#reset-the-insertion-mode-appropriately>reset the insertion mode
appropriately</a>.</li>

</ol></dd>

<dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <a href=#current-node>current node</a> is an <code title="">mi</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <a href=#current-node>current node</a> is an <code title="">mo</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <a href=#current-node>current node</a> is an <code title="">mn</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <a href=#current-node>current node</a> is an <code title="">ms</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if the <a href=#current-node>current node</a> is an <code title="">mtext</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag whose tag name is "svg", if the <a href=#current-node>current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a></dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title="">text/html</code>"</dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title="">application/xhtml+xml</code>"</dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is a <code title="">foreignObject</code> element in the <a href=#svg-namespace>SVG namespace</a></dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is a <code title="">desc</code> element in the <a href=#svg-namespace>SVG namespace</a></dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is a <code title="">title</code> element in the <a href=#svg-namespace>SVG namespace</a></dt>
<dt>A start tag, if the <a href=#current-node>current node</a> is an element in the <a href=#html-namespace-0>HTML namespace</a></dt>
<dt>Any other end tag</dt>
<dd>

<ol><li><p>Process the token <a href=#using-the-rules-for>using the rules for</a> the
"<a href=#parsing-main-inbody title="insertion mode: in body">in body</a>"
<a href=#insertion-mode>insertion mode</a>, except that if those rules say to
reprocess the token, these steps must be finished first (i.e. the
insertion mode is reset by the following step before the token is
reprocessed).</li>

<li><p>If, after doing so, the <a href=#insertion-mode>insertion mode</a> is
still "<a href=#parsing-main-inforeign title="insertion mode: in foreign content">in
foreign content</a>", <a href=#reset-the-insertion-mode-appropriately>reset the insertion mode
appropriately</a>.</li>

</ol></dd>

<dt>A start tag whose tag name is one of: <!--"a",--> "b", "big",
"blockquote", "body"<!--by inspection-->, "br", "center", "code",
"dd", "div", "dl", "dt"<!-- so that dd and dt can be handled
@@ -83098,27 +83019,19 @@ <h5 id=parsing-main-inselect><span class=secno>12.2.5.19 </span>The "<dfn title=
attributes named "color", "face", or "size"</dt> <!-- the
attributes here are required so that SVG <font> will go through as
SVG but legacy <font>s won't -->
<dt>An end-of-file token</dt> <dd>

<dd>

<p><a href=#parse-error>Parse error</a>.</p>

<p>Pop an element from the <a href=#stack-of-open-elements>stack of open elements</a>,
and then keep popping more elements from the <a href=#stack-of-open-elements>stack of open
elements</a> until the <a href=#current-node>current node</a> is one of the
following:</p>
elements</a> until the <a href=#current-node>current node</a> is a
<a href=#mathml-text-integration-point>MathML text integration point</a>, an <a href=#html-integration-point>HTML
integration point</a>, or an element in the <a href=#html-namespace-0>HTML
namespace</a>.</p>

<ul class=brief><li>an <code title="">mi</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>an <code title="">mo</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>an <code title="">mn</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>an <code title="">ms</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>an <code title="">mtext</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>an <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>a <code title="">foreignObject</code> element in the <a href=#svg-namespace>SVG namespace</a></li>
<li>a <code title="">desc</code> element in the <a href=#svg-namespace>SVG namespace</a></li>
<li>a <code title="">title</code> element in the <a href=#svg-namespace>SVG namespace</a></li>
<li>an element in the <a href=#html-namespace-0>HTML namespace</a></li>

</ul><p>Then, <a href=#reset-the-insertion-mode-appropriately>reset the insertion mode appropriately</a> and
<p>Then, <a href=#reset-the-insertion-mode-appropriately>reset the insertion mode appropriately</a> and
reprocess the token.</p>

</dd>
@@ -83195,7 +83108,95 @@ <h5 id=parsing-main-inselect><span class=secno>12.2.5.19 </span>The "<dfn title=

</dd>

</dl><h5 id=parsing-main-afterbody><span class=secno>12.2.5.22 </span>The "<dfn title="insertion mode: after body">after body</dfn>" insertion mode</h5>
<dt id=scriptForeignEndTag>An end tag whose tag name is "script", if the <a href=#current-node>current node</a> is a <code title="">script</code> element in the <a href=#svg-namespace>SVG namespace</a></dt>
<dd>

<p>Pop the <a href=#current-node>current node</a> off the <a href=#stack-of-open-elements>stack of open
elements</a>.</p>

<p>Let the <var title="">old insertion point</var> have the
same value as the current <a href=#insertion-point>insertion point</a>. Let
the <a href=#insertion-point>insertion point</a> be just before the <a href=#next-input-character>next
input character</a>.</p>

<p>Increment the parser's <a href=#script-nesting-level>script nesting level</a> by
one. Set the <a href=#parser-pause-flag>parser pause flag</a> to true.</p>

<p><a href=http://www.w3.org/TR/SVGMobile12/script.html#ScriptContentProcessing>Process
the <code title="">script</code> element</a> according to the SVG
rules, if the user agent supports SVG. <a href=#refsSVG>[SVG]</a></p>

<p class=note>Even if this causes <a href=#dom-document-write title=dom-document-write>new characters to be inserted into the
tokenizer</a>, the parser will not be executed reentrantly,
since the <a href=#parser-pause-flag>parser pause flag</a> is true.</p>

<p>Decrement the parser's <a href=#script-nesting-level>script nesting level</a> by
one. If the parser's <a href=#script-nesting-level>script nesting level</a> is zero,
then set the <a href=#parser-pause-flag>parser pause flag</a> to false.</p>

<p>Let the <a href=#insertion-point>insertion point</a> have the value of the <var title="">old insertion point</var>. (In other words, restore the
<a href=#insertion-point>insertion point</a> to its previous value. This value
might be the "undefined" value.)</p>

</dd>

<dt>Any other end tag</dt>

<dd>

<p>Run these steps:</p>

<ol><li><p>Initialize <var title="">node</var> to be the <a href=#current-node>current
node</a> (the bottommost node of the stack).</li>

<li><p>If <var title="">node</var> is not an element with the
same tag name as the token, then this is a <a href=#parse-error>parse
error</a>.</li>

<li><p><i>Loop</i>: If <var title="">node</var>'s tag name,
<a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, is the same as as the
tag name of the token, pop elements from the <a href=#stack-of-open-elements>stack of open
elements</a> until <var title="">node</var> has been popped
from the stack, and then jump to the last step of this list of
steps.</li>

<li><p>Set <var title="">node</var> to the previous entry in the
<a href=#stack-of-open-elements>stack of open elements</a>.</li>

<li><p>If <var title="">node</var> is not an element in the
<a href=#html-namespace-0>HTML namespace</a>, return to the step labeled
<i>loop</i>.</li>

<li><p>Otherwise, process the token <a href=#using-the-rules-for>using the rules
for</a> the "<a href=#parsing-main-inbody title="insertion mode: in body">in
body</a>" <a href=#insertion-mode>insertion mode</a>, except that if those
rules say to reprocess the token, these steps must be finished
first (i.e. the insertion mode is reset by the following step
before the token is reprocessed).</li>

<li><p>If the <a href=#insertion-mode>insertion mode</a> is still "<a href=#parsing-main-inforeign title="insertion mode: in foreign content">in foreign
content</a>", <a href=#reset-the-insertion-mode-appropriately>reset the insertion mode
appropriately</a>.</li>

</ol></dd>

</dl><p>The <a href=#current-node>current node</a> is a <dfn id=mathml-text-integration-point>MathML text
integration point</dfn> if it is one of the following elements:</p>

<ul class=brief><li>An <code title="">mi</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>An <code title="">mo</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>An <code title="">mn</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>An <code title="">ms</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
<li>An <code title="">mtext</code> element in the <a href=#mathml-namespace>MathML namespace</a></li>
</ul><p>The <a href=#current-node>current node</a> is an <dfn id=html-integration-point>HTML
integration point</dfn> if it is one of the following elements:</p>

<ul class=brief><li>An <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title="">text/html</code>"</li>
<li>An <code title="">annotation-xml</code> element in the <a href=#mathml-namespace>MathML namespace</a> whose start tag token had an attribute with the name "encoding" whose value was an <a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string "<code title="">application/xhtml+xml</code>"</li>
<li>A <code title="">foreignObject</code> element in the <a href=#svg-namespace>SVG namespace</a></li>
<li>A <code title="">desc</code> element in the <a href=#svg-namespace>SVG namespace</a></li>
<li>A <code title="">title</code> element in the <a href=#svg-namespace>SVG namespace</a></li>
</ul><h5 id=parsing-main-afterbody><span class=secno>12.2.5.22 </span>The "<dfn title="insertion mode: after body">after body</dfn>" insertion mode</h5>

<p>When the <a href=#insertion-mode>insertion mode</a> is "<a href=#parsing-main-afterbody title="insertion
mode: after body">after body</a>", tokens must be handled as follows:</p>
Oops, something went wrong.

0 comments on commit 965728b

Please sign in to comment.