Open Bug 871054 Opened 11 years ago Updated 2 years ago

getComputedStyle returns incorrect (half, rounded) border widths for table elements with border-collapse:collapse (collapsed borders)

Categories

(Core :: DOM: CSS Object Model, defect)

20 Branch
x86
Windows XP
defect

Tracking

()

People

(Reporter: vcarlson, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

window.getComputedStyle(HTMLTableElement).style.borderXxxWidth


Actual results:

if the table element's border-collapse property evaluates to "collapse" the returned values are incorrect. The returned values are ceil(actual border width/2) for left and top and floor(actual border width/2) for right and bottom.


Expected results:

The rendered border width values should be returned.
Component: Untriaged → DOM
Product: Firefox → Core
Component: DOM → CSS Parsing and Computation
For border-collapse tables, the border behavior is weird: half the border is inside the table's content-box and half is outside.  Hence the /2 behavior you see.

The spec on this says to just return the computed value for border widths, which would in this case equal the specified value, but it's not clear to me how web-compatible that part of the spec is.
Component: CSS Parsing and Computation → DOM: CSS Object Model
Whiteboard: DUPEME
Summary: getComputedStyle returns invalid border widths for table elements → getComputedStyle returns invalid border widths for table elements with border-collapse:collapse (collapsed borders)
The problem with the current returned values is that they are indeterminate. For example, returned values of 3px and 2px for opposing borders could indicate specified borders of 5px and 5px, 6px and 4px or 6px and 5px.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: getComputedStyle returns invalid border widths for table elements with border-collapse:collapse (collapsed borders) → getComputedStyle returns incorrect (half, rounded) border widths for table elements with border-collapse:collapse (collapsed borders)
Whiteboard: DUPEME
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.