Skip to content

Commit 5dbc126

Browse files
annevkAlice Boxhall
authored and
Alice Boxhall
committed
Make attribute order not matter for <progress>
Fixes whatwg#3066.
1 parent 2a48284 commit 5dbc126

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

source

+22-19
Original file line numberDiff line numberDiff line change
@@ -51375,47 +51375,49 @@ interface <dfn>HTMLProgressElement</dfn> : <span>HTMLElement</span> {
5137551375

5137651376
<p>If the progress bar is a determinate progress bar, user agents must parse the <code
5137751377
data-x="attr-progress-value">value</code> attribute's value according to the <span>rules for
51378-
parsing floating-point number values</span>. If this does not result in an error, and if the
51379-
parsed value is less than the <span data-x="concept-progress-maximum">maximum value</span> and
51380-
greater than zero, then the <dfn data-x="concept-progress-value">current value</dfn> of the
51381-
progress bar is that parsed value. Otherwise, if the parsed value was greater than or equal to the
51382-
<span data-x="concept-progress-maximum">maximum value</span>, then the <span
51383-
data-x="concept-progress-value">current value</span> of the progress bar is the <span
51384-
data-x="concept-progress-maximum">maximum value</span> of the progress bar. Otherwise, if parsing
51385-
the <code data-x="attr-progress-value">value</code> attribute's value resulted in an error, or a
51386-
number less than or equal to zero, then the <span data-x="concept-progress-value">current
51387-
value</span> of the progress bar is zero.</p>
51378+
parsing floating-point number values</span>. If this does not result in an error and the parsed
51379+
value is greater than zero, then the <dfn data-x="concept-progress-value">value</dfn> of the
51380+
progress bar is that parsed value. Otherwise, if parsing the <code
51381+
data-x="attr-progress-value">value</code> attribute's value resulted in an error or a number less
51382+
than or equal to zero, then the <span data-x="concept-progress-value">value</span> of the progress
51383+
bar is zero.</p>
51384+
51385+
<p>If the progress bar is a determinate progress bar, then the <dfn
51386+
data-x="concept-progress-current-value">current value</dfn> is the <span
51387+
data-x="concept-progress-maximum">maximum value</span>, if <span
51388+
data-x="concept-progress-value">value</span> is greater than the <span
51389+
data-x="concept-progress-maximum">maximum value</span>, and <span
51390+
data-x="concept-progress-value">value</span> otherwise.</p>
5138851391

5138951392
<p><strong>UA requirements for showing the progress bar</strong>: When representing a
5139051393
<code>progress</code> element to the user, the UA should indicate whether it is a determinate or
5139151394
indeterminate progress bar, and in the former case, should indicate the relative position of the
51392-
<span data-x="concept-progress-value">current value</span> relative to the <span
51395+
<span data-x="concept-progress-current-value">current value</span> relative to the <span
5139351396
data-x="concept-progress-maximum">maximum value</span>.</p>
5139451397

5139551398
</div>
5139651399

5139751400
<dl class="domintro">
51398-
5139951401
<dt><var>progress</var> . <code subdfn data-x="dom-progress-position">position</code></dt>
5140051402

5140151403
<dd>
51402-
5140351404
<p>For a determinate progress bar (one with known current and maximum values), returns the
5140451405
result of dividing the current value by the maximum value.</p>
5140551406

5140651407
<p>For an indeterminate progress bar, returns &#x2212;1.</p>
51407-
5140851408
</dd>
51409-
5141051409
</dl>
5141151410

5141251411
<div w-nodev>
5141351412

51414-
<p>If the progress bar is an indeterminate progress bar, then the <dfn><code data-x="dom-progress-position">position</code></dfn> IDL attribute must return &#x2212;1.
51415-
Otherwise, it must return the result of dividing the <span data-x="concept-progress-value">current
51416-
value</span> by the <span data-x="concept-progress-maximum">maximum value</span>.</p>
51413+
<p>If the progress bar is an indeterminate progress bar, then the <dfn><code
51414+
data-x="dom-progress-position">position</code></dfn> IDL attribute must return &#x2212;1.
51415+
Otherwise, it must return the result of dividing the <span
51416+
data-x="concept-progress-current-value">current value</span> by the <span
51417+
data-x="concept-progress-maximum">maximum value</span>.</p>
5141751418

51418-
<p>If the progress bar is an indeterminate progress bar, then the <dfn><code data-x="dom-progress-value">value</code></dfn> IDL attribute, on getting, must return 0.
51419+
<p>If the progress bar is an indeterminate progress bar, then the <dfn><code
51420+
data-x="dom-progress-value">value</code></dfn> IDL attribute, on getting, must return 0.
5141951421
Otherwise, it must return the <span data-x="concept-progress-value">current value</span>. On
5142051422
setting, the given value must be converted to the <span>best representation of the number as a
5142151423
floating-point number</span> and then the <code data-x="dom-progress-value">value</code> content
@@ -120331,6 +120333,7 @@ INSERT INTERFACES HERE
120331120333
Jim Ley,
120332120334
Jim Meehan,
120333120335
Jim Michaels,
120336+
Jinjiang (勾三股四), <!-- GitHub -->
120334120337
Jirka Kosek,
120335120338
Jjgod Jiang,
120336120339
Jo&atilde;o Eiras,

0 commit comments

Comments
 (0)