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-syntax-3][cssom-1] Return declarations in specified order #9821

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cdoublev
Copy link
Collaborator

The attribute change steps for Element.style, and the procedure for creating a new CSSStyleDeclaration, are receiving declarations from parse a CSS declaration block, in undefined order.

https://drafts.csswg.org/cssom-1/#css-declaration-blocks

A CSS declaration block has these attribute change steps [...]:

[...]

  1. Otherwise, let the declarations be the result of parse a CSS declaration block from a string value.

When a CSS declaration block object is created, then:

[...]

If value is not null, let the declarations be the result of parse a CSS declaration block from a string value.

Declarations should be in specified order, which I propose to apply in parse a CSS declaration block.

@cdoublev
Copy link
Collaborator Author

cdoublev commented Jan 22, 2024

Actually consume a block's contents (CSS Syntax) now filters invalid declarations in the context, so it should also be responsible of applying the specified order, and the steps of parse a CSS declaration block should only be returning the declarations from the result of parse a block's contents.

(edit: fixed) I do not know how to create a link to specified order in CSSOM from CSS Syntax, so I mark this PR as a draft.

@cdoublev cdoublev marked this pull request as draft January 22, 2024 13:41
@cdoublev cdoublev changed the title [cssom-1] Return declarations in specified order from parse a CSS dec… [css-syntax-3] Return declarations in specified order from parse a CSS dec… Jan 22, 2024
@cdoublev cdoublev changed the title [css-syntax-3] Return declarations in specified order from parse a CSS dec… [css-syntax-3] Return declarations in specified order Jan 22, 2024
@cdoublev cdoublev changed the title [css-syntax-3] Return declarations in specified order [css-syntax-3][cssom-1] Return declarations in specified order Jan 22, 2024
@cdoublev cdoublev marked this pull request as ready for review January 25, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant