Bug 251909 - table element 'overflow:clip' is not applied to nested table elements (thead, tr, td, etc) with a background-color
Summary: table element 'overflow:clip' is not applied to nested table elements (thead,...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 16
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rob Buis
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2023-02-08 01:50 PST by Pierre Ossman
Modified: 2023-06-19 12:37 PDT (History)
4 users (show)

See Also:


Attachments
Test case (545 bytes, text/html)
2023-02-08 01:50 PST, Pierre Ossman
no flags Details
safari, firefox, chrome (64.06 KB, image/png)
2023-02-08 23:46 PST, Karl Dubost
no flags Details
rendering with outlines (12.68 KB, image/png)
2023-02-08 23:53 PST, Karl Dubost
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Ossman 2023-02-08 01:50:18 PST
Created attachment 464905 [details]
Test case

If a table has "overflow: clip;", then Chrome and Firefox both clip the contents of the table to the shape of the table. This is very useful when you want a table with round corners.

Unfortunately, WebKit does not, giving sharp edges for elements that have a non-transparent background.

Tested using Safari on iOS, and Epiphany on Linux.
Comment 1 Pierre Ossman 2023-02-08 01:52:11 PST
It is possible to work around this using some ugly CSS like:

tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

But it quickly becomes ugly when considering variations on <thead>, <tbody> and <tfoot>.
Comment 2 Karl Dubost 2023-02-08 23:46:33 PST
Created attachment 464917 [details]
safari, firefox, chrome

Rendering in Safari TP, Firefox Nightly, Chrome Canary
latest versions
Comment 3 Karl Dubost 2023-02-08 23:53:14 PST
Created attachment 464918 [details]
rendering with outlines

putting a yellow outline on the table element
and a red outline on the thead element
we can better see what is happening.
Comment 4 Radar WebKit Bug Importer 2023-02-08 23:56:09 PST
<rdar://problem/105210397>
Comment 5 Radar WebKit Bug Importer 2023-02-08 23:58:42 PST
<rdar://problem/105210442>
Comment 6 Rob Buis 2023-05-19 07:16:21 PDT
Pull request: https://github.com/WebKit/WebKit/pull/14078
Comment 7 EWS 2023-06-02 21:26:40 PDT
Committed 264849@main (0e5a15b84122): <https://commits.webkit.org/264849@main>

Reviewed commits have been landed. Closing PR #14078 and removing active labels.
Comment 8 Thomas Wisniewski [:twisniewski] 2023-06-18 07:26:07 PDT
Might the WPT in this patch be pushed to the main repo? It would be nice to have it on wpt.live.
Comment 9 Rob Buis 2023-06-19 12:06:33 PDT
(In reply to Thomas Wisniewski [:twisniewski] from comment #8)
> Might the WPT in this patch be pushed to the main repo? It would be nice to
> have it on wpt.live.

Thanks for the heads up, I forgot to land the test in wpt, should be fixed now.
Comment 10 Thomas Wisniewski [:twisniewski] 2023-06-19 12:37:05 PDT
No worries, thanks!