[whatwg] WF2 part 1-3

Mark Schenk whatwg at markschenk.com
Sat Aug 28 15:41:52 PDT 2004

Quoting Ian Hickson <ian at hixie.ch>:

> > Another problem with the existing proposals is the fact that you will
> > encounter elements with the same index/repeat value, when you use
> > different repeat templates. Example (snipped):

> True, but that shouldn't be a huge problem since the form controls in 
> those different sections can be uniquely named.

Yes, I understand that, but it makes processing a little more difficult imho,
although a good regexp can do miracles :) 

What I would ideally like to see (I'm entering the domain of a full-featured
repetition model here) is a way to define one counter/index for a group of
repetition templates. Fantasai once suggested using a "repetition-group"
template for this. 

Each repetition template belonging to a certain group would use the same index
value when one is added/removed etc. The advantage of this would be easier
processing of the form fields inside the different repetition blocks, because
you can use the same naming scheme, but all names would be unique nonetheless.

This is probably beyond the scope of this repetition model, but it would be

> > That would kill the repeat-template attribute because you merge it into 
> > one attribute on the repetition block
> At the cost of much more complicated processing of the attribute, sadly, 
> and without really simplifying the model at all.
True, but I don't see any other solution for a repetition model at the moment
and I was primarily thinking of ways to kill attributes :)
> > and it would give you unique values for "repeat" attributes throughout 
> > the document:
> > 
> > repeat="[repetition template id] [repetition block index]"
> Why is that an advantage, particularly?
Well, it would be really nice if a repetition block would have an attribute
value unique to that block. As mentioned earlier in the thread, the "repeat"
attribute is not unique when multiple templates are used. 

The nicest solution would be to let each repetition block have a unique id, so
you can use the already existing getElementById() method to manipulate the
blocks. However, giving the repetition blocks a unique id would further
complicate the repeat model, so I didn't mention it before...

> Same problem. Actually the spec had something like this originally. It was 
> more of a pain than a help, which is why I split them into multiple 
> attributes. 

Like I said before, the current model is verbose but the meaning of the
attributes is very clear and that's a Good Thing.


More information about the whatwg mailing list