Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[cgiow] (1) Make the label required if <select required> is used with…
…out multiple='' or size=''. Also, make it possible for the label to be disabled, for legacy UAs (new UAs wouldn't let the user select the label).

git-svn-id: http://svn.whatwg.org/webapps@6039 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 28, 2011
1 parent d8d67d8 commit 92269e3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
18 changes: 12 additions & 6 deletions complete.html
Expand Up @@ -47312,16 +47312,22 @@ <h4 id=the-select-element><span class=secno>4.10.9 </span>The <dfn><code>select<

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1; and if the
<a href=#concept-option-value title=concept-option-value>value</a> of the first
<code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code> element's
<a href=#concept-select-option-list title=concept-select-option-list>list of options</a> (if
any) is the empty string, and that <code><a href=#the-option-element>option</a></code> is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, and, finally, that
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1;
and if the <a href=#concept-option-value title=concept-option-value>value</a> of the
first <code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code>
element's <a href=#concept-select-option-list title=concept-select-option-list>list of
options</a> (if any) is the empty string, and that
<code><a href=#the-option-element>option</a></code> element's parent node is the <code><a href=#the-select-element>select</a></code>
element (and not an <code><a href=#the-optgroup-element>optgroup</a></code> element), then that
<code><a href=#the-option-element>option</a></code> is the <code><a href=#the-select-element>select</a></code> element's
<dfn id=placeholder-label-option>placeholder label option</dfn>.</p>

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1,
then the <code><a href=#the-select-element>select</a></code> element must have a <a href=#placeholder-label-option>placeholder
label option</a>.</p>

<div class=impl>

<p><strong>Constraint validation</strong>: If the element has its
Expand All @@ -47330,7 +47336,7 @@ <h4 id=the-select-element><span class=secno>4.10.9 </span>The <dfn><code>select<
the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> have their
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true, or the only <code><a href=#the-option-element>option</a></code> element in the
<code>selected</code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true is the <a href=#placeholder-label-option>placeholder label option</a>, then the element
is <a href=#suffering-from-being-missing>suffering from being missing</a>.</p>
Expand Down
18 changes: 12 additions & 6 deletions index
Expand Up @@ -47335,16 +47335,22 @@ You cannot submit this form when the field is incorrect.</samp></pre>

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1; and if the
<a href=#concept-option-value title=concept-option-value>value</a> of the first
<code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code> element's
<a href=#concept-select-option-list title=concept-select-option-list>list of options</a> (if
any) is the empty string, and that <code><a href=#the-option-element>option</a></code> is not <a href=#concept-option-disabled title=concept-option-disabled>disabled</a>, and, finally, that
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1;
and if the <a href=#concept-option-value title=concept-option-value>value</a> of the
first <code><a href=#the-option-element>option</a></code> element in the <code><a href=#the-select-element>select</a></code>
element's <a href=#concept-select-option-list title=concept-select-option-list>list of
options</a> (if any) is the empty string, and that
<code><a href=#the-option-element>option</a></code> element's parent node is the <code><a href=#the-select-element>select</a></code>
element (and not an <code><a href=#the-optgroup-element>optgroup</a></code> element), then that
<code><a href=#the-option-element>option</a></code> is the <code><a href=#the-select-element>select</a></code> element's
<dfn id=placeholder-label-option>placeholder label option</dfn>.</p>

<p>If a <code><a href=#the-select-element>select</a></code> element has a <code title=attr-select-required><a href=#attr-select-required>required</a></code> attribute specified,
does not have a <code title=attr-select-multiple><a href=#attr-select-multiple>multiple</a></code>
attribute specified, and has a <a href=#concept-select-size title=concept-select-size>display size</a> of 1,
then the <code><a href=#the-select-element>select</a></code> element must have a <a href=#placeholder-label-option>placeholder
label option</a>.</p>

<div class=impl>

<p><strong>Constraint validation</strong>: If the element has its
Expand All @@ -47353,7 +47359,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
the <code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> have their
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true, or the only <code><a href=#the-option-element>option</a></code> element in the
<code>selected</code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<code><a href=#the-select-element>select</a></code> element's <a href=#concept-select-option-list title=concept-select-option-list>list of options</a> with its
<a href=#concept-option-selectedness title=concept-option-selectedness>selectedness</a> set to
true is the <a href=#placeholder-label-option>placeholder label option</a>, then the element
is <a href=#suffering-from-being-missing>suffering from being missing</a>.</p>
Expand Down
21 changes: 14 additions & 7 deletions source
Expand Up @@ -53085,17 +53085,24 @@ You cannot submit this form when the field is incorrect.</samp></pre>
title="attr-select-required">required</code> attribute specified,
does not have a <code title="attr-select-multiple">multiple</code>
attribute specified, and has a <span
title="concept-select-size">display size</span> of 1; and if the
<span title="concept-option-value">value</span> of the first
<code>option</code> element in the <code>select</code> element's
<span title="concept-select-option-list">list of options</span> (if
any) is the empty string, and that <code>option</code> is not <span
title="concept-option-disabled">disabled</span>, and, finally, that
title="concept-select-size">display size</span> of 1;
and if the <span title="concept-option-value">value</span> of the
first <code>option</code> element in the <code>select</code>
element's <span title="concept-select-option-list">list of
options</span> (if any) is the empty string, and that
<code>option</code> element's parent node is the <code>select</code>
element (and not an <code>optgroup</code> element), then that
<code>option</code> is the <code>select</code> element's
<dfn>placeholder label option</dfn>.</p>

<p>If a <code>select</code> element has a <code
title="attr-select-required">required</code> attribute specified,
does not have a <code title="attr-select-multiple">multiple</code>
attribute specified, and has a <span
title="concept-select-size">display size</span> of 1,
then the <code>select</code> element must have a <span>placeholder
label option</span>.</p>

<div class="impl">

<p><strong>Constraint validation</strong>: If the element has its
Expand All @@ -53105,7 +53112,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
title="concept-select-option-list">list of options</span> have their
<span title="concept-option-selectedness">selectedness</span> set to
true, or the only <code>option</code> element in the
<code>selected</code> element's <span
<code>select</code> element's <span
title="concept-select-option-list">list of options</span> with its
<span title="concept-option-selectedness">selectedness</span> set to
true is the <span>placeholder label option</span>, then the element
Expand Down

0 comments on commit 92269e3

Please sign in to comment.