Bug 482057 - PageUp/Down with the findbar focused does not use smooth scrolling [r=Enn, a=akeybl]
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 26 Mar 2012 10:42:28 -0700
changeset 91998 af44d93f215990c37db66a6887bd13b4d1bd897e
parent 91997 01fbbc855886b2eb1d54e0bfdd248f7a141e3388
child 91999 63c5274f27cb791e1cb05905afccdb1f740d2cea
push idunknown
push userunknown
push dateunknown
reviewersEnn, akeybl
bugs482057
milestone13.0a2
Bug 482057 - PageUp/Down with the findbar focused does not use smooth scrolling [r=Enn, a=akeybl]
toolkit/content/widgets/findbar.xml
--- a/toolkit/content/widgets/findbar.xml
+++ b/toolkit/content/widgets/findbar.xml
@@ -122,45 +122,46 @@
           return;
         }
         this.findbar._find(this.value);
       ]]></handler>
 
       <handler event="keypress"><![CDATA[
         var win = this.findbar._currentWindow ||
                   this.findbar.browser.contentWindow;
+        var controller = this.findbar._getSelectionController(win);
 
         var shouldHandle = !event.altKey && !event.ctrlKey &&
                            !event.metaKey && !event.shiftKey;
 
         switch (event.keyCode) {
           case KeyEvent.DOM_VK_RETURN:
             this._handleEnter(event);
             break;
           case KeyEvent.DOM_VK_TAB:
             this._handleTab(event);
             break;
           case KeyEvent.DOM_VK_PAGE_UP:
             if (shouldHandle) {
-              win.scrollByPages(-1);
+              controller.scrollPage(false);
               event.preventDefault();
             }
             break;
           case KeyEvent.DOM_VK_PAGE_DOWN:
             if (shouldHandle) {
-              win.scrollByPages(1);
+              controller.scrollPage(true);
               event.preventDefault();
             }
             break;
           case KeyEvent.DOM_VK_UP:
-            win.scrollByLines(-1);
+            controller.scrollLine(false);
             event.preventDefault();
             break;
           case KeyEvent.DOM_VK_DOWN:
-            win.scrollByLines(1);
+            controller.scrollLine(true);
             event.preventDefault();
             break;
         }
       ]]></handler>
 
       <handler event="blur"><![CDATA[
         var findbar = this.findbar;
         var fastFind = findbar.browser.fastFind;