Changeset 51961 in webkit


Ignore:
Timestamp:
Dec 10, 2009 1:54:34 PM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2009-12-10 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: debugger shortcuts don't work when
Search field or Console drawer has focus.

https://bugs.webkit.org/show_bug.cgi?id=32392

Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51960 r51961  
     12009-12-10  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: debugger shortcuts don't work when
     6        Search field or Console drawer has focus.
     7
     8        https://bugs.webkit.org/show_bug.cgi?id=32392
     9
     10        * inspector/front-end/inspector.js:
     11        (WebInspector.loaded):
     12        (WebInspector.documentKeyDown):
     13        (WebInspector.documentKeyUp):
     14        (WebInspector.searchKeyDown):
     15
    1162009-12-10  Dimitri Glazkov  <dglazkov@chromium.org>
    217
  • trunk/WebCore/inspector/front-end/ElementsTreeOutline.js

    r51946 r51961  
    198198            return;
    199199
    200         // Delete or backspace pressed, delete the node.
    201         if (event.keyCode === 8 || event.keyCode === 46) {
     200        if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Backspace ||
     201                event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Delete) {
    202202            selectedElement.remove();
    203203            event.preventDefault();
  • trunk/WebCore/inspector/front-end/KeyboardShortcut.js

    r51341 r51961  
    4545
    4646WebInspector.KeyboardShortcut.KeyCodes = {
     47    Backspace: 8,
    4748    Esc: 27,
    4849    Space: 32,
     
    5556    Right: 39,       // also NUM_EAST
    5657    Down: 40,        // also NUM_SOUTH
     58    Delete: 46,
    5759    F1: 112,
    5860    F2: 113,
  • trunk/WebCore/inspector/front-end/inspector.js

    r51946 r51961  
    483483
    484484    var mainPanelsElement = document.getElementById("main-panels");
    485     mainPanelsElement.handleKeyEvent = this.mainKeyDown.bind(this);
    486     mainPanelsElement.handleKeyUpEvent = this.mainKeyUp.bind(this);
    487485    mainPanelsElement.handleCopyEvent = this.mainCopy.bind(this);
    488486
     
    641639WebInspector.documentKeyDown = function(event)
    642640{
    643     if (!this.currentFocusElement)
    644         return;
    645     if (this.currentFocusElement.handleKeyEvent)
    646         this.currentFocusElement.handleKeyEvent(event);
    647     else if (this.currentFocusElement.id && this.currentFocusElement.id.length && WebInspector[this.currentFocusElement.id + "KeyDown"])
    648         WebInspector[this.currentFocusElement.id + "KeyDown"](event);
     641    if (this.currentFocusElement) {
     642        if (this.currentFocusElement.handleKeyEvent)
     643            this.currentFocusElement.handleKeyEvent(event);
     644        else if (this.currentFocusElement.id && this.currentFocusElement.id.length && WebInspector[this.currentFocusElement.id + "KeyDown"])
     645            WebInspector[this.currentFocusElement.id + "KeyDown"](event);
     646        if (event.handled)
     647            return;
     648    }
     649
     650    if (this.currentPanel && this.currentPanel.handleKeyEvent)
     651        this.currentPanel.handleKeyEvent(event);
    649652
    650653    if (!event.handled) {
     
    731734WebInspector.documentKeyUp = function(event)
    732735{
    733     if (!this.currentFocusElement || !this.currentFocusElement.handleKeyUpEvent)
    734         return;
    735     this.currentFocusElement.handleKeyUpEvent(event);
     736    if (this.currentFocusElement) {
     737        if (this.currentFocusElement.handleKeyUpEvent)
     738            this.currentFocusElement.handleKeyUpEvent(event);
     739        if (event.handled)
     740            return;
     741    }
     742
     743    if (this.currentPanel && this.currentPanel.handleKeyUpEvent)
     744        this.currentPanel.handleKeyUpEvent(event);
    736745}
    737746
     
    761770    if (event.handled || event.target.hasStyleClass("popup-glasspane"))
    762771        event.preventDefault();
    763 }
    764 
    765 WebInspector.mainKeyDown = function(event)
    766 {
    767     if (this.currentPanel && this.currentPanel.handleKeyEvent)
    768         this.currentPanel.handleKeyEvent(event);
    769 }
    770 
    771 WebInspector.mainKeyUp = function(event)
    772 {
    773     if (this.currentPanel && this.currentPanel.handleKeyUpEvent)
    774         this.currentPanel.handleKeyUpEvent(event);
    775772}
    776773
     
    15511548    if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Esc) {
    15521549        event.preventDefault();
    1553         event.handled = true;
     1550        // When search was selected manually and is currently blank, we'd like Esc stay unhandled
     1551        // and hit console drawer handler.
     1552        event.handled = !(this.previousFocusElement === event.target && event.target.value === "");
    15541553        event.target.value = "";
    15551554
     
    15581557        if (this.currentFocusElement === event.target)
    15591558            this.currentFocusElement.select();
    1560 
     1559        return false;
     1560    } else if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Backspace ||
     1561               event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Delete) {
     1562        event.handled = true;
    15611563        return false;
    15621564    }
Note: See TracChangeset for help on using the changeset viewer.