Bug 158151

Summary: Table cell background color isn't shown when cellpadding value is 0
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: TablesAssignee: Gyuyoung Kim <gyuyoung.kim>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, rniwa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Table screenshot
none
WIP
none
Safari 15.6.1 differs from other browsers none

Description Gyuyoung Kim 2016-05-27 04:32:42 PDT
Created attachment 279951 [details]
Table screenshot

Unlike other browsers, when *cellpadding* value is defined to 0, table cell has been filled with table bgcolor, not table cell color.

<table border="0" width="100%" height="40" cellspacing="1" cellpadding="0" bgcolor="#B7BA52">
  <tr bgcolor="#FFFFFF">
    <td></td>
    <td></td>		
    <td></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td></td>
    <td></td>		
    <td></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td></td>
    <td></td>		
    <td></td>
  </tr>
</table>

I attach a screenshot to show how to draw this code on WebKit.
Comment 1 Gyuyoung Kim 2016-05-27 04:34:21 PDT
Created attachment 279952 [details]
WIP
Comment 2 Gyuyoung Kim 2016-05-27 04:35:13 PDT
Comment on attachment 279952 [details]
WIP

View in context: https://bugs.webkit.org/attachment.cgi?id=279952&action=review

> Source/WebCore/html/HTMLTableElement.cpp:418
> +            m_padding = std::max(1, value.toInt());

I think this is very wrong fix. But it looks this is a clue how to fix this issue correctly.
Comment 3 Ahmad Saleem 2022-08-18 12:22:10 PDT
Created attachment 461720 [details]
Safari 15.6.1 differs from other browsers

I took the test case from Comment 0 and changed it into following:

JSFiddle Link - https://jsfiddle.net/zj435kLv/show

As ca be seen from screenshots, this is reproducible in Safari 15.6.1 and also in Safari Technology Preview 151. It fills the color in the all cells while all other browsers render differently but matching each other.

Attached WIP patch was modifying following:

https://github.com/WebKit/WebKit/blob/147df77f6bb805a2c35456b30b5bbb8f794b043c/Source/WebCore/html/HTMLTableElement.cpp#L402

Just wanted to share updated results. Thanks!
Comment 4 Radar WebKit Bug Importer 2022-08-18 12:51:28 PDT
<rdar://problem/98845731>