W3C home > Mailing lists > Public > www-style@w3.org > October 2009

Re: Inconsistent treatment of "em" and "ex" unit when used to specify "font-size"

From: Philip TAYLOR <P.Taylor@Rhul.Ac.Uk>
Date: Fri, 30 Oct 2009 14:09:25 +0000
Message-ID: <4AEAF395.4050405@Rhul.Ac.Uk>
To: Bert Bos <bert@w3.org>
CC: W3C Style List <www-style@w3.org>


Bert Bos wrote:

>> On Mon, Oct 26, 2009 at 9:59 AM, Philip TAYLOR<P.Taylor@rhul.ac.uk>

>>> Is there any reason why "ex" does not also reference
>>> the parent element's font size if set on the 'font-size'
>>> property, as if "ex" units are used to specify font-size,
>>> there would appear to be a problem of self-reference
>>> (see example below).
>
> The working group decided that this was an oversight and the ex
> definition will be changed to say the same as the em definition. We
> didn't check all implementations, but those we checked already do it
> this way. (Indeed, it would be hard to imagine how else it could work.)

Thank you for the confirmation, Bert.  It was certainly
the case in the past that browsers treated "ex" inconsistently,
as a result of which we [1] ceased using them, relying instead
(and with far greater success) on the use of "em" units
even in a vertical context where "ex"s would have been
preferable.  However, I am quite willing to believe that
the current generation of browsers now treat "ex" units
consistently.

> On that last sentence of the quoted text (which is marked as an issue in
> the working draft): The WG currently believes that the text of CSS 2.1
> ("In the cases where it is impossible or impractical to determine the
> x-height, a value of 0.5em should be used.") is still the best and can
> be inserted unchanged at that point in the CSS3 module.

I am a little unhappy with "or impractical"; does this not
leave a rather large loophole for browser inconsistencies ?

Philip Taylor
--------
[1] The Web team at Royal Holloway, University of London
Received on Friday, 30 October 2009 14:10:19 GMT

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