From 52977c3c0ccba6d167e58cb73fe9b7e45a38601c Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Tue, 13 Feb 2024 10:47:00 +0000 Subject: [PATCH] [css-view-transitions-1] Auto-skip a view-transition if document is hidden See [resolution](https://github.com/w3c/csswg-drafts/issues/9543#issuecomment-1939242246). --- css-view-transitions-1/Overview.bs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/css-view-transitions-1/Overview.bs b/css-view-transitions-1/Overview.bs index 31e90b36fae..197dbb5a7e3 100644 --- a/css-view-transitions-1/Overview.bs +++ b/css-view-transitions-1/Overview.bs @@ -956,8 +956,12 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface; 1. Let |document| be [=this's=] [=relevant global object's=] [=associated document=]. + 1. If |document|'s [=Document/visibility state=] is "hidden", + then [=skip the view transition|skip=] |transition| with an "{{InvalidStateError}}" {{DOMException}}, + and return. + 1. If |document|'s [=auto-skip view transitions=] is true, - then [=skip the view transition=] for |transition| with "{{InvalidStateError}}" {{DOMException}}, + then [=skip the view transition|skip=] |transition| with an "{{InvalidStateError}}" {{DOMException}}, and return. 1. If |document|'s [=active view transition=] is not null, @@ -1955,7 +1959,7 @@ Changes from issue 9669. * Refactor algorithm to clarify timing, especially of `updateCallbackDone. See issue 9762. * Add animation-delay inherit to UA stylesheet rules for (::view-transition) -image-pair, -old, and -new. See issue 9817. - +* Auto-skip animation when document is hidden. See issue 9543.

Changes from 2022-05-25 Working Draft