mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 775372 - Fix exceptions in _cancelTapHighlight when the highlight element is from a dead window [r=margaret]
This commit is contained in:
parent
7a2dbdcf4c
commit
780d66b2f3
@ -3477,6 +3477,10 @@ var BrowserEventHandler = {
|
||||
_doTapHighlight: function _doTapHighlight(aElement) {
|
||||
this._cancelTapHighlight();
|
||||
this._highlightTimeout = setTimeout(function(self) {
|
||||
// If aElement is from a dead window, defaultView will be null.
|
||||
if (!aElement.ownerDocument.defaultView)
|
||||
return;
|
||||
|
||||
DOMUtils.setContentState(aElement, kStateActive);
|
||||
self._highlightElement = aElement;
|
||||
}, kTapHighlightDelay, this);
|
||||
@ -3491,13 +3495,19 @@ var BrowserEventHandler = {
|
||||
if (!this._highlightElement)
|
||||
return;
|
||||
|
||||
let ownerDocument = this._highlightElement.ownerDocument;
|
||||
this._highlightElement = null;
|
||||
|
||||
// If _highlightElement is from a dead window, defaultView will be null.
|
||||
if (!ownerDocument.defaultView)
|
||||
return;
|
||||
|
||||
// If the active element is in a sub-frame, we need to make that frame's document
|
||||
// active to remove the element's active state.
|
||||
if (this._highlightElement.ownerDocument != BrowserApp.selectedBrowser.contentWindow.document)
|
||||
DOMUtils.setContentState(this._highlightElement.ownerDocument.documentElement, kStateActive);
|
||||
if (ownerDocument != BrowserApp.selectedBrowser.contentWindow.document)
|
||||
DOMUtils.setContentState(ownerDocument.documentElement, kStateActive);
|
||||
|
||||
DOMUtils.setContentState(BrowserApp.selectedBrowser.contentWindow.document.documentElement, kStateActive);
|
||||
this._highlightElement = null;
|
||||
},
|
||||
|
||||
_updateLastPosition: function(x, y, dx, dy) {
|
||||
|
Loading…
Reference in New Issue
Block a user