Bug 158151 - Table cell background color isn't shown when cellpadding value is 0
Summary: Table cell background color isn't shown when cellpadding value is 0
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tables (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gyuyoung Kim
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-05-27 04:32 PDT by Gyuyoung Kim
Modified: 2022-08-18 12:51 PDT (History)
7 users (show)

See Also:


Attachments
Table screenshot (12.75 KB, image/png)
2016-05-27 04:32 PDT, Gyuyoung Kim
no flags Details
WIP (4.30 KB, patch)
2016-05-27 04:34 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Safari 15.6.1 differs from other browsers (707.48 KB, image/png)
2022-08-18 12:22 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>