forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The beforeinput event should fire before textInput
https://bugs.webkit.org/show_bug.cgi?id=268988 Reviewed by Wenson Hsieh and Ryosuke Niwa. This change makes WebKit fire the beforeinput & textInput events in the order (beforeinput first, textInput after) conforming to UI Events spec requirements at w3c/uievents#362 and in the spec at https://w3c.github.io/uievents/event-algo.html#fire%20key%20input%20events and consistent with the order in which the events are fired in Blink. Otherwise, without this change, WebKit fires the events in an order (textInput first, beforeinput after) that breaks conformance with the spec requirements, and that breaks compatibility with Blink. Note also that this change makes WebKit conform to the requirements in https://w3c.github.io/uievents/event-algo.html#fire%20key%20input%20events, https://w3c.github.io/uievents/event-algo.html#handle%20native%20paste, and https://w3c.github.io/uievents/event-algo.html#end%20composition — limiting textInput to being fired only when ending a composition or when the input type is insertText, insertParagraph, insertLineBreak, or insertFromPaste. * LayoutTests/editing/execCommand/break-out-of-empty-list-item.html: * LayoutTests/editing/inserting/typing-space-to-trigger-smart-link.html: * LayoutTests/editing/pasteboard/paste-text-events-expected.txt: * LayoutTests/editing/pasteboard/paste-text-events.html: * LayoutTests/editing/style/highlight-insert-paragraph.html: * LayoutTests/fast/events/input-events-fired-when-typing-expected.txt: * LayoutTests/fast/events/input-events-fired-when-typing.html: * LayoutTests/fast/events/ios/submit-form-target-blank-using-return-key.html: * LayoutTests/fast/events/onchange-passwordfield.html: * LayoutTests/fast/events/onchange-searchfield.html: * LayoutTests/fast/events/onchange-textfield.html: * LayoutTests/fast/forms/onchange-change-type.html: * LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt: * LayoutTests/http/tests/navigation/keyboard-events-during-provisional-subframe-navigation-expected.txt: * LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt: * LayoutTests/platform/wpe/TestExpectations: * Source/WebCore/dom/Node.cpp: (WebCore::Node::defaultEventHandler): * Source/WebCore/dom/TextEvent.cpp: (WebCore::TextEvent::TextEvent): (WebCore::TextEvent::initTextEvent): (WebCore::TextEvent::createForPlainTextPaste): Deleted. (WebCore::TextEvent::createForFragmentPaste): Deleted. (WebCore::TextEvent::createForDictation): Deleted. * Source/WebCore/dom/TextEvent.h: * Source/WebCore/editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::insertDictatedText): * Source/WebCore/editing/Editor.cpp: (WebCore::dispatchTextInputEvent): (WebCore::Editor::selectionForCommand): (WebCore::Editor::pasteAsPlainText): (WebCore::Editor::pasteAsFragment): (WebCore::dispatchTextInputEvents): (WebCore::Editor::appliedEditing): (WebCore::Editor::insertText): (WebCore::Editor::insertTextForConfirmedComposition): (WebCore::Editor::insertTextWithoutSendingTextEvent): (WebCore::Editor::setComposition): (WebCore::Editor::handleTextEvent): Deleted. * Source/WebCore/editing/Editor.h: * Source/WebCore/editing/EditorCommand.cpp: (WebCore::executeInsertBacktab): (WebCore::executeInsertLineBreak): (WebCore::executeInsertNewline): (WebCore::executeInsertTab): (WebCore::executeYank): (WebCore::executeYankAndSelect): (WebCore::enabledVisibleSelection): (WebCore::enabledVisibleSelectionAndMark): (WebCore::enableCaretInEditableText): (WebCore::enabledInEditableText): * Source/WebCore/page/EventHandler.cpp: (WebCore::EventHandler::handleTextInput): (WebCore::EventHandler::handleTextInputEvent): Deleted. (WebCore::EventHandler::defaultTextInputEventHandler): Deleted. * Source/WebCore/page/EventHandler.h: Canonical link: https://commits.webkit.org/278971@main
- Loading branch information
1 parent
dbcbbe8
commit 7da094e
Showing
25 changed files
with
213 additions
and
281 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.