Changeset 236271 in webkit
- Timestamp:
- Sep 20, 2018 11:20:02 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r236265 r236271 1 2018-09-20 Daniel Bates <dabates@apple.com> 2 3 [iOS] Support testing more hardware special keys 4 https://bugs.webkit.org/show_bug.cgi?id=189793 5 6 Reviewed by Simon Fraser. 7 8 For now, many of the DOM keydown and keyup events for special hardware keys are wrong. 9 We will fix this up in a subsequent commit(s). 10 11 * fast/events/ios/keydown-keyup-special-keys-in-non-editable-element-expected.txt: Added. 12 * fast/events/ios/keydown-keyup-special-keys-in-non-editable-element.html: Added. 13 1 14 2018-09-20 Per Arne Vollan <pvollan@apple.com> 2 15 -
trunk/Tools/ChangeLog
r236269 r236271 1 2018-09-20 Daniel Bates <dabates@apple.com> 2 3 [iOS] Support testing more hardware special keys 4 https://bugs.webkit.org/show_bug.cgi?id=189793 5 6 Reviewed by Simon Fraser. 7 8 * TestRunnerShared/spi/IOKitSPI.h: Add more SPI constants. 9 * WebKitTestRunner/ios/HIDEventGenerator.mm: 10 (keyCodeForDOMFunctionKey): Extracted out logic from hidUsageCodeForCharacter() to return the 11 key code for the F1, F2, ..., F12 keys and extended the code to compute the key code for the 12 F13, F14, ..., F24 keys. 13 (hidUsageCodeForCharacter): Modified to call keyCodeForDOMFunctionKey(). 14 1 15 2018-09-20 Michael Catanzaro <mcatanzaro@igalia.com> 2 16 -
trunk/Tools/TestRunnerShared/spi/IOKitSPI.h
r214586 r236271 187 187 kHIDUsage_KeyboardSlash = 0x38, 188 188 kHIDUsage_KeyboardF1 = 0x3A, 189 kHIDUsage_KeyboardPrintScreen = 0x46, 190 kHIDUsage_KeyboardInsert = 0x49, 189 191 kHIDUsage_KeyboardHome = 0x4A, 190 192 kHIDUsage_KeyboardPageUp = 0x4B, 193 kHIDUsage_KeyboardDeleteForward = 0x4C, 191 194 kHIDUsage_KeyboardEnd = 0x4D, 195 kHIDUsage_KeyboardPageDown = 0x4E, 192 196 kHIDUsage_KeyboardRightArrow = 0x4F, 193 197 kHIDUsage_KeyboardLeftArrow = 0x50, 194 198 kHIDUsage_KeyboardDownArrow = 0x51, 195 199 kHIDUsage_KeyboardUpArrow = 0x52, 200 kHIDUsage_KeyboardF13 = 0x68, 201 kHIDUsage_KeyboardMenu = 0x76, 196 202 kHIDUsage_KeyboardLeftControl = 0xE0, 197 203 kHIDUsage_KeyboardLeftShift = 0xE1, 198 kHIDUsage_KeyboardLeftAlt = 0xE2 204 kHIDUsage_KeyboardLeftAlt = 0xE2, 205 kHIDUsage_KeyboardLeftGUI = 0xE3, 206 kHIDUsage_KeyboardRightControl = 0xE4, 207 kHIDUsage_KeyboardRightShift = 0xE5, 208 kHIDUsage_KeyboardRightAlt = 0xE6, 209 kHIDUsage_KeyboardRightGUI = 0xE7, 199 210 }; 200 211 -
trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm
r235837 r236271 33 33 #import <wtf/Assertions.h> 34 34 #import <wtf/BlockPtr.h> 35 #import <wtf/Optional.h> 35 36 #import <wtf/RetainPtr.h> 36 37 #import <wtf/SoftLinking.h> … … 824 825 } 825 826 return false; 827 } 828 829 static std::optional<uint32_t> keyCodeForDOMFunctionKey(NSString *key) 830 { 831 // Compare the input string with the function-key names defined by the DOM spec (i.e. "F1",...,"F24"). 832 // If the input string is a function-key name, set its key code. On iOS the key codes for the first 12 833 // function keys are disjoint from the key codes of the last 12 function keys. 834 for (int i = 1; i <= 12; ++i) { 835 if ([key isEqualToString:[NSString stringWithFormat:@"F%d", i]]) 836 return kHIDUsage_KeyboardF1 + i - 1; 837 } 838 for (int i = 13; i <= 24; ++i) { 839 if ([key isEqualToString:[NSString stringWithFormat:@"F%d", i]]) 840 return kHIDUsage_KeyboardF13 + i - 1; 841 } 842 return std::nullopt; 826 843 } 827 844 … … 908 925 } 909 926 } 910 const int functionKeyOffset = kHIDUsage_KeyboardF1; 911 for (int functionKeyIndex = 1; functionKeyIndex <= 12; ++functionKeyIndex) { 912 if ([key isEqualToString:[NSString stringWithFormat:@"F%d", functionKeyIndex]]) 913 return functionKeyOffset + functionKeyIndex - 1; 914 } 927 928 if (auto keyCode = keyCodeForDOMFunctionKey(key)) 929 return *keyCode; 930 931 if ([key isEqualToString:@"pageUp"]) 932 return kHIDUsage_KeyboardPageUp; 933 if ([key isEqualToString:@"pageDown"]) 934 return kHIDUsage_KeyboardPageDown; 935 if ([key isEqualToString:@"home"]) 936 return kHIDUsage_KeyboardHome; 937 if ([key isEqualToString:@"insert"]) 938 return kHIDUsage_KeyboardInsert; 939 if ([key isEqualToString:@"end"]) 940 return kHIDUsage_KeyboardEnd; 915 941 if ([key isEqualToString:@"escape"]) 916 942 return kHIDUsage_KeyboardEscape; … … 927 953 if ([key isEqualToString:@"delete"]) 928 954 return kHIDUsage_KeyboardDeleteOrBackspace; 955 if ([key isEqualToString:@"leftCommand"]) 956 return kHIDUsage_KeyboardLeftGUI; 957 if ([key isEqualToString:@"rightCommand"]) 958 return kHIDUsage_KeyboardRightGUI; 929 959 // The simulator keyboard interprets both left and right modifier keys using the left version of the usage code. 930 960 if ([key isEqualToString:@"leftControl"] || [key isEqualToString:@"rightControl"])
Note: See TracChangeset
for help on using the changeset viewer.