[go: up one dir, main page]

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-cascade-6] What is the desired shape of CSSScopeRule? #8626

Closed
mirisuzanne opened this issue Mar 21, 2023 · 9 comments
Closed

[css-cascade-6] What is the desired shape of CSSScopeRule? #8626

mirisuzanne opened this issue Mar 21, 2023 · 9 comments

Comments

@mirisuzanne
Copy link
Contributor

In #8468 @andruud pushed a spec definition for adding CSSScopeRule to CSSOM:

	[Exposed=Window]
	interface CSSScopeRule : CSSGroupingRule {
	  readonly attribute CSSOMString start;
	  readonly attribute CSSOMString end;
	};

As far as I can tell, this change in the spec never had a resolution attached – so bringing it up here to get that resolution. In conversation with @fantasai, she also raised a few questions about the final shape of this rule:

  • Is 'start'/'end' the terms we want? Or do we want 'root'/'floor', or any number of other things. Since this is the only place in which the terminology is actually user-facing, it becomes a real question.
  • Should they return null string or null if they're missing?
  • Do they include the wrapping parentheses or not?
@fantasai
Copy link
Collaborator

Fwiw, I think we should not include the wrapping parentheses so that the returned string is a proper selector, and they should be null if omitted.

I don't have much opinion on the names (they seem fine), but I think it's a question worth asking.

@mirisuzanne
Copy link
Contributor Author

I agree that the names seem fine to me. Other terms that get used for these concepts are 'root', and 'boundary' or 'limit'.

@tabatkins
Copy link
Member

I'm fine with the names as well. I could think of some different ones, but nothing seems better, and quite a bit seem worse.

null when omitted is indeed correct imo. There's a lot of stuff in CSSOM that uses empty string for this semantic and I think that's just terrible legacy design, and doesn't need to be emulated.

Yeah, omit the wrapping parens so the values are just the selectors themselves. The parens are a syntactic necessity for the rule itself, they're not part of the start/end bits.

@tabatkins
Copy link
Member

Well, wrt the names, I actually suggested upper and lower as option-bag property names in qSA() over in #7709 (comment). Those might be a little better?

@bramus
Copy link
Contributor
bramus commented Mar 22, 2023

Does upper and lower make sense with @scope-siblings? My hunch would be that start and end is better, especially if the suggested :scope-end selector would make it.

@tabatkins
Copy link
Member

Yeah that's a good point, so let's stick with the more generic start and end.

@mirisuzanne
Copy link
Contributor Author

Does this seem like a good candidate for async resolution? I think so. Proposal is:

  • Keep start/end terms
  • Return null when missing
  • Don't include parenthesis

@mirisuzanne mirisuzanne added the Async Resolution: Proposed Candidate for auto-resolve with stated time limit label Mar 23, 2023
@bramus
Copy link
Contributor
bramus commented Mar 24, 2023

SGTM

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-cascade-6] What is the desired shape of CSSScopeRule?, and agreed to the following:

  • RESOLVED: Accept the CSSScopeRule design, with the three changes noted in the thread.
The full IRC log of that discussion <TabAtkins> miriam: Anders pushed a definition for the CSSSCopeRule, in the ED
<TabAtkins> miriam: We didn't ahve a resolution on the details tho, so wanted to clarify it's defined properly
<TabAtkins> miriam: Main qs in the thread are terms used for the start and end fo the scope (sometimes called "root" and "lower boudnary"/"scoping limit")
<TabAtkins> miriam: In thread we decided start/end were clearest terms, especially if we do sibling scopes - they keep making sense, while upper/lower dont'
<TabAtkins> miriam: Another q is what to return if one of the values isn't specified, we suggest null
<TabAtkins> miriam: Final q, should the value contain the parens around the selectors? Propose no.
<Rossen_> q?
<TabAtkins> miriam: So proposal is accept the CSSScopeRule, with the three conclusions outlined above.
<fantasai> +1
<bramus> +1
<TabAtkins> Rossen_: Looks like agreement in the thread, anyone have objections?
<TabAtkins> RESOLVED: Accept the CSSScopeRule design, with the three changes noted in the thread.

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

6 participants