Skip to content

Commit

Permalink
[giow] (3) Handle foster-parenting of <math> and <svg> elements.
Browse files Browse the repository at this point in the history
Affected topics: HTML Syntax and Parsing

git-svn-id: http://svn.whatwg.org/webapps@8112 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 31, 2013
1 parent 8b83514 commit 8cf34ad
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 51 deletions.
45 changes: 28 additions & 17 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -89337,8 +89337,8 @@ <h5 id=creating-and-inserting-nodes><span class=secno>12.2.5.1 </span>Creating a

</ol><hr><!-- The names of these algorithms are kinda confusing; e.g. see the confusion in
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
Not sure what we could call them instead, though... --><p>When the steps below require the UA to <dfn id=insert-an-html-element>insert an HTML element</dfn> for a token, the UA
must run the following steps:</p>
Not sure what we could call them instead, though... --><p>When the steps below require the user agent to <dfn id=insert-an-html-element>insert an HTML element</dfn> for a token,
the user agent must run the following steps:</p>

<ol><li><p>Let the <var title="">adjusted insertion location</var> be the <a href=#appropriate-place-for-inserting-a-node>appropriate
place for inserting a node</a>.</li>
Expand Down Expand Up @@ -89372,21 +89372,31 @@ <h5 id=creating-and-inserting-nodes><span class=secno>12.2.5.1 </span>Creating a

<li><p>Return the newly created element.</li>

</ol><hr><!--CLEANUP--><p>When the steps below require the UA to <dfn id=insert-a-foreign-element>insert a foreign element</dfn> for a token, the UA
must first <a href=#create-an-element-for-the-token>create an element for the token</a> in the given namespace, with the <a href=#current-node>current node</a> as the intended parent, and then append
this node to the <a href=#current-node>current node</a>, and push it onto the <a href=#stack-of-open-elements>stack of open
elements</a> so that it is the new <a href=#current-node>current node</a>. If the newly created element has
an <code title="">xmlns</code> attribute in the <a href=#xmlns-namespace>XMLNS namespace</a> whose value is not
exactly the same as the element's namespace, that is a <a href=#parse-error>parse error</a>. Similarly, if the
newly created element has an <code title="">xmlns:xlink</code> attribute in the <a href=#xmlns-namespace>XMLNS
namespace</a> whose value is not the <a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse
error</a>.</p>

<p class=note>The <a href=#insert-a-foreign-element>insert a foreign element</a> algorithm isn't affected by the <a href=#foster-parent title="foster parent">foster parenting</a> logic (it doesn't use the <a href=#appropriate-place-for-inserting-a-node>appropriate place for
inserting a node</a> algorithm); the <a href=#current-node>current node</a>, when the <a href=#insert-a-foreign-element>insert a
foreign element</a> algorithm is invoked, is always itself a non-HTML element.</p>

<p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
</ol><hr><p>When the steps below require the user agent to <dfn id=insert-a-foreign-element>insert a foreign element</dfn> for a token,
the user agent must run these steps:</p>

<ol><li><p>Let the <var title="">adjusted insertion location</var> be the <a href=#appropriate-place-for-inserting-a-node>appropriate
place for inserting a node</a>.</li>

<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> in the given namespace, with the
intended parent being the element in which the <var title="">adjusted insertion location</var>
finds itself.</li>

<li><p>If the newly created element has an <code title="">xmlns</code> attribute in the
<a href=#xmlns-namespace>XMLNS namespace</a> whose value is not exactly the same as the element's namespace, that
is a <a href=#parse-error>parse error</a>. Similarly, if the newly created element has an <code title="">xmlns:xlink</code> attribute in the <a href=#xmlns-namespace>XMLNS namespace</a> whose value is not the
<a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse error</a>.</li>

<li><p>If it is possible to insert an element at the <var title="">adjusted insertion
location</var>, then insert the newly created element at the <var title="">adjusted insertion
location</var>.</li>

<li><p>Push the element onto the <a href=#stack-of-open-elements>stack of open elements</a> so that it is the new
<a href=#current-node>current node</a>.</li>

<li><p>Return the newly created element.</li>

