Skip to content

[css-view-transitions-1] Display live image when element is outside the snapshot containing block in old state #10587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use bounding box
  • Loading branch information
noamr committed Jul 17, 2024
commit 0070f5e286c2ba35f54a6643407c7dffb40e988c
12 changes: 8 additions & 4 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

<dl dfn-for="captured element">
: <dfn>old image</dfn>
:: a 2D bitmap, "`live`" or null. Initially null.
:: a 2D bitmap, "`live`", or null. Initially null.

: <dfn>old width</dfn>
: <dfn>old height</dfn>
Expand Down Expand Up @@ -1371,9 +1371,11 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
1. Let |originalRect| be [=snapshot containing block=] if |element| is the [=document element=],
otherwise, the element|'s [=border box=].

1. If |originalRect| does not intersect with [=snapshot containing block=], then set |capture|'s [=old image=] to "`live`".
1. Let |boundingBox| be |element|'s [=Element/get the bounding box|bounding box=], with [=ink overflow=] taken into account.
Copy link
Member

@khushalsagar khushalsagar Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


1. Otherwise, set |capture|'s [=old image=] to the result of [=capturing the image=] of |element|.
1. If |boundingBox| intersects with [=snapshot containing block=], then set |capture|'s [=old image=] to the result of [=capturing the image=] of |element|.

1. Otherwise, set |capture|'s [=old image=] to "`live`".

1. Set |capture|'s [=captured element/old width=] to |originalRect|'s {{DOMRect/width}}.

Expand Down Expand Up @@ -1917,12 +1919,14 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. Set |new|'s [=replaced element=] content to |liveSnapshot|.

1. If |capturedElement|'s [=old image=] is "`live`", then:
1. If |capturedElement|'s [=old image=] is not "`live`", then:

1. Let |old| be the ''::view-transition-old()'' with the [=view transition name=] |transitionName|.

1. Set |old|'s [=replaced element=] content to |liveSnapshot|.

Note: In case of an exit transition of an offscreen element, the group would have no content.

This algorithm must be executed to update styles in [=user-agent origin=] if its effects can be observed by a web API.

Note: An example of such a web API is `window.getComputedStyle(document.documentElement, "::view-transition")`.
Expand Down