Changeset 271760 in webkit
- Timestamp:
- Jan 22, 2021 1:55:33 PM (18 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt (added)
-
LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events.html (added)
-
LayoutTests/accessibility/keyevents-for-increment-actions-with-node-removal-expected.txt (modified) (1 diff)
-
LayoutTests/accessibility/keyevents-posted-for-increment-actions-expected.txt (modified) (1 diff)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityNodeObject.cpp (modified) (5 diffs)
-
Source/WebCore/dom/KeyboardEvent.cpp (modified) (2 diffs)
-
Source/WebCore/dom/KeyboardEvent.h (modified) (2 diffs)
-
Source/WebCore/dom/UIEvent.cpp (modified) (1 diff)
-
Source/WebCore/dom/UIEvent.h (modified) (2 diffs)
-
Source/WebCore/dom/UIEventWithKeyState.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271752 r271760 1 2021-01-22 Chris Fleizach <cfleizach@apple.com> 2 3 AX: AT-synthesized key events for common user actions (increment/decrement) are detectably different in many ways, potentially causing both web app breakage and AT identification 4 https://bugs.webkit.org/show_bug.cgi?id=220675 5 <rdar://problem/73263977> 6 7 Reviewed by Zalan Bujtas. 8 9 * accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt: Added. 10 * accessibility/keyevents-for-actions-mimic-real-key-events.html: Added. 11 1 12 2021-01-22 Devin Rousso <drousso@apple.com> 2 13 -
trunk/LayoutTests/accessibility/keyevents-for-increment-actions-with-node-removal-expected.txt
r263823 r271760 4 4 5 5 6 Keycode received: identifier: right key name: ArrowRight6 Keycode received: identifier: Right key name: ArrowRight 7 7 PASS successfullyParsed is true 8 8 -
trunk/LayoutTests/accessibility/keyevents-posted-for-increment-actions-expected.txt
r271536 r271760 6 6 Increment/Decrement - LTR 7 7 Horizontal orientation 8 Keycode received: identifier: right key name: ArrowRight key code: 399 Keycode received: identifier: left key name: ArrowLeft key code: 378 Keycode received: identifier: Right key name: ArrowRight key code: 39 9 Keycode received: identifier: Left key name: ArrowLeft key code: 37 10 10 Vertical orientation 11 Keycode received: identifier: up key name: ArrowUp key code: 3812 Keycode received: identifier: down key name: ArrowDown key code: 4011 Keycode received: identifier: Up key name: ArrowUp key code: 38 12 Keycode received: identifier: Down key name: ArrowDown key code: 40 13 13 Increment/Decrement - RTL 14 14 Horizontal orientation 15 Keycode received: identifier: left key name: ArrowLeft key code: 3716 Keycode received: identifier: right key name: ArrowRight key code: 3915 Keycode received: identifier: Left key name: ArrowLeft key code: 37 16 Keycode received: identifier: Right key name: ArrowRight key code: 39 17 17 Vertical orientation 18 Keycode received: identifier: up key name: ArrowUp key code: 3819 Keycode received: identifier: down key name: ArrowDown key code: 4018 Keycode received: identifier: Up key name: ArrowUp key code: 38 19 Keycode received: identifier: Down key name: ArrowDown key code: 40 20 20 PASS successfullyParsed is true 21 21 -
trunk/LayoutTests/platform/win/TestExpectations
r271593 r271760 1396 1396 accessibility/keyevents-posted-for-increment-actions.html [ Skip ] 1397 1397 accessibility/keyevents-posted-for-dismiss-action.html [ Skip ] 1398 accessibility/keyevents-for-actions-mimic-real-key-events.html [ Skip ] 1398 1399 1399 1400 webkit.org/b/140796 accessibility/alt-tag-on-image-with-nonimage-role.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r271758 r271760 1 2021-01-22 Chris Fleizach <cfleizach@apple.com> 2 3 AX: AT-synthesized key events for common user actions (increment/decrement) are detectably different in many ways, potentially causing both web app breakage and AT identification 4 https://bugs.webkit.org/show_bug.cgi?id=220675 5 <rdar://problem/73263977> 6 7 Reviewed by Zalan Bujtas. 8 9 Test: accessibility/keyevents-for-actions-mimic-real-key-events.html 10 11 When accessibility posts keyboard events in response to ax actions, they should mimic 12 real key events so as to be indistinguishable. 13 14 https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional 15 16 * accessibility/AccessibilityNodeObject.cpp: 17 (WebCore::dispatchSimulatedKeyboardUpDownEvent): 18 (WebCore::InitializeLegacyKeyInitProperties): 19 (WebCore::AccessibilityNodeObject::performDismissAction): 20 (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange): 21 * dom/KeyboardEvent.cpp: 22 (WebCore::KeyboardEvent::KeyboardEvent): 23 (WebCore::KeyboardEvent::create): 24 * dom/KeyboardEvent.h: 25 * dom/UIEvent.cpp: 26 (WebCore::UIEvent::UIEvent): 27 * dom/UIEvent.h: 28 (WebCore::UIEvent::create): 29 * dom/UIEventWithKeyState.h: 30 (WebCore::UIEventWithKeyState::UIEventWithKeyState): 31 1 32 2021-01-22 Rob Buis <rbuis@igalia.com> 2 33 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r271536 r271760 39 39 #include "Editing.h" 40 40 #include "ElementIterator.h" 41 #include "Event.h" 41 42 #include "EventNames.h" 42 43 #include "FloatRect.h" … … 1105 1106 bool handled = false; 1106 1107 if (auto* node = object->node()) { 1107 auto event = KeyboardEvent::create(eventNames().keydownEvent, keyInit );1108 auto event = KeyboardEvent::create(eventNames().keydownEvent, keyInit, Event::IsTrusted::Yes); 1108 1109 node->dispatchEvent(event); 1109 1110 handled |= event->defaultHandled(); … … 1112 1113 // Ensure node is still valid and wasn't removed after the keydown. 1113 1114 if (auto* node = object->node()) { 1114 auto event = KeyboardEvent::create(eventNames().keyupEvent, keyInit );1115 auto event = KeyboardEvent::create(eventNames().keyupEvent, keyInit, Event::IsTrusted::Yes); 1115 1116 node->dispatchEvent(event); 1116 1117 handled |= event->defaultHandled(); 1117 1118 } 1118 1119 return handled; 1120 } 1121 1122 static void InitializeLegacyKeyInitProperties(KeyboardEvent::Init &keyInit, const AccessibilityObject& object) 1123 { 1124 keyInit.which = keyInit.keyCode; 1125 keyInit.code = keyInit.key; 1126 1127 keyInit.view = object.document()->windowProxy(); 1128 keyInit.cancelable = true; 1129 keyInit.composed = true; 1130 keyInit.bubbles = true; 1119 1131 } 1120 1132 … … 1124 1136 keyInit.key = "Escape"_s; 1125 1137 keyInit.keyCode = 0x1b; 1126 1138 keyInit.keyIdentifier = "U+001B"_s; 1139 InitializeLegacyKeyInitProperties(keyInit, *this); 1140 1127 1141 return dispatchSimulatedKeyboardUpDownEvent(this, keyInit); 1128 1142 } … … 1135 1149 bool isLTR = page()->userInterfaceLayoutDirection() == UserInterfaceLayoutDirection::LTR; 1136 1150 1151 // The goal is to mimic existing keyboard dispatch completely, so that this is indistinguishable from a real key press. 1137 1152 typedef enum { left = 37, up = 38, right = 39, down = 40 } keyCode; 1138 1153 keyInit.key = increase ? (vertical ? "ArrowUp"_s : (isLTR ? "ArrowRight"_s : "ArrowLeft"_s)) : (vertical ? "ArrowDown"_s : (isLTR ? "ArrowLeft"_s : "ArrowRight"_s)); 1139 1154 keyInit.keyCode = increase ? (vertical ? keyCode::up : (isLTR ? keyCode::right : keyCode::left)) : (vertical ? keyCode::down : (isLTR ? keyCode::left : keyCode::right)); 1140 keyInit.keyIdentifier = increase ? (vertical ? "up"_s : (isLTR ? "right"_s : "left"_s)) : (vertical ? "down"_s : (isLTR ? "left"_s : "right"_s)); 1155 keyInit.keyIdentifier = increase ? (vertical ? "Up"_s : (isLTR ? "Right"_s : "Left"_s)) : (vertical ? "Down"_s : (isLTR ? "Left"_s : "Right"_s)); 1156 1157 InitializeLegacyKeyInitProperties(keyInit, *this); 1141 1158 1142 1159 return dispatchSimulatedKeyboardUpDownEvent(this, keyInit); -
trunk/Source/WebCore/dom/KeyboardEvent.cpp
r252936 r271760 122 122 } 123 123 124 inline KeyboardEvent::KeyboardEvent(const AtomString& eventType, const Init& initializer )125 : UIEventWithKeyState(eventType, initializer )124 inline KeyboardEvent::KeyboardEvent(const AtomString& eventType, const Init& initializer, IsTrusted isTrusted) 125 : UIEventWithKeyState(eventType, initializer, isTrusted) 126 126 , m_key(initializer.key) 127 127 , m_code(initializer.code) … … 148 148 } 149 149 150 Ref<KeyboardEvent> KeyboardEvent::create(const AtomString& type, const Init& initializer )151 { 152 return adoptRef(*new KeyboardEvent(type, initializer ));150 Ref<KeyboardEvent> KeyboardEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted) 151 { 152 return adoptRef(*new KeyboardEvent(type, initializer, isTrusted)); 153 153 } 154 154 -
trunk/Source/WebCore/dom/KeyboardEvent.h
r252936 r271760 63 63 }; 64 64 65 static Ref<KeyboardEvent> create(const AtomString& type, const Init& );65 static Ref<KeyboardEvent> create(const AtomString& type, const Init&, IsTrusted = IsTrusted::No); 66 66 67 67 virtual ~KeyboardEvent(); … … 98 98 KeyboardEvent(); 99 99 KeyboardEvent(const PlatformKeyboardEvent&, RefPtr<WindowProxy>&&); 100 KeyboardEvent(const AtomString&, const Init& );100 KeyboardEvent(const AtomString&, const Init&, IsTrusted = IsTrusted::No); 101 101 102 102 std::unique_ptr<PlatformKeyboardEvent> m_underlyingPlatformEvent; -
trunk/Source/WebCore/dom/UIEvent.cpp
r250060 r271760 50 50 } 51 51 52 UIEvent::UIEvent(const AtomString& eventType, const UIEventInit& initializer )53 : Event(eventType, initializer, IsTrusted::No)52 UIEvent::UIEvent(const AtomString& eventType, const UIEventInit& initializer, IsTrusted isTrusted) 53 : Event(eventType, initializer, isTrusted) 54 54 , m_view(initializer.view.get()) 55 55 , m_detail(initializer.detail) -
trunk/Source/WebCore/dom/UIEvent.h
r250060 r271760 44 44 return adoptRef(*new UIEvent); 45 45 } 46 static Ref<UIEvent> create(const AtomString& type, const UIEventInit& initializer )46 static Ref<UIEvent> create(const AtomString& type, const UIEventInit& initializer, IsTrusted = IsTrusted::No) 47 47 { 48 48 return adoptRef(*new UIEvent(type, initializer)); … … 70 70 UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail); 71 71 UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, IsTrusted = IsTrusted::Yes); 72 UIEvent(const AtomString&, const UIEventInit& );72 UIEvent(const AtomString&, const UIEventInit&, IsTrusted = IsTrusted::No); 73 73 74 74 private: -
trunk/Source/WebCore/dom/UIEventWithKeyState.h
r250060 r271760 63 63 } 64 64 65 UIEventWithKeyState(const AtomString& type, const EventModifierInit& initializer )66 : UIEvent(type, initializer )65 UIEventWithKeyState(const AtomString& type, const EventModifierInit& initializer, IsTrusted isTrusted = IsTrusted::No) 66 : UIEvent(type, initializer, isTrusted) 67 67 , m_modifiers(modifiersFromInitializer(initializer)) 68 68 {
Note: See TracChangeset
for help on using the changeset viewer.