ex and em units are way off

VERIFIED FIXED

Status

()

Core
CSS Parsing and Computation
P2
normal
VERIFIED FIXED
19 years ago
19 years ago

People

(Reporter: dbaron, Assigned: Peter Linss)

Tracking

Trunk
x86
Windows 95
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

19 years ago
The ex and em units don't seem to be resizing themselves to the font size of
the parent on these pages.  All the images show up the same height.
(Reporter)

Comment 1

19 years ago
The ex unit test is at
http://www.fas.harvard.edu/~dbaron/csstest/exunit.html

The em unit test is above.

Updated

19 years ago
Status: NEW → ASSIGNED

Updated

19 years ago
Assignee: troy → peterl
Status: ASSIGNED → NEW
Component: Layout → Style System

Comment 2

19 years ago
Peter, this looks like a style system problem. Just looking at this much smaller
case, when I get the style info for the image I'm told its height is only 170
twips. That's why we end up with such a small image

<html lang="en-US">
<head>
<base href="http://www.fas.harvard.edu/~dbaron/csstest/">
<style type="text/css">
IMG { height: 1em; vertical-align: bottom; }
SPAN.hl { line-height: 1em; background-color: yellow; vertical-align: bottom; }
.one { font-size: 50px; font-family: Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<p class="one">
  <span class="hl">M</span><img src="sq_small.jpg" alt="[Squirrel Image]"><span
class="hl">M</span>
</p>
</body></html>
(Reporter)

Comment 3

19 years ago
The problem has to do with inheritance of the font-size property.  If I stick
an explicit "font-size: inherit" on the image, things are OK.

Once the inheritance is fixed, you should probably reassign the bug to someone
else, because the sizing is still a little bit off with inherit put in
(although it could be line-height that has the size error).
(Reporter)

Comment 4

19 years ago
The cause of the inheritance problem is the font-size: 8.5pt in ua.css, which
you use to set the size of the ALT text.

ALT text should probably be the same size as regular text.  In fact, it should
not be constrained to the image size.  See bug 1994.

If you insist on doing ALT text the way you do now, you probably need an
internal pseudo-element for it.

This bug prevents the use of em/ex units on images without font-size: inherit,
which is a serious problem.  It's something that you probably will find on the
web already.
(Assignee)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

19 years ago
Changed alt text sizing rule in ua.css (now only applies font size to text
within images, not the image itself). The images are now the right size, but
they still don't line up with the text backgrounds. That's a seperate issue.
(Reporter)

Updated

19 years ago
Status: RESOLVED → VERIFIED
(Reporter)

Comment 6

19 years ago
Verified fixed.
You need to log in before you can comment on or make changes to this bug.