mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 778263 - Clean up SelectionHandler data when we bail in startSelection. r=mfinkle
This commit is contained in:
parent
bd8aac38bd
commit
9eb4b7cf5e
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user