Bug 147256

Summary: window.onscroll event handler is not called
Product: [Applications] konqueror Reporter: Michael Schuerig <michael>
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: luke-jr+kdebugs, maksim
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Example for non-functional window.onscroll
Example for working window.addEventListener('scroll', ...)
patch. Not well-tested

Description Michael Schuerig 2007-06-26 17:53:46 UTC
Version:           3.5.7 (using KDE 3.5.7, Debian Package 4:3.5.7.dfsg.1-1 (lenny/sid))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.18-4-686

Konqueror/khtml supports the scroll event on window objects when the handler is attached with window.addEventListener. However, the DOM 0 equivalent, window.onscroll, does not work.
Comment 1 Michael Schuerig 2007-06-26 17:54:54 UTC
Created attachment 20974 [details]
Example for non-functional window.onscroll
Comment 2 Michael Schuerig 2007-06-26 17:55:34 UTC
Created attachment 20975 [details]
Example for working window.addEventListener('scroll', ...)
Comment 3 Maksim Orlovich 2007-11-28 16:05:11 UTC
Yeah, we don't bind onscroll, just list it as an IE extension we don't handle. Should be easy enough to do.
Comment 4 Maksim Orlovich 2007-11-28 16:35:00 UTC
Created attachment 22235 [details]
patch. Not well-tested

This makes us bind it... I wonder why it wasn't added before, though.
We also seem to emit it on scrollwheel changes even if there is no scrollbar.
Comment 5 Germain Garand 2007-11-29 13:25:47 UTC
patch looks all fine but wouldn't that prevent an addEventListener path to be triggered? (and thus possibly end up having us identified as IE on some sites?)

Which browsers support it?

> We also seem to emit it on scrollwheel changes even if there is no scrollbar. 

it should check, in KHTMLView::scrollContentsBy(x,y), that the offset is non-zero before emitting the scroll event.
Comment 6 Germain Garand 2007-12-31 06:26:59 UTC
SVN commit 755002 by ggarand:

Don't fire a scroll event if the view has been scrolled by a (0,0) delta.
This happen when a view deprived of scrolling controls receives e.g.
a wheel event.

CCBUG: 147256


 M  +1 -1      khtmlview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=755002
Comment 7 Luke-Jr 2008-02-08 00:03:19 UTC
This bug is still open in 4.0.1, and combined with bug 157375 break my webapp.
Comment 8 Maksim Orlovich 2009-02-15 21:31:47 UTC
Handled in newer versions...