-
Notifications
You must be signed in to change notification settings - Fork 693
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
[css-view-transitions-2] Reflecting view-transition-group
in computed style
#10638
Comments
I lean towards (1) because it'll allow us more room to iterate on whether a name applies or not going forward. For example, on #8282 we considered a CSS property which says, "ignore the name if it's offscreen". If we went with (2) or (3) then we'd have a harder time doing this since we'll need to know if an element is offscreen during the style cascade which would be extremely complicated. Or we'd have to say the computed style gets you the final name except in these cases which is also confusing. |
I think the overhead here is worth considering. The problem is that if done at style computation, then this needs to be kept up to date with things like topology changes and style invalidations all the time. However, this properly only has an effect when a view transition starts which is a rare event compared to style computation. My preference would be to have the computed value be the specified value, and then figure out the used value at capture time (or whenever the transition actually begins) |
I don't think this is a sufficient argument. If we come up with a use case that can't be resolved during style computation in the future, we can handle it then.
Optimizations for this are possible, such as only computing it when calling I do agree that there is some implementation complexity to it and we should weigh whether the slight ergonomic benefit is worth it. |
Same, for the reasons stated above. I don't think unnecessary complexity should be introduced if there's no significant benefit. |
Closing this for now, I don't think anyone proposes something different from the existing text. |
Folllow up on #10334
We defined a few rules on how
view-transition-group
is computed:nearest
/normal
/contain
)view-transition-name
)We have all the information we need during style computation to compute a resolved
view-transition-group
, so hypotheticallygetComputedStyle
can already return the resolved group. It fits with other things thatgetComputedStyle
does (colors, length, transforms etc). The other option is to resolve them when capturingThere are a few options:
getComputedStyle
nearest
/normal
/contain
keywords, but doesn't resolve rules that depend on the existence ofview-transition-name
.view-transition-group
is always computed to be a valid ancestorview-transition-name
.I think (3) would be the most useful for developers and consistent with other things
getComputedStyle
does, but perhaps the overhead on style computation is unnecessary.The text was updated successfully, but these errors were encountered: