-
Notifications
You must be signed in to change notification settings - Fork 759
Description
It has been resolved to disable forgiving parsing in selector(). The initial motivation was to add styles based on user agent restrictions on :has() argument, which was previously <forgiving-relative-selector-list> but is now <relative-selector-list>.
Outdated browser interoperability issue
Chrome and FF seem to disagree on forgiving invalid selectors in selector(): in the following test case, text is red, not underlined in Chrome, and is neither red or underlined in FF.
<style>
@supports selector(:is(undeclared|div)) { /* Forgiving :is() */
div { color: red }
}
@supports selector(:not(undeclared|div)) { /* Unforgiving :not() */
div { text-decoration: underline }
}
</style>
<div>text</div>Also, should selector(:is()) evaluate to true or false? Chrome and FF also disagree on this.
I do not have a strong opinion but I find it a bit surprising that selector(:is(::before, div)) must evaluate to false whereas :is(::before, div) selects any div. If the author wants to test the support of pseudo-elements, he can write selector(::pseudo) or selector(:not(::pseudo, ::another-pseudo)).