Boostrap scrollspy does not work in Chrome but works in Firefox

The reason for this problem is:

"Non-:visible target elements ignored Target elements that are not :visible according to jQuery will be ignored and their corresponding nav items will never be highlighted."

:visible has different behavour in Firefox and Chrome.

For example following HTML is invisible in Chrome, but visible in Firefox:

<a id="home"></a>

Bootstrap commit where :visible check is enabled: