Skip to content

Commit 7e941ae

Browse files
Donovan Gloverdomenic
authored andcommitted
Editorial: always state invalid value default
Previously there was a rule that it fell back to the missing value default. This implicit behavior could be confusing, so instead we now state both for every enumerated attribute. Closes whatwg#173.
1 parent 4823cf5 commit 7e941ae

File tree

1 file changed

+43
-26
lines changed

1 file changed

+43
-26
lines changed

source

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4386,10 +4386,9 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
43864386
<p>When the attribute is specified, if its value is an <span>ASCII case-insensitive</span> match
43874387
for one of the given keywords then that keyword's state is the state that the attribute
43884388
represents. If the attribute value matches none of the given keywords, but the attribute has an
4389-
<i data-x="invalid value default">invalid value default</i>, then the attribute represents that state. Otherwise, if the
4390-
attribute value matches none of the keywords but there is a <i data-x="missing value default">missing value default</i> state
4391-
defined, then <em>that</em> is the state represented by the attribute. Otherwise, there is no
4392-
default, and invalid values mean that there is no state represented.</p>
4389+
<i data-x="invalid value default">invalid value default</i>, then the attribute represents that
4390+
state. Otherwise, there is no default, and invalid values mean that there is no state
4391+
represented.</p>
43934392

43944393
<p>When the attribute is <em>not</em> specified, if there is a <i data-x="missing value default">missing value default</i> state
43954394
defined, then that is the state represented by the (missing) attribute. Otherwise, the absence of
@@ -11771,8 +11770,9 @@ Transport Protocol">HTTP&lt;/abbr> today.&lt;/p></pre> <!-- DO NOT REWRAP THIS L
1177111770
<p>The attribute's keywords are the empty string, <code data-x="">yes</code>, and <code
1177211771
data-x="">no</code>. The empty string and the <code data-x="">yes</code> keyword map to the
1177311772
<i>yes</i> state. The <code data-x="">no</code> keyword maps to the <i>no</i> state. In addition,
11774-
there is a third state, the <i>inherit</i> state, which is the <i data-x="missing value default">missing value default</i> (and
11775-
the <i data-x="invalid value default">invalid value default</i>).</p>
11773+
there is a third state, the <i>inherit</i> state, which is the <i
11774+
data-x="missing value default">missing value default</i> and the <i
11775+
data-x="invalid value default">invalid value default</i>.</p>
1177611776

