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

Fix :nth-*(an+b) pseudo-classes selectors for negative a's #42

Closed
wants to merge 3 commits into from
Closed

Fix :nth-*(an+b) pseudo-classes selectors for negative a's #42

wants to merge 3 commits into from

Conversation

redapple
Copy link
Contributor

@redapple redapple commented Jul 23, 2014

Fixes #15 and #46

I rewrote xpath_nth_child_function() to follow the logic I wrote down on paper with simple equations. It's not the nicest code.

I also changed the expected result for li:nth-last-child(2n+2):
as I understand the W3C specs, an+b-1 siblings after should return li's that have 2n+1 siblings after them, so li 6, 4 and 2 (of the 7 li in the test document)
http://www.w3.org/TR/selectors/#nth-last-child-pseudo

</head>
<body>
<div id="test">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a huge diff unrelated to the rest of the commit. Could you avoid touching non-trailing whitespace? Or if you really want to get rid of tabs, please do it in a separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, it's my editor default settings. Will clean it up

@redapple
Copy link
Contributor Author

Does that look better?

@redapple
Copy link
Contributor Author

@SimonSapin , do you think this can be merged?
Any feedback?
Thanks.

@SimonSapin
Copy link
Contributor

Please see #48.

Fix :nth-last-child(1)/:nth-last-of-type(1) translations (fixes #15)
@codecov-io
Copy link

codecov-io commented Jul 7, 2016

Current coverage is 95.43%

Merging #42 into master will increase coverage by 0.37%

@@             master        #42   diff @@
==========================================
  Files             3          3          
  Lines           708        723    +15   
  Methods           0          0          
  Messages          0          0          
  Branches        114        121     +7   
==========================================
+ Hits            673        690    +17   
  Misses           19         19          
+ Partials         16         14     -2   

Powered by Codecov. Last updated by b6ba4ff...cca9529

@redapple
Copy link
Contributor Author

Superseded by #60

@redapple redapple closed this Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

:nth-last-child() is wrong
3 participants