Ah. While I agree there is some risk in the drag code, the translation from range to 3-div also has a decent amount of complexity. I think it shouldn't be too hard to write unit tests for that part. See OdtDocumentTests for inspiration, as that is testing the line start/end navigation which relies on client rectangles :)