Closed
Bug 216456
Opened 22 years ago
Closed 18 years ago
'font' with system font keyword and 'font-family' with generic font family keyword behaving incorrectly
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: stanio, Assigned: dbaron)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: qawanted, Whiteboard: [patch])
Attachments
(4 files, 2 obsolete files)
2.29 KB,
text/html
|
Details | |
42.76 KB,
image/png
|
Details | |
44.18 KB,
image/png
|
Details | |
4.14 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030815 Netscape/7.1 (ax; svg)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030815
Read the notes in the test case for more info.
Reproducible: Always
Steps to Reproduce:
1. Open the test case.
2. Observe the results.
3. Check with the descriptions.
Actual Results:
Using:
{
font: message-box;
font-family: sans-serif;
}
The 'font-family' statement resets all other font properties which should(!) be
set by the 'font' shorthand property. This is a case with system font keyword
used with 'font' and later generic font family keyword applied to the
'font-family' property.
Expected Results:
The 'font' shorthand property should set all other font properties in compliance
with the CSS spec therefore the above test case should not to fail.
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Comment 2•22 years ago
|
||
Mozilla screen shot of the browser window on my system.
Reporter | ||
Comment 3•22 years ago
|
||
Internet Explorer screen shot of the browser window on my system. Here, IE
shows the test case fine unlike Mozilla.
Reporter | ||
Comment 4•22 years ago
|
||
Could it be related to Bug 120903?
Assignee | ||
Updated•21 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Updated•21 years ago
|
OS: Windows XP → All
Hardware: PC → All
![]() |
||
Comment 5•21 years ago
|
||
To do this per CSS spec we'd probably need to resolve the system fonts into a
family/size/etc in the CSS parser instead of whenever we actually end up doing it...
Comment 6•19 years ago
|
||
Assignee | ||
Updated•18 years ago
|
QA Contact: ian → style-system
Assignee | ||
Comment 7•18 years ago
|
||
Bug 377947 was supposed to fix this, but it looks like it didn't.
Assignee | ||
Comment 8•18 years ago
|
||
Comment on attachment 204104 [details]
Simplified Test Page (INVALID)
This testcase is invalid: system fonts are used in the font shorthand as only a standalone value; they can't be followed by a font-family value.
Attachment #204104 -
Attachment description: Simplified Test Page → Simplified Test Page (INVALID)
Attachment #204104 -
Attachment is obsolete: true
Assignee | ||
Comment 9•18 years ago
|
||
If I delete the second item of the testcase, the third one is corrected. That suggests there's a problem with nsRuleNode::ComputeFontData in the case where aStartStruct is non-null.
Assignee | ||
Comment 10•18 years ago
|
||
This patch works, and also fixes bug 199755 fully. I'd like to think about it a little more before requesting review.
This code goes back to the beginning of these functions:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/html/style/src/nsRuleNode.cpp&rev=3.22&mark=1913,1918-1920,1923-1925,1966-1968#1912
Assignee | ||
Comment 11•18 years ago
|
||
Comment on attachment 271007 [details] [diff] [review]
patch
We can't stomp on aFont as temporary storage because it's sometimes the only copy of aStartStruct we have, and we're not allowed to modify it.
I'm comfortable passing parentFont twice, since the COMPUTE_START_* macros often set up the parent struct as the same as the struct, so we have to be able to handle that in general. And the code looks like it handles it fine.
This code still scares me a little, but I think this is right.
Attachment #271007 -
Flags: superreview?(bzbarsky)
Attachment #271007 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•18 years ago
|
Whiteboard: [patch]
Assignee | ||
Comment 12•18 years ago
|
||
Comment on attachment 271007 [details] [diff] [review]
patch
This seems to break generic fonts entirely, though.
Attachment #271007 -
Flags: superreview?(bzbarsky)
Attachment #271007 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 13•18 years ago
|
||
I think the nsRuleNode code added in bug 74186/bug 99010 is fundamentally incompatible with the aStartStruct parameter; fixing this probably just depends on bug 380915.
Depends on: 380915
Assignee | ||
Comment 14•18 years ago
|
||
...but I can effectively skip the optimization by changing SetGenericFont, which fixes the major problems with this interaction (although I think some remain; see the XXXldb comment being added).
Attachment #271007 -
Attachment is obsolete: true
Attachment #271263 -
Flags: superreview?(bzbarsky)
Attachment #271263 -
Flags: review?(bzbarsky)
![]() |
||
Comment 15•18 years ago
|
||
Comment on attachment 271263 [details] [diff] [review]
patch
>+ if (i != 0)
>+ fontData.mFamily.Reset(); // avoid unnecessary operations in SetFont()
Document that this is because i == 0 is our own context and we do care about the font-family then?
r+sr=bzbarsky. Sorry for the delay; I have an irrational aversion to reviewing code I don't think I fully understand, so this took awhile. :(
Attachment #271263 -
Flags: superreview?(bzbarsky)
Attachment #271263 -
Flags: superreview+
Attachment #271263 -
Flags: review?(bzbarsky)
Attachment #271263 -
Flags: review+
Assignee | ||
Comment 16•18 years ago
|
||
Fix checked in to trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•18 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•