[whatwg] [wf2] Restrict template attributes to only fieldset, tr, and li?

On Mon, 12 Dec 2005, dolphinling wrote:
>
> Okay, it still bugs me that template attributes apply to all elements 
> when I think they should only apply to fieldsets. I do realize though 
> that because of backwards compatibility and because in current browsers 
> there are places fieldset can't go, this is impossible.
> 
> However, could it be made so the template attributes only apply to 
> fieldsets and wherever else they need to because of current parsing, as 
> opposed to all elements?
> 
> I believe this would mean it applied to fieldset, tr, and li (and 
> perhaps td, though that would be a strange thing to do).

What about <svg:g> elements? It would be very useful to allow them there.

And <p> elements (in fact in one application where I did something like 
this once, I was repeating <p> elements).

And <tbody>, in case what is being repeated is more than just one row.

And if we're going to allow <li>, why not <dd>?

So the full list would be <fieldset>, <tr>, <tbody>, <td>, <p>, <li>, 
<dd>, and <svg:g>. Assuming we haven't missed any. (<section>?)

Now, consider the implementation. Every time it has to do anything in the 
repetition model, it will now have to check the tag name against all of 
these before deciding whether or not an element is a repetition block.

The ua.css rules go from:

   @namespace xh url(http://www.w3.org/1999/xhtml);
   :not(xh|*)[xh|repeat="template"],
   xh|*[|repeat="template"] { display: none; }

...to:

   @namespace xh url(http://www.w3.org/1999/xhtml);
   @namespace svg url(http://www.w3.org/2000/svg);
   svg|g [xh|repeat="template"], xh|fieldset[|repeat="template"],
   xh|tr[|repeat="template"], xh|tbody[|repeat="template"],
   xh|td[|repeat="template"], xh|p[|repeat="template"],
   xh|li[|repeat="template"], xh|dd[|repeat="template"] {
     display: none;
   }

I don't understand why it bugs you that template attributes apply to all 
elements, and don't understand why you think they should only apply to 
fieldsets. Could you expand on this?

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

Received on Monday, 19 December 2005 14:13:04 UTC