Closed Bug 319554 Opened 20 years ago Closed 19 years ago

Keyboard modifier (shift,ctrl,alt) and left-clicking on a link creates an event that is NOT cancelable by event handler

Categories

(Firefox :: General, defect, P2)

defect

Tracking

()

VERIFIED FIXED
Firefox 3 alpha1

People

(Reporter: bugzilla, Assigned: Gavin)

Details

(Keywords: fixed-seamonkey1.1a, testcase)

Attachments

(3 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 The following link <a href="http://www.firefox.com" onclick="return false;">Show Bug</a> has the onclick attribute set in order to define an event handler. Here, the handler just returns false to ask the UA to cancel the default event action.[*] Now press a modifier key while clicking on the link and suddenly the link can be activated: it may open in a tab or even in a new window. [*] Of course, it does not make any sense to have a link that can not be activated but it's just there as proof of concept. Reproducible: Always Steps to Reproduce: Expected Results: Expected: Nothing should happen.
This is a testcase that shows that you can not cancel the event which is created when (shift,ctrl,alt) and left-clicking on a link.
By the way, this report specifically refers to left-clicking and neither middle- nor right-clicking. :-) See also: bug 151142: talks about modifier+click on a link should not generate a "click" event AT ALL for links. As it stands currently, FF does create the event and thus the event should be cancelable. At least, thats how I understand: http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-cancelation Cheers Daniel
Keywords: testcase
I still see this on the current release of FF. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
I also see this problem on latest trunk. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a1) Gecko/20060517 Minefield/3.0a1
Component: General → DOM: Events
Product: Firefox → Core
Version: unspecified → 1.8 Branch
It's on the 2.0 branch as well. I have an AJAX application and many of my links perform some JavaScript tasks and return false, but using ctrl-click or middle clicking on the link opens a new tab and does not perform the JavaScript. Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1a2) Gecko/20060519 BonEcho/2.0a2 ID:2006051904
Assignee: nobody → events
QA Contact: general → ian
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9a1) Gecko/20060530 Minefield/3.0a1 - Build ID: 0000000000 Confirmed. Quite odd.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: modifier (shift,ctrl,alt) and left-clicking on a link creates an event that is NOT cancelable by event handler → Keyboard modifier (shift,ctrl,alt) and left-clicking on a link creates an event that is NOT cancelable by event handler
Version: 1.8 Branch → Trunk
Not a DOM events issue. The code that opens the new tab or window doesn't check whether the default action has been prevented. It's an app issue. Reassigning to Firefox based on UA string, but Seamonkey has the same problem.
Assignee: events → nobody
Component: DOM: Events → General
Product: Core → Firefox
QA Contact: ian → general
Attached patch xpfe fixSplinter Review
Attachment #229281 - Flags: superreview?(jag)
Attachment #229281 - Flags: review?(jag)
Attachment #229281 - Flags: superreview?(jag)
Attachment #229281 - Flags: superreview+
Attachment #229281 - Flags: review?(jag)
Attachment #229281 - Flags: review+
Assignee: nobody → gavin.sharp
OS: Linux → All
Hardware: PC → All
Attached patch firefox patchSplinter Review
Attachment #239528 - Flags: review?(mano)
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch-r?]
Target Milestone: --- → Firefox 3 alpha1
Comment on attachment 239528 [details] [diff] [review] firefox patch r=mano
Attachment #239528 - Flags: review?(mano) → review+
mozilla/browser/base/content/browser.js 1.709
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [patch-r?]
Cheers mates! Thanks for fixing this bug.
verified with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061205 Minefield/3.0a1
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: