W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2004

[whatwg] repetition model

From: Peter-Paul Koch <gassinaumasis@hotmail.com>
Date: Sun, 13 Jun 2004 22:26:17 +0000
Message-ID: <BAY22-F11rD1MEol0Sy0006b666@hotmail.com>

> > 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'))

>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.

> > 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.

> > imho, something like the <repeat> construct belongs in the realm of
> > jsp/asp/php. maybe this functionality can be included as a DOM method
> > for completeness?
>
>It is a DOM method too. In fact, it's defined in terms of two DOM methods.
>And it could indeed be done on the server side, although it would be a
>lot uglier.
>
>Should I just remove it for now?

Replace it, rather, by an existing tag with a non-existing attribute, for 
instance

<div WFaction="repeat">

or whatever. This way it's accessible to W3C DOM scripts, which bear the 
brunt of repeating anyway until native support for Web Forms is reached.

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

-------------------------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.quirksmode.org/
Column "Keep it Simple": http://www.digital-web.com/types/keep_it_simple/
------------------------------------------------------------------

_________________________________________________________________
Play online games with your friends with MSN Messenger 
http://messenger.msn.nl/
Received on Sunday, 13 June 2004 15:26:17 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:34 UTC