зеркало из https://github.com/mozilla/gecko-dev.git
Bug 778263 - Clean up SelectionHandler data when we bail in startSelection. r=mfinkle
This commit is contained in:
Родитель
9f556de8de
Коммит
1b2c2dc75a
|
@ -1683,13 +1683,14 @@ var SelectionHandler = {
|
|||
selectionController.wordMove(!this._isRTL, true);
|
||||
} catch(e) {
|
||||
// If we couldn't select the word at the given point, bail
|
||||
Cu.reportError("Error selecting word: " + e);
|
||||
this._cleanUp();
|
||||
return;
|
||||
}
|
||||
|
||||
// If there isn't an appropriate selection, bail
|
||||
if (!selection.rangeCount || !selection.getRangeAt(0) || !selection.toString().trim().length) {
|
||||
selection.collapseToStart();
|
||||
this._cleanUp();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1838,13 +1839,17 @@ var SelectionHandler = {
|
|||
}
|
||||
}
|
||||
|
||||
this._cleanUp();
|
||||
|
||||
return selectedText;
|
||||
},
|
||||
|
||||
_cleanUp: function sh_cleanUp() {
|
||||
this._view.removeEventListener("pagehide", this, false);
|
||||
this._view = null;
|
||||
this._target = null;
|
||||
this._isRTL = false;
|
||||
this.cache = null;
|
||||
|
||||
return selectedText;
|
||||
},
|
||||
|
||||
_getViewOffset: function sh_getViewOffset() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче