[whatwg] Repetition model changes
Matthew Raymond
mattraymond at earthlink.net
Sun Jun 27 05:10:37 PDT 2004
Ian Hickson 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). The webmaster also has to ensure that the
template isn't generated at all they want a list with zero empty items.
This means that the repeat-start mechanism does not degrade gracefully
for non-WF2 clients.
(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.)
It would seem to me that webmasters would either not use
repeat-start at all or require all users to have WF2-compliant UAs. Does
this mean that WHAT WG will consider features of a similar nature?
(Note: The following are not actual feature suggestions.) Why not have
two templates, or even three:
--------------------------------------------------------------------------
<table><tbody>
<tr id="order" repeat="template" repeat-start="3">
<td><input type="text" name="row[order].product" value=""></td>
<td><input type="text" name="row[order].quantity" value="1"></td>
</tr>
<tr id="genus" repeat="template" repeat-start="2">
<td><input type="text" name="grow[genus].product" value=""></td>
<td>
<input type="text" name="grow[genus].quantity" value="2">
</td>
</tr>
<tr id="species" repeat="template" repeat-start="5">
<td><input type="text" name="srow[species].product" value=""></td>
<td>
<input type="text" name="srow[species].quantity" value="3">
</td>
</tr>
</tbody></table>
<p><button type="add" template="order" value="order">
Add Order Row
</button></p>
<p><button type="add" template="genus" value="genus">
Add Genus Row
</button></p>
<p><button type="add" template="species" value="species">
Add Species Row
</button></p>
<p><button type="submit">Submit</button></p>
--------------------------------------------------------------------------
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.
So if such things are allowed, we can do this:
--------------------------------------------------------------------------
<table>
<tload href="myTableMarkup.html" />
</table>
--------------------------------------------------------------------------
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?
More information about the whatwg
mailing list