Re: [csswg-drafts] [css-view-transitions-1] Define behaviour when capturing image for a large element. (#8561)

@noamr, the resolution we had on this issue was captured in the comment [here](https://github.com/w3c/csswg-drafts/issues/8561#issuecomment-1470414852).

1. user agent can limit rasterization for performance limitations, but must size the element as if it was fully rasterized
   \
   This is for the size assigned to the `::view-transition-group` pseudo-element. The relevant spec text is [here](https://drafts.csswg.org/css-view-transitions-1/#capture-old-state-algorithm:~:text=The%20size%20of%20the%20snapshot%20root%20if%20element%20is%20the%20document%20element%2C%20otherwise%2C%20the%20width%20and%20height%20of%20element%E2%80%99s%20border%20box.). We resolved that even if the full element can't be captured, this size is independent of that.

2. rasterization must cover at least the visible area of the viewport
   \
   This resolution needs an edit to the approach defined [here](https://drafts.csswg.org/css-view-transitions-1/#capture-the-image-algorithm:~:text=Let%20interestRectangle%20be,the%20interestRectangle%20bounds.). The original spec text was written with the assumption that we'll define the exact subset of the element that the UA has to capture.
   \
   But with this resolution, the UA needs to capture the part of the element which is in the visible viewport. The extra buffer around it can be a recommendation in the spec but is left to the UA.


> Think of a 500x10000 DIV with transform: rotateX(85deg). It would have most or all of its pre-transformed 5m pixels "in viewport".

I didn't follow this. Was trying the test case [here](https://jsbin.com/mafewejoci/edit?html,output) but I'm likely misunderstanding what you said. This does bring up a good point that when we say "visible area in the viewport", we mean an intersection between the snapshot root and the element's quad based on its screen space transform. The transform for that is already defined in the spec [here](https://drafts.csswg.org/css-view-transitions-1/#capture-old-state-algorithm:~:text=A%20transform%20that%20would%20map%20element%E2%80%99s%20border%20box%20from%20the%20snapshot%20root%20origin%20to%20its%20current%20visual%20position.).


The end of the discussion was about a different point:

```
<emeyer> fantasai: You can limit rasterization but if you’re getting to the point you can’t even transition what’s on-screen, you should skip the whole thing
```

Assuming we do have to capture everything in the viewport to be visually correct, but we don't have enough GPU memory to do it, should we abort the transition? And if so, should that failure be visible to authors or silent. This is a rare edge case that can be discussed as a follow up. But it doesn't alter the resolution that the UA must capture what's in the visible viewport and any extra buffer beyond that is a UA detail.

-- 
GitHub Notification of comment by khushalsagar
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8561#issuecomment-1539110905 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 8 May 2023 22:02:09 UTC