Closed Bug 403486 Opened 17 years ago Closed 16 years ago

Strange rendering of border-collapse: collapse inside a div with overflow: scroll|hidden|auto

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 410621

People

(Reporter: greenie2600, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

The left and top borders of a table with "border-collapse: collapse" lose one pixel when placed inside a div with "overflow" set to anything other than "visible".

Reproducible: Always

Steps to Reproduce:
1. Create a <div> with the "overflow" property set to any value other than "visible".
2. Inside this <div>, place a <table> with border-collapse: collapse, and a border of any style and width.

Actual Results:  
Exactly one pixel is shaved off the top and left edges of the <table>. In other words, a 1px border disappears entirely on the top and left; a 2px border becomes a 1px border on the top and left; &c.


Expected Results:  
I expected to see the full border, as specified in the stylesheet, displayed on all edges of the table.

This seems to be a problem with Firefox's treatment of border-collapse, because any other object placed inside the <div> (such as an <img>) is rendered normally (i.e., none of the edges are clipped).

Floating the table to the right reveals the left border. Placing a line break immediately before the table reveals the top border.

I thought this might have been correct behavior due to some obscurity in the CSS 2.1 spec (e.g., perhaps the borders of the table were interacting with the [nonexistent] borders of the div), but I see nothing in the spec's description of the collapsing border model that mentions containing elements. So I don't think table borders should collapse into the borders of their container, if that is indeed what's happening.
Attached file Test case
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: