[whatwg] [wf2] repetition model addition step 14 issue

Rikkert Koppes rikkert at finalist.com
Sun Oct 14 04:33:58 PDT 2007


Note that this is also an issue in Opera's current implementation

test case: http://www.rikkertkoppes.com/other/wf2-repetition-model/
note the legend element ending up halfway the fieldset. It occurs to 
that this is unwanted bahaviour, it follows directly from the current wd 
though

Regards,
Rikkert Koppes

Rikkert Koppes wrote:
> Related is the movement of repetition blocks, section 3.6.3 step 3: 
> http://www.whatwg.org/specs/web-forms/current-work/#movement
> ---
> # If distance is negative: while distance is not zero and target's 
> |previousSibling| is defined and is not a repetition template 
> <http://www.whatwg.org/specs/web-forms/current-work/#repetition2>, set 
> target to this |previousSibling| and, if it is a repetition block 
> <http://www.whatwg.org/specs/web-forms/current-work/#repetition3>, 
> increase distance by one (make it less negative by one).
> ---
> blocks might move above previous siblings that are not repetition 
> blocks (picture a legend element).
>
> Regards,
> Rikkert Koppes
>
> Rikkert Koppes schreef:
>> the addition sequence, step 14 states 
>> (http://www.whatwg.org/specs/web-forms/current-work/#addition):
>> ---
>> If the first argument to the method was null, then the template once 
>> again crawls through its previous siblings, this time stopping at the 
>> first node (possibly the template itself) whose previous sibling is a 
>> repetition block (regardless of what that block's template is) or the 
>> first node that has no previous sibling, whichever comes first. The 
>> new element is the inserted into the parent of the template, 
>> immediately before that node. Mutation events are fired if appropriate.
>> ---
>>
>> Furthermore, as I interpret correctly, this is also the case at 
>> initialisation, i.e. the addRepetitionBlock() method is invoked with 
>> null as it's argument 
>> (http://www.whatwg.org/specs/web-forms/current-work/#initial). (not 
>> quite sure whether this is indeed correct interpreted, see further)
>> ---
>> For each element that has a |repeat 
>> <http://www.whatwg.org/specs/web-forms/current-work/#repeat>| 
>> attribute with the literal value |template 
>> <http://www.whatwg.org/specs/web-forms/current-work/#template>|, the 
>> UA must invoke the template's replication behaviour as many times as 
>> the |repeat-start 
>> <http://www.whatwg.org/specs/web-forms/current-work/#repeat-start>| 
>> attribute on the same element specifies (just once, if the attribute 
>> is missing or has an invalid value).[...] (Invoking the template's 
>> replication behaviour means calling its |addRepetitionBlock() 
>> <http://www.whatwg.org/specs/web-forms/current-work/#addrepetitionblock>| 
>> method).
>> ---
>>
>> If this is the case, at initialisation, when there are no repetition 
>> blocks, the first block is added as the very first child of the 
>> template's parent, which is not necessarily before the template. This 
>> doesn't seems to be desired very often. Picture a fieldset with a 
>> legend where the first replicated block ends up before the legend. 
>> Should the initial replication behaviour maybe call the 
>> addRepetitionBlock with the template's previous sibling as argument?
>>
>> Regards,
>> Rikkert Koppes



More information about the whatwg mailing list