Bug 957259 - Error: "TypeError: caretPos is null" in SelectionHandler.js @ line: 585, r=margaret

This commit is contained in:
Mark Capella 2014-01-08 02:59:08 -05:00
parent 9fcca9708f
commit 2b61a6e620

View File

@ -541,6 +541,10 @@ var SelectionHandler = {
// in editable targets. We should factor out the logic that's currently in _sendMouseEvents.
let viewOffset = this._getViewOffset();
let caretPos = this._contentWindow.document.caretPositionFromPoint(aX - viewOffset.x, aY - viewOffset.y);
if (!caretPos) {
// User moves handle offscreen while positioning
return;
}
// Constrain text selection within editable elements.
let targetIsEditable = this._targetElement instanceof Ci.nsIDOMNSEditableElement;