зеркало из https://github.com/mozilla/gecko-dev.git
Bug 777450 - Part 2: Long pressing a Flash video no longer activates text selection. r=wesj
This commit is contained in:
Родитель
7d8500d645
Коммит
762918d29a
|
@ -1388,8 +1388,7 @@ var NativeWindow = {
|
|||
0, null);
|
||||
rootElement.ownerDocument.defaultView.addEventListener("contextmenu", this, false);
|
||||
rootElement.dispatchEvent(event);
|
||||
} else {
|
||||
// Otherwise, let the selection handler take over
|
||||
} else if (SelectionHandler.canSelect(rootElement)) {
|
||||
SelectionHandler.startSelection(rootElement, aX, aY);
|
||||
}
|
||||
},
|
||||
|
@ -1643,6 +1642,14 @@ var SelectionHandler = {
|
|||
this._ignoreCollapsedSelection = false;
|
||||
},
|
||||
|
||||
/** Returns true if the provided element can be selected in text selection, false otherwise. */
|
||||
canSelect: function sh_canSelect(aElement) {
|
||||
return !(aElement instanceof Ci.nsIDOMHTMLButtonElement ||
|
||||
aElement instanceof Ci.nsIDOMHTMLEmbedElement ||
|
||||
aElement instanceof Ci.nsIDOMHTMLImageElement ||
|
||||
aElement instanceof Ci.nsIDOMHTMLMediaElement);
|
||||
},
|
||||
|
||||
// aX/aY are in top-level window browser coordinates
|
||||
startSelection: function sh_startSelection(aElement, aX, aY) {
|
||||
// Clear out any existing selection
|
||||
|
|
Загрузка…
Ссылка в новой задаче