Skip to content

Commit

Permalink
[css-view-transitions-1] Fragmented elements don't participate in vie…
Browse files Browse the repository at this point in the history
…w transitions. (#8831)

* Fragmented elements don't participate in view transitions.

Closes #8339

* Update css-view-transitions-1/Overview.bs

Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>

* Skip transition if captured element became fragmented

* Move constraint to 'update' phase

---------

Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
  • Loading branch information
noamr and khushalsagar committed May 15, 2023
1 parent ea43cbf commit 7d8f178
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,19 +1243,17 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. If any [=flat tree=] ancestor of this |element| [=skips its contents=], then [=continue=].

1. If |element| has more than one [=box-fragment=], then [=continue=].

Issue: We might want to enable transitions for fragmented elements in future versions.

1. Let |transitionName| be the [=computed value=] of 'view-transition-name' for |element|.

1. If |transitionName| is ''view-transition-name/none'',
or |element| is [=element-not-rendered|not rendered=],
then [=continue=].

1. If any of the following is true:

* |usedTransitionNames| [=list/contains=] |transitionName|.

* |element| is not |element|'s [=tree/root=] and |element| allows [=fragmentation=].

Then return failure.
1. If |usedTransitionNames| [=list/contains=] |transitionName|, then return failure.

1. [=set/Append=] |transitionName| to |usedTransitionNames|.

Expand Down Expand Up @@ -1615,7 +1613,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
1. Let |hasActiveAnimations| be a boolean, initially false.

1. [=list/For each=] |element| of |transition|'s [=ViewTransition/transition root pseudo-element=]'s [=tree/inclusive descendants=]:

1. For each |animation| whose [=timeline=] is a [=document timeline=] associated with |document|,
and contains at least one [=animation/associated effect=] whose [=effect target=] is |element|,
set |hasActiveAnimations| to true if any of the following conditions is true:
Expand Down Expand Up @@ -1675,9 +1672,12 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. Otherwise:

1. If any [=flat tree=] ancestor of |capturedElement|'s [=new element=] [=skips its contents=],
or |capturedElement|'s [=new element=] is [=element-not-rendered|not rendered=],
then return failure.
1. Return failure if any of the following conditions is true:
- |capturedElement|'s [=new element=] has a [=flat tree=] ancestor that [=skips its contents=].

- |capturedElement|'s [=new element=] is [=element-not-rendered|not rendered=].

- |capturedElement| has more than one [=box-fragment=].

Note: Other rendering constraints are enforced via |capturedElement|'s [=new element=] being [=involved in a view transition=].

Expand Down Expand Up @@ -1794,6 +1794,7 @@ Changes from <a href="https://www.w3.org/TR/2022/WD-css-view-transitions-1-20221
* When skipping a transition, the {{UpdateCallback}} is called in own task rather than synchronosly. See <a href="https://github.com/w3c/csswg-drafts/issues/7904">issue 7904</a>
* When capturing images, at least the in-viewport part of the image should be captured, downscale if needed. See <a href="https://github.com/w3c/csswg-drafts/issues/8561">issue 8561</a>.
* Applying the [=ink overflow=] to the captured image is implementation defined, and doesn't affect the image's [=natural size=]. See <a href="https://github.com/w3c/csswg-drafts/issues/8597">issue 8597</a>.
* Fragmented elements don't participate in view transitions. See <a href="https://github.com/w3c/csswg-drafts/issues/8339">issue 8339</a>.

<h3 id="changes-since-2022-10-25">
Changes from <a href="https://www.w3.org/TR/2022/WD-css-view-transitions-1-20221025/">2022-10-25 Working Draft (FPWD)</a>
Expand Down

0 comments on commit 7d8f178

Please sign in to comment.