fast/parser/font.html

Dirk Mueller mueller at kde.org
Wed Feb 11 01:27:52 CET 2004


On Wednesday 11 February 2004 00:32, David Hyatt wrote:

> Note the check of style->font().... if line-height is applied first,
> then that check could cause you to look at the wrong font size.

no, since we don't change the order of font-size/lineheight, and font-size is 
applied first (applyRule, PROP_FONT) :

            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 );

But thats apparently not enough in all cases. 

> we could just make a "Percent" unit type instead of checking
> style->font() up front and then let the lineHeight() methods over in
> the render tree handle this case (as they already do for the CSS_NUMBER
> line-height, which makes a Percent type).

No, you can't do it in the rendertree since percentage line-heights are not 
inherited. 

However we have this neat adjustRenderStyle now, where we can fix it up. I can 
live with this hack just fine. See patch. 

Didn't give it any great testing so far, but some tests seem to work a lot 
better now. 


Dirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/khtml-devel/attachments/20040211/c29ebf4c/lineheight.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cssstyleselector.diff
Type: text/x-diff
Size: 3011 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/khtml-devel/attachments/20040211/c29ebf4c/cssstyleselector.bin


More information about the Khtml-devel mailing list