fast/parser/font.html

David Hyatt hyatt at apple.com
Wed Feb 11 00:32:22 CET 2004


Applying line-height first sounds great to me, although in our version 
of the code for line height (in the gigantic switch statement in 
cssstyleselector.cpp) we have the following code for when line-height 
is a percentage value:

else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
             lineHeight = Length( ( style->font().pixelSize() * 
int(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)) ) 
/ 100, Fixed );

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.  Maybe 
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).

What do you think?

dave

On Feb 10, 2004, at 2:58 PM, Dirk Mueller wrote:

> On Tuesday 10 February 2004 23:33, David Hyatt wrote:
>
>> Here's the patch that went with that checkin:
>
> Yeah, I saw that. I don't see any case where the change would make a
> difference though, thats why I'm curious :)
>
>> The problem is that font is applied first (it has a higher priority),
>> and then line-height is applied.
>
> Correct, and I think the fix would be to apply line-height as "first" 
> as well,
> similiar to font. Those two are very closely related via the font 
> shorthand
> anyway. see patch.
>
>> The bug I was fixing (if I remember correctly) was that line-height
>> specified inside the font property was actually being completely
>> ignored for one of the cases in fast/parser/fonts.html.
>
> Hmm. I don't see how that can happen..
>
>> all of those tests in fonts.html then maybe you made a different fix 
>> or
>> already have the fix in question.
>
> I'm not sure if I pass the tests since I don't have access to Safari to
> compare with. what I see is http://khtml.homeip.net/font.png
>
>
> Dirk
> <cssstyleselector.diff>_______________________________________________
> Khtml-devel at kde.org
> https://mail.kde.org/mailman/listinfo/khtml-devel



More information about the Khtml-devel mailing list