Bug with line-height (font shorthand)
David Hyatt
khtml-devel@kde.org
Fri, 21 Feb 2003 16:47:29 -0800
The font shorthand property has a bug with the application of
line-height. The test case that triggered the bug was
font: 1em/1em Ahem;
The problem is that font has not yet been updated when line-height
needs to check the font-size, so it gets the wrong font-size. The
following patch fixes the problem by adding an update if needed before
applying the line-height rule.
======
applyRule( CSS_PROP_FONT_SIZE, font->size );
// Line-height can depend on font().pixelSize(), so we have
to update the font
// before we evaluate line-height, e.g., font: 1em/1em
if (fontDirty)
CSSStyleSelector::style->htmlFont().update(
paintDeviceMetrics );
applyRule( CSS_PROP_LINE_HEIGHT, font->lineHeight );
======
Cheers,
Dave
(hyatt@apple.com)