- From: Noam Rosenthal via GitHub <sysbot+gh@w3.org>
- Date: Tue, 09 Jan 2024 15:28:54 +0000
- To: public-css-archive@w3.org
One thing that we'd want to resolve in with the WG is whether programmatic reloads (e.g. `location.reload()`) should be included in `auto`. As per the current spec they don't, but they're interceptable via the navigation API.
If we enable it, skipping the transition for a reload in the outgoing page is still possible, and would look like this:
```js
navigation.addEventListener("navigate", async e => {
if (e.navigationType === "reload") {
const sheet = new CSSStyleSheet();
sheet.replaceSync("@view-transition { navigation: none }");
// Note that there's no need to restore it because a `reload` cancels BFCache.
// If this was not a `reload` we'd have to remove the sheet from the adopted stylesheets on `pagehide`.
document.adoptedStyleSheets.push(sheet);
}
});
```
--
GitHub Notification of comment by noamr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8783#issuecomment-1883265772 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 9 January 2024 15:28:56 UTC