Skip to content

Commit 2432401

Browse files
annevkinikulin
authored andcommitted
Editorial: refactor two algorithms to not use labels
1 parent 76cf8a0 commit 2432401

File tree

1 file changed

+26
-41
lines changed

1 file changed

+26
-41
lines changed

source

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -55617,15 +55617,12 @@ fur
5561755617
empty.</p></li>
5561855618

5561955619
<li>
55620-
55621-
<p><i>Loop</i>: For each element <var>field</var> in <var>controls</var>, in
55622-
<span>tree order</span>, run the following substeps:</p>
55620+
<p>For each element <var>field</var> in <var>controls</var>, in <span>tree order</span>:</p>
5562355621

5562455622
<ol>
5562555623

5562655624
<li>
55627-
55628-
<p>If any of the following conditions are met, then skip these substeps for this element:</p>
55625+
<p>If any of the following is true:</p>
5562955626

5563055627
<ul>
5563155628

@@ -55658,23 +55655,19 @@ fur
5565855655

5565955656
</ul>
5566055657

55661-
<p>Otherwise, process <var>field</var> as follows:</p>
55662-
55658+
<p>Then continue.</p>
5566355659
</li>
5566455660

5566555661
<li><p>Let <var>type</var> be the value of the <code data-x="">type</code> IDL
5566655662
attribute of <var>field</var>.</p></li> <!-- if the field is an <object> element, this
5566755663
will get ignored. -->
5566855664

5566955665
<li>
55670-
5567155666
<p>If the <var>field</var> element is an <code>input</code> element whose <code
5567255667
data-x="attr-input-type">type</code> attribute is in the <span
55673-
data-x="attr-input-type-image">Image Button</span> state, then run these further nested
55674-
substeps:</p>
55668+
data-x="attr-input-type-image">Image Button</span> state, then:</p>
5567555669

5567655670
<ol>
55677-
5567855671
<li><p>If the <var>field</var> element has a <code data-x="attr-fe-name">name</code>
5567955672
attribute specified and its value is not the empty string, let <var>name</var> be
5568055673
that value followed by a single U+002E FULL STOP character (.). Otherwise, let <var>name</var> be the empty string.</p></li>
@@ -55698,11 +55691,8 @@ fur
5569855691
<li><p>Append an entry to the <var>form data set</var> with the name <var>name<sub>y</sub></var> and the value <var>y</var>, and the type
5569955692
<var>type</var>.</p></li>
5570055693

55701-
<li><p>Skip the remaining substeps for this element: if there are any more elements in <var>controls</var>, return to the top of the <i>loop</i> step, otherwise, jump to the
55702-
<i>end</i> step below.</p></li>
55703-
55694+
<li><p>Continue.</p></li>
5570455695
</ol>
55705-
5570655696
</li>
5570755697

5570855698
<li><p>Let <var>name</var> be the value of the <var>field</var> element's
@@ -55784,22 +55774,16 @@ fur
5578455774
<code data-x="attr-input-type">type</code> attribute is in either the <span
5578555775
data-x="attr-input-type-text">Text</span> state or the <span
5578655776
data-x="attr-input-type-search">Search</span> state.</p>
55787-
5578855777
</li>
55789-
5579055778
</ol>
55791-
5579255779
</li>
5579355780

5579455781
<li>
55795-
55796-
<p><i>End</i>: For the name of each entry in the <var>form data set</var>, and for the
55797-
value of each entry in the <var>form data set</var> whose type is not "<code
55798-
data-x="">file</code>" or "<code data-x="">textarea</code>", replace every occurrence of a U+000D
55799-
CARRIAGE RETURN (CR) character not followed by a U+000A LINE FEED (LF) character, and every
55800-
occurrence of a U+000A LINE FEED (LF) character not preceded by a U+000D CARRIAGE RETURN (CR)
55801-
character, by a two-character string consisting of a U+000D CARRIAGE RETURN U+000A LINE FEED
55802-
(CRLF) character pair.</p>
55782+
<p>For the name of each entry in the <var>form data set</var>, and for the value of each entry
55783+
in the <var>form data set</var> whose type is not "<code data-x="">file</code>" or "<code
55784+
data-x="">textarea</code>", replace every occurrence of U+000D (CR) not followed by U+000A (LF),
55785+
and every occurrence of U+000A (LF) not preceded by U+000D (CR), by a string consisting of a
55786+
U+000D (CR) and U+000A (LF).</p>
5580355787

5580455788
<p class="note">In the case of the <span data-x="concept-fe-value">value</span> of
5580555789
<code>textarea</code> elements, this newline normalization is already performed during the
@@ -55808,7 +55792,6 @@ fur
5580855792
wrapping). In the case of <code>input</code> elements <code data-x="attr-input-type">type</code>
5580955793
attributes in the <span data-x="attr-input-type-file">File Upload</span> state, the value is not
5581055794
normalized.</p>
55811-
5581255795
</li>
5581355796

5581455797
<li><p>Replace the name of each entry in the <var>form data set</var>, and the value of each
@@ -69535,26 +69518,28 @@ Demos:
6953569518
<span data-x="concept-ID">ID</span> <var>ID</var>, then add the first such element to
6953669519
<var>pending</var>.</p></li>
6953769520

69538-
<li><p><i>Loop</i>: If <var>pending</var> is empty, jump to the step labeled <i>end of
69539-
loop</i>.</p></li>
69540-
69541-
<li><p>Remove an element from <var>pending</var> and let <var>current</var> be
69542-
that element.</p></li>
69521+
<li>
69522+
<p>While <var>pending</var> is not empty:</p>
6954369523

69544-
<li><p>If <var>current</var> is already in <var>memory</var>, there is a
69545-
<span>microdata error</span>; return to the step labeled <i>loop</i>.</p></li>
69524+
<ol>
69525+
<li><p>Remove an element from <var>pending</var> and let <var>current</var> be that
69526+
element.</p></li>
6954669527

69547-
<li><p>Add <var>current</var> to <var>memory</var>.</p></li>
69528+
<li><p>If <var>current</var> is already in <var>memory</var>, there is a
69529+
<span>microdata error</span>; continue.</p></li>
6954869530

69549-
<li><p>If <var>current</var> does not have an <code
69550-
data-x="attr-itemscope">itemscope</code> attribute, then: add all the child elements of <var>current</var> to <var>pending</var>.</p></li>
69531+
<li><p>Add <var>current</var> to <var>memory</var>.</p></li>
6955169532

69552-
<li><p>If <var>current</var> has an <code data-x="attr-itemprop">itemprop</code>
69553-
attribute specified and has one or more <span>property names</span>, then add <var>current</var> to <var>results</var>.</p></li>
69533+
<li><p>If <var>current</var> does not have an <code data-x="attr-itemscope">itemscope</code>
69534+
attribute, then: add all the child elements of <var>current</var> to
69535+
<var>pending</var>.</p></li>
6955469536

69555-
<li><p>Return to the step labeled <i>loop</i>.</p></li>
69537+
<li><p>If <var>current</var> has an <code data-x="attr-itemprop">itemprop</code> attribute
69538+
specified and has one or more <span>property names</span>, then add <var>current</var> to
69539+
<var>results</var>.</p></li>
69540+
</ol>
6955669541

69557-
<li><p><i>End of loop</i>: Sort <var>results</var> in <span>tree order</span>.</p></li>
69542+
<li><p>Sort <var>results</var> in <span>tree order</span>.</p></li>
6955869543

6955969544
<li><p>Return <var>results</var>.</p></li>
6956069545

0 commit comments

Comments
 (0)