mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 903871 - JS crash in SelectionHandler during longtap text select on target page, r=margaret
This commit is contained in:
parent
4f6106a065
commit
aecc09afa2
@ -192,14 +192,14 @@ var SelectionHandler = {
|
||||
this._contentWindow.getSelection().removeAllRanges();
|
||||
|
||||
if (!this._domWinUtils.selectAtPoint(aX, aY, Ci.nsIDOMWindowUtils.SELECT_WORDNOSPACE)) {
|
||||
this._onFail("failed to set selection at point");
|
||||
this._closeSelection();
|
||||
return;
|
||||
}
|
||||
|
||||
let selection = this._getSelection();
|
||||
// If the range didn't have any text, let's bail
|
||||
if (!selection) {
|
||||
this._onFail("no selection was present");
|
||||
if (!selection || selection.rangeCount == 0) {
|
||||
this._closeSelection();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -452,16 +452,6 @@ var SelectionHandler = {
|
||||
this._closeSelection();
|
||||
},
|
||||
|
||||
/*
|
||||
* Called if for any reason we fail during the selection
|
||||
* process. Cancels the selection.
|
||||
*/
|
||||
_onFail: function sh_onFail(aDbgMessage) {
|
||||
if (aDbgMessage && aDbgMessage.length > 0)
|
||||
Cu.reportError("SelectionHandler - " + aDbgMessage);
|
||||
this._closeSelection();
|
||||
},
|
||||
|
||||
/*
|
||||
* Shuts SelectionHandler down.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user