Bug 182531 - [testcase] [CSS 2.1 Conformance] incorrect, inaccurate implementation of ex unit
Summary: [testcase] [CSS 2.1 Conformance] incorrect, inaccurate implementation of ex unit
Status: VERIFIED WORKSFORME
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.1.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL: http://www.damowmow.com/playground/bu...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-31 04:08 UTC by Gérard Talbot (no longer involved)
Modified: 2013-04-01 21:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gérard Talbot (no longer involved) 2009-01-31 04:08:05 UTC
ex unit is a relative length unit that is derived from the height of a fonts lower case letters that does not have descenders (i.e. the height of the letter - x - ). 

[
The 'ex' unit is defined by the element's first available font. The 'x-height' is so called because it is often equal to the height of the lowercase "x". However, an 'ex' is defined even for fonts that don't contain an "x".
]
CSS 2.1, section 4.3.2 Lengths
http://www.w3.org/TR/CSS21/syndata.html#length-units

Testcases
---------

ex unit
http://www.damowmow.com/playground/bugs/tests/ex.html

Tests 2 and 3 of key concepts - ex test
http://www.richinstyle.com/test/keyconcepts/ex.html

Height using 'ex' units with a nominal value, 7.5ex
http://samples.msdn.microsoft.com/ietestcenter/css/chapter_10/properties/height/height-083.htm

Length units
http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t040302-c61-rel-len-00-b-ag.htm

Text-indent
http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1601-c547-indent-00-b-a.htm
.six {text-indent: 1em;} 
.seven {text-indent: 1.25ex;} /* 1.25ex x 0.8em/ex == 1em */

http://samples.msdn.microsoft.com/ietestcenter/css/chapter_10/properties/min-height/min-height-083.htm

http://samples.msdn.microsoft.com/ietestcenter/css/chapter_10/properties/max-height/max-height-083.htm

http://samples.msdn.microsoft.com/ietestcenter/css/chapter_10/properties/width/width-083.htm

References
----------

Estimating the relative x-height (aspect ratio) of a font by Jukka "Yucca" Korpela
http://www.cs.tut.fi/~jkorpela/x-height.html

x-height, font aspect value by Bruno Fassino
http://brunildo.org/test/xheight.pl

Some x-height values and comparison
http://www.barrypearson.co.uk/articles/text/aspect_values.htm

Effective Style with em; Why not %, or ex?
http://mondaybynoon.com/2006/03/13/effective-style-with-em/


Notes
-----
- 1ex == 0.8em for Ahem font
- the correspondences between x-height versus font-size varies from one font to another.
- Firefox 3.0.5 pass all these tests
- It is expected to see an upcoming webkit build pass all these tests: see
Bug 16362: Incorrect implementation of 'ex' unit
https://bugs.webkit.org/show_bug.cgi?id=16362
[
this is a perfectly valid patch, that could be integrated into
WebKit and finally fix the "ex" implementation. 2009-01-01, #c12
]
-  Bug 18814: Support real 'x-height' for ex units  
https://bugzilla.mozilla.org/show_bug.cgi?id=18814
- I searched for a DUPlicate and did not find any

Regards, Gérard
Comment 1 Gérard Talbot (no longer involved) 2009-02-01 08:13:02 UTC
Main testcase (reduced and self-explanatory):
http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/accurate-ex-unit-implementation.html

There are many other testcases available testing properties (line-height, height, min-height, max-height, word-spacing, letter-spacing, width, min-width, max-width, font-size, border, padding, text-indent, etc..) where property values are specified with the ex unit.

CSS 2.1 testsuite has several tests using ex unit:

http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t040302-c61-ex-len-00-b-a.htm

http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1507-c526-font-sz-02-b-a.htm

http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1604-c541-word-sp-00-b-a.htm

http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1604-c541-word-sp-01-b-a.htm

http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1604-c542-letter-sp-00-b-a.htm

http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/t1604-c542-letter-sp-01-b-a.htm

Regards, Gérard
Comment 2 Maksim Orlovich 2009-02-01 17:30:17 UTC
Your simple testcase looks just fine to me, ~4.2.0, Linux. And all we do for handling 'ex' is query the xHeight from Qt, so that may be broken on Win32 or such.
Comment 3 Gérard Talbot (no longer involved) 2009-02-01 21:59:08 UTC
That's good news! Resolving as WORKSFORME then. I'll VERIFY the bug when I get KDE 4.2.0 (on Windows or with Kubuntu 9.04).

Regards, Gérard
Comment 4 Gérard Talbot (no longer involved) 2009-06-14 03:37:18 UTC
The AHEM____.TTF font 
can be downloaded from
http://dev.w3.org/CSS/fonts/ahem/
AHEM____.TTF     21-Mar-2008 19:44   12K

I tried the
Main testcase (reduced and self-explanatory):
http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/accurate-ex-unit-implementation.html
and
http://www.damowmow.com/playground/bugs/tests/ex.html
with Konqueror 4.2.4 (KDE 4.2.4; Linux 2.6.28-11-generic; X11) and got expected results.

Marking as VERIFIED

regards, Gérard