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
Add feature detect for nth-child() #685
Conversation
| return Modernizr.testStyles("#modernizr div {width:1px} #modernizr div:nth-child(2n) {width:2px;}", function (elem) { | ||
| var elems = elem.getElementsByTagName("div"), | ||
| test = true; | ||
| for (i=0; i<5; i++) { |
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.
You're leaking the i
|
Please add a description to the PR about how the test works. |
| var elems = elem.getElementsByTagName('div'), | ||
| test = true; | ||
|
|
||
| for (var i=0; i<5; i++) { |
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.
for (var i = 0; i < 5; i++) {
|
@emilchristensen ping |
|
👍 |
Move unit test plugins to devDependencies
Fixed `define()` stripping regex
|
+1 |
|
This needs updating to the v3 format before we can accept it. @emilchristensen are you able to do this, or does someone else fancy volunteering? |
|
I'll update it to v3 asap |
|
Great, thanks. |
|
Alright, this is updated and should adhere to the v3 principle and former comments in this thread. |
|
Need me to squash it before merge or are we good to go? |
- Moved 'how it works' out of DOC block (this is for user documentation, rather than maintainer/implementation documentation – I've also clarified this on [the wiki](https://github.com/Modernizr/Modernizr/wiki/Authoring-a-v3-test)) - Turned `"authors"` and `"warnings"` fields into arrays - Corrected `"property"` field to match name used in `Modernizr.addTest()` (these must be the same)
|
Thanks. I've raised a PR on your fork of the repo with a couple of changes to the metadata/DOC blocks. If you're happy with that, could you merge that in, squash the commits and push again? Then we'll pull it in. Thanks :-) |
Metadata / DOC improvements
|
I couldn't rebase n' squash all the way back I'm afraid. I'm guessing too big difference in the structure of how the project looked back then. I've been able to squash back to 1fe1e83. Do you want me to push that? Or do you have an idea on how to fix the problems (I'm thinking it's something with the files getting added in different places) |
|
Yeah if you could push that, that'll be fine – thanks. |
Add feature detect for nth-child()
|
Nice one, thanks @emilchristensen! |
Add feature detect for nth-child()
Reference: http://reference.sitepoint.com/css/pseudoclass-nthchild
Tested to work in:
Internet Explorer 7 (false), 8 (false), 9 (true)
Chrome 7 (true), 21 (true)
Firefox 3.6 (true), 14 (true)
Safari 5.2 (true), 6 (true)
Opera 9.0 build 3447 (false), 12 (true)
Known issues in:
Safari 3.1, 3.2.2 (false negatives)