Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specificity of the most specific complex selector in its selector list argument doesn't counts for :nth-child() and :nth-last-child() selectors #12

Closed
Semigradsky opened this issue Oct 3, 2020 · 1 comment · Fixed by #40
Labels
enhancement New feature or request

Comments

@Semigradsky
Copy link

See example 59 from https://www.w3.org/TR/selectors-4/#specificity-rules

:nth-child(even of li, .item) has a specificity of (0,2,0)—like a class selector (.item) plus a pseudo-class—when matched against any of <li>, <ul class=item>, or <li class=item id=foo>.

:nth-child(even of li, .item)

AST (in recursive parsing mode):

{
	"type": "pseudo-class",
	"content": ":nth-child(even of li, .item)",
	"name": "nth-child",
	"argument": "even of li, .item",
	"pos": [
		0,
		29
	]
}

Specificity: 0,1,0

@LeaVerou LeaVerou added the enhancement New feature or request label Oct 5, 2020
@LeaVerou
Copy link
Owner

LeaVerou commented Oct 5, 2020

Yes, this syntax is not accounted for yet. It's parsed correctly due to Parsel's permissiveness, but it's not implemented in the specificity calculation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants