Open Bug 928664 Opened 11 years ago Updated 2 years ago

checkForMiddleClick should trigger event handlers added via addEventListener

Categories

(Firefox :: General, enhancement)

25 Branch
x86_64
Windows 7
enhancement

Tracking

()

People

(Reporter: pikadudeno1+bugzilla, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: feature)

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.
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
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
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)
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
Closed: 8 years ago
Resolution: --- → INCOMPLETE
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 → ---
As it is enhancement, changing its status to NEW.
Status: REOPENED → NEW
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
Keywords: feature
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.