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-backgrounds-4] How to set declarations of background-position containing a logical keyword? #9253

Open
cdoublev opened this issue Aug 28, 2023 · 0 comments

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Aug 28, 2023

Context

  • the grammar of background-position as a shorthand is still under discussion
  • there is some browser support of background-position-x/background-position-y
  • there does not seem to be a pressing need to implement this feature

When the specified value includes a logical keyword, the text does not seem to know what it should exactly happen yet:

Issue 2: Specify the value assignment in more detail. Should expand just like Level 3.

Issue 3: Specify what happens to set of properties that are not set. Maybe they’re just not set?

https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position

Logical longhand declarations must be added after physical longhand declarations, isn't it? And physical longhand declarations must be added after logical longhand declarations if physical keywords are specified.

If I am not mistaken, step 3.4.2 of serialize a CSS declaration block would need to be changed if the set of longhands that is not explicitly declared is not reset to its initial value:

  1. If all properties that map to shorthand are not present in longhands, continue with the steps labeled shorthand loop.

For example: if shorthand maps to longhands included in a logical property group, and all longhands of the same mapping logic have a declaration in longhands (excluding longhand declarations that do not map to shorthand) that come after any other declaration with another mapping logic, continue with the procedure.

A similar check would be required in the procedure of style.getPropertyValue().

But what is the benefit of, I guess, preserving longhands declarations that would have been set before setting the shorthand with values for longhands that follow a different mapping logic?

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

1 participant