</ol><p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
then, if the token has an attribute named <code title="">definitionurl</code>, change its name to
<code title="">definitionURL</code> (note the case difference).</p>

Expand Down Expand Up @@ -91581,6 +91591,7 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
<a href=#appropriate-place-for-inserting-a-node>appropriate place for inserting a node</a>, but using <var title="">common
ancestor</var> as the <i>override target</i>.</li>

<!--CLEANUP-->
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
element</var> was created, in the <a href=#html-namespace-0>HTML namespace</a>, with <var title="">furthest block</var> as the intended
parent.</li>
Expand Down
45 changes: 28 additions & 17 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -89337,8 +89337,8 @@ dictionary <dfn id=storageeventinit>StorageEventInit</dfn> : <a href=#eventinit>

</ol><hr><!-- The names of these algorithms are kinda confusing; e.g. see the confusion in
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
Not sure what we could call them instead, though... --><p>When the steps below require the UA to <dfn id=insert-an-html-element>insert an HTML element</dfn> for a token, the UA
must run the following steps:</p>
Not sure what we could call them instead, though... --><p>When the steps below require the user agent to <dfn id=insert-an-html-element>insert an HTML element</dfn> for a token,
the user agent must run the following steps:</p>

<ol><li><p>Let the <var title="">adjusted insertion location</var> be the <a href=#appropriate-place-for-inserting-a-node>appropriate
place for inserting a node</a>.</li>
Expand Down Expand Up @@ -89372,21 +89372,31 @@ dictionary <dfn id=storageeventinit>StorageEventInit</dfn> : <a href=#eventinit>

<li><p>Return the newly created element.</li>

</ol><hr><!--CLEANUP--><p>When the steps below require the UA to <dfn id=insert-a-foreign-element>insert a foreign element</dfn> for a token, the UA
must first <a href=#create-an-element-for-the-token>create an element for the token</a> in the given namespace, with the <a href=#current-node>current node</a> as the intended parent, and then append
this node to the <a href=#current-node>current node</a>, and push it onto the <a href=#stack-of-open-elements>stack of open
elements</a> so that it is the new <a href=#current-node>current node</a>. If the newly created element has
an <code title="">xmlns</code> attribute in the <a href=#xmlns-namespace>XMLNS namespace</a> whose value is not
exactly the same as the element's namespace, that is a <a href=#parse-error>parse error</a>. Similarly, if the
newly created element has an <code title="">xmlns:xlink</code> attribute in the <a href=#xmlns-namespace>XMLNS
namespace</a> whose value is not the <a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse
error</a>.</p>

<p class=note>The <a href=#insert-a-foreign-element>insert a foreign element</a> algorithm isn't affected by the <a href=#foster-parent title="foster parent">foster parenting</a> logic (it doesn't use the <a href=#appropriate-place-for-inserting-a-node>appropriate place for
inserting a node</a> algorithm); the <a href=#current-node>current node</a>, when the <a href=#insert-a-foreign-element>insert a
foreign element</a> algorithm is invoked, is always itself a non-HTML element.</p>

<p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
</ol><hr><p>When the steps below require the user agent to <dfn id=insert-a-foreign-element>insert a foreign element</dfn> for a token,
the user agent must run these steps:</p>

<ol><li><p>Let the <var title="">adjusted insertion location</var> be the <a href=#appropriate-place-for-inserting-a-node>appropriate
place for inserting a node</a>.</li>

<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> in the given namespace, with the
intended parent being the element in which the <var title="">adjusted insertion location</var>
finds itself.</li>

<li><p>If the newly created element has an <code title="">xmlns</code> attribute in the
<a href=#xmlns-namespace>XMLNS namespace</a> whose value is not exactly the same as the element's namespace, that
is a <a href=#parse-error>parse error</a>. Similarly, if the newly created element has an <code title="">xmlns:xlink</code> attribute in the <a href=#xmlns-namespace>XMLNS namespace</a> whose value is not the
<a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse error</a>.</li>

<li><p>If it is possible to insert an element at the <var title="">adjusted insertion
location</var>, then insert the newly created element at the <var title="">adjusted insertion
location</var>.</li>

<li><p>Push the element onto the <a href=#stack-of-open-elements>stack of open elements</a> so that it is the new
<a href=#current-node>current node</a>.</li>

