Bug 1283582 - Stop displaying the context menu in Fennec if web content did a preventDefault on the event. r=margaret

MozReview-Commit-ID: 4JQwXNfJxip
This commit is contained in:
Kartikaya Gupta 2016-07-05 10:09:38 -04:00
parent b8fa6c4b53
commit 8296f93061

View File

@ -2678,6 +2678,12 @@ var NativeWindow = {
return;
}
// If the event was already defaultPrevented by somebody (web content, or
// some other part of gecko), then don't do anything with it.
if (event.defaultPrevented) {
return;
}
// Use the highlighted element for the context menu target. When accessibility is
// enabled, elements may not be highlighted so use the event target instead.
this._target = BrowserEventHandler._highlightElement || event.target;