Skip to content

Commit 8cf34ad

Browse files
committed
[giow] (3) Handle foster-parenting of <math> and <svg> elements.
Affected topics: HTML Syntax and Parsing git-svn-id: http://svn.whatwg.org/webapps@8112 340c8d12-0b0e-0410-8428-c7bf67bfef74
1 parent 8b83514 commit 8cf34ad

File tree

3 files changed

+87
-51
lines changed

3 files changed

+87
-51
lines changed

complete.html

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89337,8 +89337,8 @@ <h5 id=creating-and-inserting-nodes><span class=secno>12.2.5.1 </span>Creating a
8933789337

8933889338
</ol><hr><!-- The names of these algorithms are kinda confusing; e.g. see the confusion in
8933989339
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
89340-
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
89341-
must run the following steps:</p>
89340+
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,
89341+
the user agent must run the following steps:</p>
8934289342

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

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

89375-
</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
89376-
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
89377-
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
89378-
elements</a> so that it is the new <a href=#current-node>current node</a>. If the newly created element has
89379-
an <code title="">xmlns</code> attribute in the <a href=#xmlns-namespace>XMLNS namespace</a> whose value is not
89380-
exactly the same as the element's namespace, that is a <a href=#parse-error>parse error</a>. Similarly, if the
89381-
newly created element has an <code title="">xmlns:xlink</code> attribute in the <a href=#xmlns-namespace>XMLNS
89382-
namespace</a> whose value is not the <a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse
89383-
error</a>.</p>
89384-
89385-
<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
89386-
inserting a node</a> algorithm); the <a href=#current-node>current node</a>, when the <a href=#insert-a-foreign-element>insert a
89387-
foreign element</a> algorithm is invoked, is always itself a non-HTML element.</p>
89388-
89389-
<p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
89375+
</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,
89376+
the user agent must run these steps:</p>
89377+
89378+
<ol><li><p>Let the <var title="">adjusted insertion location</var> be the <a href=#appropriate-place-for-inserting-a-node>appropriate
89379+
place for inserting a node</a>.</li>
89380+
89381+
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> in the given namespace, with the
89382+
intended parent being the element in which the <var title="">adjusted insertion location</var>
89383+
finds itself.</li>
89384+
89385+
<li><p>If the newly created element has an <code title="">xmlns</code> attribute in the
89386+
<a href=#xmlns-namespace>XMLNS namespace</a> whose value is not exactly the same as the element's namespace, that
89387+
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
89388+
<a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse error</a>.</li>
89389+
89390+
<li><p>If it is possible to insert an element at the <var title="">adjusted insertion
89391+
location</var>, then insert the newly created element at the <var title="">adjusted insertion
89392+
location</var>.</li>
89393+
89394+
<li><p>Push the element onto the <a href=#stack-of-open-elements>stack of open elements</a> so that it is the new
89395+
<a href=#current-node>current node</a>.</li>
89396+
89397+
<li><p>Return the newly created element.</li>
89398+
89399+
</ol><p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
8939089400
then, if the token has an attribute named <code title="">definitionurl</code>, change its name to
8939189401
<code title="">definitionURL</code> (note the case difference).</p>
8939289402

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

91594+
<!--CLEANUP-->
9158491595
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
9158591596
element</var> was created, in the <a href=#html-namespace-0>HTML namespace</a>, with <var title="">furthest block</var> as the intended
9158691597
parent.</li>

index

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89337,8 +89337,8 @@ dictionary <dfn id=storageeventinit>StorageEventInit</dfn> : <a href=#eventinit>
8933789337

8933889338
</ol><hr><!-- The names of these algorithms are kinda confusing; e.g. see the confusion in
8933989339
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
89340-
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
89341-
must run the following steps:</p>
89340+
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,
89341+
the user agent must run the following steps:</p>
8934289342

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

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

