Bug with line-height (font shorthand)
David Hyatt
khtml-devel@kde.org
Mon, 24 Feb 2003 11:19:36 -0800
No. line-height values are based off the font on *your* element.
Consider this example:
font: 36px/1.5em Helvetica;
The line height should be 54 px.
Font-size in ems will be based off the size of the parent element's
font, but line height values are based off the font size on your
element.
In fact, even my patch isn't good enough for some crazier cases.
Consider this example:
<div style="font:12px/1.5em Helvetica; font-size:
36px">Hello<br>Hello</div>
Again, the line height should be 54 px.
Technically you can never evaluate line-height until your font has been
completely determined, even when you have a font shorthand.
dave
(hyatt@apple.com)
On Monday, February 24, 2003, at 07:59 AM, Lars Knoll wrote:
>
>> On Fre, 21 Feb 2003, David Hyatt wrote:
>>> font: 1em/1em Ahem;
>>
>> doh. can you confirm that the attached patch works?
>
> You're doing too much in that patch. There is no need to call update()
> for the
> font size calculations, as these relate to the parent elements font.
> Calling
> it before calculating the line height should be enough.
>
> Cheers,
> Lars
>
> _______________________________________________
> Khtml-devel@mail.kde.org
> http://mail.kde.org/mailman/listinfo/khtml-devel