-
Notifications
You must be signed in to change notification settings - Fork 747
Description
Firefox includes table borders in clientWidth. Blink doesn't. I suspect Firefox adheres closer to the spec (though see below), but is it intended that table.clientWidth
and table.offsetWidth
always return the same value?
Given that the border properties apply to the table grid box, not the table wrapper box, the pertinent question is: does clientWidth operate on table wrapper box or table grid box?
The text from clientWidth :
- If the element has no associated CSS layout box or if the CSS layout box is inline, return zero.
- N/A
- Return the width of the padding edge excluding the width of any rendered scrollbar between the padding edge and the border edge, ignoring any transforms that apply to the element and its ancestors
I assume that when the steps above say the, they refer to the element's principal box, but could I get clarification on that? Should they, in this case, refer to the table grid box? If these steps do refer to the principal box, then FF behavior is correct but seemingly unfortunate in that offsetWidth and clientWidth are the same for tables. Which brings back to the original question: is it intended that table.clientWidth and table.offsetWidth are the same?
More relevant research:
The bug where Gecko switched to using the wrapper box for client* properties cites the definition of offset* as justification, which does say that offset* operates on the wrapper box. But the relevant part of that definition—"Return the border edge width of the first CSS layout box"—only appears for the offset* properties, not the client* properties.
Further, the offset* and client* properties are extensions of different interfaces: offset* is on HTMLElement. client* is on Element. Is that relevant to why offset* includes first CSS layout box but client* doesn't?
This stems from a chrome bug report.
/cc @FremyCompany @fantasai (as she was instrumental in the current definition of table wrapper box)