Re: [csswg-drafts] [css-shared-element-transitions-1] when to update the pseudo element styles (#7812)

> when the stylesheet is updated to represent the changed source element does not have a precedent

Conceptually generating style for these elements is similar to computing the layout for any element IMO. Let's take the ::page-transition-container as an example. The style values for it are computed based on the text [here](https://drafts.csswg.org/css-view-transitions-1/#create-transition-pseudo-elements-algorithm:~:text=Set%20width%20to%20the%20current%20width%20of%20capturedElement%E2%80%99s%20incoming%20element%27s%20border%20box.) : "Set width to the current width of capturedElement’s [incoming element](https://drafts.csswg.org/css-view-transitions-1/#captured-element-incoming-element)'s [border box](https://drafts.csswg.org/css-box-4/#border-box)."

So the browser would need to update layout to get the corresponding element's layout bounds and generate the style values for this pseudo-element. A similar layout operation would've been forced if the developer queried offsetWidth for that DOM element. So why can't we do the same thing here if the developer queries style for that pseudo-element? Trying to limit this to specific events makes it difficult for the developer to reason about when to query this state.



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


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

Received on Friday, 14 October 2022 16:19:09 UTC