[XBL] Attribute forwarding defaults

Hi.

This is a last call comment on the XBL 2 Editor’s Draft (dated 27
October 2006).

There should be discussion in the document about what happens with
attribute forwarding when the attribute is already present on the
element in the template.  I think this should allow a mechanism for
providing a default attribute value when it’s not specified on the
bound element.

An example:

  <xbl:binding element="ex|circleText">
    <xbl:template>
      <svg:circle r="100" xbl:inherits="cx cy r"/>
      <svg:text xbl:inherits="x=cx y=cy xbl:text=label"/>
    </xbl:template>
  </xbl:binding>

which can be used like:

  <ex:circleText cx="40" cy="80" label="Hi"/>

to get a default 100 unit radius circle, or:

  <ex:circleText cx="40" cy="80" r="50" label="Hi"/>

to specify the radius as 50 units.

An extra editorial point in the 5.3 Attribute Forwarding section:

  If an attribute is listed multiple times on the left hand side (or on
  its own), then the latter designation wins (as if the attributes were
  each forwarded in turn, an earlier forwarding being overwritten by a
  later one).

s/latter/last/, since “latter” is used only when there are two things.

Thanks,

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
 xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

Received on Thursday, 21 December 2006 05:37:10 UTC