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 NOBODY (OOPS!). This change (controlled by the ConformantBeforeinputEventFiringOrderEnabled, preference, also introduced in this change) makes WebKit fire the beforeinput and textInput events in the order: beforeinput first, textInput after — conforming to the requirements at w3c/uievents#362 and 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 the order: textInput first, beforeinput after — which breaks conformance with the spec requirements, and 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-nonconforming-expected.txt: Copied from LayoutTests/fast/events/input-events-fired-when-typing-expected.txt. * LayoutTests/fast/events/input-events-fired-when-typing-nonconforming.html: Copied from LayoutTests/fast/events/input-events-fired-when-typing.html. * LayoutTests/fast/events/input-events-fired-when-typing.html: * LayoutTests/fast/events/ios/submit-form-target-blank-using-return-key-old-code-path-expected.txt: Added. * LayoutTests/fast/events/ios/submit-form-target-blank-using-return-key-old-code-path.html: Added. * 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/ios/TestExpectations: * LayoutTests/platform/mac-wk2/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt: * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::insertDictatedText): * Source/WebCore/editing/Editor.cpp: (WebCore::dispatchTextInputEvent): (WebCore::Editor::selectionForCommand): (WebCore::Editor::handleTextEvent): (WebCore::Editor::pasteAsPlainText): (WebCore::Editor::pasteAsFragment): (WebCore::dispatchTextInputEvents): (WebCore::Editor::appliedEditing): (WebCore::Editor::insertText): (WebCore::Editor::insertTextForConfirmedComposition): (WebCore::Editor::insertTextWithoutSendingTextEventNew): (WebCore::Editor::insertTextWithoutSendingTextEventOld): (WebCore::Editor::setComposition): (WebCore::Editor::insertTextWithoutSendingTextEvent): 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/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): * Source/WebCore/page/EventHandler.cpp: (WebCore::EventHandler::handleTextInput): * Source/WebCore/page/EventHandler.h:
- Loading branch information
1 parent
ade27f1
commit 3349026
Showing
24 changed files
with
568 additions
and
128 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
86 changes: 86 additions & 0 deletions
86
LayoutTests/fast/events/input-events-fired-when-typing-nonconforming-expected.txt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Typing into contenteditable div element | ||
Fired `textInput`! | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is true | ||
PASS event.composed is true | ||
Fired `onbeforeinput`! | ||
PASS event.__lookupGetter__('inputType') is defined. | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.__lookupGetter__('dataTransfer') is defined. | ||
PASS event.getTargetRanges is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is true | ||
PASS event.composed is true | ||
PASS event.isComposing is false | ||
Fired `oninput`! | ||
PASS event.__lookupGetter__('inputType') is defined. | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.__lookupGetter__('dataTransfer') is defined. | ||
PASS event.getTargetRanges is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is false | ||
PASS event.composed is true | ||
PASS event.isComposing is false | ||
Typing into input element | ||
Fired `textInput`! | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is true | ||
PASS event.composed is true | ||
Fired `onbeforeinput`! | ||
PASS event.__lookupGetter__('inputType') is defined. | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.__lookupGetter__('dataTransfer') is defined. | ||
PASS event.getTargetRanges is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is true | ||
PASS event.composed is true | ||
PASS event.isComposing is false | ||
Fired `oninput`! | ||
PASS event.__lookupGetter__('inputType') is defined. | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.__lookupGetter__('dataTransfer') is defined. | ||
PASS event.getTargetRanges is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is false | ||
PASS event.composed is true | ||
PASS event.isComposing is false | ||
Typing into textarea element | ||
Fired `textInput`! | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is true | ||
PASS event.composed is true | ||
Fired `onbeforeinput`! | ||
PASS event.__lookupGetter__('inputType') is defined. | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.__lookupGetter__('dataTransfer') is defined. | ||
PASS event.getTargetRanges is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is true | ||
PASS event.composed is true | ||
PASS event.isComposing is false | ||
Fired `oninput`! | ||
PASS event.__lookupGetter__('inputType') is defined. | ||
PASS event.__lookupGetter__('data') is defined. | ||
PASS event.__lookupGetter__('dataTransfer') is defined. | ||
PASS event.getTargetRanges is defined. | ||
PASS event.target.id is expectedTargetID | ||
PASS event.bubbles is true | ||
PASS event.cancelable is false | ||
PASS event.composed is true | ||
PASS event.isComposing is false | ||
a | ||
|
Oops, something went wrong.