WebKit Bugzilla
Attachment 357504 Details for
Bug 192788
: Wrong value for key property in keydown and keyup events generated holding Control key
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192788-20181217170244.patch (text/plain), 3.28 KB, created by
Daniel Bates
on 2018-12-17 17:02:45 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-12-17 17:02:45 PST
Size:
3.28 KB
patch
obsolete
>Subversion Revision: 239303 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8c68b600bc7acffcba78aaffb40ad18a272711ca..f55d021339972143b2060afc3804b9c5cee51632 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-12-17 Daniel Bates <dabates@apple.com> >+ >+ Wrong value for key property in keydown and keyup events generated holding Control key >+ https://bugs.webkit.org/show_bug.cgi?id=192788 >+ <rdar://problem/46795214> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Similar to what we do on Mac, compute the DOM key property from the characters ignoring >+ modifier keys input string when the Control key is held down. >+ >+ * platform/ios/PlatformEventFactoryIOS.mm: >+ (WebCore::keyForKeyEvent): >+ * platform/mac/PlatformEventFactoryMac.mm: >+ (WebCore::keyForKeyEvent): >+ > 2018-12-17 Daniel Bates <dabates@apple.com> > > Make DocumentMarker::allMarkers() constexpr >diff --git a/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm b/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >index a67648f22e94ee1928c37745bab19c24b3b84d96..a9e716ac713ff49b313759c90e37b09d98485248 100644 >--- a/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >+++ b/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm >@@ -190,7 +190,13 @@ String keyForKeyEvent(WebEvent *event) > } > } > >- NSString *characters = event.characters; >+ // If more than one key is being pressed and the key combination includes one or more modifier keys >+ // that result in the key no longer producing a printable character (e.g., Control + a), then the >+ // key value should be the printable key value that would have been produced if the key had been >+ // typed with the default keyboard layout with no modifier keys except for Shift and AltGr applied. >+ // See <https://www.w3.org/TR/2015/WD-uievents-20151215/#keys-guidelines>. >+ bool isControlDown = event.modifierFlags & WebEventFlagMaskControlKey; >+ NSString *characters = isControlDown ? event.charactersIgnoringModifiers : event.characters; > auto length = [characters length]; > // characters return an empty string for dead keys. > // https://developer.apple.com/reference/appkit/nsevent/1534183-characters >diff --git a/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm b/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm >index e399b628155a19bbc98432b20b30ce9b58c99509..1c7c49ca149d47735d0c6e43f92c3c0e25ec477f 100644 >--- a/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm >+++ b/Source/WebCore/platform/mac/PlatformEventFactoryMac.mm >@@ -260,7 +260,7 @@ String keyForKeyEvent(NSEvent *event) > // that result in the key no longer producing a printable character (e.g., Control + a), then the > // key value should be the printable key value that would have been produced if the key had been > // typed with the default keyboard layout with no modifier keys except for Shift and AltGr applied. >- // https://w3c.github.io/uievents/#keys-guidelines >+ // See <https://www.w3.org/TR/2015/WD-uievents-20151215/#keys-guidelines>. > bool isControlDown = ([event modifierFlags] & NSEventModifierFlagControl); > NSString *s = isControlDown ? [event charactersIgnoringModifiers] : [event characters]; > auto length = [s length];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192788
: 357504