Changeset 252873 in webkit
- Timestamp:
- Nov 25, 2019 9:18:54 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252856 r252873 1 2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Update KeyboardEvent as per the latest specification 4 https://bugs.webkit.org/show_bug.cgi?id=202183 5 6 Reviewed by Ross Kirsling. 7 8 * platform/win/TestExpectations: 9 * platform/wincairo/TestExpectations: 10 Unskipped fast/events/arrow-keys-on-body.html, fast/events/keyboardevent-key.html, and fast/events/key-events-in-input-text.html. 11 1 12 2019-11-25 Zan Dobersek <zdobersek@igalia.com> and Chris Lord <clord@igalia.com> 2 13 -
trunk/LayoutTests/platform/win/TestExpectations
r252830 r252873 3235 3235 fast/dom/Window/get-set-properties.html [ Failure ] 3236 3236 fast/dom/Window/window-lookup-precedence.html [ Failure ] 3237 fast/events/arrow-keys-on-body.html [ Failure ]3238 3237 fast/events/before-input-events-prevent-drag-and-drop.html [ Failure ] 3239 3238 fast/events/constructors/keyboard-event-constructor.html [ Failure ] … … 3246 3245 fast/events/input-events-paste-rich-datatransfer.html [ Failure ] 3247 3246 fast/events/key-events-in-input-button.html [ Failure ] 3248 fast/events/key-events-in-input-text.html [ Failure ]3249 3247 fast/events/keyboardevent-code.html [ Failure ] 3250 fast/events/keyboardevent-key.html [ Failure ]3251 3248 fast/events/updateLayoutForHitTest.html [ Failure ] 3252 3249 fast/events/wheelevent-basic.html [ Failure ] -
trunk/LayoutTests/platform/wincairo/TestExpectations
r252768 r252873 1637 1637 fast/dom/adopt-attribute-crash.svg [ Failure ] 1638 1638 fast/dom/navigator-property-gc-after-frame-detach.html [ Failure ] 1639 fast/events/arrow-keys-on-body.html [ Failure ]1640 1639 fast/events/attempt-scroll-with-no-scrollbars.html [ Failure ] 1641 1640 fast/events/autoscroll-when-input-is-offscreen.html [ Skip ] # UIScript … … 1673 1672 fast/events/input-events-paste-rich-datatransfer.html [ Failure ] 1674 1673 fast/events/key-events-in-input-button.html [ Failure ] 1675 fast/events/key-events-in-input-text.html [ Failure ]1676 1674 fast/events/keyboardevent-code.html [ Failure ] 1677 fast/events/keyboardevent-key.html [ Failure ]1678 1675 fast/events/keydown-numpad-keys.html [ Failure ] 1679 1676 fast/events/mouse-cursor-image-set.html [ Failure ] -
trunk/Source/WTF/ChangeLog
r252870 r252873 1 2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Update KeyboardEvent as per the latest specification 4 https://bugs.webkit.org/show_bug.cgi?id=202183 5 6 Reviewed by Ross Kirsling. 7 8 * wtf/FeatureDefines.h: 9 1 10 2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com> 2 11 -
trunk/Source/WTF/wtf/FeatureDefines.h
r251963 r252873 752 752 753 753 #if !defined(ENABLE_KEYBOARD_KEY_ATTRIBUTE) 754 #define ENABLE_KEYBOARD_KEY_ATTRIBUTE 0754 #define ENABLE_KEYBOARD_KEY_ATTRIBUTE 1 755 755 #endif 756 756 757 757 #if !defined(ENABLE_KEYBOARD_CODE_ATTRIBUTE) 758 #define ENABLE_KEYBOARD_CODE_ATTRIBUTE 0758 #define ENABLE_KEYBOARD_CODE_ATTRIBUTE 1 759 759 #endif 760 760 -
trunk/Source/WebCore/ChangeLog
r252869 r252873 1 2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Update KeyboardEvent as per the latest specification 4 https://bugs.webkit.org/show_bug.cgi?id=202183 5 6 Reviewed by Ross Kirsling. 7 8 Add 'key' and 'code' properties of KeyboardEvent for Windows. The 9 implementation is copied from Chromium for Windows. 10 11 For implementing 'key' properties, ToUnicodeEx API is used to 12 convert a virtual key code to a character information. 13 Unfortunately, ToUnicodeEx alters the stored previous typed dead 14 key in the driver, it can't be used for each key event. So, 15 ToUnicodeEx is used to convert all virtual keys with all modifier 16 combinations beforehand. 17 18 This change turns on ENABLE_KEYBOARD_KEY_ATTRIBUTE and 19 ENABLE_KEYBOARD_CODE_ATTRIBUTE macros for all ports. A follow-up 20 patch will remove the macros. 21 22 Existing tests covers. 23 24 * PlatformWin.cmake: 25 * platform/win/KeyEventWin.cpp: 26 (WebCore::windowsKeyNames): 27 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): 28 * platform/win/WindowsKeyNames.cpp: Added. 29 (hasControlAndAlt): 30 (getModifierFlags): 31 (nonPrintableVirtualKeyToDomKey): 32 (WindowsKeyNames::WindowsKeyNames): 33 (WindowsKeyNames::domKeyFromLParam): 34 (singleCharacterString): 35 (WindowsKeyNames::domKeyFromChar): 36 (WindowsKeyNames::domCodeFromLParam): 37 (WindowsKeyNames::updateLayout): 38 * platform/win/WindowsKeyNames.h: Added. 39 1 40 2019-11-25 Zalan Bujtas <zalan@apple.com> 2 41 -
trunk/Source/WebCore/PlatformWin.cmake
r252036 r252873 108 108 platform/win/WidgetWin.cpp 109 109 platform/win/WindowMessageBroadcaster.cpp 110 platform/win/WindowsKeyNames.cpp 110 111 111 112 rendering/RenderThemeWin.cpp … … 143 144 platform/win/WindowMessageBroadcaster.h 144 145 platform/win/WindowMessageListener.h 146 platform/win/WindowsKeyNames.h 145 147 platform/win/WindowsTouch.h 146 148 ) -
trunk/Source/WebCore/platform/win/KeyEventWin.cpp
r241751 r252873 27 27 #include "PlatformKeyboardEvent.h" 28 28 29 #include "WindowsKeyNames.h" 29 30 #include <windows.h> 30 31 #include <wtf/ASCIICType.h> … … 219 220 } 220 221 222 static WindowsKeyNames& windowsKeyNames() 223 { 224 static NeverDestroyed<WindowsKeyNames> keyNames; 225 return keyNames; 226 } 227 221 228 PlatformKeyboardEvent::PlatformKeyboardEvent(HWND, WPARAM code, LPARAM keyData, Type type, bool systemKey) 222 229 : PlatformEvent(type, GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT, GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT, false, WallTime::fromRawSeconds(::GetTickCount() * 0.001)) 223 230 , m_text((type == PlatformEvent::Char) ? singleCharacterString(code) : String()) 224 231 , m_unmodifiedText((type == PlatformEvent::Char) ? singleCharacterString(code) : String()) 232 , m_key(type == PlatformEvent::Char ? windowsKeyNames().domKeyFromChar(code) : windowsKeyNames().domKeyFromLParam(keyData)) 233 , m_code(windowsKeyNames().domCodeFromLParam(keyData)) 225 234 , m_keyIdentifier((type == PlatformEvent::Char) ? String() : keyIdentifierForWindowsKeyCode(code)) 226 235 , m_windowsVirtualKeyCode((type == RawKeyDown || type == KeyUp) ? windowsKeycodeWithLocation(code, keyData) : 0) -
trunk/Source/WebKit/ChangeLog
r252851 r252873 1 2019-11-25 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Win] Update KeyboardEvent as per the latest specification 4 https://bugs.webkit.org/show_bug.cgi?id=202183 5 6 Reviewed by Ross Kirsling. 7 8 * Shared/WebEvent.h: 9 * Shared/WebKeyboardEvent.cpp: 10 (WebKit::WebKeyboardEvent::WebKeyboardEvent): 11 * Shared/win/WebEventFactory.cpp: 12 (WebKit::windowsKeyNames): 13 (WebKit::WebEventFactory::createWebKeyboardEvent): 14 1 15 2019-11-25 ChangSeok Oh <changseok@webkit.org> 2 16 -
trunk/Source/WebKit/Shared/WebEvent.h
r250596 r252873 264 264 WebKeyboardEvent(Type, const String& text, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, bool isKeypad, OptionSet<Modifier>, WallTime timestamp); 265 265 #else 266 WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key Identifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier>, WallTime timestamp);266 WebKeyboardEvent(Type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier>, WallTime timestamp); 267 267 #endif 268 268 -
trunk/Source/WebKit/Shared/WebKeyboardEvent.cpp
r244975 r252873 133 133 #else 134 134 135 WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key Identifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier> modifiers, WallTime timestamp)135 WebKeyboardEvent::WebKeyboardEvent(Type type, const String& text, const String& unmodifiedText, const String& key, const String& code, const String& keyIdentifier, int windowsVirtualKeyCode, int nativeVirtualKeyCode, int macCharCode, bool isAutoRepeat, bool isKeypad, bool isSystemKey, OptionSet<Modifier> modifiers, WallTime timestamp) 136 136 : WebEvent(type, modifiers, timestamp) 137 137 , m_text(text) 138 138 , m_unmodifiedText(unmodifiedText) 139 , m_key(key) 140 , m_code(code) 139 141 , m_keyIdentifier(keyIdentifier) 140 142 , m_windowsVirtualKeyCode(windowsVirtualKeyCode) -
trunk/Source/WebKit/Shared/win/WebEventFactory.cpp
r249560 r252873 32 32 #include <WebCore/PlatformWheelEvent.h> 33 33 #include <WebCore/Scrollbar.h> 34 #include <WebCore/WindowsKeyNames.h> 34 35 #include <WebCore/WindowsKeyboardCodes.h> 35 36 #include <windowsx.h> … … 447 448 } 448 449 450 static WindowsKeyNames& windowsKeyNames() 451 { 452 static NeverDestroyed<WindowsKeyNames> keyNames; 453 return keyNames; 454 } 455 449 456 WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) 450 457 { … … 452 459 String text = textFromEvent(wparam, type); 453 460 String unmodifiedText = unmodifiedTextFromEvent(wparam, type); 461 String key = message == WM_CHAR ? windowsKeyNames().domKeyFromChar(wparam) : windowsKeyNames().domKeyFromLParam(lparam); 462 String code = windowsKeyNames().domCodeFromLParam(lparam); 454 463 String keyIdentifier = keyIdentifierFromEvent(wparam, type); 455 464 int windowsVirtualKeyCode = static_cast<int>(wparam); … … 461 470 auto modifiers = modifiersForCurrentKeyState(); 462 471 463 return WebKeyboardEvent(type, text, unmodifiedText, key Identifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, autoRepeat, isKeypad, isSystemKey, modifiers, WallTime::now());472 return WebKeyboardEvent(type, text, unmodifiedText, key, code, keyIdentifier, windowsVirtualKeyCode, nativeVirtualKeyCode, macCharCode, autoRepeat, isKeypad, isSystemKey, modifiers, WallTime::now()); 464 473 } 465 474
Note: See TracChangeset
for help on using the changeset viewer.