Changeset 147535 in webkit


Ignore:
Timestamp:
Apr 3, 2013 3:24:58 AM (11 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [REGRESSION(r147117)][Elements] Copy/paste keyboard shortcuts broken in "Edit as HTML"
https://bugs.webkit.org/show_bug.cgi?id=113798

Reviewed by Yury Semikhatsky.

Stop propagation of "copy" event from the multiline editor's
CodeMirror host element so that it is not handled by
WebInspector.documentCopy().

  • inspector/front-end/UIUtils.js:

(.consumeCopy):
(.cleanUpAfterEditing):

  • inspector/front-end/inspector.js:

(WebInspector.addMainEventListeners):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r147533 r147535  
     12013-04-03  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [REGRESSION(r147117)][Elements] Copy/paste keyboard shortcuts broken in "Edit as HTML"
     4        https://bugs.webkit.org/show_bug.cgi?id=113798
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        Stop propagation of "copy" event from the multiline editor's
     9        CodeMirror host element so that it is not handled by
     10        WebInspector.documentCopy().
     11
     12        * inspector/front-end/UIUtils.js:
     13        (.consumeCopy):
     14        (.cleanUpAfterEditing):
     15        * inspector/front-end/inspector.js:
     16        (WebInspector.addMainEventListeners):
     17
    1182013-04-03  Takashi Sakamoto  <tasak@google.com>
    219
  • trunk/Source/WebCore/inspector/front-end/UIUtils.js

    r147117 r147535  
    448448    var cssLoadView;
    449449
     450    function consumeCopy(e)
     451    {
     452        e.consume();
     453    }
     454
    450455    if (isMultiline) {
    451456        loadScript("CodeMirrorTextEditor.js");
     
    453458        cssLoadView.show(element);
    454459        WebInspector.setCurrentFocusElement(element);
     460        element.addEventListener("copy", consumeCopy, true);
    455461        codeMirror = window.CodeMirror(element, {
    456462            mode: config.mode,
     
    501507
    502508        if (isMultiline) {
     509            element.removeEventListener("copy", consumeCopy, true);
    503510            cssLoadView.detach();
    504511            return;
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r147105 r147535  
    10171017    doc.addEventListener("keydown", this.postDocumentKeyDown.bind(this), false);
    10181018    doc.addEventListener("beforecopy", this.documentCanCopy.bind(this), true);
    1019     doc.addEventListener("copy", this.documentCopy.bind(this), true);
     1019    doc.addEventListener("copy", this.documentCopy.bind(this), false);
    10201020    doc.addEventListener("contextmenu", this.contextMenuEventFired.bind(this), true);
    10211021    doc.addEventListener("click", this.documentClick.bind(this), true);
Note: See TracChangeset for help on using the changeset viewer.