[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

beidson at apple.com beidson at apple.com
Thu Apr 8 02:01:48 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit f8db6973bc9aebf59d6f2c78ab990b07325fe3c9
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 26 22:26:33 2010 +0000

    Arrow keys do not scroll source view in Resources pane or Scripts pane.
    <rdar://problem/7594367> and https://bugs.webkit.org/show_bug.cgi?id=34356
    
    Reviewed by Pavel Feldman.
    
    Handle vertical scrolling in the Text Viewer:
    * inspector/front-end/TextViewer.js:
    (WebInspector.TextViewer): Listen for the keydown event.
    (WebInspector.TextViewer.prototype._handleKeyDown): If the event has no modifiers and refers
      to an arrow key, scroll. The horizontal values were ripped from the default "pixels per scroll line"
      value in ScrollBar.h.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55313 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f0c9cba..ec1e19e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-26  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Pavel Feldman.
+
+        Arrow keys do not scroll source view in Resources pane or Scripts pane.
+        <rdar://problem/7594367> and https://bugs.webkit.org/show_bug.cgi?id=34356
+
+        Handle vertical scrolling in the Text Viewer:
+        * inspector/front-end/TextViewer.js:
+        (WebInspector.TextViewer): Listen for the keydown event.
+        (WebInspector.TextViewer.prototype._handleKeyDown): If the event has no modifiers and refers
+          to an arrow key, scroll. The horizontal values were ripped from the default "pixels per scroll line"
+          value in ScrollBar.h.
+
 2010-02-26  Gavin Barraclough  <barraclough at apple.com>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/WebCore/inspector/front-end/TextViewer.js b/WebCore/inspector/front-end/TextViewer.js
index 50ce3d3..4c1558f 100644
--- a/WebCore/inspector/front-end/TextViewer.js
+++ b/WebCore/inspector/front-end/TextViewer.js
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -39,6 +40,7 @@ WebInspector.TextViewer = function(textModel, platform, url)
     this.element.tabIndex = 0;
 
     this.element.addEventListener("scroll", this._scroll.bind(this), false);
+    this.element.addEventListener("keydown", this._handleKeyDown.bind(this), false);
 
     this._url = url;
 
@@ -202,6 +204,37 @@ WebInspector.TextViewer.prototype = {
                 this._repaintAll();
         }.bind(this), 50);
     },
+    
+    _handleKeyDown: function()
+    {
+        if (event.metaKey || event.shiftKey || event.ctrlKey || event.altKey)
+            return;
+        
+        var scrollValue = 0;
+        if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Up)
+            scrollValue = -1;
+        else if (event.keyCode == WebInspector.KeyboardShortcut.KeyCodes.Down)
+            scrollValue = 1;
+        
+        if (scrollValue) {
+            event.preventDefault();
+            event.stopPropagation();
+            this.element.scrollByLines(scrollValue);
+            return;
+        }
+        
+        scrollValue = 0;
+        if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Left)
+            scrollValue = -40;
+        else if (event.keyCode == WebInspector.KeyboardShortcut.KeyCodes.Right)
+            scrollValue = 40;
+        
+        if (scrollValue) {
+            event.preventDefault();
+            event.stopPropagation();
+            this.element.scrollLeft += scrollValue;
+        }
+    },
 
     beginUpdates: function(enabled)
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list