Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Oct 2016 23:11:56 +0000 (23:11 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Oct 2016 23:11:56 +0000 (23:11 +0000)
commitfbf9e6b58538203a695a2c93ab7b179fcb1d78ae
tree67f7bed0c6166343b02ce70eac19070b117ff4e5
parentb936fe5ecb149c47d84e3b6843e2a98cec522aad
Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
https://bugs.webkit.org/show_bug.cgi?id=163176

Reviewed by Darin Adler.

Source/WebCore:

Update KeyboardEvent to stop using legacy [ConstructorTemplate=Event]
and use a proper constructor instead, like in the specification:
- https://www.w3.org/TR/uievents/#interface-keyboardevent

Also add support for passing modifierAltGraph / modifierCapsLock
in the inialization dictionary as we support those modifiers via
getModifierState().

No new tests, extended existing test.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventModifierInit.h: Added.
(WebCore::EventModifierInit::EventModifierInit):
* dom/EventModifierInit.idl: Added.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::getModifierState):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::MouseRelatedEvent):
* dom/MouseRelatedEvent.h:
* dom/UIEvent.cpp:
(WebCore::UIEvent::UIEvent):
* dom/UIEvent.h:
(WebCore::UIEvent::create): Deleted.
* dom/UIEventInit.h: Added.
(WebCore::UIEventInit::UIEventInit):
* dom/UIEventInit.idl: Added.
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::altGraphKey):
(WebCore::UIEventWithKeyState::capsLockKey):
(WebCore::UIEventWithKeyState::UIEventWithKeyState):
(WebCore::UIEventWithKeyState::ctrlKey): Deleted.
(WebCore::UIEventWithKeyState::shiftKey): Deleted.
(WebCore::UIEventWithKeyState::altKey): Deleted.
(WebCore::UIEventWithKeyState::metaKey): Deleted.

LayoutTests:

Rebaseline existing test now that the exception message is slightly
different in some cases. Also add test coverage for passing
modifierAltGraph / modifierCapsLock in initialization dictionary.

* fast/events/constructors/keyboard-event-constructor-expected.txt:
* fast/events/constructors/keyboard-event-constructor.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt
LayoutTests/fast/events/constructors/keyboard-event-constructor.html
LayoutTests/platform/ios-simulator/fast/events/constructors/keyboard-event-constructor-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/EventModifierInit.h [new file with mode: 0644]
Source/WebCore/dom/EventModifierInit.idl [new file with mode: 0644]
Source/WebCore/dom/KeyboardEvent.cpp
Source/WebCore/dom/KeyboardEvent.h
Source/WebCore/dom/KeyboardEvent.idl
Source/WebCore/dom/MouseRelatedEvent.cpp
Source/WebCore/dom/MouseRelatedEvent.h
Source/WebCore/dom/UIEvent.cpp
Source/WebCore/dom/UIEvent.h
Source/WebCore/dom/UIEventInit.h [new file with mode: 0644]
Source/WebCore/dom/UIEventInit.idl [new file with mode: 0644]
Source/WebCore/dom/UIEventWithKeyState.h