Bug 120412

Summary: Khtml create TextEvents doesnt make it into input and textarea widgets
Product: [Applications] konqueror Reporter: Fredrik Johansson <fredrik>
Component: generalAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: 3.5   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: testpage
html_formimpl.cpp changed version of rev: 497603
html_formimpl.h changed version of rev: 490943

Description Fredrik Johansson 2006-01-18 22:27:39 UTC
Version:           3.5 (using KDE 3.5.0, Kubuntu Package 4:3.5.0-0ubuntu0breezy1 breezy)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-10-386

Okay to explain this bug, at least I think that its a bug, I need to explain why I want this to functionality.

I am trying to make a javascript inputmask on a inputbox, so if the user presses say "a" I want to convert this into a uppercase "A". I include a test htmlfile.

First I check the charCode of the event that is triggered by the user when he/she presses the key.
If it is not a Uppercase char then I stop the Event and creates a new one with a uppercase char.

In mozilla I can create a keyEvent with the apropriate keyCode, khtml has TextEvents and that should work as well.

And does work through the DOM tree, at least as far as I can tell after watching kdevelop and gdb attached to testkhtml.

But I cant se any place were the event actually gets dispatched into the rendered widget ie. KLineEdit or KTextEdit.

I did make a awfull hack to implement this into html_formimpl.cpp, only with the intention to make you see what I am trying to do. You propably know how to get this sort of thing into the lib a lot better than my stumbling steps in C++.

Maybe its there somewere and it's just broken, or I have missunderstood what it intends to do.


In any case I would like thank you for this great lib!

Regards
Fredrik Johansson
Comment 1 Fredrik Johansson 2006-01-18 22:30:11 UTC
Created attachment 14301 [details]
testpage 

3 different functions that all creates, init and dispatches a TextEvent
Comment 2 Fredrik Johansson 2006-01-18 22:38:43 UTC
Created attachment 14302 [details]
html_formimpl.cpp changed version of rev: 497603

This is NOT a high quality patch, see above description
Added code into HTMLInputElementImpl::defaultEventHandler
from line 1730 -> 1774

Added method HTMLTextAreaElementImpl::defaultEventHandler
from line 2756 -> 2802
Comment 3 Fredrik Johansson 2006-01-18 22:41:25 UTC
Created attachment 14303 [details]
html_formimpl.h changed version of rev: 490943

This is NOT a high quality patch, see above description

Added method declaration HTMLTextAreaElementImpl::defaultEventHandler
from line 554 -> 555
Comment 4 Maksim Orlovich 2006-01-21 19:55:39 UTC

*** This bug has been marked as a duplicate of 120408 ***