[whatwg] Re: several messages
ian at hixie.ch
Thu Jul 1 07:06:21 PDT 2004
On Thu, 1 Jul 2004, Matthew Raymond wrote:
>> I intend to say that the content model of the <datalist> element is the
>> same as the content model of its parent with the addition that <option>
>> elements may be allowed as direct children, and that the <datalist>
>> element is allowed anywhere that the <select> element is.
> So it's kinda like the following:
> <div type="hidden" use_options_from_select="true">
> <!-- Whatever you want -->
> <select id="something"><!-- Options --></select>
> <!-- Whatever you want -->
Pretty much, in the typical case.
> I just want to limit the amount of new markup. If you'd prefer a
> specific element for hiding markup intended for legacy UAs [...]
While I agree we don't want to go overboard with new elements, I don't
think <datalist> is a bad thing to add. The semantic is new -- it's a list
of options that can be reused elsewhere; that semantic doesn't exist
anywhere in HTML at the moment. And we are reusing <option>, so it's not
like we're adding redundant elements.
That it hides markup intended for legacy UAs is just a fringe benefit,
IMHO. It's not its primary reason for existing.
>>> Furthermore, what happens if the <select> element doesn't have the
>>> same |name| as the <input>?
>> <datalist> is ignored by legacy UAs. So what happens is the same as if you
>> gave the markup to the UA without the <datalist> tags.
> No, I was talking about how WF2 UAs would handle it. I presume you
> mean that the options would be transferred to the <datalist>, and the
> <select> value would never be submitted. Yeah, I guess that's okay...
Yeah, the contents of the <datalist> are never successful for submission.
>>> Would it be valid in WF2 to include more than one <select> element in
>>> What happens if multiple <selects> have the same |name|.
>> Same as now.
> I presume you mean that, because the <select> elements are ignored in
> WF2 UAs, the options from different <select> elements just get dropped
> to the <datalist> level and lumped together.
Right (sorry, I thought you meant in legacy UAs). Yes, the <datalist>
would simply amalgamate all its descendant <option>s.
>> I don't see why. There's very little practical difference between <div
>> repeat="template" repeat-start="0"> and <datalist>.
> There's nothing about the name <datalist> that would tell me it
> would behave in the manner you describe
The manner being "list all the data"? Or the manner being "hide the
contents"? There's nothing about <select> that says it will hide the
contents either, nor is there anyting about <table> that says that
unexpected children will be placed at the top of the table.
My point being that the hiding behaviour is almost "error handling"
behaviour rather than any important part of the element's semantics.
And of course you _can_ just use a repetition template if you want, so
long as it contains the <select> element that your list="" attribute
points to. :-)
>> Why? Duplication seems error prone at best.
> It's a copy-paste, so it's less error prone than forgetting to put in a
> </datalist> tag. Worst case scenario is that the webmaster does a lot of
No, worse case scenario is that the author, when maintaining his site,
only updates one of them, and doesn't notice because he didn't test it in
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg