Bug 165607 - text input onchange event never gets called [testcase???]
Summary: text input onchange event never gets called [testcase???]
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-03 03:42 UTC by Radu Benea
Modified: 2008-10-18 18:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
very simple test case proving the bug (158 bytes, text/html)
2008-07-03 03:44 UTC, Radu Benea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radu Benea 2008-07-03 03:42:59 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.3.1 gcc (Gentoo 4.3.1 p1.0) 4.3.1
OS:                Linux

on inputs with type="text" the onchange="whatever()" is ignored in current konqueror/khtml/kjs
in other words function whatever() never gets called
hope this was clear enough
Comment 1 Radu Benea 2008-07-03 03:44:48 UTC
Created attachment 25802 [details]
very simple test case proving the bug

hope this gets fixed before 4.1
Comment 2 Radu Benea 2008-07-03 03:51:03 UTC
just a little reformulation, none of the inputs care about onchange event
Comment 3 A. Spehr 2008-07-03 21:38:28 UTC
Er, can you explain how this testcase is supposed to work? When I load it, the textbox says "it works", but....? I can then type in the box, hit return, and an alert box pops up with whatever I typed in. Is that the expected behavior? 
It does that in both 3.5.9 & 4.00.84

The current testcase: 

<html>
	<head>
		<title>Input not working demo</title>
	</head>
	<body>
		<input type="text" value="it works!" onchange="alert(this.value)">
	</body>
</html>
Comment 4 A. Spehr 2008-07-03 22:42:32 UTC
Furthermore, it works the same way in iceweasel.
Comment 5 Radu Benea 2008-07-04 01:14:20 UTC
doesn't work in kde svn... at least not in my build and it's less than 2 days old, the message never pops up, ever
Comment 6 Radu Benea 2008-07-04 01:15:26 UTC
and yes, the way you experienced it was the expected behaviour
Comment 7 Radu Benea 2008-07-04 01:22:07 UTC
I keep forgetting to state something... it is a 4.1 prerelease svn build from gentoo overlay, I made sure I updated kdelibs, kdepimlibs, libkonq and konqueror - could it be that I missed some required update?
Comment 8 A. Spehr 2008-07-04 03:44:10 UTC
So it works fine for me? 

ok, i'm r826995 kdelibs atm. Last changed according to svn info: 2008-07-01
I have no clue why it wouldn't work for you...
Comment 9 Radu Benea 2008-07-04 09:36:35 UTC
So, here it is... the real problem, seems I'm pretty slow at this... updated to latest sources

When testing the way you did it works
BUT
It should also work by changing the input contents and using the mouse to click somewhere other than the input (to make it lose focus) - and this case does not work.

Also, if you change input to type="checkbox" or type="radiobutton" it should work when using the mouse to change the checked state - without it needing to lose focus and this case also doesn't seem to work.

Sorry for all the confusion I created due to my previous posts, please let me know if this is reproducible with your build.
Comment 10 Jaime Torres 2008-07-04 16:27:38 UTC
I agree with Radu, this only works when the control loses the input focus by pressing Enter, not by clicking elsewhere. Tested in r825239

What should do the event is defined in:
http://www.w3.org/TR/REC-html40/interact/scripts.html

onchange = script [CT]
    The onchange event occurs when a control loses the input focus and its value has been modified since gaining focus. This attribute applies to the following elements: INPUT, SELECT, and TEXTAREA.
Comment 11 Maksim Orlovich 2008-10-18 18:37:34 UTC
SVN commit 873059 by orlovich:

Rework how we do onchange for input/checkboxes, unbreaking it and simplifying things.
As we only want to fire it in response to user events, this just does it in defaultEventHandler.
Fixes kde-look wallaper settings, and along with Germain's previous fix this covers 
#165607, #170451. This also doesn't suffer from #148118

BUG:148118
BUG:165607
BUG:170451


 M  +8 -0      html/html_formimpl.cpp  
 M  +1 -12     rendering/render_form.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=873059
Comment 12 Maksim Orlovich 2008-10-18 18:39:16 UTC
SVN commit 873060 by orlovich:

Merged revision 873059:
Rework how we do onchange for input/checkboxes, unbreaking it and simplifying things.
As we only want to fire it in response to user events, this just does it in defaultEventHandler.
Fixes kde-look wallaper settings, and along with Germain's previous fix this covers 
#165607, #170451. This also doesn't suffer from #148118

BUG:148118
BUG:165607
BUG:170451

 M  +8 -0      html/html_formimpl.cpp  
 M  +1 -12     rendering/render_form.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=873060