
In issues of chromium over the past few days, several issues have appeared in which the following scenario is described: a heavy css3 selector is used, as a result of which there is an incorrect appeal. Including the selector to multiple objects can work incorrectly through a comma (#a, #b, #c etc.), nth-last-child definitely does not work correctly. Guaranteed bug with it.
The problem, apparently, is in the mechanism of css-requests, since document.querySelector is also incorrectly addressed. What is most unpleasant - jQuery also relies on native functions (if they exist). Thus, complex jQuery queries also stopped working correctly.
If your projects use nth-last-child, the details of the bug under the cut
The bug manifests itself under all OSs: the reports in the chrome repository go under windows, we came across a problem in Mac OS.
In version 31, as it turned out, a very strange behavior of the nth-last-child appeared:
: nth-last-child (1) ==: last-child, it may be a matter of query optimization.
: nth-last-child (2) == null
: nth-last-child (3) ==: nth-child (1)
: nth-last-child (4) ==: nth-child (2)
and so on.
At the same time, this behavior is enabled for any change in styles. This can be: hover, and jQuery initialization.
Subjectively, sensations suggest that other “heavy” css3 selectors may also not work correctly.
In our case - immediately after the discovery, we checked all the projects and found $ (': nth-last-child (3)') in two pieces of code. Fortunately, the selector influenced the functionality slightly. In other projects, such selectors are also sometimes found (both in styles and in code), so be prepared for a little unusual work of sites, and the more complex the site, the greater the likelihood of strange behavior in the world's most popular automatically updated browser in at least the next few days
Yes, it seems to be one of the usual Chrome bugs, but the trouble is that using nth-last-child as a crutch in some projects now, unfortunately, is a relatively common practice, and, for example, a solution with a conditional block width for headers has appeared two years ago.
')
Examples of incorrect behavior:

Slightly modified code from one of the examples:
http://codepen.io/anon/pen/buDspTo start the glitch move the mouse around the circles.
Gifka with what is happening: (just hover, not clicks)

In this case, nth-of-type and nth-last-of-type work correctly, so that in most cases you can use them as a temporary solution.
Oh, yes, the issue, of course, is already in the chromium tracker, as it was written at the very beginning, this is just information for those who use nth-last-child in production - that this selector will most likely not work correctly.