Re: [csswg-drafts] [css-cascade-5] Cascade Layers need CSSOM support (#6576)

It seems pretty clear that we'd have (as @xiaochengh outlined above):

```
[Exposed=Window]
interface CSSLayerBlockRule : CSSGroupingRule {
  attribute somethingsomethingforthenames;
};

[Exposed=Window]
interface CSSLayerStatementRule : CSSRule {
  attribute somethingsomethingforthenames;
};
```

But the open question is, what are the somethingsomethingforthenames?

Tab suggests to have .name or .nameText or something on the group rule be a simple string (e.g. "name.subname"), which is pretty straightforward, but then for the statement rule, do we want a single string ("name1, name.subname, name3") or a list of strings ("name1", "name.subname", "name3")?

It feels pretty weird if we have the attribute on these rules both be single strings while the group rule string has commas in it and the other one doesn't. Miriam also thinks it feels more natural to have an array here. We'd prefer something like string .name for the grouping rule, and an array of strings .nameList for the statement rule. (But neither of us knows much about CSSOM interfaces.)

One point that @tabatkins  brought up was that various comma-separated things in the CSSOM (e.g. selectors, conditionText) are represented as a single list. But a) in these cases the comma represents an "or" operator, so the string is not so much representing a list of things as a single combined condition and b) none of these are trying to coordinate with a nearly-identical rule whose corresponding attribute represents a single item of the type represented in that comma-separated list.

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6576#issuecomment-943858864 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 15 October 2021 00:19:37 UTC