Skip to content

Commit

Permalink
Editorial: refactor two algorithms to not use labels
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk authored and Alice Boxhall committed Jan 7, 2019
1 parent 0813ed6 commit a8368fa
Showing 1 changed file with 26 additions and 41 deletions.
67 changes: 26 additions & 41 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -55619,15 +55619,12 @@ fur
empty.</p></li>

<li>

<p><i>Loop</i>: For each element <var>field</var> in <var>controls</var>, in
<span>tree order</span>, run the following substeps:</p>
<p>For each element <var>field</var> in <var>controls</var>, in <span>tree order</span>:</p>

<ol>

<li>

<p>If any of the following conditions are met, then skip these substeps for this element:</p>
<p>If any of the following is true:</p>

<ul>

Expand Down Expand Up @@ -55660,23 +55657,19 @@ fur

</ul>

<p>Otherwise, process <var>field</var> as follows:</p>

<p>Then continue.</p>
</li>

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

<li>

<p>If the <var>field</var> element is an <code>input</code> element whose <code
data-x="attr-input-type">type</code> attribute is in the <span
data-x="attr-input-type-image">Image Button</span> state, then run these further nested
substeps:</p>
data-x="attr-input-type-image">Image Button</span> state, then:</p>

<ol>

<li><p>If the <var>field</var> element has a <code data-x="attr-fe-name">name</code>
attribute specified and its value is not the empty string, let <var>name</var> be
that value followed by a single U+002E FULL STOP character (.). Otherwise, let <var>name</var> be the empty string.</p></li>
Expand All @@ -55700,11 +55693,8 @@ fur
<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
<var>type</var>.</p></li>

<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
<i>end</i> step below.</p></li>

<li><p>Continue.</p></li>
</ol>

</li>

<li><p>Let <var>name</var> be the value of the <var>field</var> element's
Expand Down Expand Up @@ -55786,22 +55776,16 @@ fur
<code data-x="attr-input-type">type</code> attribute is in either the <span
data-x="attr-input-type-text">Text</span> state or the <span
data-x="attr-input-type-search">Search</span> state.</p>

</li>

</ol>

</li>

<li>

<p><i>End</i>: For the name of each entry in the <var>form data set</var>, and for the
value of each entry in the <var>form data set</var> whose type is not "<code
data-x="">file</code>" or "<code data-x="">textarea</code>", replace every occurrence of a U+000D
CARRIAGE RETURN (CR) character not followed by a U+000A LINE FEED (LF) character, and every
occurrence of a U+000A LINE FEED (LF) character not preceded by a U+000D CARRIAGE RETURN (CR)
character, by a two-character string consisting of a U+000D CARRIAGE RETURN U+000A LINE FEED
(CRLF) character pair.</p>
<p>For the name of each entry in the <var>form data set</var>, and for the value of each entry
in the <var>form data set</var> whose type is not "<code data-x="">file</code>" or "<code
data-x="">textarea</code>", replace every occurrence of U+000D (CR) not followed by U+000A (LF),
and every occurrence of U+000A (LF) not preceded by U+000D (CR), by a string consisting of a
U+000D (CR) and U+000A (LF).</p>

<p class="note">In the case of the <span data-x="concept-fe-value">value</span> of
<code>textarea</code> elements, this newline normalization is already performed during the
Expand All @@ -55810,7 +55794,6 @@ fur
wrapping). In the case of <code>input</code> elements <code data-x="attr-input-type">type</code>
attributes in the <span data-x="attr-input-type-file">File Upload</span> state, the value is not
normalized.</p>

</li>

<li><p>Replace the name of each entry in the <var>form data set</var>, and the value of each
Expand Down Expand Up @@ -69537,26 +69520,28 @@ Demos:
<span data-x="concept-ID">ID</span> <var>ID</var>, then add the first such element to
<var>pending</var>.</p></li>

<li><p><i>Loop</i>: If <var>pending</var> is empty, jump to the step labeled <i>end of
loop</i>.</p></li>

<li><p>Remove an element from <var>pending</var> and let <var>current</var> be
that element.</p></li>
<li>
<p>While <var>pending</var> is not empty:</p>

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

<li><p>Add <var>current</var> to <var>memory</var>.</p></li>
<li><p>If <var>current</var> is already in <var>memory</var>, there is a
<span>microdata error</span>; continue.</p></li>

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

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

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

<li><p><i>End of loop</i>: Sort <var>results</var> in <span>tree order</span>.</p></li>
<li><p>Sort <var>results</var> in <span>tree order</span>.</p></li>

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

Expand Down

0 comments on commit a8368fa

Please sign in to comment.