Closed Bug 131454 Opened 23 years ago Closed 23 years ago

incorrect inheritance of font-size

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: matt, Assigned: dbaron)

References

()

Details

Attachments

(2 files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:0.9.9) Gecko/20020310 BuildID: 2002031005 Somewhere between 0.9.8 and 0.9.9 font-size seems to have stopped being inherited properly.In the testcase I specify a font-size: 12px on the body element and a font-size: 1em on the p element. The text within the p appears with an apparent font-size of 16px -- my default. This is different behaviour from 0.9.8 and earlier (all the way back to 0.8 at least) Reproducible: Always Steps to Reproduce: 1.load the testcase, or other page with font-size cascaded using em.
Eek. This looks like it's somehow related to the code that deals with font-family stuff. I could've broken it with my zoom changes, or something else could have. rbs, any ideas?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
OS: MacOS X → All
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.0
The problem is related to having a fully specified font struct on the style context.
Attached patch patch fixing bugSplinter Review
The cause of the problem was my optimization for lazy calls to the parent contexts' GetStyleData. CheckSpecifiedProperties doesn't need, for any other purposes (at least I hope not), to compute whether 'em' or similar units cause inheritance. However, my optimization depended on it doing that for 'font-size', where 'em' means inheritance from a parent context rather than from another or the same struct associated with the same context. I *think* this is all that's necessary to fix these issues, and it certainly fixes this bug.
The patch that I mentioned that caused the problem was the patch in bug 113098.
Comment on attachment 74550 [details] [diff] [review] patch fixing bug make sense... r=bzbarsky
Attachment #74550 - Flags: review+
Blocks: 131707
sr=hyatt
I should test a rule with something like: font: menu; font-size: 2em;
Comment on attachment 74550 [details] [diff] [review] patch fixing bug a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #74550 - Flags: approval+
Comment on attachment 74550 [details] [diff] [review] patch fixing bug >@@ -761,7 +762,7 @@ > (family == NS_STYLE_FONT_LIST) || > (family == NS_STYLE_FONT_FIELD) || > (family == NS_STYLE_FONT_THEME)) >- return nsRuleNode::eRuleFullMixed; >+ return nsRuleNode::eRuleFullReset; > } > return nsRuleNode::eRuleUnknown; > } I looked into the implementation of the 'font' shorthand and realized this change is wrong, so I'm replacing it with: @@ -761,6 +795,8 @@ (family == NS_STYLE_FONT_LIST) || (family == NS_STYLE_FONT_FIELD) || (family == NS_STYLE_FONT_THEME)) + // Mixed rather than Reset in case another sub-property has + // an explicit 'inherit'. XXXperf Could check them. return nsRuleNode::eRuleFullMixed; } return nsRuleNode::eRuleUnknown;
Fix checked in 2002-03-18 17:32 PST.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verified using testcase
Status: RESOLVED → VERIFIED
This fix wasn't quite enough. I forgot percents. See bug 132381.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: