[whatwg] The examples of the list attribute of the input element is incorrect

On Wed, 6 Jan 2010, Futomi Hatano wrote:
> 
> There is a example which shows how to mark up fallback contents of the 
> datalist element.
> 
> <p>
>  <label>
>   Enter a breed:
>   <input type="text" name="breed" list="breeds">
>  </label>
>  <datalist id="breeds">
>   <label>
>    or select one from the list:
>    <select name="breed">
>     <option value=""> (none selected)
>     <option>Abyssinian
>     <option>Alpaca
>     <!-- ... -->
>    </select>
>   </label>
>  </datalist>
> </p>
> 
> I think that this example is incorrect. [...] But it does not work in 
> UAs which support the datalist element as expected (i.e. the suggests 
> are not shown.), because the option elements do not have a value 
> attribute.
>
> The spec says that a value attribute is required in the option element 
> for a suggestion. 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element

It doesn't say they have to have a value _attribute_, it says it has to 
have a value. "Value" in this context is defined:

   http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#concept-option-value

...as "The value of an option element is the value of the value attribute, 
if there is one, or the textContent of the element, if there isn't".

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 12 February 2010 04:28:31 UTC