Changeset 208014 in webkit


Ignore:
Timestamp:
Oct 27, 2016 3:46:46 PM (7 years ago)
Author:
Wenson Hsieh
Message:

Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
https://bugs.webkit.org/show_bug.cgi?id=163948
<rdar://problem/28921433>

Reviewed by Darin Adler.

Source/WebCore:

Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
(renamed from EditActionDrag, which is no longer necessary after this patch).

When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
means that we currently fire two input events on the source and destination elements (i.e. given by the start
and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
need to fire events in this order:

  1. beforeinput ("deleteByDrag") on the source
  2. Update DOM
  3. input ("deleteByDrag") on the source
  1. beforeinput ("insertFromDrop") on the destination
  2. Update DOM
  3. input ("insertFromDrop") on the destination

To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
events, and also handle preventDefault() separately.

Tests: fast/events/before-input-events-prevent-drag-and-drop.html

fast/events/input-events-drag-and-drop.html
fast/events/input-events-insert-by-drop.html

  • editing/CompositeEditCommand.cpp:

(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::composition):

Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
now perform the assertion here instead.

  • editing/CompositeEditCommand.h:

(WebCore::CompositeEditCommand::shouldDispatchInputEvents):

This is true by default, which means that if apply() is called for a composite edit command that does not
override this to return false, it will try to dispatch input events. In most cases, the parent command will call
on the child command to doApply(), bypassing this check.

(WebCore::CompositeEditCommand::composition): Deleted.

  • editing/EditAction.h:
  • editing/EditCommand.cpp:

(WebCore::inputTypeNameForEditingAction):
(WebCore::EditCommand::isEditingTextAreaOrTextInput):
(WebCore::EditCommand::setStartingSelection):
(WebCore::EditCommand::setEndingSelection):
(WebCore::EditCommand::setParent):

  • editing/Editor.cpp:

(WebCore::Editor::willApplyEditing):
(WebCore::Editor::appliedEditing):

After applying editing, only adjust the current selection and notify clients of selection change if the applied
command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
command have been applied. In particular, we should not register the applied command as an undo step.

  • editing/MoveSelectionCommand.cpp:

(WebCore::MoveSelectionCommand::doApply):
(WebCore::MoveSelectionCommand::editingAction):

  • editing/MoveSelectionCommand.h:
  • page/DragController.cpp:

(WebCore::DragController::concludeEditDrag):

For the cases where we're not deleting text from the drag source (i.e. we're just applying a
ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.

Source/WebKit/mac:

Add support for new drag and drop-related EditAction enum values.

  • WebCoreSupport/WebEditorClient.mm:

(undoNameForEditAction):

Source/WebKit/win:

Add support for new drag and drop-related EditAction enum values.

  • WebCoreSupport/WebEditorClient.cpp:

(undoNameForEditAction):

Source/WebKit2:

Add support for new drag and drop-related EditAction enum values.

  • UIProcess/WebEditCommandProxy.cpp:

(WebKit::WebEditCommandProxy::nameForEditAction):

LayoutTests:

Adds 3 new layout tests verifying that when dragging and dropping (both from a contenteditable to another
contenteditable and from non-editable content into a contenteditable) beforeinput and input events are fired in
the right order with the right data and inputTypes, and that undoing/redoing still considers the drag and drop
command as a single unit. Also tests that both deleting text by dragging and inserting text by dropping are
preventable.

  • fast/events/before-input-events-prevent-drag-and-drop-expected.txt: Added.
  • fast/events/before-input-events-prevent-drag-and-drop.html: Added.
  • fast/events/input-events-drag-and-drop-expected.txt: Added.
  • fast/events/input-events-drag-and-drop.html: Added.
  • fast/events/input-events-insert-by-drop-expected.txt: Added.
  • fast/events/input-events-insert-by-drop.html: Added.
  • platform/ios-simulator/TestExpectations:
  • platform/mac-wk2/TestExpectations:
Location:
trunk
Files:
6 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r208012 r208014  
     12016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
     4        https://bugs.webkit.org/show_bug.cgi?id=163948
     5        <rdar://problem/28921433>
     6
     7        Reviewed by Darin Adler.
     8
     9        Adds 3 new layout tests verifying that when dragging and dropping (both from a contenteditable to another
     10        contenteditable and from non-editable content into a contenteditable) beforeinput and input events are fired in
     11        the right order with the right data and inputTypes, and that undoing/redoing still considers the drag and drop
     12        command as a single unit. Also tests that both deleting text by dragging and inserting text by dropping are
     13        preventable.
     14
     15        * fast/events/before-input-events-prevent-drag-and-drop-expected.txt: Added.
     16        * fast/events/before-input-events-prevent-drag-and-drop.html: Added.
     17        * fast/events/input-events-drag-and-drop-expected.txt: Added.
     18        * fast/events/input-events-drag-and-drop.html: Added.
     19        * fast/events/input-events-insert-by-drop-expected.txt: Added.
     20        * fast/events/input-events-insert-by-drop.html: Added.
     21        * platform/ios-simulator/TestExpectations:
     22        * platform/mac-wk2/TestExpectations:
     23
    1242016-10-27  Devin Rousso  <dcrousso+webkit@gmail.com>
    225
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r208003 r208014  
    12061206fast/events/ime-composition-events-001.html [ Failure ]
    12071207fast/events/inputText-never-fired-on-keydown-cancel.html [ Failure ]
     1208fast/events/input-events-drag-and-drop.html [ Failure ]
     1209fast/events/input-events-insert-by-drop.html [ Failure ]
    12081210fast/events/input-events-fired-when-typing.html [ Failure ]
    12091211fast/events/input-events-paste-data.html [ Failure ]
     
    12271229fast/events/before-input-events-prevent-recomposition.html [ Failure ]
    12281230fast/events/before-input-events-prevent-insert-composition.html [ Failure ]
     1231fast/events/before-input-events-prevent-drag-and-drop.html [ Failure ]
    12291232fast/events/key-events-in-input-button.html [ Failure ]
    12301233fast/events/keydown-1.html [ Failure ]
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r207574 r208014  
    174174fast/events/remove-target-with-shadow-in-drag.html
    175175
     176fast/events/before-input-events-prevent-drag-and-drop.html [ Failure ]
     177fast/events/input-events-drag-and-drop.html [ Failure ]
     178fast/events/input-events-insert-by-drop.html [ Failure ]
     179
    176180webkit.org/b/81833 fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Failure ]
    177181
  • trunk/Source/WebCore/ChangeLog

    r208013 r208014  
     12016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
     4        https://bugs.webkit.org/show_bug.cgi?id=163948
     5        <rdar://problem/28921433>
     6
     7        Reviewed by Darin Adler.
     8
     9        Implements support for "insertFromDrop" and "deleteByDrag" inputTypes. These are fired when dragging and
     10        dropping text in editable areas. To do this, we introduce EditActionInsertFromDrop and EditActionDeleteByDrag
     11        (renamed from EditActionDrag, which is no longer necessary after this patch).
     12
     13        When moving text from an editable element to another, we will use a DeleteSelectionCommand to delete the text
     14        from the source element and a ReplaceSelectionCommand to insert the text into the destination element. This
     15        means that we currently fire two input events on the source and destination elements (i.e. given by the start
     16        and end selections) after both child editing commands of the MoveSelectionCommand have been applied. Instead, we
     17        need to fire events in this order:
     18
     19        1. beforeinput ("deleteByDrag") on the source
     20        2. Update DOM
     21        3. input ("deleteByDrag") on the source
     22
     23        4. beforeinput ("insertFromDrop") on the destination
     24        5. Update DOM
     25        6. input ("insertFromDrop") on the destination
     26
     27        To accomplish this, we allow an edit command to defer dispatching input events to its child commands via
     28        CompositeEditCommand::shouldDispatchInputEvents, which the MoveSelectionCommand overrides. Additionally,
     29        when applying the MoveSelectionCommand, we now apply() the child DeleteSelectionCommand and
     30        ReplaceSelectionCommand instead of using doApply(). This allows these children to separately dispatch input
     31        events, and also handle preventDefault() separately.
     32
     33        Tests: fast/events/before-input-events-prevent-drag-and-drop.html
     34               fast/events/input-events-drag-and-drop.html
     35               fast/events/input-events-insert-by-drop.html
     36
     37        * editing/CompositeEditCommand.cpp:
     38        (WebCore::CompositeEditCommand::apply):
     39        (WebCore::CompositeEditCommand::composition):
     40
     41        Searches for the top-level command and returns its composition. Also ASSERTs that the m_command of all child
     42        commands along the way is null. In places where we used to ASSERT that command.composition() should be null, we
     43        now perform the assertion here instead.
     44
     45        * editing/CompositeEditCommand.h:
     46        (WebCore::CompositeEditCommand::shouldDispatchInputEvents):
     47
     48        This is true by default, which means that if apply() is called for a composite edit command that does not
     49        override this to return false, it will try to dispatch input events. In most cases, the parent command will call
     50        on the child command to doApply(), bypassing this check.
     51
     52        (WebCore::CompositeEditCommand::composition): Deleted.
     53        * editing/EditAction.h:
     54        * editing/EditCommand.cpp:
     55        (WebCore::inputTypeNameForEditingAction):
     56        (WebCore::EditCommand::isEditingTextAreaOrTextInput):
     57        (WebCore::EditCommand::setStartingSelection):
     58        (WebCore::EditCommand::setEndingSelection):
     59        (WebCore::EditCommand::setParent):
     60        * editing/Editor.cpp:
     61        (WebCore::Editor::willApplyEditing):
     62        (WebCore::Editor::appliedEditing):
     63
     64        After applying editing, only adjust the current selection and notify clients of selection change if the applied
     65        command was a top-level command; otherwise, these actions should wait until all child commands of the top-level
     66        command have been applied. In particular, we should not register the applied command as an undo step.
     67
     68        * editing/MoveSelectionCommand.cpp:
     69        (WebCore::MoveSelectionCommand::doApply):
     70        (WebCore::MoveSelectionCommand::editingAction):
     71        * editing/MoveSelectionCommand.h:
     72        * page/DragController.cpp:
     73        (WebCore::DragController::concludeEditDrag):
     74
     75        For the cases where we're not deleting text from the drag source (i.e. we're just applying a
     76        ReplaceSelectionCommand) pass in EditActionInsertFromDrop as the EditAction when creating the command.
     77
    1782016-10-27  Per Arne Vollan  <pvollan@apple.com>
    279
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r207841 r208014  
    344344        case EditActionTypingInsertFinalComposition:
    345345        case EditActionPaste:
    346         case EditActionDrag:
     346        case EditActionDeleteByDrag:
    347347        case EditActionSetWritingDirection:
    348348        case EditActionCut:
     
    350350        case EditActionInsert:
    351351        case EditActionInsertReplacement:
     352        case EditActionInsertFromDrop:
    352353        case EditActionDelete:
    353354        case EditActionDictation:
     
    403404RefPtr<DataTransfer> CompositeEditCommand::inputEventDataTransfer() const
    404405{
     406    return nullptr;
     407}
     408
     409EditCommandComposition* CompositeEditCommand::composition() const
     410{
     411    for (auto* command = this; command; command = command->parent()) {
     412        if (auto composition = command->m_composition) {
     413            ASSERT(!command->parent());
     414            return composition.get();
     415        }
     416    }
    405417    return nullptr;
    406418}
  • trunk/Source/WebCore/editing/CompositeEditCommand.h

    r207841 r208014  
    106106    void apply();
    107107    bool isFirstCommand(EditCommand* command) { return !m_commands.isEmpty() && m_commands.first() == command; }
    108     EditCommandComposition* composition() { return m_composition.get(); }
     108    EditCommandComposition* composition() const;
    109109    EditCommandComposition* ensureComposition();
    110110
     
    119119    virtual String inputEventData() const { return { }; }
    120120    virtual bool isBeforeInputEventCancelable() const { return true; }
     121    virtual bool shouldDispatchInputEvents() const { return true; }
    121122    Vector<RefPtr<StaticRange>> targetRangesForBindings() const;
    122123    virtual RefPtr<DataTransfer> inputEventDataTransfer() const;
  • trunk/Source/WebCore/editing/EditAction.h

    r207698 r208014  
    3232        EditActionInsert,
    3333        EditActionInsertReplacement,
     34        EditActionInsertFromDrop,
    3435        EditActionSetColor,
    3536        EditActionSetBackgroundColor,
     
    5657        EditActionOutline,
    5758        EditActionUnscript,
    58         EditActionDrag,
     59        EditActionDeleteByDrag,
    5960        EditActionCut,
    6061        EditActionBold,
  • trunk/Source/WebCore/editing/EditCommand.cpp

    r207698 r208014  
    5959    case EditActionSetColor:
    6060        return ASCIILiteral("formatForeColor");
    61     case EditActionDrag:
     61    case EditActionDeleteByDrag:
    6262        return ASCIILiteral("deleteByDrag");
    6363    case EditActionCut:
     
    9393    case EditActionInsertReplacement:
    9494        return ASCIILiteral("insertReplacementText");
     95    case EditActionInsertFromDrop:
     96        return ASCIILiteral("insertFromDrop");
    9597    case EditActionTypingInsertLineBreak:
    9698        return ASCIILiteral("insertLineBreak");
     
    179181{
    180182    for (EditCommand* cmd = this; ; cmd = cmd->m_parent) {
    181         if (EditCommandComposition* composition = compositionIfPossible(cmd)) {
    182             ASSERT(cmd->isTopLevelCommand());
     183        if (auto* composition = compositionIfPossible(cmd))
    183184            composition->setStartingSelection(s);
    184         }
    185185        cmd->m_startingSelection = s;
    186186        if (!cmd->m_parent || cmd->m_parent->isFirstCommand(cmd))
     
    192192{
    193193    for (EditCommand* cmd = this; cmd; cmd = cmd->m_parent) {
    194         if (EditCommandComposition* composition = compositionIfPossible(cmd)) {
    195             ASSERT(cmd->isTopLevelCommand());
     194        if (auto* composition = compositionIfPossible(cmd))
    196195            composition->setEndingSelection(s);
    197         }
    198196        cmd->m_endingSelection = s;
    199197    }
     
    203201{
    204202    ASSERT((parent && !m_parent) || (!parent && m_parent));
    205     ASSERT(!parent || !isCompositeEditCommand() || !toCompositeEditCommand(this)->composition());
    206203    m_parent = parent;
    207204    if (parent) {
  • trunk/Source/WebCore/editing/Editor.cpp

    r207841 r208014  
    10841084bool Editor::willApplyEditing(CompositeEditCommand& command, Vector<RefPtr<StaticRange>>&& targetRanges) const
    10851085{
     1086    if (!command.shouldDispatchInputEvents())
     1087        return true;
     1088
    10861089    auto* composition = command.composition();
    10871090    if (!composition)
     
    11031106    notifyTextFromControls(composition->startingRootEditableElement(), composition->endingRootEditableElement());
    11041107
    1105     // Don't clear the typing style with this selection change.  We do those things elsewhere if necessary.
    1106     FrameSelection::SetSelectionOptions options = cmd->isDictationCommand() ? FrameSelection::DictationTriggered : 0;
    1107    
    1108     changeSelectionAfterCommand(newSelection, options);
    1109     dispatchInputEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement(), cmd->inputEventTypeName(), cmd->inputEventData(), cmd->inputEventDataTransfer());
    1110 
    1111     updateEditorUINowIfScheduled();
    1112    
    1113     m_alternativeTextController->respondToAppliedEditing(cmd.get());
    1114 
    1115     if (!cmd->preservesTypingStyle())
    1116         m_frame.selection().clearTypingStyle();
    1117 
    1118     // Command will be equal to last edit command only in the case of typing
    1119     if (m_lastEditCommand.get() == cmd)
    1120         ASSERT(cmd->isTypingCommand());
    1121     else {
    1122         // Only register a new undo command if the command passed in is
    1123         // different from the last command
    1124         m_lastEditCommand = cmd;
    1125         if (client())
    1126             client()->registerUndoStep(m_lastEditCommand->ensureComposition());
    1127     }
    1128 
    1129     respondToChangedContents(newSelection);
     1108    if (cmd->isTopLevelCommand()) {
     1109        // Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
     1110        FrameSelection::SetSelectionOptions options = cmd->isDictationCommand() ? FrameSelection::DictationTriggered : 0;
     1111
     1112        changeSelectionAfterCommand(newSelection, options);
     1113    }
     1114
     1115    if (cmd->shouldDispatchInputEvents())
     1116        dispatchInputEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement(), cmd->inputEventTypeName(), cmd->inputEventData(), cmd->inputEventDataTransfer());
     1117
     1118    if (cmd->isTopLevelCommand()) {
     1119        updateEditorUINowIfScheduled();
     1120
     1121        m_alternativeTextController->respondToAppliedEditing(cmd.get());
     1122
     1123        if (!cmd->preservesTypingStyle())
     1124            m_frame.selection().clearTypingStyle();
     1125
     1126        // Command will be equal to last edit command only in the case of typing
     1127        if (m_lastEditCommand.get() == cmd)
     1128            ASSERT(cmd->isTypingCommand());
     1129        else {
     1130            // Only register a new undo command if the command passed in is
     1131            // different from the last command
     1132            m_lastEditCommand = cmd;
     1133            if (client())
     1134                client()->registerUndoStep(m_lastEditCommand->ensureComposition());
     1135        }
     1136        respondToChangedContents(newSelection);
     1137    }
    11301138}
    11311139
  • trunk/Source/WebCore/editing/MoveSelectionCommand.cpp

    r194496 r208014  
    2727#include "MoveSelectionCommand.h"
    2828
     29#include "DeleteSelectionCommand.h"
    2930#include "DocumentFragment.h"
    3031#include "ReplaceSelectionCommand.h"
     
    6162    }
    6263
    63     deleteSelection(m_smartDelete);
     64    {
     65        auto deleteSelection = DeleteSelectionCommand::create(document(), m_smartDelete, true, false, true, true, EditActionDeleteByDrag);
     66        deleteSelection->setParent(this);
     67        deleteSelection->apply();
     68        m_commands.append(WTFMove(deleteSelection));
     69    }
    6470
    6571    // If the node for the destination has been removed as a result of the deletion,
     
    7379
    7480    setEndingSelection(VisibleSelection(pos, endingSelection().affinity(), endingSelection().isDirectional()));
     81    setStartingSelection(endingSelection());
    7582    if (!pos.anchorNode()->inDocument()) {
    7683        // Document was modified out from under us.
     
    8087    if (m_smartInsert)
    8188        options |= ReplaceSelectionCommand::SmartReplace;
    82     applyCommandToComposite(ReplaceSelectionCommand::create(document(), WTFMove(m_fragment), options));
     89
     90    {
     91        auto replaceSelection = ReplaceSelectionCommand::create(document(), WTFMove(m_fragment), options, EditActionInsertFromDrop);
     92        replaceSelection->setParent(this);
     93        replaceSelection->apply();
     94        m_commands.append(WTFMove(replaceSelection));
     95    }
    8396}
    8497
    8598EditAction MoveSelectionCommand::editingAction() const
    8699{
    87     return EditActionDrag;
     100    return EditActionDeleteByDrag;
    88101}
    89102
  • trunk/Source/WebCore/editing/MoveSelectionCommand.h

    r177733 r208014  
    4545    virtual void doApply();
    4646    virtual EditAction editingAction() const;
     47    bool shouldDispatchInputEvents() const final { return false; }
    4748   
    4849    RefPtr<DocumentFragment> m_fragment;
  • trunk/Source/WebCore/page/DragController.cpp

    r204972 r208014  
    533533                if (chosePlainText)
    534534                    options |= ReplaceSelectionCommand::MatchStyle;
    535                 applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse, WTFMove(fragment), options));
     535                applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse, WTFMove(fragment), options, EditActionInsertFromDrop));
    536536            }
    537537        }
     
    544544        m_client.willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
    545545        if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point))
    546             applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse, createFragmentFromText(*range, text),  ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting));
     546            applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse, createFragmentFromText(*range, text),  ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting, EditActionInsertFromDrop));
    547547    }
    548548
  • trunk/Source/WebKit/mac/ChangeLog

    r207990 r208014  
     12016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
     4        https://bugs.webkit.org/show_bug.cgi?id=163948
     5        <rdar://problem/28921433>
     6
     7        Reviewed by Darin Adler.
     8
     9        Add support for new drag and drop-related EditAction enum values.
     10
     11        * WebCoreSupport/WebEditorClient.mm:
     12        (undoNameForEditAction):
     13
    1142016-10-27  Dan Bernstein  <mitz@apple.com>
    215
  • trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm

    r207698 r208014  
    565565        case EditActionInsert: return nil;
    566566        case EditActionInsertReplacement: return nil;
     567        case EditActionInsertFromDrop: return nil;
    567568        case EditActionSetColor: return UI_STRING_KEY_INTERNAL("Set Color", "Set Color (Undo action name)", "Undo action name");
    568569        case EditActionSetBackgroundColor: return UI_STRING_KEY_INTERNAL("Set Background Color", "Set Background Color (Undo action name)", "Undo action name");
     
    589590        case EditActionOutline: return UI_STRING_KEY_INTERNAL("Outline", "Outline (Undo action name)", "Undo action name");
    590591        case EditActionUnscript: return UI_STRING_KEY_INTERNAL("Unscript", "Unscript (Undo action name)", "Undo action name");
    591         case EditActionDrag: return UI_STRING_KEY_INTERNAL("Drag", "Drag (Undo action name)", "Undo action name");
     592        case EditActionDeleteByDrag: return UI_STRING_KEY_INTERNAL("Drag", "Drag (Undo action name)", "Undo action name");
    592593        case EditActionCut: return UI_STRING_KEY_INTERNAL("Cut", "Cut (Undo action name)", "Undo action name");
    593594        case EditActionPaste: return UI_STRING_KEY_INTERNAL("Paste", "Paste (Undo action name)", "Undo action name");
  • trunk/Source/WebKit/win/ChangeLog

    r207928 r208014  
     12016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
     4        https://bugs.webkit.org/show_bug.cgi?id=163948
     5        <rdar://problem/28921433>
     6
     7        Reviewed by Darin Adler.
     8
     9        Add support for new drag and drop-related EditAction enum values.
     10
     11        * WebCoreSupport/WebEditorClient.cpp:
     12        (undoNameForEditAction):
     13
    1142016-10-26  Brian Burg  <bburg@apple.com>
    215
  • trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp

    r206979 r208014  
    593593    case EditActionOutline: return WEB_UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name");
    594594    case EditActionUnscript: return WEB_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name");
    595     case EditActionDrag: return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name");
     595    case EditActionDeleteByDrag: return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name");
    596596    case EditActionCut: return WEB_UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name");
    597597    case EditActionPaste: return WEB_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name");
  • trunk/Source/WebKit2/ChangeLog

    r207931 r208014  
     12016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
     4        https://bugs.webkit.org/show_bug.cgi?id=163948
     5        <rdar://problem/28921433>
     6
     7        Reviewed by Darin Adler.
     8
     9        Add support for new drag and drop-related EditAction enum values.
     10
     11        * UIProcess/WebEditCommandProxy.cpp:
     12        (WebKit::WebEditCommandProxy::nameForEditAction):
     13
    1142016-10-26  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp

    r207698 r208014  
    7474    switch (editAction) {
    7575    case EditActionUnspecified:
    76         return String();
    7776    case EditActionInsert:
    78         return String();
    7977    case EditActionInsertReplacement:
     78    case EditActionInsertFromDrop:
    8079        return String();
    8180    case EditActionSetColor:
     
    127126    case EditActionUnscript:
    128127        return WEB_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name");
    129     case EditActionDrag:
     128    case EditActionDeleteByDrag:
    130129        return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name");
    131130    case EditActionCut:
Note: See TracChangeset for help on using the changeset viewer.