Changeset 51961 in webkit
- Timestamp:
- Dec 10, 2009 1:54:34 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51960 r51961 1 2009-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 1 16 2009-12-10 Dimitri Glazkov <dglazkov@chromium.org> 2 17 -
trunk/WebCore/inspector/front-end/ElementsTreeOutline.js
r51946 r51961 198 198 return; 199 199 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) { 202 202 selectedElement.remove(); 203 203 event.preventDefault(); -
trunk/WebCore/inspector/front-end/KeyboardShortcut.js
r51341 r51961 45 45 46 46 WebInspector.KeyboardShortcut.KeyCodes = { 47 Backspace: 8, 47 48 Esc: 27, 48 49 Space: 32, … … 55 56 Right: 39, // also NUM_EAST 56 57 Down: 40, // also NUM_SOUTH 58 Delete: 46, 57 59 F1: 112, 58 60 F2: 113, -
trunk/WebCore/inspector/front-end/inspector.js
r51946 r51961 483 483 484 484 var mainPanelsElement = document.getElementById("main-panels"); 485 mainPanelsElement.handleKeyEvent = this.mainKeyDown.bind(this);486 mainPanelsElement.handleKeyUpEvent = this.mainKeyUp.bind(this);487 485 mainPanelsElement.handleCopyEvent = this.mainCopy.bind(this); 488 486 … … 641 639 WebInspector.documentKeyDown = function(event) 642 640 { 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); 649 652 650 653 if (!event.handled) { … … 731 734 WebInspector.documentKeyUp = function(event) 732 735 { 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); 736 745 } 737 746 … … 761 770 if (event.handled || event.target.hasStyleClass("popup-glasspane")) 762 771 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);775 772 } 776 773 … … 1551 1548 if (event.keyCode === WebInspector.KeyboardShortcut.KeyCodes.Esc) { 1552 1549 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 === ""); 1554 1553 event.target.value = ""; 1555 1554 … … 1558 1557 if (this.currentFocusElement === event.target) 1559 1558 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; 1561 1563 return false; 1562 1564 }
Note: See TracChangeset
for help on using the changeset viewer.