Re: [csswg-drafts] [css-view-transitions-1] Capturing fragmented elements (#8339)

The Firefox implementation doesn't seem to align to the [spec](https://w3c.github.io/csswg-drafts/css-images-4/#element-notation:~:text=If%20the%20referenced%20element%20has%20a%20transform%20applied%20to%20it%20or%20an%20ancestor%2C%20the%20transform%20must%20be%20ignored%20when%20rendering%20the%20element%20as%20an%20image.), it explicitly states that transforms on the element should be ignored: "If the referenced element has a transform applied to it or an ancestor, the transform must be ignored when rendering the element as an image."

View Transition [spec](https://drafts.csswg.org/css-view-transitions-1/#capture-rendering-characteristics:~:text=If%20the%20referenced%20element%20has%20a%20transform%20applied%20to%20it%20(or%20its%20ancestors)%2C%20then%20the%20transform%20is%20ignored) handles transforms the same way, they are ignored when rendering the element's image: "If the referenced element has a transform applied to it (or its ancestors), then the transform is ignored".

This model makes sense for non-fragmented content since the element's screen space transform, which includes layout position, transform from ancestors and its local transform; is applied to the pseudo-element displaying it. We'll have to carve out many special cases for fragmented elements:

- Figure out what the border box size should be to decide what to size its ::view-transition-group. We've talked about unioning the rects of each fragment, but I'm not sure what these rects are relative to.
- Render the image with the local transform, as opposed to without it in the default case.
- Figure out what the image size should be. This is different from the non-fragmented case where we take the ink overflow rectangle. This size will be the union of transformed rects for each fragment with their overflow.
- Figure out what the object-view-box should be. In the default case its the value which places the border-box origin in the image at ::view-transition-group's pseudo's origin.

I'm not saying the above is not doable, but its a lot of complexity for an esoteric case that I don't think is worth doing. Though would be good to get another implementor's take on this: @emilio @dholbert.

Also @vmpstr, @bfgeek and @chrishtr who probably know a lot more complications with this case than me; and have expressed disallowing transitions on a fragmented element as the better option. Please clarify if I misunderstood.

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


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

Received on Tuesday, 14 March 2023 21:11:47 UTC