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

NEW
Unassigned

Status

()

Core
DOM: CSS Object Model
5 years ago
2 years ago

People

(Reporter: Vic Carlson, Unassigned)

Tracking

20 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
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.

Updated

5 years ago
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)
(Reporter)

Comment 2

5 years ago
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.
Duplicate of this bug: 1281818
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
You need to log in before you can comment on or make changes to this bug.