[Seaside] [ENH] Unnecessary repeat attribut in HTML page

Avi Bryant avi@beta4.com
Tue, 2 Apr 2002 15:19:16 -0800 (PST)


On Wed, 3 Apr 2002, Alain Fischer wrote:

> Hi Avi,
>
> If you take a look at the HTML generated by Seaside, you can see that
> there is unnecessary repeat attribute for IAVisibleRepeat. This make
> unnecessary big HTML page.

Thanks Alain,

That only happens if you write something like
<tr repeat="@item/list">.  If you use the sea:id attribute directly, you
won't see that effect: <tr sea:id="item/list">.
However, making a special case of repeat doesn't make sense because you
could actually use any attribute you want in its place - <tr
foo="@item/list"> would work just the same.

It would be possible to take out all such attributes - right now the macro
IAImplicitIDExpansion that changes <tr repeat="@foo"> into <tr
sea:id="foo"> maintains the repeat attribute, on the theory that you might
be using some attribute you actually needed to stay around. The only
example I can think of offhand would be something like <div id="@foo">,
except that the CSS macro already creates an id attribute for you, so that
case is taken care of.  Anyway, if you want to make that global change,
then you want to change IAImplicitIDExpansion>>expand: so that the line
"aNode attributeAt: attr key put: id" becomes "aNode removeAttribute: attr
key".

I think I'll make this change in SSVS as well, unless someone offers a
good reason not to.

Avi