Bug 136622 - testcase - regression: onClick handler returning false doesn't inhibit following HREF link
Summary: testcase - regression: onClick handler returning false doesn't inhibit follow...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-01 12:47 UTC by Jonathan Marten
Modified: 2009-06-26 13:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test case for popup/link handling (687 bytes, text/html)
2006-11-01 12:48 UTC, Jonathan Marten
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2006-11-01 12:47:39 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Compiled From Sources
Compiler:          gcc version 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)
 
OS:                Linux

Well, it does in a very simple case - this was a problem fixed a long time ago (bug 25874 and lots of dups).

A link of the form

<A onClick="var w = window.open('someURL'); return false" HREF="anotherURL">

correctly opens a new window showing 'someURL' and does not follow the HREF.  However, doing anything which uses the new window - even the most trivial of operations - before the 'return false' incorrectly follows the link.  For example,

<A onClick="var w = window.open('someURL'); w.focus(); return false" HREF="anotherURL">

opens a new window showing 'someURL', but also follows the link to display 'anotherURL' in the original window.

The test case attached demonstrates this.  The first link works, the popup window appears but the original page does not change.  The second and third links demonstrate the problem.

No JS debug messages are displayed.

This problem does not happen with KDE4 trunk.
Comment 1 Jonathan Marten 2006-11-01 12:48:58 UTC
Created attachment 18348 [details]
Test case for popup/link handling
Comment 2 Maksim Orlovich 2006-11-01 14:58:51 UTC
Are you using 3.5.5, or 3.5.x SVN?

Comment 3 Jonathan Marten 2006-11-01 15:35:53 UTC
Using 3.5.5 compiled from sources
(With kdepim only from SVN 3.5.5+ features branch)
Comment 4 Maksim Orlovich 2006-11-01 16:06:19 UTC
Uff. Works here. 3.5.x r597771 (though I can't think of anything relevant that changed --- I mainly asked because I recently made changes to focus handling), popup policy at smart...

...Will check on a different machine in a few minutes. Wonder why the difference..
Comment 5 Jonathan Marten 2006-11-01 16:35:08 UTC
If it's relevant: popup policy=ask (although the same results if set to allow).  Clicking "don't allow the popup" correctly stops the new window but still follows the link to www.kde.org
Comment 6 Maksim Orlovich 2006-11-01 17:02:47 UTC
How did you answer the question? 

Following the link when it's set to disallow is sensible, since then there isn't a window returned from window.open, so the w.op has to bail out. May be we want to do some sort of a stub return for that, but I'd have to see an actual website to be convinced that's worth the effort....
Comment 7 Maksim Orlovich 2006-11-01 17:09:34 UTC
My, I managed to read "allow" as "disallow". Anyway, works fine here on a kubuntu 3.5.5 as well... Weird. (And ask is shady due to potential nested event loop issues, BTW)

Comment 8 FiNeX 2008-04-20 22:45:44 UTC
Confirmed working ok konqueror 4.
Comment 9 Jonathan Marten 2009-06-26 13:28:25 UTC
Resolved as working in KDE4.