checkForMiddleClick should trigger event handlers added via addEventListener

NEW
Unassigned

Status

()

--
enhancement
5 years ago
2 years ago

People

(Reporter: pikadudeno1+bugzilla, Unassigned)

Tracking

(Depends on: 1 bug, {feature})

25 Branch
x86_64
Windows 7
feature
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131017174213

Steps to reproduce:

Call checkForMiddleClick(node, event) (defined in utilityOverlay.js).


Actual results:

Only the event handler defined by the oncommand attribute is called.


Expected results:

Handlers added via node.addEventListener("command", handler) should be called as well. For bootstrapped add-ons, which can only add elements via JavaScript code, addEventListener is the most convenient way to go.

Comment 1

3 years ago
User Agent 	Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0
Version 	46.0a1
Build ID 	20160111030207
Channel 	nightly

Thank you for taking time to report this.  Sorry it took longer to review this issue.
Are you still able to reproduce this in the latest version ?  Can you give more details and sample test page to verify this ?
Component: Untriaged → Event Handling
Flags: needinfo?(pikadudeno1+bugzilla)
Product: Firefox → Core

Comment 2

3 years ago
This is all Firefox code, not Gecko. And nothing to do with event handling. Just a JS function doing something.
Component: Event Handling → General
Product: Core → Firefox
(Reporter)

Comment 3

3 years ago
I've confirmed that Firefox still has the bug by checking the source code on dxr. Permalink: https://dxr.mozilla.org/mozilla-central/rev/b67316254602a63bf4e568198a5c7d3288a9db27/browser/base/content/utilityOverlay.js#381

As you can see, checkForMiddleClick works by reading the oncommand attribute and executing its code, ignoring all other event listeners.
Flags: needinfo?(pikadudeno1+bugzilla)
Hi reporter,

Can you please provide a functional test case so I can test this on my end? Does other browsers have the same behavior when calling checkForMiddleClick(node, event) function?

Also, can you please try to reproduce this on the latest release(44.0) and latest Nightly(47.0a1) and provide the results? When doing this, please try to reproduce with a new clean Firefox profile, maybe even in safe mode, as some of this issues may be caused by third party installed add-ons or custom settings(https://support.mozilla.org/en-US/kb/troubleshoot-and-diagnose-firefox-problems).

Thanks,
Paul.
Flags: needinfo?(pikadudeno1+bugzilla)

Comment 5

3 years ago
Considering the fact that the reporter did not answer to the above (comments 1 & 4) requests until now, I will mark this as resolved-incomplete.
If anyone can still reproduce it, feel free to reopen the issue and provide more information.

Thanks
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INCOMPLETE

Comment 6

3 years ago
This is a valid improvement request for add-on compat. It might be quite tricky to implement correctly (what about command listeners on the parents/ancestors of the element?), but there's enough info here.
Severity: normal → enhancement
Status: RESOLVED → REOPENED
Ever confirmed: true
Flags: needinfo?(pikadudeno1+bugzilla)
Resolution: INCOMPLETE → ---

Comment 7

3 years ago
As it is enhancement, changing its status to NEW.
Status: REOPENED → NEW
(Reporter)

Comment 8

3 years ago
Were the doCommand method able to accept a click event argument, fixing this would a simple matter of having checkForMiddleClick use that instead of read the oncommand attribute/property.
Depends on: 461578

Updated

3 years ago
Keywords: feature
You need to log in before you can comment on or make changes to this bug.