marijnh/CodeMirror2 — pull request #568 by njx (2012-06-07 01:00:13+00:00)
Title: Round off fractional pixel in virtual scroll height calculation

This fixes an off-by-one error that causes a scrollbar to sometimes show up when CodeMirror is in autoresize mode: https://groups.google.com/forum/?fromgroups#!topic/CodeMirror/cN_494YVlCw

If the scroller is set to `height: auto`, when calculating its height, some browsers (notably Firefox) seem to round off fractional pixels. This change makes it so we also round off our calculated document height to match.

I tested this with various large percentage heights to see if the error was ever more than one pixel (in the original code), but never found a case where that happened. This fix appears to fix the problem in all the cases I found, and seems safe generally.