RESOLVED INVALID 15882
Padding on table cells off by one
https://bugs.webkit.org/show_bug.cgi?id=15882
Summary Padding on table cells off by one
Marcus Better
Reported 2007-11-07 05:42:30 PST
If a TD element has a top and/or bottom padding, the total height of the cell seems to be off by one. The border box of the cell decreases by 1px for each edge that has padding applied to it, regardless of the size of the padding.
Attachments
Test case (611 bytes, text/html)
2007-11-07 05:43 PST, Marcus Better
no flags
Result with WebKit r27433 (18.05 KB, image/png)
2007-11-07 05:43 PST, Marcus Better
no flags
Marcus Better
Comment 1 2007-11-07 05:43:01 PST
Created attachment 17108 [details] Test case
Marcus Better
Comment 2 2007-11-07 05:43:53 PST
Created attachment 17109 [details] Result with WebKit r27433 The right- and leftmost boxes are one pixel smaller than the middle one.
Chasen Le Hara
Comment 3 2008-02-04 23:40:51 PST
Confirmed on nightly r29955.
Robert Blaut
Comment 4 2008-02-05 06:34:28 PST
Marcus, you assume that td have initially padding set to 0, but it isn't true in this case. After initializing "td {padding: 0}" the test case works as expected. You should notice, that every browser have implemented its own default style sheet. http://www.w3.org/TR/CSS21/sample.html have example of such style sheet. However above mentioned example is *informative*, not *normative* so implementators are not obligated to use it. It looks that Webkit uses small default padding set to 1px for td. In this case, for me, the bug is INVALID, but I would like to see final decision made by more experienced Webkit developer. PS. The test case fails completely in Firefox and Opera.
Marcus Better
Comment 5 2008-02-05 06:56:18 PST
(In reply to comment #4) > Marcus, you assume that td have initially padding set to 0, but it isn't > true in this case. Seems you are right. Besides the test case is in content-box mode so I don't see why the boxes should be the same height at all.
Robert Blaut
Comment 6 2008-02-05 07:10:47 PST
(In reply to comment #5) > Seems you are right. Besides the test case is in content-box mode so I don't > see why the boxes should be the same height at all. I assume that td is initialized with padding: 0 and borders are set to 0. So computed "visible" height of td is: table 1: 5px + 95px+0px = 100px table 2: 0px + 100px + 0px = 100px table 3: 0px + 95px + 5px = 100px
Note You need to log in before you can comment on or make changes to this bug.