Changeset 239361 in webkit
- Timestamp:
- Dec 18, 2018 4:23:21 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r239358 r239361 1 2018-12-18 Daniel Bates <dabates@apple.com> 2 3 Wrong value for key property in keydown and keyup events generated holding Control key 4 https://bugs.webkit.org/show_bug.cgi?id=192788 5 <rdar://problem/46795214> 6 7 Reviewed by Wenson Hsieh. 8 9 Similar to what we do on Mac, compute the DOM key property from the characters ignoring 10 modifier keys input string when the Control key is held down. 11 12 * platform/ios/PlatformEventFactoryIOS.mm: 13 (WebCore::keyForKeyEvent): 14 * platform/mac/PlatformEventFactoryMac.mm: 15 (WebCore::keyForKeyEvent): 16 1 17 2018-12-18 Sihui Liu <sihui_liu@apple.com> 2 18 -
trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm
r237738 r239361 191 191 } 192 192 193 NSString *characters = event.characters; 193 // If more than one key is being pressed and the key combination includes one or more modifier keys 194 // that result in the key no longer producing a printable character (e.g., Control + a), then the 195 // key value should be the printable key value that would have been produced if the key had been 196 // typed with the default keyboard layout with no modifier keys except for Shift and AltGr applied. 197 // See <https://www.w3.org/TR/2015/WD-uievents-20151215/#keys-guidelines>. 198 bool isControlDown = event.modifierFlags & WebEventFlagMaskControlKey; 199 NSString *characters = isControlDown ? event.charactersIgnoringModifiers : event.characters; 194 200 auto length = [characters length]; 195 201 // characters return an empty string for dead keys. -
trunk/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
r237990 r239361 261 261 // key value should be the printable key value that would have been produced if the key had been 262 262 // typed with the default keyboard layout with no modifier keys except for Shift and AltGr applied. 263 // https://w3c.github.io/uievents/#keys-guidelines263 // See <https://www.w3.org/TR/2015/WD-uievents-20151215/#keys-guidelines>. 264 264 bool isControlDown = ([event modifierFlags] & NSEventModifierFlagControl); 265 265 NSString *s = isControlDown ? [event charactersIgnoringModifiers] : [event characters];
Note: See TracChangeset
for help on using the changeset viewer.