[whatwg] Repetition model changes
ian at hixie.ch
Sun Jun 27 07:39:17 PDT 2004
On Sun, 27 Jun 2004, Matthew Raymond wrote:
>>> Note that I left off repeat-start because the default value is one. So
>>> why exactly do we need repeat-start???
>> Because on the long run, people may want to either only support WF2 UAs
>> (much the same way as, e.g., GMail only supports UAs that do
>> XmlHttpRequest) or may wish to only provide basic functionality to
>> legacy clients, with WF2 clients having a better experience.
> If, on a website supports non-WF2 UAs, the webmaster wants a preset
> number of items, the webmaster has to create a mechanism that will
> generate non-template blocks for each item (except for the template
> itself as the last item).
A preset number of empty items? Or a preset number of prefilled items?
If you mean a preset number of empty items, then yes -- the benefit of a
WF2-compliant UA would be control over the number of initial empty blocks
you can get without explicit markup.
Is the number of empty blocks ever critical? As in, does the fact that a
non-WF2 UA only gets one empty row really matter?
> The webmaster also has to ensure that the template isn't generated at
> all [if] they want a list with zero empty items. This means that the
> repeat-start mechanism does not degrade gracefully for non-WF2 clients.
It doesn't provide exactly the same experience, no, and with a non-WF2 UA
you can't do everything you can with a WF2 UA. But it does degrade
gracefully in that the content still makes sense and can still be used,
even if the experience isn't as perfect.
> (By the way, does this mean that WF2 clients won't even see an empty
> row if repeat-start="0"? I would hope that there's a way to suppress
> template rendering in a client that supports Web Forms 2.0.)
The template never renders in a WF2 UA, and yes, repeat-start="0" prevents
the empty row from appearing.
> It would seem to me that webmasters would either not use repeat-start at
Well, they would rely on its initial value, but yes.
> or require all users to have WF2-compliant UAs.
This will indeed always be an option, of course. Many authors are happy to
do this (as I keep mentioning, GMail for instance requires very up-to-date
UAs). The point is to not _require_ that the authors require WF2-enabled
users; the features in WF2 can be used while still supporting legacy UAs.
> Does this mean that WHAT WG will consider features of a similar nature?
Yes, indeed WF2 has several features that only "work" in a WF2 UA,
degrading to just being completely ignored in a non-WF2 UA. "Graceful
degradation" means that it doesn't _break_, or display garbage, in legacy
UAs, not that it be fully functional. (e.g. <button action=""> will be
totally ignored in legacy UAs, falling back on the form's action
attribute. And the form="" attribute will only ever work in WF2 UAs,
degrading to using the ancestor form element in non-WF2 UAs.)
> (Note: The following are not actual feature suggestions.) Why not have
> two templates, or even three: [...]
That's actually already supported in WF2. The markup you wrote would just
work. (The different types of rows couldn't mix, though, at least not in
WF2. That is on the list of things to maybe look at in WF3.)
> Same bloody thing. Renders properly only in a WF2 client. Requires
> webmasters to pretty much chuck WF2 out the window in order to support
> the same thing on non-WF2 clients. People could still create WF2 web
> pages that degrade gracefully by avoiding such features, but the above
> clearly will not degrade gracefully.
Why not? I'm confused as to why you think the above would not degrade.
Sure, it wouldn't be perfect, and would only display one empty row per
template instead of the specified number, but it would be easy to extend
my demo to work with what you describe.
> So if such things are allowed, we can do this:
> <tload href="myTableMarkup.html" />
> Sure it doesn't render anything on a non-WF2 client, but who cares,
> cause webmasters are only going to use it if they require Web Forms 2.0
> compliant browsers. Do you see the slippery slope here?
Well, the data="" feature in WF2 isn't far off what you are presumably
proposing above. You can, using data="", prepopulate a form, including
repetition templates, from an external data source. Of course, this only
works in WF2 UAs, legacy UAs would just display a blank form; the feature
degrading to simply being ignored.
There will always be features that people want that, when introduced, are
simply ignored by legacy UAs. We're certainly not going to limit ourselves
to things that already work, there wouldn't be much point.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg