Skip to content
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-anchor-position] Does fallback affect the computed style? #9229

Closed
emilio opened this issue Aug 23, 2023 · 5 comments
Closed

[css-anchor-position] Does fallback affect the computed style? #9229

emilio opened this issue Aug 23, 2023 · 5 comments

Comments

@emilio
Copy link
Collaborator

emilio commented Aug 23, 2023

https://drafts.csswg.org/css-anchor-position-1/#fallback-rule is pretty vague on how fallback applies.

Should the fallback be observable from getComputedStyle()? What about computedStyleMap?

Presumably insets/margins should since those return the used values from getComputedStyle, but others properties won't?

@xiaochengh
Copy link
Contributor

I think these are already clear in the current specs.

https://drafts.csswg.org/css-anchor-position-1/#fallback-apply:

When an element uses a position fallback list, it selects one entry from the list as defined below, and applies those properties to itself as used values."

So they are applied at used value time (during layout), and do not affect the computed values.

Should the fallback be observable from getComputedStyle()?

Yes, because getComputedStyle() returns used values for some properties.

What about computedStyleMap?

No, because computedStyleMap holds computed values only.


Note: this is just how it currently works, but ideally, we would still like fallback declarations to be applied at computed value time, so that smooth transitioning between fallback positions can be possible. See #8372

@emilio
Copy link
Collaborator Author

emilio commented Aug 23, 2023

Ok, that matches my intuition on how it should be spec'd, great :)

I think I just didn't realize that was properly defined further down. Maybe https://drafts.csswg.org/css-anchor-position-1/#fallback-rule should somehow link to that section?

@emilio emilio removed the Agenda+ label Aug 23, 2023
@xiaochengh
Copy link
Contributor

I assume this issue is purely editorial then?

@emilio
Copy link
Collaborator Author

emilio commented Aug 30, 2023

Yes

@tabatkins
Copy link
Member

This should be well specified now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants