Bug 292968

Summary: REGRESSION (Safari 18.4): Declarative shadow DOM and custom elements do not work with parseUnsafeHTML
Product: WebKit Reporter: mic.gallego
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, cdumez, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Reduction none

mic.gallego
Reported 2025-05-13 18:22:38 PDT
Hello, On Safari exclusively (it works on Chrome), parseUnsafeHTML and setUnsafeHTML are not working with nested web components. Even though the web components are inserted into the page, the `connectedCallback` is never called. You can experience the issue here: https://codepen.io/bakura10/pen/LEEqGmy On Chrome, both messages are logged. On Safari, the nested web components is not initialized at all. Thanks.
Attachments
Reduction (597 bytes, text/html)
2025-05-16 15:49 PDT, Ryosuke Niwa
no flags
mic.gallego
Comment 1 2025-05-13 18:36:18 PDT
After further testing, it appears to work on Safari 18.1, but not on 18.3 and 18.4. It therefore seems to be a recent regression.
Ahmad Saleem
Comment 2 2025-05-13 19:00:17 PDT
***
Radar WebKit Bug Importer
Comment 3 2025-05-13 19:00:26 PDT
Ahmad Saleem
Comment 4 2025-05-13 19:02:22 PDT
*** Safari Technology Preview 218 *** "Bar: Should be called" *** Chrome Canary 138.0.7177.0 (Official Build) canary (arm64) *** "Bar: Should be called" "Bim: Should be called" *** Firefox Nightly 140 (20250513214736) *** "Bar: Should be called" "Bim: Should be called"
Alexey Proskuryakov
Comment 5 2025-05-14 15:18:17 PDT
Thank you for the report! Between 18.2 and 18.3, guessing the former because it was a release with more changes overall.
Alexey Proskuryakov
Comment 6 2025-05-14 15:19:59 PDT
Actually, looks like our testing so far disagrees, and 18.3 worked.
Ryosuke Niwa
Comment 7 2025-05-16 15:49:44 PDT
Created attachment 475277 [details] Reduction
Ryosuke Niwa
Comment 8 2025-05-16 17:00:07 PDT
EWS
Comment 9 2025-05-16 21:53:26 PDT
Committed 295050@main (6d35fd51666a): <https://commits.webkit.org/295050@main> Reviewed commits have been landed. Closing PR #45526 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.