WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
300385
CSS transitions in the Shadow DOM are interrupted when the slotted content is replaced
https://bugs.webkit.org/show_bug.cgi?id=300385
Summary
CSS transitions in the Shadow DOM are interrupted when the slotted content is...
artasend
Reported
2025-10-08 03:54:53 PDT
Created
attachment 477026
[details]
Native example of the described issue CSS transitions within the Shadow DOM are interrupted and reset unexpectedly when the content (Light DOM children) is replaced, but they work correctly in Firefox and Chrome. ## Steps to Reproduce: - Create a Web Component with Shadow DOM containing an element with CSS transition - Include a <slot> element in the Shadow DOM template - Place content in the slot from Light DOM - Simultaneously trigger: - A property change that starts a CSS transition on an element in Shadow DOM - A replacement of the slotted content (not just property updates, but full node replacement) ## Expected Result: The CSS transition in Shadow DOM should complete normally, independent of changes to slotted content. ## Actual Result: The CSS transition is interrupted and the element immediately jumps to the end state without animation. ## Environment: I have tested this on a few devices and the issue always occurs: ### Device 1 Safari Version: 18.0 (19619.1.26.111.10, 19619) macOS Version: 14.6.1 (23G93) ### Device 2 (Emulator) iPhone 15 Pro, iOS 17.5 ## Technical Notes: - The issue occurs specifically when slotted content nodes are replaced (e.g., replaceChild()) - Simple property updates to slotted content don't trigger the issue ## Real world impact This bug has severe implications for web applications using component-based page layouts. A common pattern is: ```html <main-layout> #shadow-root <main-menu activeItem="..."></main-menu> <slot></slot> <my-page> </main-layout> ``` When users navigate between pages, the <my-page> component in the slot is replaced, which breaks ALL animations in the main menu (highlighting active items, hover effects, transitions, etc.). ## Attachments - [Live demo using Lit framework](
https://lit.dev/playground/#project=W3sibmFtZSI6ImFuaW1hdGlvbi1kZW1vLnRzIiwiY29udGVudCI6ImltcG9ydCB7aHRtbCwgY3NzLCBMaXRFbGVtZW50fSBmcm9tICdsaXQnO1xuaW1wb3J0IHtjdXN0b21FbGVtZW50LCBzdGF0ZX0gZnJvbSAnbGl0L2RlY29yYXRvcnMuanMnO1xuaW1wb3J0IHtjY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J9XQ
) - Also, there is a native implementation (without any frameworks) in the attached HTML file.
Attachments
Native example of the described issue
(3.21 KB, text/html)
2025-10-08 03:54 PDT
,
artasend
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-10-15 03:55:12 PDT
<
rdar://problem/162672242
>
Antoine Quint
Comment 2
2025-10-15 08:01:24 PDT
I feel like we already fixed similar bugs with interrupted animations on slotted content, but not specifically transitions.
artasend
Comment 3
2025-10-16 02:02:06 PDT
(In reply to Antoine Quint from
comment #2
)
> I feel like we already fixed similar bugs with interrupted animations on > slotted content, but not specifically transitions.
The problem is not with transitions on the slotted content itself, but about a Shadow DOM transitions being incorrectly interrupted by unrelated Light DOM changes. The slot content replacement shouldn't affect transitions on separate Shadow DOM elements.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug