[whatwg] Repetition model changes

Ian Hickson ian at hixie.ch
Sat Jun 26 10:37:59 PDT 2004


Ok I took in all the feedback you've all been sending (thanks!) and made
the following changes to make the repetition model degrade more
gracefully:


1. The template now comes at the _end_ of the block, not the start, with
repetition blocks appearing above the template in the DOM.

This makes it degrade gracefully by allowing the template to be used as an
empty row in legacy UAs. You can see this in action in the demo -- the
template acts as an empty row in legacy UAs, but is hidden in WF2 UAs.


2. <repeat> is gone. Instead, we have a new attribute repeat-start, which
says how many times to repeat the template when the page is loaded. It
defaults to one, which happens to be the same number of blank rows as you
would see if you were loading the page in a legacy UA.


3. I've introduced repeat-min and repeat-max attributes. The latter puts a
maximum on how many rows you can create with the "add" button. The former
makes the template re-populate itself when the "remove" button is pressed.


4. I've changed the "do not process this attribute" prefix from "[]" to a
non-breaking zero-width space character, U+FEFF. This character is
generally harmless, it can always be ignored safely on the server side (it
is also the BOM character), and so can be used in forms that will be sent
to legacy UAs without having to worry about random characters appearing
all over the place. In WF2 UAs, it'll be silently stripped.


5. I haven't changed the [id] replacement thing. None of the other
proposals (autoname, appending numbers, appending numbers and dots, using
just the order of the controls, using strings that are unlikely to match
real content, etc) solved all the other use cases, IMHO. If you think I
missed a suggestion for replacing [id] let me know.


I think that's it. Please send in your comments on the new proposal!

There's a demo of some of these features here:

   http://whatwg.org/demos/repeat-01/

The spec is here:

   http://whatwg.org/specs/web-forms/current-work/#repeatingFormControls

Cheers,
-- 
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