Closed Bug 264501 Opened 20 years ago Closed 7 years ago

<br> in tables or blocks with display:table is calculated as 1px in the container width

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: pascalc, Unassigned)

Details

(Keywords: testcase, Whiteboard: DUPEME)

Attachments

(2 files)

Mozilla 1.8a4 windows XP

1 put an image and a <br> in a table cell or a div with display:table
2 put a redbackground color on the container

expected result : total width is the width of the image
actual result : total width is the image width + 1px, you see the red background
color on the right side

This is very annoying on all the sites using tables for layout of their images

testcase coming
This testcase shows how width is miscalculated. The Image is 80px wide and the
container should therefore be 80px wide as well.

Dom inspector shows that it is in fact 81px wide

Note that Dom Inspector also shows that the br element is 0.06667px wide, I
don't know why <br> should have a width, perhaps because it is required by the
engine to be able to parse it, but 80+0.06 should not be rounded to 81 :)
Not a tables bug.  Over to inline layout, but I was sure we had a bug on this
already....
Component: Layout: Tables → Layout: Block and Inline
OS: Windows XP → All
QA Contact: core.layout.tables → core.layout.block-and-inline
Hardware: PC → All
Whiteboard: DUPEME
This is another testcase which shows the 1px width bug.  The use of a <select>
tag causes all subsequent paragraphs to be missing from the <div>.
The bug is gone, the div in the testcase now has a 80.017px width that is 80px for the div + 0.017px for the <br> tag, no more rounding up.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: