If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

background-color does not match text size within span tags

RESOLVED DUPLICATE of bug 202942

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 202942
13 years ago
13 years ago

People

(Reporter: Geoff Phillips, Assigned: dbaron)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20040913 Firefox/0.10

Example page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Test</title></head>
<body>
<span style="background-color: red;">
<font style="font-size: 40pt;">SOME TEXT</font>
</span>
</body>
</html>

Reproducible: Always
Steps to Reproduce:
View attached page

Actual Results:  
The background colour only covers the lower part of the text.

Expected Results:  
The background colour should cover all of the text
(Reporter)

Comment 1

13 years ago
Created attachment 159497 [details]
Page containing example HTML

Comment 2

13 years ago
confirming Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8a4) Gecko/20040911
screen resolution 800x600

body has a margin of 8 px, otherwise margin/border/padding 0

DOM-Inspector Box Model 
box heigth: body 63, span 19, font 61

DOM-Inspector Computed Style
     height: body   63px, span   auto, font   auto
line height: body normal, span normal, font normal
font size  : body   16px, span   16px, font 53.3333px

Comment 3

13 years ago
This sounds INVALID.

The height of the outer span (inline element) is not determined by the height of
its children, but by the height of the font.

(There's a bit of an explanation with a similar example in bug 202942, and an
excerpt from the visual formatting model.)

Comment 4

13 years ago
This is invalid.  It's the same setup as bug 202942.

*** This bug has been marked as a duplicate of 202942 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.