Bug 112585 - double activation of href javascript when using the keyboard
Summary: double activation of href javascript when using the keyboard
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: 2005-09-14 12:29 UTC by Luciano Montanaro
Modified: 2005-11-03 15:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Test case for the bug (469 bytes, text/html)
2005-09-14 12:32 UTC, Luciano Montanaro
Details
possible fix (522 bytes, patch)
2005-09-14 12:37 UTC, Luciano Montanaro
Details
Fix for the problem (800 bytes, patch)
2005-10-19 12:59 UTC, Luciano Montanaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Montanaro 2005-09-14 12:29:19 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

When an anchor element is activated with the enter key, the href gets activated twice. I will post an a simple test case demonstrating the problem, and a possible fix.

The problem is present in the KDE 3.4 and 3.5 branches, for sure.

I think it was not there at 3.4.0 time, but I think I remember the event handling code got some improvement in the while. This may be one side effect.
Comment 1 Luciano Montanaro 2005-09-14 12:32:39 UTC
Created attachment 12565 [details]
Test case for the bug

This page shows the problem. Clicking the link increments the counter once,
while using the tab key and pressing enter makes the counter advance by two.

I tested the page on firefox also, and it behaves the same with the mouse or
with the keyboard.
Comment 2 Luciano Montanaro 2005-09-14 12:37:17 UTC
Created attachment 12566 [details]
possible fix

This one-line patch cures the symptoms for me. I'm not sure it does not break
other things, however.

But the click() in the keypress case will eventually call submitURL() anyway.
Comment 3 Luciano Montanaro 2005-10-19 12:53:05 UTC
Comment on attachment 12566 [details]
possible fix

Wrong patch.
I'll post a new one.
Comment 4 Luciano Montanaro 2005-10-19 12:59:18 UTC
Created attachment 13057 [details]
Fix for the problem

This should be the correct one.
Comment 5 Luciano Montanaro 2005-11-03 15:47:35 UTC
*** Bug has been marked as fixed ***.