1177711777
<p>Each element (even non-HTML elements) has a <dfn>translation mode</dfn>, which is in either the
1177811778
<span>translate-enabled</span> state or the <span>no-translate</span> state. If an <span
@@ -33918,7 +33918,8 @@ interface <dfn>MediaError</dfn> {
3391833918

3391933919
<p>The empty string is also a valid keyword, and maps to the <span
3392033920
data-x="attr-media-preload-auto-state">Automatic</span> state. The attribute's <i data-x="missing
33921-
value default">missing value default</i> is user-agent defined, though the <span
33921+
value default">missing value default</i> and <i data-x="invalid value default">invalid value
33922+
default</i> are user-agent defined, though the <span
3392233923
data-x="attr-media-preload-metadata-state">Metadata</span> state is suggested as a compromise
3392333924
between reducing server load and providing an optimal user experience.</p>
3392433925

@@ -38717,7 +38718,8 @@ interface <dfn>HTMLAreaElement</dfn> : <span>HTMLElement</span> {
3871738718
<td w-nodev>Non-conforming
3871838719
</table>
3871938720

38720-
<p>The attribute may be omitted. The <i data-x="missing value default">missing value default</i> is the <span
38721+
<p>The attribute may be omitted. The <i data-x="missing value default">missing value default</i>
38722+
and <i data-x="invalid value default">invalid value default</i> are the <span
3872138723
data-x="attr-area-shape-rect">rectangle</span> state.</p>
3872238724

3872338725
<p>The <dfn><code data-x="attr-area-coords">coords</code></dfn> attribute must, if specified,
@@ -40720,8 +40722,9 @@ interface <dfn>HTMLTableCellElement</dfn> : <span>HTMLElement</span> {
4072040722

4072140723
</dl>
4072240724

40723-
<p>The <code data-x="attr-th-scope">scope</code> attribute's <i data-x="missing value default">missing value default</i> is the
40724-
<i>auto</i> state.</p>
40725+
<p>The <code data-x="attr-th-scope">scope</code> attribute's <i data-x="missing value
40726+
default">missing value default</i> and <i data-x="invalid value default">invalid value default</i>
40727+
are the <i>auto</i> state.</p>
4072540728

4072640729
<p>The <code>th</code> element may have an <dfn><code data-x="attr-th-abbr">abbr</code></dfn>
4072740730
content attribute specified. Its value must be an alternative label for the header cell, to be
@@ -42877,7 +42880,8 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
4287742880
data-x="attr-form-autocomplete-on-state">on</dfn> state, and the <dfn><code
4287842881
data-x="attr-form-autocomplete-off">off</code></dfn> keyword maps to the <dfn
4287942882
data-x="attr-form-autocomplete-off-state">off</dfn> state. The attribute may also be omitted. The
42880-
<i data-x="missing value default">missing value default</i> is the <span
42883+
<i data-x="missing value default">missing value default</i> and the <i
42884+
data-x="invalid value default">invalid value default</i> are the <span
4288142885
data-x="attr-form-autocomplete-on-state">on</span> state. The <span
4288242886
data-x="attr-form-autocomplete-off-state">off</span> state indicates that by default, form
4288342887
controls in the form will have their <span>autofill field name</span> set to "<code
@@ -43657,8 +43661,9 @@ interface <dfn>HTMLInputElement</dfn> : <span>HTMLElement</span> {
4365743661
<td> A button
4365843662
</table>
4365943663

43660-
<p>The <i data-x="missing value default">missing value default</i> is the <span data-x="attr-input-type-text">Text</span>
43661-
state.</p>
43664+
<p>The <i data-x="missing value default">missing value default</i> and the <i
43665+
data-x="invalid value default">invalid value default</i> are the <span
43666+
data-x="attr-input-type-text">Text</span> state.</p>
4366243667

4366343668
<p>Which of the
4366443669
<code data-x="attr-input-accept">accept</code>,
@@ -49666,8 +49671,9 @@ interface <dfn>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
4966649671
<td>Does nothing.
4966749672
</table>
4966849673

49669-
<p>The <i data-x="missing value default">missing value default</i> is the <span data-x="attr-button-type-submit-state">Submit
49670-
Button</span> state.</p>
49674+
<p>The <i data-x="missing value default">missing value default</i> and <i
49675+
data-x="invalid value default">invalid value default</i> are the <span
49676+
data-x="attr-button-type-submit-state">Submit Button</span> state.</p>
4967149677

4967249678
<p>If the <code data-x="attr-button-type">type</code> attribute is in the <span
4967349679
data-x="attr-button-type-submit-state">Submit Button</span> state, the element is specifically a
@@ -51003,8 +51009,9 @@ interface <dfn>HTMLTextAreaElement</dfn> : <span>HTMLElement</span> {
5100351009
<p>The <dfn><code data-x="attr-textarea-wrap">wrap</code></dfn> attribute is an <span>enumerated
5100451010
attribute</span> with two keywords and states: the <dfn><code data-x="attr-textarea-wrap-soft">soft</code></dfn> keyword which maps to the <span
5100551011
data-x="attr-textarea-wrap-soft-state">Soft</span> state, and the <dfn><code data-x="attr-textarea-wrap-hard">hard</code></dfn> keyword which maps to the <span
51006-
data-x="attr-textarea-wrap-hard-state">Hard</span> state. The <i data-x="missing value default">missing value default</i> is the
51007-
<span data-x="attr-textarea-wrap-soft-state">Soft</span> state.</p>
51012+
data-x="attr-textarea-wrap-hard-state">Hard</span> state. The <i data-x="missing value
51013+
default">missing value default</i> and <i data-x="invalid value default">invalid value default</i>
51014+
are the <span data-x="attr-textarea-wrap-soft-state">Soft</span> state.</p>
5100851015

5100951016
<p>The <dfn data-x="attr-textarea-wrap-soft-state">Soft</dfn> state indicates that the text in the
5101051017
<code>textarea</code> is not to be wrapped when it is submitted (though it can still be wrapped in
@@ -52768,7 +52775,9 @@ interface <dfn>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5276852775
<p>The <i data-x="invalid value default">invalid value default</i> for these attributes is the <span
5276952776
data-x="attr-fs-method-GET">GET</span> state. The <i data-x="missing value default">missing value default</i> for the <code
5277052777
data-x="attr-fs-method">method</code> attribute is also the <span
52771-
data-x="attr-fs-method-GET">GET</span> state. (There is no <i data-x="missing value default">missing value default</i> for the
52778+
data-x="attr-fs-method-GET">GET</span> state. (There is no <i
52779+
data-x="missing value default">missing value default</i> or <i
52780+
data-x="invalid value default">invalid value default</i> for the
5277252781
<code data-x="attr-fs-formmethod">formmethod</code> attribute.)</p>
5277352782

5277452783
<p>The <dfn data-x="concept-fs-method">method</dfn> of an element is one of those states. If the
@@ -52846,8 +52855,9 @@ interface <dfn>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5284652855
<p>The <i data-x="invalid value default">invalid value default</i> for these attributes is the <code
5284752856
data-x="attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</code> state. The <i data-x="missing value default">missing value default</i> for the <code data-x="attr-fs-enctype">enctype</code> attribute is also the <code
5284852857
data-x="attr-fs-enctype-urlencoded">application/x-www-form-urlencoded</code> state. (There is no
52849-
<i data-x="missing value default">missing value default</i> for the <code data-x="attr-fs-formenctype">formenctype</code>
52850-
attribute.)</p>
52858+
<i data-x="missing value default">missing value default</i> or <i
52859+
data-x="invalid value default">invalid value default</i> for the <code
52860+
data-x="attr-fs-formenctype">formenctype</code> attribute.)</p>
5285152861

5285252862
<p>The <dfn data-x="concept-fs-enctype">enctype</dfn> of an element is one of those three states.
5285352863
If the element is a <span data-x="concept-submit-button">submit button</span> and has a <code
@@ -73812,7 +73822,9 @@ addShortcutKeyLabel(document.getElementById('c'));</pre>
7381273822
<span>enumerated attribute</span> whose keywords are the empty string, <code data-x="">true</code>,
7381373823
and <code data-x="">false</code>. The empty string and the <code data-x="">true</code> keyword map
7381473824
to the <i>true</i> state. The <code data-x="">false</code> keyword maps to the <i>false</i> state.
73815-
In addition, there is a third state, the <i>inherit</i> state, which is the <i data-x="missing value default">missing value default</i> (and the <i data-x="invalid value default">invalid value default</i>).</p>
73825+
In addition, there is a third state, the <i>inherit</i> state, which is the <i
73826+
data-x="missing value default">missing value default</i> and the <i
73827+
data-x="invalid value default">invalid value default</i>.</p>
7381673828

7381773829
<p>The <i>true</i> state indicates that the element is editable. The <i>inherit</i> state
7381873830
indicates that the element is editable if its parent is. The <i>false</i> state indicates that the
@@ -74074,7 +74086,9 @@ body { display:none }
7407474086
attribute</span> whose keywords are the empty string, <code data-x="">true</code> and <code
7407574087
data-x="">false</code>. The empty string and the <code data-x="">true</code> keyword map to the
7407674088
<i>true</i> state. The <code data-x="">false</code> keyword maps to the <i>false</i> state. In
74077-
addition, there is a third state, the <i>default</i> state, which is the <i data-x="missing value default">missing value default</i> (and the <i data-x="invalid value default">invalid value default</i>).</p>
74089+
addition, there is a third state, the <i>default</i> state, which is the <i
74090+
data-x="missing value default">missing value default</i> and the <i
74091+
data-x="invalid value default">invalid value default</i>.</p>
7407874092

7407974093
<p class="note">The <i>true</i> state indicates that the element is to have its spelling and
7408074094
grammar checked. The <i>default</i> state indicates that the element is to act according to a
@@ -76643,7 +76657,8 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
7664376657
<span>enumerated attribute</span>. It has three states. The first state is <i>true</i> and it has
7664476658
the keyword <code data-x="">true</code>. The second state is <i>false</i> and it has the keyword
7664576659
<code data-x="">false</code>. The third state is <i>auto</i>; it has no keywords but it is the
76646-
<i data-x="missing value default">missing value default</i>.</p>
76660+
<i data-x="missing value default">missing value default</i> and the <i
76661+
data-x="invalid value default">invalid value default</i>.</p>
7664776662

7664876663
<p>The <i>true</i> state means the element is draggable; the <i>false</i> state means that it is
7664976664
not. The <i>auto</i> state uses the default behavior of the user agent.</p>
@@ -113755,7 +113770,8 @@ interface <dfn>HTMLMarqueeElement</dfn> : <span>HTMLElement</span> {
113755113770
<td><dfn data-x="attr-marquee-behavior-alternate">alternate</dfn>
113756113771
</table>
113757113772

113758-
<p>The <i data-x="missing value default">missing value default</i> is the <span
113773+
<p>The <i data-x="missing value default">missing value default</i> and <i
113774+
data-x="invalid value default">invalid value default</i> are the <span
113759113775
data-x="attr-marquee-behavior-scroll">scroll</span> state.</p>
113760113776

113761113777
<hr>
@@ -113784,8 +113800,9 @@ interface <dfn>HTMLMarqueeElement</dfn> : <span>HTMLElement</span> {
113784113800
<td><dfn data-x="attr-marquee-direction-down">down</dfn>
113785113801
</table>
113786113802

113787-
<p>The <i data-x="missing value default">missing value default</i> is the <span data-x="attr-marquee-direction-left">left</span>
113788-
state.</p>
113803+
<p>The <i data-x="missing value default">missing value default</i> and <i
113804+
data-x="invalid value default">invalid value default</i> are the <span
113805+
data-x="attr-marquee-direction-left">left</span> state.</p>
113789113806

113790113807
<hr>
113791113808

0 commit comments

Comments
 (0)