[whatwg] Re: several messages

Ian Hickson ian at hixie.ch
Thu Jul 1 05:59:54 PDT 2004


On Thu, 1 Jul 2004, Matthew Raymond wrote:
>
> My big question for this example is: "What markup ISN'T allowed in
> the <datalist> element?"

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.


> Do you mean to tell me that you honestly believe people won't do the
> following?:
>
>     <datalist>
>       <p>
>         Your browser does not support Web Forms 2.0.
>         Please download a copy of MNGZilla
>         <a href="mngzilla.sf.net">here</a>.
>       <p>
>     </datalist>

No, of course they will do that. Just like they do:

   <h6>(c) copyright 1999 by I Don't Understand HTML</h6>

   <blockquote> Look at me, I'm indented. </blockquote>

   <p> I want some <cite>italic text</cite> </p>

   <div>this is paragraph 1<br><br>this is paragraph 2</div>

   <body><font size=7>header</font><br><font size=3>body text

The point is not that people won't abuse the markup, the point is that the
spec shouldn't _require_ that you abuse the markup in order to do the
right thing. This repetition templates have nothing to do with combo
boxes, they shouldn't be used to do them.


> Well, it's not exactly what they'd put in it, but the point is that
> <datalist> could be abused in a similar way to repetition blocks.

The difference being that it seemed you _wanted_ them to abuse repetition
blocks. :-)


> 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.


> Would it be valid in WF2 to include more than one <select> element in
> <datalist>?

Yes.


> What happens if multiple <selects> have the same |name|.

Same as now.


> Not that this approach couldn't work if it had specific limitations and
> rules. It's just that it seems to confusing for the web developers to be
> workable. On the other hand, using a repetition template is powerful but
> easy to understand. My example may have used it for an unintended
> purpose, but there is no confusion about what works in a repetition
> block and what doesn't.

I don't see why. There's very little practical difference between <div
repeat="template" repeat-start="0"> and <datalist>.


> On the other hand, I don't think I liked having my |list| property
> reference a <select> in a repetition template. I was exploring all the
> options, but that option raises too many question and just doesn't feel
> right to me. Better to duplicate the list contents.

Why? Duplication seems error prone at best.


> This sounds like we're making up complex markup rules for the webmasters
> to memorize. The <option> elements are supposed to be inside a <select>
> element, but only when dealing with legacy-UAs.

More to the point, <option> is allowed inside <select> if you want the
list to be available to legacy UAs, and <option> is also allowed inside
<datalist> if you don't mind the list not being visible to legacy UAs.


> You can use some elements inside <datalist>, like <label> and <select>,
> but not others.

You can use whatever elements you could use in its parent.


> You can use |data| to load options into a |select|, but not when
> the <select> is inside a <datalist>.

You can use |data| to prefill a <select> wherever it is.


> While my <cl> + repetition template solution was a bit longer and
> repeated the option list, it never introduced this many rules to keep
> track of.

I think it introduces the same number of rules, as far as I can tell.

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



More information about the whatwg mailing list