Closed
Bug 27873
Opened 25 years ago
Closed 22 years ago
inline bgs should use em square height, not bounding box height {ll} (background) [BG]
Categories
(Core :: Layout, defect, P3)
Core
Layout
Tracking
()
RESOLVED
FIXED
Future
People
(Reporter: ian, Assigned: ian)
References
()
Details
(Keywords: fonts, meta, testcase, Whiteboard: [Hixie-PF] NOT A BUG)
Mozilla currently *sets* the font size in the correct way (i.e. em square), but
it draws the background relative to nsIFontMetrics::GetHeight, which returns
the *bounding box* height of the Western font and not the em-square height.
So, the background is being calculated in the wrong way.
Bug History: see bug 4234, bug 13072.
See also bug 27164: "update nsIFontMetrics API".
The test case to look at is:
http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/lineheight4.html
This test page uses a font called Ahem, designed by Todd Fahrner.
Instructions for downloading the font are included on the test page itself.
The font must be installed before passing a browser through the test.
Some more test pages:
http://www.fas.harvard.edu/~dbaron/css/fonts/sizes/
http://www.fas.harvard.edu/~dbaron/css/test/inlinetest
http://www.fas.harvard.edu/~dbaron/css/test/linebox4
http://www.fas.harvard.edu/~dbaron/css/test/emunit
http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/lineheight1.html
http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/lineheight2.html
http://www.bath.ac.uk/%7Epy8ieh/internet/eviltests/lineheight3.html
Assignee | ||
Comment 1•25 years ago
|
||
Comment 2•25 years ago
|
||
Accepting for now, may pass to Gecko group once I've changed nsIFontMetrics.
Status: NEW → ASSIGNED
Assignee | ||
Updated•25 years ago
|
Summary: inline bgs should use em-square height, not bounding box height → inline bgs should use em-square height, not bounding box height {ll}
Comment 3•25 years ago
|
||
Since background is not as important as line-height, and since 20394 is
targetted for M16, I'm targetting this bug at M17.
Target Milestone: M15 → M17
Assignee | ||
Updated•25 years ago
|
Keywords: correctness,
nsbeta3
Comment 4•25 years ago
|
||
Are you sure our current behavior is wrong?
Assignee | ||
Comment 5•25 years ago
|
||
Yes.
Assignee | ||
Comment 6•25 years ago
|
||
As per meeting with ChrisD yesterday, taking QA.
QA Contact: petersen → py8ieh=bugzilla
Assignee | ||
Comment 7•25 years ago
|
||
David: In fact, you test for this in one of your testcases:
http://www.people.fas.harvard.edu/~dbaron/css/test/linebox4
Keywords: testcase
Summary: inline bgs should use em-square height, not bounding box height {ll} → inline bgs should use em square height, not bounding box height {ll} (background)
Whiteboard: hit during nsbeta2 standards compliance testing
Comment 8•25 years ago
|
||
The CSS spec doesn't say how to handle fonts whose font size is bigger than
their Maybe I changed my mind.
Assignee | ||
Comment 9•25 years ago
|
||
Maybe? ;-)
The reason I still believe this bug is valid is that if we just let the
background cover the bounding box of the font's glyphs, then the results are
much more unpredictable. What if you happen to trigger a very cursive font with
huge curly descenders? Then the background will spread up and down by several
lines for no obvious reason, which will look odd especially on lines where there
are no such glyhs.
Comment 10•25 years ago
|
||
If you have a cursive font with really big descenders, how do you decide where
to draw the background? If you pick the middle of the bbox, it might not end up
behind the letters...
Assignee | ||
Comment 11•25 years ago
|
||
You draw the background in the em square. That is (finally) well defined. We
know where the em square starts and ends (or rather, we know the em square
height and we know the position of the baseline in the em square -- right?).
Authors can then add padding if they want more background. But if you let the
background cover the entire bounding box, you can't add negative padding to put
it back to the 'line-height'...
Also, imagine what it would look like if you have line-height:1.2 and a
background on the inline element spanning the block. Nice lines with 0.2em
transparent 'slits' between them, guarenteed. You can't [easily] get that
effect if you use the bounding box height.
Comment 12•25 years ago
|
||
nsbeta3- per bug meeting w/ ekrock.
Whiteboard: hit during nsbeta2 standards compliance testing → [nsbeta3-]hit during nsbeta2 standards compliance testing
Assignee | ||
Comment 13•25 years ago
|
||
Per CSS WG meeting, we are now per spec. The spec has been loosened so that
both the current and perviously only correct behaviours are correct. In the
future, this may be controlled by a pref.
OS: Windows 98 → All
Hardware: PC → All
Target Milestone: M17 → Future
Assignee | ||
Updated•24 years ago
|
Summary: inline bgs should use em square height, not bounding box height {ll} (background) → inline bgs should use em square height, not bounding box height {ll} (background) [BG]
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Comment 15•24 years ago
|
||
I'm taking this because it is NOT A BUG but I want to keep it on my radar until
CSS3 addresses the issues.
Assignee | ||
Updated•24 years ago
|
Whiteboard: NOT A BUG → [Hixie-PF] NOT A BUG
Comment 16•22 years ago
|
||
*** Bug 46921 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 17•22 years ago
|
||
ok, wg has dealt with this
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•