Bug 284634

Summary: SVG elements with display: contents is visually hidden
Product: WebKit Reporter: Gaël Poupard <webkit.jiion>
Component: SVGAssignee: Ahmad Saleem <ahmad.saleem792>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, karlcow, sabouhallawa, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
rendering in safari, firefox, chrome
none
Reference Screenshot (Local build with fix) none

Gaël Poupard
Reported 2024-12-13 08:54:18 PST
1. With Epiphany on Ubuntu (also tested with Safari TP 209) 2. Open reduced test case on CodePen : https://codepen.io/ffoodd/pen/WbeowEj?editors=1000 Three SVG <circle> are in the markup: 1. one without any style, 2. one with `style="display: contents` on <circle>, 3. and another with a `<g style="display: contents">` containing the `<circle>`. Expected: circle are shown. Actual: circles with `display: contents` are visually hidden. FWIW, both Chromium and Firefox renders the third circle (`display: contents` on `<g>`) but not the second circle. I ran onto this behaviour while trying to stop SMIL animations in CSS when `prefers-reduced-motion: reduce` is true, but it seems that this behavior is not related to animations at all.
Attachments
rendering in safari, firefox, chrome (1.55 MB, image/png)
2024-12-17 21:52 PST, Karl Dubost
no flags
Reference Screenshot (Local build with fix) (268.29 KB, image/png)
2024-12-20 17:57 PST, Ahmad Saleem
no flags
Karl Dubost
Comment 1 2024-12-17 21:52:57 PST
Created attachment 473591 [details] rendering in safari, firefox, chrome Tested with Safari Technology Preview 208 20621.1.6 Firefox Nightly 135.0a1 13524.12.16 Google Chrome Canary 133.0.6902.0 6902.0
Radar WebKit Bug Importer
Comment 2 2024-12-20 08:55:13 PST
Ahmad Saleem
Comment 4 2024-12-20 17:55:12 PST
Ahmad Saleem
Comment 5 2024-12-20 17:57:25 PST
Created attachment 473620 [details] Reference Screenshot (Local build with fix)
Note You need to log in before you can comment on or make changes to this bug.