Re: [csswg-drafts] [css-view-transitions-2] Script event on old Document for cross-document ViewTransitions (#8785)

I think the gotcha of remembering to reset names is always going to happen if you're using inline styles. Irrespective of whether we have a script event with post redirect info. Since capturing will always be async, it'll run at the next rendering loop after this event.

> What I'm contemplating is whether we should have a VT-specific event here or a more general same-origin-redirect event in the navigation API.

That's a good question. I was wondering whether VT-specific is nicer from a performance standpoint. We don't have to delay the navigation on dispatch of this event unless there is a transition. In the transition case we have to go back to the page to capture old snapshots anyway so the additional event has no perf impact.

But you can do the above with a generic event as well. The browser can track whether an event handler is registered or allow making the event passive so event dispatch doesn't block the navigation from being committed. Given that, navigation API seems like a better spot for it.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8785#issuecomment-1817001811 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 17 November 2023 19:54:29 UTC