Skip to content

Commit 17308a5

Browse files
authored
Editorial: align fragment parsing algorithms with their parameter types
Invoke the HTML and XML fragment parsing algorithms separately, since they take different arguments. Also use 'parser scripting mode' for the HTML fragment parsing algorithms as the fragment parser sets the parsing mode to the 'Disabled' which is wider than the fragment parsing mode definition.
1 parent 508706c commit 17308a5

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

source

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125017,19 +125017,23 @@ enum <dfn enum>DOMParserSupportedType</dfn> {
125017125017

125018125018
<div algorithm>
125019125019
<p>The <dfn export>fragment parsing algorithm steps</dfn>, given an <code>Element</code>
125020-
<var>context</var>, a string <var>markup</var>, and an optional <span>fragment parser scripting
125021-
mode</span> <var>scriptingMode</var> (default <span data-x="scripting-mode-inert">Inert</span>),
125022-
are:</p>
125020+
<var>context</var>, a string <var>markup</var>, and an optional <span>parser scripting mode</span>
125021+
<var>scriptingMode</var> (default <span data-x="scripting-mode-inert">Inert</span>), are:</p>
125023125022

125024125023
<ol>
125025-
<li><p>Let <var>algorithm</var> be the <span>HTML fragment parsing algorithm</span>.</p></li>
125024+
<li><p><span>Assert</span>: <var>scriptingMode</var> is either <span
125025+
data-x="scripting-mode-inert">Inert</span> or <span
125026+
data-x="scripting-mode-fragment">Fragment</span>.
125027+
125028+
<li><p>Let <var>newChildren</var> be null.</p></li>
125026125029

125027125030
<li><p>If <var>context</var>'s <span>node document</span> is an <span data-x="XML documents">XML
125028-
document</span>, then set <var>algorithm</var> to the <span>XML fragment parsing
125029-
algorithm</span>.</p></li>
125031+
document</span>, then set <var>newChildren</var> to the result of invoking the <span>XML fragment
125032+
parsing algorithm</span> given <var>context</var> and <var>markup</var>.</p></li>
125030125033

125031-
<li><p>Let <var>newChildren</var> be the result of invoking <var>algorithm</var> given
125032-
<var>context</var>, <var>markup</var>, false, and <var>scriptingMode</var>.</p></li>
125034+
<li><p>Otherwise, set <var>newChildren</var> to the result of invoking the <span>HTML fragment
125035+
parsing algorithm</span> given <var>context</var>, <var>markup</var>, false, and
125036+
<var>scriptingMode</var>.</p></li>
125033125037

125034125038
<li><p>Let <var>fragment</var> be a new <code>DocumentFragment</code> whose <span>node
125035125039
document</span> is <var>context</var>'s <span>node document</span>.</p></li>
@@ -137780,10 +137784,6 @@ dictionary <dfn dictionary>StorageEventInit</dfn> : <span>EventInit</span> {
137780137784
data-x="dom-Range-createContextualFragment">createContextualFragment()</code>.</dd>
137781137785
</dl>
137782137786

137783-
<p>A <dfn>fragment parser scripting mode</dfn> is either <span
137784-
data-x="scripting-mode-inert">Inert</span> or <span
137785-
data-x="scripting-mode-fragment">Fragment</span>.</p>
137786-
137787137787
<p>The <dfn>frameset-ok flag</dfn> is set to "ok" when the parser is created. It is set to "not
137788137788
ok" after certain tokens are seen.</p>
137789137789

@@ -145690,7 +145690,7 @@ console.assert(container.firstChild instanceof SuperP);
145690145690
<p>The <dfn>HTML fragment parsing algorithm</dfn>, given an <code>Element</code> node <dfn
145691145691
data-x="concept-frag-parse-context"><var>context</var></dfn>, string <var>input</var>, an
145692145692
optional boolean <var>allowDeclarativeShadowRoots</var> (default false), and an optional
145693-
<span>fragment parser scripting mode</span> <var>scriptingMode</var> (default <span
145693+
<span>parser scripting mode</span> <var>scriptingMode</var> (default <span
145694145694
data-x="scripting-mode-inert">Inert</span>) is the following steps. They return a list of zero or
145695145695
more nodes.</p>
145696145696

@@ -145702,6 +145702,10 @@ console.assert(container.firstChild instanceof SuperP);
145702145702
handling this algorithm, then that is an error in the specification.</p>
145703145703

145704145704
<ol>
145705+
<li><p><span>Assert</span>: <var>scriptingMode</var> is either <span
145706+
data-x="scripting-mode-inert">Inert</span> or <span
145707+
data-x="scripting-mode-fragment">Fragment</span>.
145708+
145705145709
<li><p>Let <var>document</var> be a <code>Document</code> node whose <span
145706145710
data-x="concept-document-type">type</span> is "<code data-x="">html</code>".</p></li>
145707145711

0 commit comments

Comments
 (0)