Bug 147256 - window.onscroll event handler is not called
Summary: window.onscroll event handler is not called
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-26 17:53 UTC by Michael Schuerig
Modified: 2009-02-15 21:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example for non-functional window.onscroll (1.19 KB, text/html)
2007-06-26 17:54 UTC, Michael Schuerig
Details
Example for working window.addEventListener('scroll', ...) (1.23 KB, text/html)
2007-06-26 17:55 UTC, Michael Schuerig
Details
patch. Not well-tested (2.30 KB, patch)
2007-11-28 16:35 UTC, Maksim Orlovich
Details

Note You need to log in before you can comment on or make changes to this bug.
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...