Bug 233553 - Combining CSS clip-path with any property that creates a new stacking context makes img element disappear
Summary: Combining CSS clip-path with any property that creates a new stacking context...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: https://codepen.io/jelmerdemaat/full/...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-29 02:51 PST by Jelmer de Maat
Modified: 2022-10-25 00:45 PDT (History)
4 users (show)

See Also:


Attachments
Demo HTML file showing the bug (1.88 KB, text/html)
2021-11-29 02:51 PST, Jelmer de Maat
no flags Details
Screenshot showing the disappeared img (960.99 KB, image/png)
2021-11-29 02:53 PST, Jelmer de Maat
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jelmer de Maat 2021-11-29 02:51:37 PST
Created attachment 445263 [details]
Demo HTML file showing the bug

Combining CSS a `clip-path: url(#shape)` declaration with any property that creates a new stacking context (like `transform: translate3d(0,0,0)`) makes an <img> element disappear completely. It does take up its space in pixels, but is otherwise invisible.

See attachment or demo link: https://codepen.io/jelmerdemaat/full/MWEgRBQ

Issue does not occur when `transform` is removed.
Issue does not occur when element is a <div> in stead of an <img>.

Note that the SVG shape has an attribute of `clipPathUnits="objectBoundingBox"`.
Comment 1 Jelmer de Maat 2021-11-29 02:53:53 PST
Created attachment 445264 [details]
Screenshot showing the disappeared img
Comment 2 Jelmer de Maat 2021-11-29 02:54:35 PST
Detected when testing https://bugs.webkit.org/show_bug.cgi?id=233469
Comment 3 Radar WebKit Bug Importer 2021-12-06 02:52:34 PST
<rdar://problem/86091397>
Comment 4 Ahmad Saleem 2022-10-24 15:33:38 PDT
I am able to reproduce this bug in Safari Technology Preview 156 as well and Safari does not load picture for:

"<img> with clip-path: url(#shape) and transform: translate3d(0,0,0):"

While both Chrome Canary 109 and Firefox Nightly 108 does. Just wanted to share updated testing results. Thanks!
Comment 5 Simon Fraser (smfr) 2022-10-24 16:17:37 PDT
Do we know if this worked in some older OS versions?
Comment 6 Ahmad Saleem 2022-10-25 00:45:16 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Do we know if this worked in some older OS versions?

It was not working with macOS Monterey as well since I tested it few days back but forgot to post comment and now tried again today with Ventura.

Unfortunately, my first experience with macOS was with Monterey only.