W3C home > Mailing lists > Public > www-style@w3.org > September 2003

Re: attr(x, y)

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 15 Sep 2003 13:54:13 +0000 (UTC)
To: Bert Bos <bert@w3.org>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-ID: <Pine.LNX.4.58.0309151335450.6502@dhalsim.dreamhost.com>

On Mon, 15 Sep 2003, Bert Bos wrote:
>
> Or, more subtly:
>
>     <INLINE LH="14">text with line height "14"</>
>
> [...]
>
>     INLINE { line-height: attr(LH,length) }   /* 14px */

Actually, that would compute to '0' because '14' is not a valid <length>.
(At least, according to my formal proposal [1]).

(And yes, I do mean "compute" here.)


> > I've also seen 'em' as the second argument, I see the need for that,
> >
> > input[size] {width: attr(size, em) }
> >
> > but how is that a type?
>
> It's not a type. Do we need this functionality?

I think so, if we want to be able to handle existing HTML 3.2 content in
this way. (My proposal includes all the units as valid "types".)


> Note that '12em' is probably about twice as wide as "<INPUT SIZE=12>" is
> supposed to be.

Indeed. The following is probably closer to the original intent:

   input[size] { width: attr(size, ch); }

...although I would highly recommend giving a third argument since if the
"size" attribute is not a valid float, it would get defaulted to 0ch,
which is not backwards-compatible with legacy HTML Forms UAs.


[1] http://lists.w3.org/Archives/Member/w3c-css-wg/2002OctDec/0141.html
    (Member only link)

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 15 September 2003 09:54:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:23 GMT