Changeset 142142 in webkit


Ignore:
Timestamp:
Feb 7, 2013 9:46:41 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: home button behaviour is wrong in DTE
https://bugs.webkit.org/show_bug.cgi?id=109154

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-02-07
Reviewed by Vsevolod Vlasov.

Source/WebCore:

Handle home key shortcut explicitly in TextEditorMainPanel.

New test: inspector/editor/text-editor-home-button.html

  • inspector/front-end/DefaultTextEditor.js:

(WebInspector.TextEditorMainPanel.prototype._registerShortcuts):
(WebInspector.TextEditorMainPanel.prototype._handleHomeKey):

LayoutTests:

Add layout test to verify home button behaviour. Exclude this test on
platforms that do not have eventSender object in test shell.

  • inspector/editor/text-editor-home-button-expected.txt: Added.
  • inspector/editor/text-editor-home-button.html: Added.
  • platform/efl/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/qt/TestExpectations:
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142140 r142142  
     12013-02-07  Andrey Lushnikov  <lushnikov@chromium.org>
     2
     3        Web Inspector: home button behaviour is wrong in DTE
     4        https://bugs.webkit.org/show_bug.cgi?id=109154
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Add layout test to verify home button behaviour. Exclude this test on
     9        platforms that do not have eventSender object in test shell.
     10
     11        * inspector/editor/text-editor-home-button-expected.txt: Added.
     12        * inspector/editor/text-editor-home-button.html: Added.
     13        * platform/efl/TestExpectations:
     14        * platform/mac/TestExpectations:
     15        * platform/qt/TestExpectations:
     16
    1172013-02-07  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    218
  • trunk/LayoutTests/platform/efl/TestExpectations

    r142051 r142142  
    18201820inspector/editor/text-editor-formatter.html
    18211821inspector/editor/text-editor-word-jumps.html
     1822inspector/editor/text-editor-home-button.html
    18221823
    18231824# Remove from list after enabling CANVAS_PATH
  • trunk/LayoutTests/platform/mac/TestExpectations

    r142084 r142142  
    255255inspector/editor/text-editor-formatter.html [ Skip ]
    256256inspector/editor/text-editor-word-jumps.html [ Skip ]
     257inspector/editor/text-editor-home-button.html [ Skip ]
    257258
    258259# https://bugs.webkit.org/show_bug.cgi?id=71120
  • trunk/LayoutTests/platform/qt/TestExpectations

    r142135 r142142  
    26022602inspector/editor/text-editor-formatter.html
    26032603inspector/editor/text-editor-word-jumps.html
     2604inspector/editor/text-editor-home-button.html
    26042605
    26052606# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=14664
  • trunk/Source/WebCore/ChangeLog

    r142141 r142142  
     12013-02-07  Andrey Lushnikov  <lushnikov@chromium.org>
     2
     3        Web Inspector: home button behaviour is wrong in DTE
     4        https://bugs.webkit.org/show_bug.cgi?id=109154
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        Handle home key shortcut explicitly in TextEditorMainPanel.
     9
     10        New test: inspector/editor/text-editor-home-button.html
     11
     12        * inspector/front-end/DefaultTextEditor.js:
     13        (WebInspector.TextEditorMainPanel.prototype._registerShortcuts):
     14        (WebInspector.TextEditorMainPanel.prototype._handleHomeKey):
     15
    1162013-02-07  Gavin Peters  <gavinp@chromium.org>
    217
  • trunk/Source/WebCore/inspector/front-end/DefaultTextEditor.js

    r142138 r142142  
    13981398        this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Tab.code)] = handleTabKey;
    13991399        this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Tab.code, modifiers.Shift)] = handleShiftTabKey;
     1400
     1401        this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Home.code, modifiers.None)] = this._handleHomeKey.bind(this, false);
     1402        this._shortcuts[WebInspector.KeyboardShortcut.makeKey(keys.Home.code, modifiers.Shift)] = this._handleHomeKey.bind(this, true);
     1403    },
     1404
     1405    /**
     1406     * @param {boolean} shift
     1407     */
     1408    _handleHomeKey: function(shift)
     1409    {
     1410        var selection = this.selection();
     1411
     1412        var line = this._textModel.line(selection.endLine);
     1413        var firstNonBlankCharacter = 0;
     1414        while (firstNonBlankCharacter < line.length) {
     1415            var char = line.charAt(firstNonBlankCharacter);
     1416            if (char === " " || char === "\t")
     1417                ++firstNonBlankCharacter;
     1418            else
     1419                break;
     1420        }
     1421        if (firstNonBlankCharacter >= line.length || selection.endColumn === firstNonBlankCharacter)
     1422            return false;
     1423
     1424        selection.endColumn = firstNonBlankCharacter;
     1425        if (!shift)
     1426            selection = selection.collapseToEnd();
     1427        this._restoreSelection(selection);
     1428        return true;
    14001429    },
    14011430
Note: See TracChangeset for help on using the changeset viewer.