-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add sourceIndex
to Selector
nodes
#290
add sourceIndex
to Selector
nodes
#290
Conversation
@@ -685,7 +693,10 @@ export default class Parser { | |||
let unbalanced = 1; | |||
this.position ++; | |||
if (last && last.type === types.PSEUDO) { | |||
const selector = new Selector({source: {start: tokenStart(this.tokens[this.position - 1])}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell this was always incorrect.
this.tokens[this.position - 1]
is the open parenthesis, but that isn't the start token of the selector. The selector starts inside the parenthesis.
:is(foo)
^ here
:is(foo)
^ not here
By comparison when the selector is part of a list and follows a comma it also does not have the comma as the start position. It starts after the comma.
:is(foo,bar)
^ here
:is(foo,bar)
^ not here
Thank you @alexander-akait 🙇 |
fixes : #287