Closed
Bug 83658
Opened 24 years ago
Closed 24 years ago
font size=7 broken
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla0.9.3
People
(Reporter: dbaron, Assigned: hyatt)
References
()
Details
Attachments
(4 files)
1.17 KB,
text/html
|
Details | |
887 bytes,
patch
|
Details | Diff | Splinter Review | |
788 bytes,
patch
|
Details | Diff | Splinter Review | |
1.38 KB,
patch
|
Details | Diff | Splinter Review |
Right now <font size=7> is broken. The HTML font size scale runs from 1-7, but
it doesn't correspond to CSS's font size scale (since the default is at 3 rather
than at 4).
Steps to reproduce:
* load attached test case
* look at "font size=7" line. It should be bigger than the size=6 line rather
than the normal size.
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
It appears that size=1=x-small, not xx-small
Assignee | ||
Comment 3•24 years ago
|
||
Yes, the comments in the testcase for font size=1 seem wrong. Looking at the
enumeration in nsStyleConsts.h, it seems that <font size="1"> went to x-small.
At first glance, I don't see why this is broken. I am using
NS_STYLE_FONT_SIZE_LARGER for <font size="7">.
Oh, I have a theory. Perhaps that const was only examined in the font element,
and now it needs to be examined over in nsRuleNode.cpp code. I may have lost
the code that checked for that case.
Assignee | ||
Comment 4•24 years ago
|
||
Oh hell. I see it now. I have an idea for how to fix this, but I need to
ensure I'm not doing anything incorrect from a CSS perspective. It looks like
blindly trying to use a value of "7" ends up corresponding to the enumerated
value of LARGER, which is not correct.
I think I want to introduce a new styleconst with a value of 7 that represents
an even larger point size (we'll call it XXXLARGE). If I do this, I think I'll
be ok as long as nobody can specify this size via CSS. In CSS, do you have to
use a keyword rather than an integer to specify values like xxsmall etc.?
If so, then what I'm proposing should work just fine.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.2
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
Assignee | ||
Comment 7•24 years ago
|
||
dbaron, attinasi, r and sr?
Reporter | ||
Comment 8•24 years ago
|
||
r=dbaron (although I thought this used to be more flexible)
Assignee | ||
Comment 9•24 years ago
|
||
What do you mean by more flexible?
I may be wrong, but I think this should be exactly equivalent to what was there
before. In the old code, a font size of <= 0 turned into 1 and a font size of
>=8 turned into 7. All values were treated as though they were the enumerated
values 1-7 and CalcPointSize was called on those values.
I preserved the boundary-checking code in fontelement and just rely on the
rulenode code that does font computation.
In fact, I reduced code bloat by consolidating all the font computation into
one place (the rule node). Before, a bunch of font computation code was
duplicated (in nsHTMLFontElement and in nsCSSStyleRule).
Assignee | ||
Comment 10•24 years ago
|
||
It just happens that the font computation code that I cut and pasted came from
nsCSSStyleRule.cpp, and that only dealt with the enumerated values 1-6. Now
that both font element and rule node use the same computation function, the
code needs to deal with a value of 7 as well.
Reporter | ||
Comment 11•24 years ago
|
||
I had thought we were leaving a gap in the mapping so <font-size=1> was
xx-small, but maybe not...
Assignee | ||
Comment 12•24 years ago
|
||
Nope. xx-small has an enumerated value of 0. We just turned all values into
the values 1-7, which means we treated <font size=1> as x-small. Is this
incorrect? It's trivial to make <font size="1"> be xx-small.
Reporter | ||
Comment 13•24 years ago
|
||
No, just as long as it's how it used to be.
Assignee | ||
Comment 14•24 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 15•24 years ago
|
||
(It's not the end of the world, but ...) in current 06/02 trunk builds (checked
on Linux on w2k), <font size=7> is still the same size as <font size=6>.
Reporter | ||
Comment 16•24 years ago
|
||
Reopening. The problem is that the code in nsRuleNode is always using
eFontSize_CSS, and if it's going to work the way it does now (which is
admittedly less flexible -- see the code in nsStyleUtil::NewCalcFontPointSize),
NewCalcFontPointSize needs to be changed. But as I said before, that gives us a
little less flexibility.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 17•24 years ago
|
||
Assignee | ||
Comment 18•24 years ago
|
||
I think this will fix it. r/sr/a again? :)
Status: REOPENED → ASSIGNED
Comment 19•24 years ago
|
||
This doesn't really fit the profile for 0.9.2, although if the attached patch
fixes it you'd probably be able to get approval for checkin during 'limbo'. ->0.9.3
Target Milestone: mozilla0.9.2 → mozilla0.9.3
Assignee | ||
Comment 20•24 years ago
|
||
This is a regression from the style system landing. We can't ship a product
with this regressed. The bug has a patch.
Reporter | ||
Comment 21•24 years ago
|
||
r=dbaron
Comment 22•24 years ago
|
||
BTW, I integrated this patch to what I am doing over at bug 84398.
Comment 23•24 years ago
|
||
Righteous. sr=waterson, le review super!
Reporter | ||
Comment 24•24 years ago
|
||
a=dbaron for trunk checkin (on behalf of drivers)
Assignee | ||
Comment 25•24 years ago
|
||
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•