Closed
Bug 89503
Opened 23 years ago
Closed 23 years ago
[review]font-size:0 ignored
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
VERIFIED
FIXED
mozilla0.9.8
People
(Reporter: megabyte, Assigned: pierre)
References
Details
(Keywords: css1, css2, fonts)
Attachments
(2 files)
786 bytes,
patch
|
rbs
:
review+
attinasi
:
superreview+
|
Details | Diff | Splinter Review |
721 bytes,
text/html
|
Details |
font-size:0 does not work.. it does not matter if units are given or not.. it is completely ignored. CSS2 15.2.4 says font-size can take <length> (4.3.2 defined as any number) but negative lengths are illegal. Zero is not illegal but Mozilla treats it as such.
Reporter | ||
Comment 1•23 years ago
|
||
also, font-size:0.1mm doesn't work either (rounded down to 0?)
Reporter | ||
Comment 2•23 years ago
|
||
Also, anything below font-size:4% doesn't work either (relative to default 16px)
Reporter | ||
Comment 4•23 years ago
|
||
From DUP bug 89590: "It's a severe limitation. IE 5 makes text invisible, and it's extremely useful - e.g. using this feature you can turn "annotated version" of your document to "not annotaed" by just setting font size to 0pt in CSS for "div.annotation" style (provided all annotations are enclosed as "<div class=annotation></div>')." I'd also like to add that it is necessary for certain Standards mode compatibility issues. In order to truly remove those bug 22274 "image descenders" a font-size of zero applied to the body is a workaround.
Reporter | ||
Updated•23 years ago
|
Keywords: mozilla0.9.3,
nsbeta1
Reporter | ||
Comment 6•23 years ago
|
||
yeah.. strike-through 8s and 0s look nearly identical
Reporter | ||
Comment 7•23 years ago
|
||
CSS1 5.2.6 also mentions this. Marking css1. Can we get an update on this one?
Keywords: css1
Comment 8•23 years ago
|
||
rbs: This is probably an easy fix while you're in the fonts code... :-)
Assignee | ||
Comment 9•23 years ago
|
||
"font-size: 0pt" doesn't make the text invisible on IE5/win98, it makes it 1px high. On MacNav4, WinNav4 and MacIE5, the declaration is more or less ignored (the size is 'normal' but the line-height can be slightly affected). Still, regardless of what the other browsers do, I don't think we have to worry about emulating their behavior. We could just fix it.
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.9.6
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Assignee | ||
Updated•23 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Reporter | ||
Comment 10•23 years ago
|
||
AFAIK IE5.5 and IE6 handle this properly, btw.
Assignee | ||
Comment 11•23 years ago
|
||
The problem appears to be that native toolbox functions refuse to set the text size to 0 (eg. on the Mac, ::TextSize(0) is ignored). Here is a patch that fixes the problem in XP code. Marc/RBS: please r/sr
Summary: font-size:0 ignored → [review]font-size:0 ignored
Assignee | ||
Comment 12•23 years ago
|
||
Assignee | ||
Comment 13•23 years ago
|
||
Comment 14•23 years ago
|
||
> The problem appears to be that native toolbox functions refuse to set the text > size to 0 (eg. on the Mac, ::TextSize(0) is ignored). Similar story on Windows. There is no special-case of font-size:0 on Windows, and nothing is breaking down. So I was curious to understand why, and I just looked at the GDI documentation, and it says that when the font-size is passed as 0, "the font mapper uses a default height value when it searches for a match." In other words, the font metrics' ascent, descent, etc, are still going to be non-zero. That may be why other browsers gave the general impression that the declaration is ignored. Looking at the patch, I first had the impression that it will achieve the same effect as a textframe with an empty content, and I was wondering what will happen when the block code will apply its min-height rule. At first, it seemed that things wouldn't collapse into nothingness since the line-height is supposedly non-zero. But after applying and testing the patch, things worked out well. The case that didn't work and left a visible blank line was: <p><span style="font-size:0pt">...invisible text...</span></p> I am leaning towards thinking that the line-height may be coming from the font-size. And since the block code collapses empty lineboxes in your testcase and its line-height is 0, it disappears... In the other case, the min-height applies. Anyway r=rbs, since authors can work-around the limitation by putting the declaration in the correct place. Note: might be worth special-casing font-size:0 when setting the line-height in bug 95267 to avoid to regress this fix.
Comment 15•23 years ago
|
||
Comment on attachment 61969 [details] [diff] [review] patch r=rbs
Attachment #61969 -
Flags: review+
Comment 16•23 years ago
|
||
Comment on attachment 61969 [details] [diff] [review] patch sr=attinasi
Attachment #61969 -
Flags: superreview+
Assignee | ||
Comment 17•23 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•