Closed Bug 284482 Opened 20 years ago Closed 12 years ago

Need a away to support onclick trigger for right mouse click

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: kevinar18, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050228 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050228 Firefox/1.0+

Bug 71705 turned off the onclick event for right click.  However, the reasons
for doing so were not based on DOM standards but useability issues (as noted in
Comment #28 and this URL:
http://lists.w3.org/Archives/Public/www-dom/2001AprJun/0033.html)

Well, for people who need this event handling for the right click button, there
needs to be some way to get this support back.  One solution I had in mind was
adding some kind of meta tag to force Gecko into pure standards mode.  However,
for now, I'm just gonna bring up this one particular issue.

BTW, you may notice that the example url is vBulletin.  After some extensive
debugging of a particular error that affects all vBulletin forums, I discovered
that the problem was related to the removal of onclick support for right click.
 Imagine my embarrasment to have to tell them that the reason it was broken in
Gecko browsers was because it didn't comply with the standards (instead of it
was supporting the standards).

Reproducible: Always
mousedown and mouseup support event.button -- could you use that?
see Bug 284512 for the opposite
(In reply to comment #1)
> mousedown and mouseup support event.button -- could you use that?
It's possible, although there may be some useability issues that I can't think
of at the moment.

(In reply to comment #2)
> see Bug 284512 for the opposite
It's probably a good idea to include a link to Bug 284512.  I found out about
Bug 284512 after I filed this one.  It was actually filed by one of the
developers of vBulleting regarding the same issue that prompted my filing of
this bug.

Essentially, either fixing this bug or Bug 284512 would solve the problems in
vBulletin.  Bug 284512 implies removing all support for detecting right mouse
clicks onclick.  This bug implies some way of re-added support for the right
mouse button.

Whether anything is done to Bug 284512 or not, I still think this particular bug
needs to be addressed.  As noted before (in
Comment #28 of Bug 71705 and this URL:
http://lists.w3.org/Archives/Public/www-dom/2001AprJun/0033.html), the DOM
specifications imply that all mouse buttons should be triggered by the mouse
events (including right click).  For this reason, I felt that it would be bad of
us to remove support for this aspect of the DOM.  If it is felt that we cannot
add support for this for every website out there, then perhaps some method needs
to be devised to allow website developers to turn on a pure-standards mode (say
special meta tags?)  I'd be willing to discuss this idea further, if you are
interested.

(On a personal note, this vBulletin incident is one example of how our changes
to a core feature can mess up the design of some rather advanced scripting.  Bug
71705 was mostly concerned with basic scripting issues with having right click
support.  At this point, I am concerned about how this will affect developers
who design much more advanced scripts.  BTW, is it odd that we are willing to
break websites in order to conform to CSS and HTML standards, but not always
with DOM standards?  I haven't figured out if this is a good thing or a bad thing.)
The breakage for CSS and HTML is usually much smaller and much less extensive
than for DOM.  And we _do_ break CSS/HTML standards in quirks mode as needed by
lots of websites...

Realistically, what do you need that the oncontextmenu handler does not provide?
(In reply to comment #4)
> Realistically, what do you need that the oncontextmenu handler does not provide?
oncontextmenu is unable to stop it from bubbling to the document root.  The
particular script detects onclick events and, if located on a certain element,
will stop the bubbling before it gets to the document root.

As with almost any piece of javscript code, there is usually a work around if
you work hard enough (and I'm sure there are work arounds to this code -- like
using onmouseup).  However, the main issue is less about vBulletin than it is
about standards support.  If this is truly a part of the standards, then I think
we should find a way to support it.  If we can't enable it for regular sites,
then perhaps a method to force Gecko to run the DOM in standards mode could be
devised.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
Status: RESOLVED → UNCONFIRMED
Resolution: EXPIRED → ---
Assignee: events → nobody
QA Contact: ian → events
Summary:
As per Bug 71705#c50, "onclick" was removed for right click on all objects, except document, window, & browser chrome.  Doubtful this would ever be changed or that it even should be.

DOM2 defines two less than ideal alternatives:
mousedown & mouseup
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent

These primitives can be used to build a type of "onclick" handler so provide everything necessary.

So... considering that onclick handling won't be changing in Firefox and we at least have these 2 options, this bug is probably ok to close.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago12 years ago
Resolution: --- → WORKSFORME
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.