Introduce InputEvent bindings in preparation for the input events spec
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Oct 2016 04:05:35 +0000 (04:05 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Oct 2016 04:05:35 +0000 (04:05 +0000)
commitaf48084ccfd14f97531a23342088e49111a3aa39
tree0366ba6f6cc16e94b3508b1ee6517fe969693533
parent0a57246e3d4a87a8ce206a6b73c7124358ca8277
Introduce InputEvent bindings in preparation for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162954

Reviewed by Ryosuke Niwa.

Source/WebCore:

Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.

Tests: fast/events/input-events-fired-when-typing.html
       fast/events/ios/input-events-fired-when-typing-in-contenteditable.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Event.cpp:
(WebCore::Event::composed):
(WebCore::Event::isInputEvent):
* dom/Event.h:
* dom/EventNames.in:
* dom/InputEvent.cpp: Added.
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h: Added.
* dom/InputEvent.idl: Added.
* dom/Node.cpp:
(WebCore::Node::dispatchInputEvent):
(WebCore::Node::defaultEventHandler):
* dom/Node.h:
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
(WebCore::HTMLInputElement::setValueFromRenderer):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::defaultEventHandler):
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit2:

Adds a new runtime switch for enabling InputEvents.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Adds a new test verifying that InputEvents are fired when the runtime switch for input events is enabled.

* fast/events/input-events-fired-when-typing-expected.txt: Added.
* fast/events/input-events-fired-when-typing.html: Added.
* fast/events/ios/input-events-fired-when-typing-in-contenteditable-expected.txt: Added.
* fast/events/ios/input-events-fired-when-typing-in-contenteditable.html: Added.
* js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/ios-simulator/TestExpectations:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/input-events-fired-when-typing-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/input-events-fired-when-typing.html [new file with mode: 0644]
LayoutTests/fast/events/ios/input-events-fired-when-typing-in-contenteditable-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/ios/input-events-fired-when-typing-in-contenteditable.html [new file with mode: 0644]
LayoutTests/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DOMAllInOne.cpp
Source/WebCore/dom/Event.cpp
Source/WebCore/dom/Event.h
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/InputEvent.cpp [new file with mode: 0644]
Source/WebCore/dom/InputEvent.h [new file with mode: 0644]
Source/WebCore/dom/InputEvent.idl [new file with mode: 0644]
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/page/Settings.in
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp