Bug 60403 - keyboard scrolling doesn't work on Yahoo! Mail pages
Summary: keyboard scrolling doesn't work on Yahoo! Mail pages
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: 2003-06-27 02:24 UTC by hughjonesd
Modified: 2003-10-23 14:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
testcase (4.14 KB, text/html)
2003-06-27 03:28 UTC, hughjonesd
Details
the original page (49.41 KB, text/html)
2003-06-27 03:31 UTC, hughjonesd
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hughjonesd 2003-06-27 02:24:19 UTC
Version:           unknown (using KDE 3.1.9)
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:          Linux (i686) release 2.4.18-4GB

On Yahoo! Mail pages, you can scroll up and down very smoothly by dragging the scrollbar, but you can't scroll up and down using the arrow keys or pageup/pagedown, even after clicking in the page body.

This is in 3.1 and current CVS.

Will try and attach a test case.
Comment 1 hughjonesd 2003-06-27 03:28:56 UTC
Created attachment 1889 [details]
testcase

OK, it's something to do with the javascript. I've removed lots of the crap
from the page. What remains still breaks scrolling. The tables seem to be
important so I assume this is some kind of Javascript/css issue.

I'll also attach the whole original page, in case anyone decides that the
cut-down version would be screwed up in any browser :-)
Comment 2 hughjonesd 2003-06-27 03:31:02 UTC
Created attachment 1890 [details]
the original page

the original page that breaks keyboard scrolling.
Comment 3 Sashmit Bhaduri 2003-06-27 05:16:00 UTC
I can confirm this-- scrolling works in the Yahoo Mail folders view, but doesn't work 
when viewing messages themselves. 
Comment 4 David Faure 2003-10-23 13:15:01 UTC
Hmm, I don't call a testcase something that references 3 external js scripts and is still very big itself :)
I have reduced it to the following testcase:

<script>
document.onkeydown = function() { }
</script>
foo<br><br>foo<br><br>foo<br><br>foo<br><br>foo<br><br>
foo<br><br>foo<br><br>foo<br><br>foo<br><br>foo<br><br>
foo<br><br>foo<br><br>foo<br><br>foo<br><br>foo<br><br>
foo<br><br>foo<br><br>foo<br><br>foo<br><br>foo<br><br>
foo<br><br>foo<br><br>foo<br><br>foo<br><br>foo<br><br>

and I suspect the code in NodeImpl::dispatchKeyEvent.
Comment 5 David Faure 2003-10-23 13:41:31 UTC
This fixes it for me.
Index: khtmlview.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtmlview.cpp,v
retrieving revision 1.570
diff -u -p -r1.570 khtmlview.cpp
--- khtmlview.cpp       20 Oct 2003 21:10:37 -0000      1.570
+++ khtmlview.cpp       23 Oct 2003 11:41:02 -0000
@@ -921,12 +921,13 @@ void KHTMLView::keyPressEvent( QKeyEvent
                return;
            }
        }
-        if (!_ke->text().isNull() && m_part->xmlDocImpl()->getHTMLEventListener(EventImpl::KHTML_KEYDOWN_EVENT))
-            if (m_part->xmlDocImpl()->documentElement()->dispatchKeyEvent(_ke))
-            {
+        if (!_ke->text().isNull() && m_part->xmlDocImpl()->getHTMLEventListener(EventImpl::KHTML_KEYDOWN_EVENT)) {
+            // If listener returned false, stop here. Otherwise handle standard keys (#60403).
+            if (!m_part->xmlDocImpl()->documentElement()->dispatchKeyEvent(_ke)) {
                 _ke->accept();
                 return;
             }
+        }
     }

     int offs = (clipper()->height() < 30) ? clipper()->height() : 30;
Comment 6 David Faure 2003-10-23 14:06:10 UTC
Applied to CVS.