Skip to content

fix nthchild false negative#1757

Merged
ryanseddon merged 2 commits intoModernizr:masterfrom
mstrutt:master
Nov 16, 2015
Merged

fix nthchild false negative#1757
ryanseddon merged 2 commits intoModernizr:masterfrom
mstrutt:master

Conversation

@mstrutt
Copy link
Contributor

@mstrutt mstrutt commented Nov 14, 2015

Passing a function in to Modernizr.addTest resulted the code being executed after elem had been removed from the DOM (and so had no layout). I've moved the code to be executed immediately and the just the result (which I renamed just to make the last line a bit more human readable) passed into Modernizr.addTest.

I searched the rest of the css feature-detects and nthchild appears to be the only test with this issue. That said, might be worth adding a little note to the docs about time of execution with testStyles and addTest.

All tests passed locally before and after this fix, but it was a bit beyond me to dive into what's happening with them

fixes #1675

Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to multiple var's this is an old one but all other tests should use this pattern going forward

@mstrutt
Copy link
Contributor Author

mstrutt commented Nov 15, 2015

done :)

ryanseddon added a commit that referenced this pull request Nov 16, 2015
fix nthchild false negative
@ryanseddon ryanseddon merged commit b42ce72 into Modernizr:master Nov 16, 2015
@ryanseddon
Copy link
Member

Thanks @mstrutt

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-child false negative

2 participants