Closed
Bug 748740
Opened 13 years ago
Closed 12 years ago
New tab is not opening after "Ctrl/Cmd+Click" on a link if there is "event.stopPropagation()" in the "click" handler
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 22
People
(Reporter: grunin.ya, Assigned: dao)
Details
(Keywords: testcase, Whiteboard: [parity-IE][parity-chrome])
Attachments
(2 files, 2 obsolete files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120312181643
Steps to reproduce:
1) Make test page with one link in it (<a href="http://google.com">Test link</a>)
2) Attach click handler to this link that stops propagation of the event:
elem.addEventListener('click', function(e) {
e.stopPropagation();
}, false);
2) "Ctrl/Cmd+Click" on this link.
Actual results:
Nothing happens.
Expected results:
A new tab should be opened with "http://google.com" in it, because there is no "e.preventDefault()" in event handler.
Middle-button click works just fine.
Confirmed on Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0
Middle click works OK
Context menu "open link in new tab" works OK
Ctrl-click does nothing.
Attachment #618410 -
Attachment mime type: text/plain → text/html
Updated•13 years ago
|
Component: Untriaged → Event Handling
Keywords: testcase
OS: Mac OS X → All
Product: Firefox → Core
QA Contact: untriaged → events
Hardware: x86 → All
Version: 11 Branch → Trunk
Comment 3•12 years ago
|
||
Please, fix this stuff
Updated•12 years ago
|
Component: Event Handling → Tabbed Browser
Product: Core → Firefox
QA Contact: events → tabbed.browser
Comment 4•12 years ago
|
||
How can I change the status? It is definitely CONFIRMED :)
Comment 5•12 years ago
|
||
Is there some known workarounds for the bug?
Assignee | ||
Updated•12 years ago
|
Status: UNCONFIRMED → NEW
Component: Tabbed Browser → General
Ever confirmed: true
QA Contact: tabbed.browser → general
Whiteboard: [parity-IE][parity-chrome]
Updated•12 years ago
|
tracking-firefox13:
--- → ?
tracking-firefox14:
--- → ?
tracking-firefox15:
--- → ?
tracking-firefox16:
--- → ?
Assignee | ||
Comment 6•12 years ago
|
||
Not a recent regression, no reason to track this.
tracking-firefox13:
? → ---
tracking-firefox14:
? → ---
tracking-firefox15:
? → ---
tracking-firefox16:
? → ---
Assignee | ||
Comment 7•12 years ago
|
||
It seems that front-end code can't do much about this. It could use a capturing click event listener, but then it wouldn't honor event.defaultPrevented.
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Comment 8•12 years ago
|
||
Sounds sad :( Navigation in my application is fully customized and based on handling this event. Work everywhere! ))) Even in IE and Opera ;)
Updated•12 years ago
|
Component: Event Handling → Tabbed Browser
Product: Core → Firefox
QA Contact: events → tabbed.browser
Comment 9•12 years ago
|
||
This is all about front-end code. It can use system event group.
Comment 10•12 years ago
|
||
Googling on "system event group" gave me no meaningful results. Could you provide me with some code snippet or other tip?
Comment 11•12 years ago
|
||
Firefox UI code can use system event group, not a web page.
As an example
http://mxr.mozilla.org/mozilla-central/source/dom/browser-element/BrowserElementChild.js?mark=120-127#119
Comment 12•12 years ago
|
||
Ok, I can catch the event after the "stopPropagation", but how it can help me to keep the default "Ctrl+Click" functionality?
Assignee | ||
Comment 13•12 years ago
|
||
Assignee: nobody → dao
Status: NEW → ASSIGNED
Assignee | ||
Updated•12 years ago
|
Component: Tabbed Browser → General
QA Contact: tabbed.browser → general
Assignee | ||
Comment 14•12 years ago
|
||
I get this failure with that patch:
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/places/tests/browser/browser_markPageAsFollowedLink.js | User activated visits should get a FRAMED_LINK transition. - Got null, expected 8
Comment 15•12 years ago
|
||
Any expectations when the issue will be resolved? =)
Assignee | ||
Comment 16•12 years ago
|
||
I don't know what to do about the browser_markPageAsFollowedLink.js failure. It seems that places history requires markPageAsFollowedLink to be called at a certain (wrong, by this bug's measure) point in time during the click event propagation.
Attachment #636265 -
Attachment is obsolete: true
Attachment #726177 -
Flags: feedback?(mak77)
Comment 17•12 years ago
|
||
Your answer didn't lit light on the issue at all for me ))
Comment 18•12 years ago
|
||
Places just collects calls to markPageAsFollowedLink and applies the last followed flag to the next visit.
so markPageAsFollowedLink -> stored into an hash -> AddVisit uses the info
There is no specific requirement about when it happens, could be the test is too picky for when it checks?
Comment 19•12 years ago
|
||
Did you verify, by chance, if we still reach the markPageAsFollowedLink call with the change? I wonder if some event change causes us to bail out earlier.
Assignee | ||
Comment 20•12 years ago
|
||
(In reply to Marco Bonardo [:mak] from comment #19)
> Did you verify, by chance, if we still reach the markPageAsFollowedLink call
> with the change? I wonder if some event change causes us to bail out earlier.
No I didn't! Apparently event.defaultPrevented is true, causing contentAreaClick to return early. Thanks for the hint.
Assignee | ||
Comment 21•12 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #20)
> Apparently event.defaultPrevented is true, causing contentAreaClick to return early.
Making the event listener a capturing one makes browser_markPageAsFollowedLink.js pass. I assume core code was consuming the event before us. Does this make sense?
Attachment #726177 -
Attachment is obsolete: true
Attachment #726177 -
Flags: feedback?(mak77)
Attachment #726574 -
Flags: feedback?(bugs)
Comment 22•12 years ago
|
||
Comment on attachment 726574 [details] [diff] [review]
patch v2
Hmm, using system group doesn't affect to preventDefault() handling, but
stopPropagation() is per group, so yes, this makes sense to me.
Attachment #726574 -
Flags: feedback?(bugs) → feedback+
Assignee | ||
Updated•12 years ago
|
Attachment #726574 -
Flags: review?(mak77)
Comment 23•12 years ago
|
||
Comment on attachment 726574 [details] [diff] [review]
patch v2
Review of attachment 726574 [details] [diff] [review]:
-----------------------------------------------------------------
sort of scary, since involves all clicks in browser, but easy to backout in case
Attachment #726574 -
Flags: review?(mak77) → review+
Assignee | ||
Comment 24•12 years ago
|
||
Comment 25•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Comment 26•12 years ago
|
||
Resolved? Seriously? You are not kidding me? =) Thanks a lot guys! I'm awaiting next FF release as never!
You need to log in
before you can comment on or make changes to this bug.
Description
•