Skip to content

[css-view-transitions-1] Clarify that observable image size refers to the border-box, and observed natural size is not affected by hw constraints #8819

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

Merged
merged 5 commits into from
May 11, 2023
Merged
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
Fix regarding texture size
  • Loading branch information
noamr committed May 11, 2023
commit 56f7ea490b123c742d6454e82d4877dbfdcd9ac5
45 changes: 8 additions & 37 deletions css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,10 +1500,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

1. [=Assert=]: |transition|'s [=ViewTransition/phase=] is not "`done`".

1. If |transition|'s [=ViewTransition/phase=] is [=phases/before=] "`update-callback-called`",
then [=queue a global task=] on the [=DOM manipulation task source=],
given |transition|'s [=relevant global object=],
to [=call the update callback=] of |transition|.
1. If |transition|'s [=ViewTransition/phase=] is [=phases/before=] "`update-callback-called`", then [=call the update callback=] of |transition|.

1. Set [=document/transition suppressing rendering=] to false.

Expand Down Expand Up @@ -1572,25 +1569,17 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
over an infinite transparent canvas,
following the [=capture rendering characteristics=].

1. Let |interestRectangle| be the result of [=computing the interest rectangle=] for |element|.
1. Return the portion of the canvas that includes |element|'s [=ink overflow rectangle=] as an image.
The [=natural size=] of the image must be |element|'s [=border box=]'s [=size=].

1. Return the portion of the canvas within |interestRectangle| as an image.
The natural size of the image is equal to the |interestRectangle| bounds.
</div>

### [=Capture rendering characteristics=] ### {#capture-rendering-characteristics-algorithm}

<div algorithm>
The <dfn>capture rendering characteristics</dfn> are as follows:

* The origin of |element|'s [=border box=] is anchored to canvas origin.

* Expand the canvas to include |element|'s [=ink overflow rectangle=]. The captured image
should include the [=ink overflow region=], however the size of that region is
[=implementation-defined=] and is not web-observable.

Note: This means that ''object-view-box'' applies to |element|'s [=border box=], and UAs
have to apply the [=ink overflow region=] to the canvas internally.
* The origin of |element|'s [=ink overflow rectangle=] is anchored to canvas origin.

* If the referenced element has a transform applied to it (or its ancestors),
then the transform is ignored.
Expand All @@ -1599,6 +1588,10 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;

* Effects on the element, such as 'opacity' and 'filter' are applied to the capture.

* Implementations may clip the rendered contents if the [=ink overflow rectangle=] exceeds some [=implementation-defined=] maximum.
However, the captured image should include, at the very least, the contents of |element| that intersect with the [=viewport=].
Implementations may adjust the rasterization quality to account for elements with a large [=border box=] that are transformed into view.

* [=list/For each=] |descendant| of [=shadow-including descendant=] {{Element}} and [=pseudo-element=] of |element|,
if |descendant| has a [=computed value=] of 'view-transition-name' that is not ''view-transition-name/none'',
then skip painting |descendant|.
Expand All @@ -1610,28 +1603,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
Issue: Specify what happens with 'mix-blend-mode'.
</div>

### [=Compute the interest rectangle=] ### {#compute-the-interest-rectangle-algorithm}

<div algorithm>
To <dfn lt="computing the interest rectangle|compute the interest rectangle">compute the interest rectangle</dfn> of an {{Element}} |element|, perform the following steps.
They return a rectangle.

Note: The interest rectangle is the subset of |element|'s [=border box=] that should be captured.
This is required for cases where an element's border box needs to be clipped because of hardware constraints.
For example, if it exceeds the maximum texture size.

1. Assert: |element| is not |element|'s [=node document=]'s [=document element=].

Note: The [=document element=] is captured differently, as specified in [=capture the image=].

1. If |element|'s [=border area=] does not exceed an implementation-defined maximum size,
then return a rectangle that is equal to |element|'s [=border box=].

1. Otherwise:

Issue: Define the algorithm used to clip the snapshot when it exceeds max size.
</div>

## [=Handle transition frame=] ## {#handle-transition-frame-algorithm}

<div algorithm>
Expand Down