A browser bug is an implementation error that makes behavior differ from what is expected. For reusable JavaScript, bugs and browser differences can undermine features across the browsers you support. Prioritize the browsers your audience uses, and ensure code degrades gracefully in less popular ones. section 14.2 section 14.2.1
A practical approach:
- Test common and fringe use cases across the supported browsers. section 14.2.1
- Avoid relying on a bug remaining: a browser update may fix it and break a workaround built around its presence. section 14.2.2
- Balance compatibility work against your audience, development resources, and schedule. section 14.2
The root element’s scroll position
The described scrollTop and scrollLeft inconsistency illustrates why workarounds need care: IE 11 and Firefox follow the stated specification for the root html element, while Safari, Chrome, and Opera require using body for the same effect. Developers have used browser-name detection to choose between them, but a later bug fix can make such a workaround break. section 14.2.2 section 14.2.1
