[whatwg] Interleaved repetition blocks

Mark Schenk css at markschenk.com
Thu Jul 1 01:51:02 PDT 2004

On Wed, 30 Jun 2004 22:01:58 +0000 (UTC), Ian Hickson <ian at hixie.ch> wrote:

> The spec now only supports interleaved. You can do stacked by using
> different containers (e.g. put each stack in a separate <div>).

Yep, that is easier than what I suggested further down. Good.

> I used "repeat-template".

Sounds good.

>> You might even be able to create extra attributes to the add-button,
>> namely add_stack (add after last occurence of the specific block) and
>> add_interleave (add after last occurence of any repetion block) which
>> would allow you to combine both methods. This might be too much of a
>> good thing, but would give tremendous flexbility with little extra
>> effort. For instance if you have the same sequence as the previous
>> example (3,1,2,3,1,1,2) but the button types are interleave, stack and
>> stack respectively, you would get:
> I'm not sure I understand the use case for this.

Let's just say I got carried away by the idea and saw an opportunity for  
tremendous flexibility, without seeing a use case. Sorry 'bout that. :)

>> There is another tremendous advantage to introducing the parent
>> attribute, which has to do with add buttons without a template attribute
>> specified, but with an ancestor that is a repetition block. Currently
>> this only works with repetition blocks that are not ancestor repetition
>> blocks (because the template has to be found), which would result in Add
>> buttons being cloned, which will subsequently not be effective. When
>> using the parent attribute, a UA will always know which template is
>> linked to the repitition block, so you can insert new repetition blocks
>> anywhere.
> Not sure what you mean by "not ancestor repetition blocks" here.

Oooops, that should be "orphan repetition block".

What I understood from the spec is that only "repetition blocks" (not  
orphan ones) can have working add buttons inside the repetition block.  
This would result in those buttons also being present in the "orphan  
repetition blocks" but then being disabled. That is ugly.

With the new repeat-template attribute, it would also be possible to have  
working add buttons inside orphan repetition blocks, because it can now be  
easily determined which template to clone. This would allow much more  
flexible addition of templates.

A major problem this brings is the numbering of the "index" value for the  
repetition blocks. This would have to be dynamically updated to all of the  
same repetition blocks.

This leads me to another question: why don't the index values changes when  
moving the repetition blocks up/down? That kind of defeats the purpose of  
the auto-numbering of the name attributes, as the order in the markup will  
differ from the index numbering.


More information about the whatwg mailing list