W3C home > Mailing lists > Public > www-style@w3.org > April 2011

RE: [css3-text] Allow control of text-decoration width

From: Koji Ishii <kojiishi@gluesoft.co.jp>
Date: Sun, 3 Apr 2011 14:28:09 -0400
To: Aryeh Gregor <Simetrical+w3c@gmail.com>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <A592E245B36A8949BDB0A302B375FB4E0AB3D55674@MAILR001.mail.lan>
> I just realized browsers are allowed to vary underline width
> on different lines to match average text size or similar.

Your observation is correct. CSS3 Text[1] defines:
| In determining the position and thickness of text decoration lines,
| user agents may consider the font sizes and dominant baselines
| of descendants

> I don't think we'd lose much of anything by saying that
> the underline's thickness must be fixed according to some
> simple function of the affected element's font-size by default,
> like Gecko does.

As Robert mentioned, underline position and thickness is a font property, and it should scale by font size. It should be consistent for the same font with the same size, but it could vary if either font or font size is different.

IE has updated to this behavior in IE8 (IE7 had fixed thickness), I hope WebKit would follow that soon to support CSS3 Text once it is more stable.

Your use case is interesting, but I'd also be surprised if the following two actions produced different results.
* Apply underline to "bar baz quz" and then remove underline from "baz"
* Apply underline to "bar" of "bar baz quz", and then to "quz"

[1] http://dev.w3.org/csswg/css3-text/#line-decoration



Regards,
Koji
Received on Sunday, 3 April 2011 18:30:06 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:39 GMT