Changeset 207698 in webkit
- Timestamp:
- Oct 21, 2016 4:06:05 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207692 r207698 1 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents 4 https://bugs.webkit.org/show_bug.cgi?id=163460 5 <rdar://problem/28784142> 6 7 Reviewed by Darin Adler. 8 9 Adds 4 new layout tests to verify that composition events are dispatched as expected when using IME, and that 10 input events of type "insertFromComposition" and "deleteByComposition" can be prevented. 11 12 Also rebaselines an existing WK1 editing test (text-input-controller.html) to account for how we now delete the 13 existing composition text before inserting the finalized composition text in Editor::setComposition. This means 14 that there are a few more delegate calls than there were before (as seen in the expected output), although the 15 resulting behavior is still the same. 16 17 * editing/mac/input/text-input-controller-expected.txt: 18 * fast/events/before-input-events-prevent-insert-composition.html: Added. 19 * fast/events/before-input-events-prevent-recomposition.html: Added. 20 * fast/events/input-events-ime-composition.html: Added. 21 * fast/events/input-events-ime-recomposition.html: Added. 22 * platform/ios-simulator/TestExpectations: 23 1 24 2016-10-20 Dean Jackson <dino@apple.com> 2 25 -
trunk/LayoutTests/editing/mac/input/text-input-controller-expected.txt
r187932 r207698 23 23 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 24 24 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 25 EDITING DELEGATE: shouldInsertText:Success replacingDOMRange:range from 0 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document givenAction:WebViewInsertActionTyped26 25 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 27 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 26 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 27 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 28 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification 29 EDITING DELEGATE: shouldInsertText:Success replacingDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionTyped 30 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > BODY > HTML > #document to 7 of #text > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE 28 31 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification 29 32 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r207670 r207698 1210 1210 fast/events/input-events-typing-data.html [ Failure ] 1211 1211 fast/events/input-events-forecolor-data.html [ Failure ] 1212 fast/events/input-events-ime-recomposition.html [ Failure ] 1213 fast/events/input-events-ime-composition.html [ Failure ] 1212 1214 fast/events/before-input-events-prevent-default.html [ Failure ] 1213 1215 fast/events/before-input-events-prevent-default-in-textfield.html [ Failure ] … … 1221 1223 fast/events/before-input-replace-text-target-ranges.html [ Failure ] 1222 1224 fast/events/before-input-delete-empty-list-target-ranges.html [ Failure ] 1225 fast/events/before-input-events-prevent-recomposition.html [ Failure ] 1226 fast/events/before-input-events-prevent-insert-composition.html [ Failure ] 1223 1227 fast/events/key-events-in-input-button.html [ Failure ] 1224 1228 fast/events/keydown-1.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r207695 r207698 1 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents 4 https://bugs.webkit.org/show_bug.cgi?id=163460 5 <rdar://problem/28784142> 6 7 Reviewed by Darin Adler. 8 9 Adds basic support for the composition inputTypes in the InputEvent spec. See w3.org/TR/input-events, 10 github.com/w3c/input-events/issues/41 and github.com/w3c/input-events/issues/42 for more details. While input 11 events are fired in the correct order with respect to each other, additional work will be required to ensure 12 that input events are fired in the correct order with respect to composition(start|update|end) events and 13 textInput events. This is held off until the expected ordering of events is officially defined in the spec. 14 15 Tests: fast/events/before-input-events-prevent-insert-composition.html 16 fast/events/before-input-events-prevent-recomposition.html 17 fast/events/input-events-ime-composition.html 18 fast/events/input-events-ime-recomposition.html 19 20 * editing/CompositeEditCommand.cpp: 21 (WebCore::CompositeEditCommand::apply): 22 * editing/CompositeEditCommand.h: 23 (WebCore::CompositeEditCommand::isBeforeInputEventCancelable): 24 25 Adds a new virtual method hook for subclasses to mark their `beforeinput` events as non-cancelable (see 26 TypingCommand::isBeforeInputEventCancelable). By default, `beforeinput` events are cancelable. 27 28 * editing/EditAction.h: 29 30 Adds 4 new EditActions corresponding to the 4 composition-related inputTypes. These are: 31 EditActionTypingDeletePendingComposition => "deleteCompositionText" 32 EditActionTypingDeleteFinalComposition => "deleteByComposition" 33 EditActionTypingInsertPendingComposition => "insertCompositionText" 34 EditActionTypingInsertFinalComposition => "insertFromComposition" 35 36 * editing/EditCommand.cpp: 37 (WebCore::inputTypeNameForEditingAction): 38 * editing/Editor.cpp: 39 (WebCore::dispatchBeforeInputEvent): 40 (WebCore::dispatchBeforeInputEvents): 41 (WebCore::Editor::willApplyEditing): 42 (WebCore::Editor::insertTextWithoutSendingTextEvent): 43 (WebCore::Editor::setComposition): 44 45 In setComposition(text, mode), tweak the logic for committing a composition to always delete the selection 46 before inserting the final composition text. In setComposition(text, underlines, start, end), catch the case 47 where we're beginning to recompose an existing range in the DOM and delete the recomposed text first. 48 49 * editing/TypingCommand.cpp: 50 (WebCore::editActionForTypingCommand): 51 (WebCore::TypingCommand::TypingCommand): 52 (WebCore::TypingCommand::deleteSelection): 53 54 Adds a TextCompositionType parameter so that call sites (see Editor::setComposition) can indicate what state the 55 edited composition is in. This allows us to differentiate between deletion of finalized composition text in 56 preparation of recomposing a range in the DOM, and deletion of composition text that has not yet been committed 57 in preparation for inserting a finalized composition into the DOM. 58 59 (WebCore::TypingCommand::deleteKeyPressed): 60 (WebCore::TypingCommand::forwardDeleteKeyPressed): 61 (WebCore::TypingCommand::insertText): 62 (WebCore::TypingCommand::insertLineBreak): 63 (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): 64 (WebCore::TypingCommand::insertParagraphSeparator): 65 (WebCore::TypingCommand::isBeforeInputEventCancelable): 66 (WebCore::TypingCommand::inputEventData): 67 (WebCore::TypingCommand::willAddTypingToOpenCommand): 68 * editing/TypingCommand.h: 69 1 70 2016-10-21 Dave Hyatt <hyatt@apple.com> 2 71 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r207670 r207698 335 335 case EditActionTypingDeleteLineBackward: 336 336 case EditActionTypingDeleteLineForward: 337 case EditActionTypingDeletePendingComposition: 338 case EditActionTypingDeleteFinalComposition: 337 339 case EditActionTypingInsertText: 338 340 case EditActionTypingInsertLineBreak: 339 341 case EditActionTypingInsertParagraph: 342 case EditActionTypingInsertPendingComposition: 343 case EditActionTypingInsertFinalComposition: 340 344 case EditActionPaste: 341 345 case EditActionDrag: -
trunk/Source/WebCore/editing/CompositeEditCommand.h
r207670 r207698 117 117 virtual String inputEventTypeName() const; 118 118 virtual String inputEventData() const { return { }; } 119 virtual bool isBeforeInputEventCancelable() const { return true; } 119 120 Vector<RefPtr<StaticRange>> targetRangesForBindings() const; 120 121 -
trunk/Source/WebCore/editing/EditAction.h
r206979 r207698 72 72 EditActionTypingDeleteLineBackward, 73 73 EditActionTypingDeleteLineForward, 74 EditActionTypingDeletePendingComposition, 75 EditActionTypingDeleteFinalComposition, 74 76 EditActionTypingInsertText, 75 77 EditActionTypingInsertLineBreak, 76 78 EditActionTypingInsertParagraph, 79 EditActionTypingInsertPendingComposition, 80 EditActionTypingInsertFinalComposition, 77 81 EditActionCreateLink, 78 82 EditActionUnlink, -
trunk/Source/WebCore/editing/EditCommand.cpp
r207670 r207698 84 84 case EditActionTypingDeleteLineForward: 85 85 return ASCIILiteral("deleteHardLineForward"); 86 case EditActionTypingDeletePendingComposition: 87 return ASCIILiteral("deleteCompositionText"); 88 case EditActionTypingDeleteFinalComposition: 89 return ASCIILiteral("deleteByComposition"); 86 90 case EditActionInsert: 87 91 case EditActionTypingInsertText: … … 97 101 case EditActionInsertUnorderedList: 98 102 return ASCIILiteral("insertUnorderedList"); 103 case EditActionTypingInsertPendingComposition: 104 return ASCIILiteral("insertCompositionText"); 105 case EditActionTypingInsertFinalComposition: 106 return ASCIILiteral("insertFromComposition"); 99 107 case EditActionIndent: 100 108 return ASCIILiteral("formatIndent"); -
trunk/Source/WebCore/editing/Editor.cpp
r207670 r207698 112 112 namespace WebCore { 113 113 114 static bool dispatchBeforeInputEvent(Element& element, const AtomicString& inputType, const String& data = { }, const Vector<RefPtr<StaticRange>>& targetRanges = { } )114 static bool dispatchBeforeInputEvent(Element& element, const AtomicString& inputType, const String& data = { }, const Vector<RefPtr<StaticRange>>& targetRanges = { }, bool cancelable = true) 115 115 { 116 116 auto* settings = element.document().settings(); … … 118 118 return true; 119 119 120 return element.dispatchEvent(InputEvent::create(eventNames().beforeinputEvent, inputType, true, true, element.document().defaultView(), data, targetRanges, 0));120 return element.dispatchEvent(InputEvent::create(eventNames().beforeinputEvent, inputType, true, cancelable, element.document().defaultView(), data, targetRanges, 0)); 121 121 } 122 122 … … 125 125 auto* settings = element.document().settings(); 126 126 if (settings && settings->inputEventsEnabled()) 127 element.dispatch ScopedEvent(InputEvent::create(eventNames().inputEvent, inputType, true, false, element.document().defaultView(), data, targetRanges, 0));127 element.dispatchEvent(InputEvent::create(eventNames().inputEvent, inputType, true, false, element.document().defaultView(), data, targetRanges, 0)); 128 128 else 129 129 element.dispatchInputEvent(); … … 1064 1064 } 1065 1065 1066 static bool dispatchBeforeInputEvents(RefPtr<Element> startRoot, RefPtr<Element> endRoot, const AtomicString& inputTypeName, const String& data = { }, const Vector<RefPtr<StaticRange>>& targetRanges = { } )1066 static bool dispatchBeforeInputEvents(RefPtr<Element> startRoot, RefPtr<Element> endRoot, const AtomicString& inputTypeName, const String& data = { }, const Vector<RefPtr<StaticRange>>& targetRanges = { }, bool cancelable = true) 1067 1067 { 1068 1068 bool continueWithDefaultBehavior = true; 1069 1069 if (startRoot) 1070 continueWithDefaultBehavior &= dispatchBeforeInputEvent(*startRoot, inputTypeName, data, targetRanges );1070 continueWithDefaultBehavior &= dispatchBeforeInputEvent(*startRoot, inputTypeName, data, targetRanges, cancelable); 1071 1071 if (endRoot && endRoot != startRoot) 1072 continueWithDefaultBehavior &= dispatchBeforeInputEvent(*endRoot, inputTypeName, data, targetRanges );1072 continueWithDefaultBehavior &= dispatchBeforeInputEvent(*endRoot, inputTypeName, data, targetRanges, cancelable); 1073 1073 return continueWithDefaultBehavior; 1074 1074 } … … 1088 1088 return true; 1089 1089 1090 return dispatchBeforeInputEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement(), command.inputEventTypeName(), command.inputEventData(), targetRanges );1090 return dispatchBeforeInputEvents(composition->startingRootEditableElement(), composition->endingRootEditableElement(), command.inputEventTypeName(), command.inputEventData(), targetRanges, command.isBeforeInputEventCancelable()); 1091 1091 } 1092 1092 … … 1262 1262 if (autocorrectionWasApplied) 1263 1263 options |= TypingCommand::RetainAutocorrectionIndicator; 1264 TypingCommand::insertText(document, text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextComposition Confirm: TypingCommand::TextCompositionNone);1264 TypingCommand::insertText(document, text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextCompositionFinal : TypingCommand::TextCompositionNone); 1265 1265 } 1266 1266 … … 1833 1833 } 1834 1834 1835 // If text is empty, then delete the old composition here. If text is non-empty, InsertTextCommand::input 1836 // will delete the old composition with an optimized replace operation. 1837 if (text.isEmpty() && mode != CancelComposition) 1838 TypingCommand::deleteSelection(document(), 0); 1835 // Always delete the current composition before inserting the finalized composition text if we're confirming our composition. 1836 // Our default behavior (if the beforeinput event is not prevented) is to insert the finalized composition text back in. 1837 // We pass TypingCommand::TextCompositionPending here to indicate that we are deleting the pending composition. 1838 if (mode != CancelComposition) 1839 TypingCommand::deleteSelection(document(), 0, TypingCommand::TextCompositionPending); 1839 1840 1840 1841 m_compositionNode = nullptr; … … 1867 1868 setIgnoreCompositionSelectionChange(false); 1868 1869 return; 1870 } 1871 1872 String originalText = selectedText(); 1873 bool isStartingToRecomposeExistingRange = !text.isEmpty() && selectionStart < selectionEnd && !hasComposition(); 1874 if (isStartingToRecomposeExistingRange) { 1875 // We pass TypingCommand::TextCompositionFinal here to indicate that we are removing composition text that has been finalized. 1876 TypingCommand::deleteSelection(document(), 0, TypingCommand::TextCompositionFinal); 1877 const VisibleSelection& currentSelection = m_frame.selection().selection(); 1878 if (currentSelection.isRange()) { 1879 // If deletion was prevented, then we need to collapse the selection to the end so that the original text will not be recomposed. 1880 m_frame.selection().setSelection({ currentSelection.end(), currentSelection.end() }); 1881 } 1869 1882 } 1870 1883 … … 1895 1908 // function doesn't create a composition node when the text is empty. 1896 1909 if (!text.isEmpty()) { 1897 target->dispatchEvent(CompositionEvent::create(eventNames().compositionstartEvent, document().domWindow(), selectedText()));1910 target->dispatchEvent(CompositionEvent::create(eventNames().compositionstartEvent, document().domWindow(), originalText)); 1898 1911 event = CompositionEvent::create(eventNames().compositionupdateEvent, document().domWindow(), text); 1899 1912 } … … 1911 1924 // will delete the old composition with an optimized replace operation. 1912 1925 if (text.isEmpty()) 1913 TypingCommand::deleteSelection(document(), TypingCommand::PreventSpellChecking );1926 TypingCommand::deleteSelection(document(), TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionPending); 1914 1927 1915 1928 m_compositionNode = nullptr; … … 1917 1930 1918 1931 if (!text.isEmpty()) { 1919 TypingCommand::insertText(document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextComposition Update);1932 TypingCommand::insertText(document(), text, TypingCommand::SelectInsertedText | TypingCommand::PreventSpellChecking, TypingCommand::TextCompositionPending); 1920 1933 1921 1934 // Find out what node has the composition now. -
trunk/Source/WebCore/editing/TypingCommand.cpp
r207670 r207698 78 78 }; 79 79 80 static inline EditAction editActionForTypingCommand(TypingCommand::ETypingCommand command, TextGranularity granularity) 81 { 80 static inline EditAction editActionForTypingCommand(TypingCommand::ETypingCommand command, TextGranularity granularity, TypingCommand::TextCompositionType compositionType) 81 { 82 if (compositionType == TypingCommand::TextCompositionPending) { 83 if (command == TypingCommand::InsertText) 84 return EditActionTypingInsertPendingComposition; 85 if (command == TypingCommand::DeleteSelection) 86 return EditActionTypingDeletePendingComposition; 87 ASSERT_NOT_REACHED(); 88 } 89 90 if (compositionType == TypingCommand::TextCompositionFinal) { 91 if (command == TypingCommand::InsertText) 92 return EditActionTypingInsertFinalComposition; 93 if (command == TypingCommand::DeleteSelection) 94 return EditActionTypingDeleteFinalComposition; 95 ASSERT_NOT_REACHED(); 96 } 97 82 98 switch (command) { 83 99 case TypingCommand::DeleteSelection: … … 125 141 126 142 TypingCommand::TypingCommand(Document& document, ETypingCommand commandType, const String &textToInsert, Options options, TextGranularity granularity, TextCompositionType compositionType) 127 : TextInsertionBaseCommand(document, editActionForTypingCommand(commandType, granularity ))143 : TextInsertionBaseCommand(document, editActionForTypingCommand(commandType, granularity, compositionType)) 128 144 , m_commandType(commandType) 129 145 , m_textToInsert(textToInsert) … … 143 159 } 144 160 145 void TypingCommand::deleteSelection(Document& document, Options options )161 void TypingCommand::deleteSelection(Document& document, Options options, TextCompositionType compositionType) 146 162 { 147 163 Frame* frame = document.frame(); … … 152 168 153 169 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*frame)) { 170 lastTypingCommand->setCompositionType(compositionType); 154 171 lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking); 155 172 lastTypingCommand->deleteSelection(options & SmartDelete); … … 157 174 } 158 175 159 TypingCommand::create(document, DeleteSelection, emptyString(), options )->apply();176 TypingCommand::create(document, DeleteSelection, emptyString(), options, compositionType)->apply(); 160 177 } 161 178 … … 165 182 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) { 166 183 updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), document.frame()); 184 lastTypingCommand->setCompositionType(TextCompositionNone); 167 185 lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking); 168 186 lastTypingCommand->deleteKeyPressed(granularity, options & AddsToKillRing); … … 181 199 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*frame)) { 182 200 updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame); 201 lastTypingCommand->setCompositionType(TextCompositionNone); 183 202 lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking); 184 203 lastTypingCommand->forwardDeleteKeyPressed(granularity, options & AddsToKillRing); … … 222 241 VisibleSelection currentSelection = frame->selection().selection(); 223 242 224 String newText = dispatchBeforeTextInsertedEvent(text, selectionForInsertion, compositionType == TextComposition Update);243 String newText = dispatchBeforeTextInsertedEvent(text, selectionForInsertion, compositionType == TextCompositionPending); 225 244 226 245 // Set the starting and ending selection appropriately if we are using a selection … … 247 266 { 248 267 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) { 268 lastTypingCommand->setCompositionType(TextCompositionNone); 249 269 lastTypingCommand->setShouldRetainAutocorrectionIndicator(options & RetainAutocorrectionIndicator); 250 270 lastTypingCommand->insertLineBreakAndNotifyAccessibility(); … … 258 278 { 259 279 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) { 280 lastTypingCommand->setCompositionType(TextCompositionNone); 260 281 lastTypingCommand->insertParagraphSeparatorInQuotedContentAndNotifyAccessibility(); 261 282 return; … … 268 289 { 269 290 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(*document.frame())) { 291 lastTypingCommand->setCompositionType(TextCompositionNone); 270 292 lastTypingCommand->setShouldRetainAutocorrectionIndicator(options & RetainAutocorrectionIndicator); 271 293 lastTypingCommand->insertParagraphSeparatorAndNotifyAccessibility(); … … 368 390 } 369 391 392 bool TypingCommand::isBeforeInputEventCancelable() const 393 { 394 return m_currentTypingEditAction != EditActionTypingInsertPendingComposition && m_currentTypingEditAction != EditActionTypingDeletePendingComposition; 395 } 396 370 397 String TypingCommand::inputEventData() const 371 398 { 372 if (m_currentTypingEditAction == EditActionTypingInsertText) 399 switch (m_currentTypingEditAction) { 400 case EditActionTypingInsertText: 401 case EditActionTypingInsertPendingComposition: 402 case EditActionTypingInsertFinalComposition: 373 403 return m_currentTextToInsert; 374 375 return CompositeEditCommand::inputEventData(); 404 default: 405 return CompositeEditCommand::inputEventData(); 406 } 376 407 } 377 408 … … 439 470 { 440 471 m_currentTextToInsert = text; 441 m_currentTypingEditAction = editActionForTypingCommand(commandType, granularity );472 m_currentTypingEditAction = editActionForTypingCommand(commandType, granularity, m_compositionType); 442 473 443 474 if (!shouldDeferWillApplyCommandUntilAddingTypingCommand()) -
trunk/Source/WebCore/editing/TypingCommand.h
r207670 r207698 45 45 enum TextCompositionType { 46 46 TextCompositionNone, 47 TextComposition Update,48 TextComposition Confirm47 TextCompositionPending, 48 TextCompositionFinal, 49 49 }; 50 50 … … 58 58 typedef unsigned Options; 59 59 60 static void deleteSelection(Document&, Options = 0 );60 static void deleteSelection(Document&, Options = 0, TextCompositionType = TextCompositionNone); 61 61 static void deleteKeyPressed(Document&, Options = 0, TextGranularity = CharacterGranularity); 62 62 static void forwardDeleteKeyPressed(Document&, Options = 0, TextGranularity = CharacterGranularity); … … 86 86 87 87 private: 88 static Ref<TypingCommand> create(Document& document, ETypingCommand command, const String& text = emptyString(), Options options = 0, TextGranularity granularity = CharacterGranularity )88 static Ref<TypingCommand> create(Document& document, ETypingCommand command, const String& text = emptyString(), Options options = 0, TextGranularity granularity = CharacterGranularity, TextCompositionType compositionType = TextCompositionNone) 89 89 { 90 return adoptRef(*new TypingCommand(document, command, text, options, granularity, TextCompositionNone));90 return adoptRef(*new TypingCommand(document, command, text, options, granularity, compositionType)); 91 91 } 92 92 … … 119 119 String inputEventTypeName() const final; 120 120 String inputEventData() const final; 121 bool isBeforeInputEventCancelable() const final; 121 122 122 123 static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, Frame*); -
trunk/Source/WebKit/mac/ChangeLog
r207689 r207698 1 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents 4 https://bugs.webkit.org/show_bug.cgi?id=163460 5 <rdar://problem/28784142> 6 7 Reviewed by Darin Adler. 8 9 Handle new EditAction types for inserting/deleting pending/final compositions. 10 11 * WebCoreSupport/WebEditorClient.mm: 12 (undoNameForEditAction): 13 1 14 2016-10-21 Jeremy Jones <jeremyj@apple.com> 2 15 -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r206979 r207698 601 601 case EditActionTypingDeleteLineBackward: 602 602 case EditActionTypingDeleteLineForward: 603 case EditActionTypingDeletePendingComposition: 604 case EditActionTypingDeleteFinalComposition: 603 605 case EditActionTypingInsertText: 604 606 case EditActionTypingInsertLineBreak: 605 607 case EditActionTypingInsertParagraph: 608 case EditActionTypingInsertPendingComposition: 609 case EditActionTypingInsertFinalComposition: 606 610 return UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name"); 607 611 case EditActionCreateLink: return UI_STRING_KEY_INTERNAL("Create Link", "Create Link (Undo action name)", "Undo action name"); -
trunk/Source/WebKit2/ChangeLog
r207689 r207698 1 2016-10-21 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents 4 https://bugs.webkit.org/show_bug.cgi?id=163460 5 <rdar://problem/28784142> 6 7 Reviewed by Darin Adler. 8 9 Handle new EditAction types for inserting/deleting pending/final compositions. 10 11 * UIProcess/WebEditCommandProxy.cpp: 12 (WebKit::WebEditCommandProxy::nameForEditAction): 13 1 14 2016-10-21 Jeremy Jones <jeremyj@apple.com> 2 15 -
trunk/Source/WebKit2/UIProcess/WebEditCommandProxy.cpp
r206979 r207698 152 152 case EditActionTypingDeleteLineBackward: 153 153 case EditActionTypingDeleteLineForward: 154 case EditActionTypingDeletePendingComposition: 155 case EditActionTypingDeleteFinalComposition: 154 156 case EditActionTypingInsertText: 155 157 case EditActionTypingInsertLineBreak: 156 158 case EditActionTypingInsertParagraph: 159 case EditActionTypingInsertPendingComposition: 160 case EditActionTypingInsertFinalComposition: 157 161 return WEB_UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name"); 158 162 case EditActionCreateLink:
Note: See TracChangeset
for help on using the changeset viewer.