W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2017

Re: [csswg-drafts] [selectors-4] reconsider specificity rule for :matches()

From: SelenIT via GitHub <sysbot+gh@w3.org>
Date: Sun, 31 Dec 2017 16:46:06 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-354613724-1514738765-sysbot+gh@w3.org>
@Loirooriol, I don’t see this ambiguity in the spec. Since the spec for `:matches()` specificity says

> The full selector’s specificity is equivalent to expanding out all the combinations in full

this example will be expanded as

`#a + .foo span, #a + * span, * + .foo span, * + * span { ... }`

and by the [rules](https://drafts.csswg.org/selectors-4/#specificity-rules) of the selectors list specificity, its specificity will be the largest one of the individual selectors in the list that match the element, in this example it would be (1, 0, 1) of `#a + * span`. There is only one way to expand `:matches()` into a selector list, and any selector list has only one maximum specificity value of its parts (even if several parts have the same specificity), so there is no place for the ambiguity to occur.

Do I miss something?

-- 
GitHub Notification of comment by SelenIT
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1027#issuecomment-354613724 using your GitHub account
Received on Sunday, 31 December 2017 16:46:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:21 UTC