Changeset 65912 in webkit


Ignore:
Timestamp:
Aug 24, 2010 10:59:22 AM (14 years ago)
Author:
weinig@apple.com
Message:

Paste event fires twice for mac WebKit
<rdar://problem/8094611>
https://bugs.webkit.org/show_bug.cgi?id=44535

Reviewed by Oliver Hunt.

WebCore:

The mac implementation of paste in WebKit was accidentally calling
Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
Use the new pasteAsPlainTextBypassingDHTML function to bypass the
second call.

Test: editing/pasteboard/paste-event-only-once.html

  • WebCore.exp.in:
  • editing/Editor.cpp:

(WebCore::Editor::pasteAsPlainTextBypassingDHTML):

  • editing/Editor.h:

Expose a function which just pastes using from the general pasteboard,
bypassing all the checking and DHTML pasting.

WebKit/mac:

The mac implementation of paste in WebKit was accidentally calling
Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
Use the new pasteAsPlainTextBypassingDHTML function to bypass the
second call.

  • WebView/WebHTMLView.mm:

(-[WebHTMLView paste:]):

LayoutTests:

  • editing/pasteboard/paste-event-only-once-expected.txt: Added.
  • editing/pasteboard/paste-event-only-once.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r65910 r65912  
     12010-08-24  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Paste event fires twice for mac WebKit
     6        <rdar://problem/8094611>
     7        https://bugs.webkit.org/show_bug.cgi?id=44535
     8
     9        * editing/pasteboard/paste-event-only-once-expected.txt: Added.
     10        * editing/pasteboard/paste-event-only-once.html: Added.
     11
    1122010-08-24  Nate Chapin  <japhet@chromium.org>
    213
  • trunk/WebCore/ChangeLog

    r65911 r65912  
     12010-08-24  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Paste event fires twice for mac WebKit
     6        <rdar://problem/8094611>
     7        https://bugs.webkit.org/show_bug.cgi?id=44535
     8
     9        The mac implementation of paste in WebKit was accidentally calling
     10        Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
     11        in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
     12        Use the new pasteAsPlainTextBypassingDHTML function to bypass the
     13        second call.
     14
     15        Test: editing/pasteboard/paste-event-only-once.html
     16
     17        * WebCore.exp.in:
     18        * editing/Editor.cpp:
     19        (WebCore::Editor::pasteAsPlainTextBypassingDHTML):
     20        * editing/Editor.h:
     21        Expose a function which just pastes using from the general pasteboard,
     22        bypassing all the checking and DHTML pasting.
     23
    1242010-08-24  Nate Chapin  <japhet@chromium.org>
    225
  • trunk/WebCore/WebCore.exp.in

    r65904 r65912  
    362362__ZN7WebCore15visitedLinkHashEPKtj
    363363__ZN7WebCore16AbstractDatabase14setIsAvailableEb
     364__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
    364365__ZN7WebCore16FontFallbackList15releaseFontDataEv
    365366__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
     
    402403__ZN7WebCore17CredentialStorage3getERKNS_15ProtectionSpaceE
    403404__ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
    404 __ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
    405405__ZN7WebCore17DeviceOrientation6createEbdbdbd
    406406__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
     
    462462__ZN7WebCore23createFragmentFromNodesEPNS_8DocumentERKN3WTF6VectorIPNS_4NodeELm0EEE
    463463__ZN7WebCore24BinaryPropertyListWriter17writePropertyListEv
     464__ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
     465__ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
    464466__ZN7WebCore24contextMenuItemTagItalicEv
    465467__ZN7WebCore24contextMenuItemTagStylesEv
    466468__ZN7WebCore24createFragmentFromMarkupEPNS_8DocumentERKN3WTF6StringES5_NS_27FragmentScriptingPermissionE
    467469__ZN7WebCore24decodeURLEscapeSequencesERKN3WTF6StringE
    468 __ZN7WebCore24DocumentMarkerController13removeMarkersENS_14DocumentMarker10MarkerTypeE
    469 __ZN7WebCore24DocumentMarkerController23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
    470470__ZN7WebCore24notifyHistoryItemChangedE
    471471__ZN7WebCore24rangeCompliantEquivalentERKNS_8PositionE
     
    629629__ZN7WebCore6Editor30applyParagraphStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
    630630__ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
     631__ZN7WebCore6Editor30pasteAsPlainTextBypassingDHTMLEv
    631632__ZN7WebCore6Editor32guessesForUngrammaticalSelectionEv
    632633__ZN7WebCore6Editor33increaseSelectionListLevelOrderedEv
  • trunk/WebCore/editing/Editor.cpp

    r65787 r65912  
    325325    ExceptionCode ec = 0;
    326326    target->dispatchEvent(TextEvent::createForFragmentPaste(m_frame->domWindow(), pastingFragment, smartReplace, matchStyle), ec);
     327}
     328
     329void Editor::pasteAsPlainTextBypassingDHTML()
     330{
     331    pasteAsPlainTextWithPasteboard(Pasteboard::generalPasteboard());
    327332}
    328333
  • trunk/WebCore/editing/Editor.h

    r65395 r65912  
    300300    void pasteAsPlainText(const String&, bool smartReplace);
    301301
     302    // This is only necessary while paste is primarily implemented in WebKit for the mac platform.
     303    void pasteAsPlainTextBypassingDHTML();
     304
    302305    Node* findEventTargetFrom(const VisibleSelection& selection) const;
    303306private:
  • trunk/WebKit/mac/ChangeLog

    r65904 r65912  
     12010-08-24  Sam Weinig  <sam@webkit.org>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Paste event fires twice for mac WebKit
     6        <rdar://problem/8094611>
     7        https://bugs.webkit.org/show_bug.cgi?id=44535
     8
     9        The mac implementation of paste in WebKit was accidentally calling
     10        Editor::tryDHTMLPaste twice, once in -[WebHTMLView paste:] and once
     11        in Editor::pasteAsPlainText (which is called -[WebHTMLView paste:]).
     12        Use the new pasteAsPlainTextBypassingDHTML function to bypass the
     13        second call.
     14
     15        * WebView/WebHTMLView.mm:
     16        (-[WebHTMLView paste:]):
     17
    1182010-08-24  Daniel Cheng  <dcheng@chromium.org>
    219
  • trunk/WebKit/mac/WebView/WebHTMLView.mm

    r65787 r65912  
    51775177        [self _pasteWithPasteboard:[NSPasteboard generalPasteboard] allowPlainText:YES];
    51785178    else
    5179         coreFrame->editor()->pasteAsPlainText();
     5179        coreFrame->editor()->pasteAsPlainTextBypassingDHTML();
    51805180}
    51815181
Note: See TracChangeset for help on using the changeset viewer.