<li><p>Return the newly created element.</li>

</ol><p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
then, if the token has an attribute named <code title="">definitionurl</code>, change its name to
<code title="">definitionURL</code> (note the case difference).</p>

Expand Down Expand Up @@ -91581,6 +91591,7 @@ document.body.appendChild(text);
<a href=#appropriate-place-for-inserting-a-node>appropriate place for inserting a node</a>, but using <var title="">common
ancestor</var> as the <i>override target</i>.</li>

<!--CLEANUP-->
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
element</var> was created, in the <a href=#html-namespace-0>HTML namespace</a>, with <var title="">furthest block</var> as the intended
parent.</li>
Expand Down
48 changes: 31 additions & 17 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -99799,8 +99799,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
Not sure what we could call them instead, though... -->

<p>When the steps below require the UA to <dfn>insert an HTML element</dfn> for a token, the UA
must run the following steps:</p>
<p>When the steps below require the user agent to <dfn>insert an HTML element</dfn> for a token,
the user agent must run the following steps:</p>

<ol>

Expand Down Expand Up @@ -99842,21 +99842,34 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {

<hr>

<!--CLEANUP-->
<p>When the steps below require the UA to <dfn>insert a foreign element</dfn> for a token, the UA
must first <span>create an element for the token</span> in the given namespace, with the <span>current node</span> as the intended parent, and then append
this node to the <span>current node</span>, and push it onto the <span>stack of open
elements</span> so that it is the new <span>current node</span>. If the newly created element has
an <code title="">xmlns</code> attribute in the <span>XMLNS namespace</span> whose value is not
exactly the same as the element's namespace, that is a <span>parse error</span>. Similarly, if the
newly created element has an <code title="">xmlns:xlink</code> attribute in the <span>XMLNS
namespace</span> whose value is not the <span>XLink Namespace</span>, that is a <span>parse
error</span>.</p>

<p class="note">The <span>insert a foreign element</span> algorithm isn't affected by the <span
title="foster parent">foster parenting</span> logic (it doesn't use the <span>appropriate place for
inserting a node</span> algorithm); the <span>current node</span>, when the <span>insert a
foreign element</span> algorithm is invoked, is always itself a non-HTML element.</p>
<p>When the steps below require the user agent to <dfn>insert a foreign element</dfn> for a token,
the user agent must run these steps:</p>

<ol>

<li><p>Let the <var title="">adjusted insertion location</var> be the <span>appropriate
place for inserting a node</span>.</p></li>

<li><p><span>Create an element for the token</span> in the given namespace, with the
intended parent being the element in which the <var title="">adjusted insertion location</var>
finds itself.</p></li>

<li><p>If the newly created element has an <code title="">xmlns</code> attribute in the
<span>XMLNS namespace</span> whose value is not exactly the same as the element's namespace, that
is a <span>parse error</span>. Similarly, if the newly created element has an <code
title="">xmlns:xlink</code> attribute in the <span>XMLNS namespace</span> whose value is not the
<span>XLink Namespace</span>, that is a <span>parse error</span>.</p></li>

<li><p>If it is possible to insert an element at the <var title="">adjusted insertion
location</var>, then insert the newly created element at the <var title="">adjusted insertion
location</var>.</p></li>

<li><p>Push the element onto the <span>stack of open elements</span> so that it is the new
<span>current node</span>.</p></li>

<li><p>Return the newly created element.</p></li>

</ol>

<p>When the steps below require the user agent to <dfn>adjust MathML attributes</dfn> for a token,
then, if the token has an attribute named <code title="">definitionurl</code>, change its name to
Expand Down Expand Up @@ -102299,6 +102312,7 @@ document.body.appendChild(text);
<span>appropriate place for inserting a node</span>, but using <var title="">common
ancestor</var> as the <i>override target</i>.</p></li>

<!--CLEANUP-->
<li><p><span>Create an element for the token</span> for which <var title="">formatting
element</var> was created, in the <span>HTML namespace</span>, with <var title="">furthest block</var> as the intended
parent.</p></li>
Expand Down

0 comments on commit 8cf34ad

Please sign in to comment.