-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix :nth-*(an+b) pseudo-classes selectors #60
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix :nth-last-child(1)/:nth-last-of-type(1) translations (fixes #15)
Current coverage is 95.00%@@ master #60 diff @@
==========================================
Files 3 3
Lines 708 701 -7
Methods 0 0
Messages 0 0
Branches 114 113 -1
==========================================
- Hits 673 666 -7
- Misses 19 20 +1
+ Partials 16 15 -1
|
redapple
changed the title
Fix :nth-*(an+b) pseudo-classes selectors for negative a's (2nd take)
[WIP] Fix :nth-*(an+b) pseudo-classes selectors for negative a's (2nd take)
Jul 12, 2016
redapple
changed the title
[WIP] Fix :nth-*(an+b) pseudo-classes selectors for negative a's (2nd take)
[WIP] Fix :nth-*(an+b) pseudo-classes selectors
Jul 12, 2016
redapple
changed the title
[WIP] Fix :nth-*(an+b) pseudo-classes selectors
Fix :nth-*(an+b) pseudo-classes selectors
Jul 12, 2016
redapple
referenced
this pull request
in sjp/selectr
Aug 29, 2016
Ported from @redapple's implementation.
Hi @redapple! It seems we'll have hard time finding anyone to review this pull request properly. I'm merging it anyways because
|
This was referenced Sep 9, 2016
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a continuation of #42 but following https://www.w3.org/TR/css3-selectors/#structural-pseudos definitions more closely, that is, counting
preceding-sibling::
orfollowing-sibling::
explicitly, instead of using context-dependentposition()
:In fact, this was suggested in sparklemotion/nokogiri#707 (comment).
It fixes #12, #15, #46.
Another change is
xpath_descendant_combinator
which now translates to/descendant
(instead of/descendant-or-self
), which looks more inline with Descendant combinator:The general case of
h2 ~ *:nth-of-type(2)
is not fixed by this PR. It looks hard (or impossible) to achieve with XPath 1.0 alone, but it may not be that common case.