Bug 575586 - [LongTap]Fennec does not pass long tap event to plug-ins [r=mbrubeck]

This commit is contained in:
Oleg Romashin 2011-01-15 11:38:30 +02:00
parent 782919f9a4
commit 8d8289736a
2 changed files with 14 additions and 3 deletions

View File

@ -382,6 +382,16 @@ let Content = {
if (!element)
return;
#ifdef MOZ_PLATFORM_MAEMO
if (element instanceof Ci.nsIDOMHTMLEmbedElement) {
// Generate a right click mouse event to make possible to show
// context menu for plugins:
this._sendMouseEvent("mousedown", element, x, y, 2);
this._sendMouseEvent("mouseup", element, x, y, 2);
break;
}
#endif
ContextHandler.messageId = json.messageId;
let event = content.document.createEvent("PopupEvents");
@ -499,7 +509,7 @@ let Content = {
gDOMUtils.setContentState(content.document.documentElement, kStateActive);
},
_sendMouseEvent: function _sendMouseEvent(aName, aElement, aX, aY) {
_sendMouseEvent: function _sendMouseEvent(aName, aElement, aX, aY, aButton) {
// the element can be out of the aX/aY point because of the touch radius
if (!(aElement instanceof HTMLHtmlElement)) {
let isTouchClick = true;
@ -523,7 +533,8 @@ let Content = {
let scrollOffset = Util.getScrollOffset(content);
let windowUtils = Util.getWindowUtils(content);
windowUtils.sendMouseEventToWindow(aName, aX - scrollOffset.x, aY - scrollOffset.y, 0, 1, 0, true);
aButton = aButton || 0;
windowUtils.sendMouseEventToWindow(aName, aX - scrollOffset.x, aY - scrollOffset.y, aButton, 1, 0, true);
},
_setTextZoom: function _setTextZoom(aZoom) {

View File

@ -31,7 +31,7 @@ chrome.jar:
content/MenuListHelperUI.js (content/MenuListHelperUI.js)
content/SelectHelperUI.js (content/SelectHelperUI.js)
content/SharingUI.js (content/SharingUI.js)
content/content.js (content/content.js)
* content/content.js (content/content.js)
content/commandUtil.js (content/commandUtil.js)
* content/bindings.xml (content/bindings.xml)
content/tabs.xml (content/tabs.xml)