Bug 112585

Summary: double activation of href javascript when using the keyboard
Product: [Applications] konqueror Reporter: Luciano Montanaro <mikelima>
Component: khtmlAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Test case for the bug
possible fix
Fix for the problem

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 ***.