89375-
</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
89376-
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
89377-
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
89378-
elements</a> so that it is the new <a href=#current-node>current node</a>. If the newly created element has
89379-
an <code title="">xmlns</code> attribute in the <a href=#xmlns-namespace>XMLNS namespace</a> whose value is not
89380-
exactly the same as the element's namespace, that is a <a href=#parse-error>parse error</a>. Similarly, if the
89381-
newly created element has an <code title="">xmlns:xlink</code> attribute in the <a href=#xmlns-namespace>XMLNS
89382-
namespace</a> whose value is not the <a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse
89383-
error</a>.</p>
89384-
89385-
<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
89386-
inserting a node</a> algorithm); the <a href=#current-node>current node</a>, when the <a href=#insert-a-foreign-element>insert a
89387-
foreign element</a> algorithm is invoked, is always itself a non-HTML element.</p>
89388-
89389-
<p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
89375+
</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,
89376+
the user agent must run these steps:</p>
89377+
89378+
<ol><li><p>Let the <var title="">adjusted insertion location</var> be the <a href=#appropriate-place-for-inserting-a-node>appropriate
89379+
place for inserting a node</a>.</li>
89380+
89381+
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> in the given namespace, with the
89382+
intended parent being the element in which the <var title="">adjusted insertion location</var>
89383+
finds itself.</li>
89384+
89385+
<li><p>If the newly created element has an <code title="">xmlns</code> attribute in the
89386+
<a href=#xmlns-namespace>XMLNS namespace</a> whose value is not exactly the same as the element's namespace, that
89387+
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
89388+
<a href=#xlink-namespace>XLink Namespace</a>, that is a <a href=#parse-error>parse error</a>.</li>
89389+
89390+
<li><p>If it is possible to insert an element at the <var title="">adjusted insertion
89391+
location</var>, then insert the newly created element at the <var title="">adjusted insertion
89392+
location</var>.</li>
89393+
89394+
<li><p>Push the element onto the <a href=#stack-of-open-elements>stack of open elements</a> so that it is the new
89395+
<a href=#current-node>current node</a>.</li>
89396+
89397+
<li><p>Return the newly created element.</li>
89398+
89399+
</ol><p>When the steps below require the user agent to <dfn id=adjust-mathml-attributes>adjust MathML attributes</dfn> for a token,
8939089400
then, if the token has an attribute named <code title="">definitionurl</code>, change its name to
8939189401
<code title="">definitionURL</code> (note the case difference).</p>
8939289402

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

91594+
<!--CLEANUP-->
9158491595
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
9158591596
element</var> was created, in the <a href=#html-namespace-0>HTML namespace</a>, with <var title="">furthest block</var> as the intended
9158691597
parent.</li>

source

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99799,8 +99799,8 @@ dictionary <dfn>StorageEventInit</dfn> : <span>EventInit</span> {
9979999799
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18367
9980099800
Not sure what we could call them instead, though... -->
9980199801

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

9980599805
<ol>
9980699806

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

9984399843
<hr>
9984499844

99845-
<!--CLEANUP-->
99846-
<p>When the steps below require the UA to <dfn>insert a foreign element</dfn> for a token, the UA
99847-
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
99848-
this node to the <span>current node</span>, and push it onto the <span>stack of open
99849-
elements</span> so that it is the new <span>current node</span>. If the newly created element has
99850-
an <code title="">xmlns</code> attribute in the <span>XMLNS namespace</span> whose value is not
99851-
exactly the same as the element's namespace, that is a <span>parse error</span>. Similarly, if the
99852-
newly created element has an <code title="">xmlns:xlink</code> attribute in the <span>XMLNS
99853-
namespace</span> whose value is not the <span>XLink Namespace</span>, that is a <span>parse
99854-
error</span>.</p>
99855-
99856-
<p class="note">The <span>insert a foreign element</span> algorithm isn't affected by the <span
99857-
title="foster parent">foster parenting</span> logic (it doesn't use the <span>appropriate place for
99858-
inserting a node</span> algorithm); the <span>current node</span>, when the <span>insert a
99859-
foreign element</span> algorithm is invoked, is always itself a non-HTML element.</p>
99845+
<p>When the steps below require the user agent to <dfn>insert a foreign element</dfn> for a token,
99846+
the user agent must run these steps:</p>
99847+
99848+
<ol>
99849+
99850+
<li><p>Let the <var title="">adjusted insertion location</var> be the <span>appropriate
99851+
place for inserting a node</span>.</p></li>
99852+
99853+
<li><p><span>Create an element for the token</span> in the given namespace, with the
99854+
intended parent being the element in which the <var title="">adjusted insertion location</var>
99855+
finds itself.</p></li>
99856+
99857+
<li><p>If the newly created element has an <code title="">xmlns</code> attribute in the
99858+
<span>XMLNS namespace</span> whose value is not exactly the same as the element's namespace, that
99859+
is a <span>parse error</span>. Similarly, if the newly created element has an <code
99860+
title="">xmlns:xlink</code> attribute in the <span>XMLNS namespace</span> whose value is not the
99861+
<span>XLink Namespace</span>, that is a <span>parse error</span>.</p></li>
99862+
99863+
<li><p>If it is possible to insert an element at the <var title="">adjusted insertion
99864+
location</var>, then insert the newly created element at the <var title="">adjusted insertion
99865+
location</var>.</p></li>
99866+
99867+
<li><p>Push the element onto the <span>stack of open elements</span> so that it is the new
99868+
<span>current node</span>.</p></li>
99869+
99870+
<li><p>Return the newly created element.</p></li>
99871+
99872+
</ol>
9986099873

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

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

0 commit comments

Comments
 (0)