[whatwg] repetition model

Ian Hickson ian at hixie.ch
Mon Jun 21 05:44:17 PDT 2004

On Sun, 13 Jun 2004, Peter-Paul Koch wrote:
>>> now i have this "repeat" element. does it show up in the DOM?
>> It's well defined:
>>    http://whatwg.org/specs/web-forms/current-work/#repeat0
> Unfortunately it only shows up in Mozilla (getElementsByTagName('repeat'))

It shows up in IE6's DOM as well (which is what matters; the idea is to
make the other browsers support all this natively).

>> As soon as the <repeat> element is inserted into the document, whether
>> by being in the original markup or via scripting, a repetition block is
>> inserted into the DOM at the appropriate place, and the <repeat>
>> element is then removed.
> If by scripting we don't need the repeat tag.

True. But it's easier to say that it happens however the element is
inserted instead of special-casing load-time.

>>> can i do this?
>>>    document.createElement("repeat");
>>> will that throw an error?
>> You can do it and it won't cause an error. If you try to insert it into
>> the document using, e.g., appendChild(), then the element will be
>> replaced by a repetition block in the final DOM, as described in the
>> spec above.
> It causes an error only in Opera, but only Mozilla actually inserts the
> element. IE and Safari don't do anything.

Sorry, I thought the question was "can I do this in a compliant Web Forms
2 implementation", as opposed to current non-WF2 browsers.

In IE it seems to insert the element. Here's the test I used:

   var t = document.createElement('repeat');
   t.appendChild(document.createTextNode('[test element here]'));

> If you want Web Forms to be implementable right now (by JavaScript),
> you'll have to (temporarily?) redefine several elements as existing
> XHTML tags.

I don't think we necessarily need it implementable in JavaScript for
UAs like Mozilla and Opera; the idea is to get those to implement this
natively soon instead.

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