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 Nesting: The Nested Declarations Rule #1048

Open
andruud opened this issue Jun 28, 2024 · 2 comments
Open

CSS Nesting: The Nested Declarations Rule #1048

andruud opened this issue Jun 28, 2024 · 2 comments

Comments

@andruud
Copy link

andruud commented Jun 28, 2024

Request for Mozilla Position on an Emerging Web Specification

Other information

See also:

@emilio
Copy link
Collaborator

emilio commented Jul 2, 2024

I think the insertRule special-case is wrong, as per discussion... Parse declarations ~never fails (spec wise), it just returns an empty declaration list, so something like insertRule("yadayada") would not throw, just create an empty CSSNestedDeclarations object...

Easiest fix would be to check if the declaration list is not empty or so, though it seems that'd cause some other weird behavior like unknown-property: foo throwing, but unknown-property: foo; color: red working (and having a single declaration). I guess it's not too bad tho...

With that tweak or something along those lines resolved on by the CSSWG, this looks acceptable to me (kinda reluctantly).

I still think it's a really weird set-up, but given the discussions and that this is still better than the status quo, I guess positive is fine? Thanks for pushing this forward :)

@andruud
Copy link
Author

andruud commented Jul 2, 2024

I think the insertRule special-case is wrong

Yes, thanks, that was a mistake from my side.

(For the benefit of other people reading):

Easiest fix would be to check if the declaration list is not empty or so

Done: w3c/csswg-drafts#10519

Filed w3c/csswg-drafts#10520 to get a stamp for the above change, or to see if we should do something else instead.

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

No branches or pull requests

2 participants