What is the correct behavior of this?
<style>
div::before {
& {
content: "test";
}
}
</style>
<div>xyz</div>
FWIW, my preferred resolution would be “inner rule matches nothing”, since pseudo element selectors are not allowed within :is() and & is generally defined in terms of :is(), but the spec is not clear on this (it doesn't define & as exactly equivalent to :is(), just that it matches the elements of the parent rule and has the same specificity).
The other two alternatives would be either parse error (difficult when taking CSSOM into account) or that it actually would be equivalent with writing out div::before (problematic when combining & with further selectors).
What is the correct behavior of this?
FWIW, my preferred resolution would be “inner rule matches nothing”, since pseudo element selectors are not allowed within :is() and & is generally defined in terms of :is(), but the spec is not clear on this (it doesn't define & as exactly equivalent to :is(), just that it matches the elements of the parent rule and has the same specificity).
The other two alternatives would be either parse error (difficult when taking CSSOM into account) or that it actually would be equivalent with writing out div::before (problematic when combining & with further selectors).