Skip to content

[css-conditional-5] Extend CSSContainerRule for multiple conditions.#13635

Open
emilio wants to merge 1 commit intomainfrom
condition-rule-cssom
Open

[css-conditional-5] Extend CSSContainerRule for multiple conditions.#13635
emilio wants to merge 1 commit intomainfrom
condition-rule-cssom

Conversation

@emilio
Copy link
Collaborator

@emilio emilio commented Mar 12, 2026

Open questions:

  • Do we want to do this "return string or array thing"? Or should we just return the empty string on containerName / containerQuery when there are multiple conditions? Maybe that's simpler.

  • If we do the "string or array thing", do we still want to expose the "always array" version (containerNames / containerQueries)? I think so, but I guess I could go either way.

Fixes #10845

@emilio emilio requested review from mirisuzanne and tabatkins March 12, 2026 12:15
@emilio emilio added the css-conditional-5 Current Work label Mar 12, 2026
@emilio
Copy link
Collaborator Author

emilio commented Mar 12, 2026

@tabatkins any strong opinions on the "String or array" thing? I think that probably just returning the empty string when there are multiple conditions is better, because otherwise things like if (rule.containerName.startsWith("my-thing")) will start crashing if you put multiple conditions.

@mirisuzanne
Copy link
Contributor

I don't have any strong feelings on the shape of this, I'd be fine with either approach.

@emilio
Copy link
Collaborator Author

emilio commented Mar 13, 2026

https://phabricator.services.mozilla.com/D287344 has some implementation and tests of this proposal.

@tabatkins
Copy link
Member

I do weakly prefer returning the empty string when it's multiple conditions, yeah.

@emilio
Copy link
Collaborator Author

emilio commented Mar 25, 2026

@mirisuzanne could I get your stamp as editor for the spec text?

lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Mar 26, 2026
…ebidl,smaug

As per w3c/csswg-drafts#13635. To be landed once
there's a resolution and so on.

The multiple conditions subtest is expected to fail until we implement
parsing for those.

Differential Revision: https://phabricator.services.mozilla.com/D287344
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 26, 2026
As per w3c/csswg-drafts#13635. To be landed once
there's a resolution and so on.

The multiple conditions subtest is expected to fail until we implement
parsing for those.

Differential Revision: https://phabricator.services.mozilla.com/D287344

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2022827
gecko-commit: 89c6e5274681ec27ca9ba117b32c38a89ce5362f
gecko-commit-git: ede0eccbeb8afa2dbd04e1876fbe6115432eadd1
gecko-reviewers: AlaskanEmily, webidl, smaug
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Mar 26, 2026
As per w3c/csswg-drafts#13635. To be landed once
there's a resolution and so on.

The multiple conditions subtest is expected to fail until we implement
parsing for those.

Differential Revision: https://phabricator.services.mozilla.com/D287344

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=2022827
gecko-commit: 89c6e5274681ec27ca9ba117b32c38a89ce5362f
gecko-commit-git: ede0eccbeb8afa2dbd04e1876fbe6115432eadd1
gecko-reviewers: AlaskanEmily, webidl, smaug
Return an empty string for multiple conditions as per resolution.

Fixes #10845
@emilio emilio force-pushed the condition-rule-cssom branch from a962648 to 4e66daf Compare March 26, 2026 14:07
@emilio
Copy link
Collaborator Author

emilio commented Mar 26, 2026

@AtkinsSJ thanks for the review! I think I addressed your comments, but lmk otherwise :)

Copy link
Contributor

@mirisuzanne mirisuzanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me (with the caveat that I have very little experience with CSSOM from either the spec or author end)

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

Labels

css-conditional-5 Current Work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[css-conditional-5] CSSContainerRule.containerName/containerQuery should return a list

4 participants