Changeset 50039 in webkit


Ignore:
Timestamp:
Oct 24, 2009 9:56:40 PM (15 years ago)
Author:
timothy@apple.com
Message:

WebInspector: Fixed issue with IME inside console
https://bugs.webkit.org/show_bug.cgi?id=30660

Patch by Keishi Hattori <casey.hattori@gmail.com> on 2009-10-24
Reviewed by Timothy Hatcher.

  • inspector/front-end/ConsoleView.js:

(WebInspector.ConsoleView.prototype._promptKeyDown):

  • inspector/front-end/DatabaseQueryView.js:

(WebInspector.DatabaseQueryView.prototype._promptKeyDown):

  • inspector/front-end/inspector.js:

(WebInspector.loaded):
(WebInspector.searchKeyDown): Moved performSearch here from WebInspector.searchKeyUp.
(WebInspector.startEditing.element.handleKeyEvent):
(WebInspector.startEditing):

  • inspector/front-end/utilities.js:

(isEnterKey): Added. Check if in IME.

Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r50038 r50039  
     12009-10-24  Keishi Hattori  <casey.hattori@gmail.com>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        WebInspector: Fixed issue with IME inside console
     6        https://bugs.webkit.org/show_bug.cgi?id=30660
     7
     8        * inspector/front-end/ConsoleView.js:
     9        (WebInspector.ConsoleView.prototype._promptKeyDown):
     10        * inspector/front-end/DatabaseQueryView.js:
     11        (WebInspector.DatabaseQueryView.prototype._promptKeyDown):
     12        * inspector/front-end/inspector.js:
     13        (WebInspector.loaded):
     14        (WebInspector.searchKeyDown): Moved performSearch here from WebInspector.searchKeyUp.
     15        (WebInspector.startEditing.element.handleKeyEvent):
     16        (WebInspector.startEditing):
     17        * inspector/front-end/utilities.js:
     18        (isEnterKey): Added. Check if in IME.
     19
    1202009-10-24  Brian Weinstein  <bweinstein@apple.com>
    221
  • trunk/WebCore/inspector/front-end/ConsoleView.js

    r50038 r50039  
    401401    _promptKeyDown: function(event)
    402402    {
    403         switch (event.keyIdentifier) {
    404             case "Enter":
    405                 this._enterKeyPressed(event);
    406                 return;
     403        if (isEnterKey(event)) {
     404            this._enterKeyPressed(event);
     405            return;
    407406        }
    408407
  • trunk/WebCore/inspector/front-end/DatabaseQueryView.js

    r47960 r50039  
    9595    _promptKeyDown: function(event)
    9696    {
    97         switch (event.keyIdentifier) {
    98             case "Enter":
    99                 this._enterKeyPressed(event);
    100                 return;
     97        if (isEnterKey(event)) {
     98            this._enterKeyPressed(event);
     99            return;
    101100        }
    102101
  • trunk/WebCore/inspector/front-end/inspector.js

    r50015 r50039  
    462462
    463463    var searchField = document.getElementById("search");
    464     searchField.addEventListener("keydown", this.searchKeyDown.bind(this), false);
    465     searchField.addEventListener("keyup", this.searchKeyUp.bind(this), false);
    466464    searchField.addEventListener("search", this.performSearch.bind(this), false); // when the search is emptied
    467465
     
    14421440WebInspector.searchKeyDown = function(event)
    14431441{
    1444     if (event.keyIdentifier !== "Enter")
    1445         return;
    1446 
    1447     // Call preventDefault since this was the Enter key. This prevents a "search" event
    1448     // from firing for key down. We handle the Enter key on key up in searchKeyUp. This
    1449     // stops performSearch from being called twice in a row.
    1450     event.preventDefault();
    1451 }
    1452 
    1453 WebInspector.searchKeyUp = function(event)
    1454 {
    1455     if (event.keyIdentifier !== "Enter")
    1456         return;
     1442    if (!isEnterKey(event))
     1443        return false;
    14571444
    14581445    // Select all of the text so the user can easily type an entirely new query.
     
    14631450    // the incremental attribute set, so we still get incremental searches.
    14641451    this.performSearch(event);
     1452
     1453    // Call preventDefault since this was the Enter key. This prevents a "search" event
     1454    // from firing for key down. This stops performSearch from being called twice in a row.
     1455    event.preventDefault();
    14651456}
    14661457
     
    16411632            return;
    16421633
    1643         if (event.keyIdentifier === "Enter") {
     1634        if (isEnterKey(event)) {
    16441635            editingCommitted.call(element);
    16451636            event.preventDefault();
  • trunk/WebCore/inspector/front-end/utilities.js

    r49174 r50039  
    818818    return { formattedResult: result, unusedSubstitutions: unusedSubstitutions };
    819819}
     820
     821function isEnterKey(event) {
     822    // Check if in IME.
     823    return event.keyCode !== 229 && event.keyIdentifier === "Enter";
     824}
Note: See TracChangeset for help on using the changeset viewer.