NEW 290923
View Transition break on inline parents with block children
https://bugs.webkit.org/show_bug.cgi?id=290923
Summary View Transition break on inline parents with block children
Sebastian Markbåge
Reported 2025-04-02 08:17:06 PDT
If you try to start a View Transition when a parent with `display: inline` and `view-transition-name` has a `display: block` child then it leads to a duplicate name error. https://repro-view-transition-inline-bug.vercel.app/ This errors with: InvalidStateError: Multiple elements found with view-transition-name: hi The most common way this would happen is with: <a href="..."><div>...</div></a> It should be treated as if it was `display: inline-block`. When that is explicitly specified, it works.
Attachments
Radar WebKit Bug Importer
Comment 1 2025-04-02 08:22:17 PDT
Tim Nguyen (:ntim)
Comment 2 2025-04-02 10:41:44 PDT
I think this started happening when we started iterating over renderers instead of elements in ViewTransition.cpp to get pseudo-element support.
Matt Woodrow
Comment 3 2025-05-11 18:34:31 PDT
Putting a block level element inside of an inline causes the inline to be fragmented (see https://www.w3.org/TR/CSS2/visuren.html#img-anon-block, and this resolution in particular - https://github.com/w3c/csswg-drafts/issues/1477#issuecomment-380771705). View transitions names should be skipped if the named element is fragmented (https://drafts.csswg.org/css-view-transitions/#view-transition-name-prop - If the element’s principal box is fragmented, skipped, or not rendered, this property has no effect.) I think we should be silently ignoring `view-transition-name: hi`, and just running a transition on the root element.
Matt Woodrow
Comment 4 2025-05-11 20:28:54 PDT
Matt Woodrow
Comment 5 2025-05-26 17:05:01 PDT
Note You need to log in before you can comment on or make changes to this bug.