W3C home > Mailing lists > Public > public-appformats@w3.org > December 2006

[XBL] Attribute forwarding defaults

From: Cameron McCormack <cam@mcc.id.au>
Date: Thu, 21 Dec 2006 15:36:56 +1000
To: public-appformats@w3.org
Message-ID: <20061221053656.GA21590@arc.mcc.id.au>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:10:20 GMT