Title: [272256] branches/safari-611-branch
Revision
272256
Author
[email protected]
Date
2021-02-02 17:39:45 -0800 (Tue, 02 Feb 2021)

Log Message

Cherry-pick r271760. rdar://problem/73890156

    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
    https://bugs.webkit.org/show_bug.cgi?id=220675
    <rdar://problem/73263977>

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    Test: accessibility/keyevents-for-actions-mimic-real-key-events.html

    When accessibility posts keyboard events in response to ax actions, they should mimic
    real key events so as to be indistinguishable.

    https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional

    * accessibility/AccessibilityNodeObject.cpp:
    (WebCore::dispatchSimulatedKeyboardUpDownEvent):
    (WebCore::InitializeLegacyKeyInitProperties):
    (WebCore::AccessibilityNodeObject::performDismissAction):
    (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange):
    * dom/KeyboardEvent.cpp:
    (WebCore::KeyboardEvent::KeyboardEvent):
    (WebCore::KeyboardEvent::create):
    * dom/KeyboardEvent.h:
    * dom/UIEvent.cpp:
    (WebCore::UIEvent::UIEvent):
    * dom/UIEvent.h:
    (WebCore::UIEvent::create):
    * dom/UIEventWithKeyState.h:
    (WebCore::UIEventWithKeyState::UIEventWithKeyState):

    LayoutTests:

    * accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt: Added.
    * accessibility/keyevents-for-actions-mimic-real-key-events.html: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271760 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-611-branch/LayoutTests/ChangeLog (272255 => 272256)


--- branches/safari-611-branch/LayoutTests/ChangeLog	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/LayoutTests/ChangeLog	2021-02-03 01:39:45 UTC (rev 272256)
@@ -1,5 +1,59 @@
 2021-02-02  Alan Coon  <[email protected]>
 
+        Cherry-pick r271760. rdar://problem/73890156
+
+    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
+    https://bugs.webkit.org/show_bug.cgi?id=220675
+    <rdar://problem/73263977>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Test: accessibility/keyevents-for-actions-mimic-real-key-events.html
+    
+    When accessibility posts keyboard events in response to ax actions, they should mimic
+    real key events so as to be indistinguishable.
+    
+    https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional
+    
+    * accessibility/AccessibilityNodeObject.cpp:
+    (WebCore::dispatchSimulatedKeyboardUpDownEvent):
+    (WebCore::InitializeLegacyKeyInitProperties):
+    (WebCore::AccessibilityNodeObject::performDismissAction):
+    (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange):
+    * dom/KeyboardEvent.cpp:
+    (WebCore::KeyboardEvent::KeyboardEvent):
+    (WebCore::KeyboardEvent::create):
+    * dom/KeyboardEvent.h:
+    * dom/UIEvent.cpp:
+    (WebCore::UIEvent::UIEvent):
+    * dom/UIEvent.h:
+    (WebCore::UIEvent::create):
+    * dom/UIEventWithKeyState.h:
+    (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+    
+    LayoutTests:
+    
+    * accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt: Added.
+    * accessibility/keyevents-for-actions-mimic-real-key-events.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-22  Chris Fleizach  <[email protected]>
+
+            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
+            https://bugs.webkit.org/show_bug.cgi?id=220675
+            <rdar://problem/73263977>
+
+            Reviewed by Zalan Bujtas.
+
+            * accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt: Added.
+            * accessibility/keyevents-for-actions-mimic-real-key-events.html: Added.
+
+2021-02-02  Alan Coon  <[email protected]>
+
         Cherry-pick r271751. rdar://problem/73890346
 
     Crash under FFTFrame::fftSetupForSize()

Added: branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt (0 => 272256)


--- branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt	2021-02-03 01:39:45 UTC (rev 272256)
@@ -0,0 +1,42 @@
+This test verifies that the increment/decrement actions post keyboard events that appear identical to real keyboard events.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Sending AT event
+Received AT event
+Sending real event
+Received real event
+PASS realKeyEvent.altGraphKey is atKeyEvent.altGraphKey
+PASS realKeyEvent.altKey is atKeyEvent.altKey
+PASS realKeyEvent.bubbles is atKeyEvent.bubbles
+PASS realKeyEvent.cancelBubble is atKeyEvent.cancelBubble
+PASS realKeyEvent.cancelable is atKeyEvent.cancelable
+PASS realKeyEvent.charCode is atKeyEvent.charCode
+PASS realKeyEvent.code is atKeyEvent.code
+PASS realKeyEvent.composed is atKeyEvent.composed
+PASS realKeyEvent.ctrlKey is atKeyEvent.ctrlKey
+PASS realKeyEvent.detail is atKeyEvent.detail
+PASS realKeyEvent.isComposing is atKeyEvent.isComposing
+PASS realKeyEvent.isTrusted is atKeyEvent.isTrusted
+PASS realKeyEvent.key is atKeyEvent.key
+PASS realKeyEvent.keyCode is atKeyEvent.keyCode
+PASS realKeyEvent.keyIdentifier is atKeyEvent.keyIdentifier
+PASS realKeyEvent.layerX is atKeyEvent.layerX
+PASS realKeyEvent.layerY is atKeyEvent.layerY
+PASS realKeyEvent.location is atKeyEvent.location
+PASS realKeyEvent.metaKey is atKeyEvent.metaKey
+PASS realKeyEvent.pageX is atKeyEvent.pageX
+PASS realKeyEvent.pageY is atKeyEvent.pageY
+PASS realKeyEvent.repeat is atKeyEvent.repeat
+PASS realKeyEvent.returnValue is atKeyEvent.returnValue
+PASS realKeyEvent.shiftKey is atKeyEvent.shiftKey
+PASS realKeyEvent.srcElement is atKeyEvent.srcElement
+PASS realKeyEvent.target is atKeyEvent.target
+PASS realKeyEvent.type is atKeyEvent.type
+PASS realKeyEvent.which is atKeyEvent.which
+PASS realKeyEvent.windowProxy is atKeyEvent.windowProxy
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events.html (0 => 272256)


--- branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events.html	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-actions-mimic-real-key-events.html	2021-02-03 01:39:45 UTC (rev 272256)
@@ -0,0 +1,87 @@
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<div id="slider"
+           role="slider"
+           tabindex="0"
+           aria-valuemin="0"
+           aria-valuenow="0"
+           aria-valuemax="255"
+           aria-labelledby="idRed"></div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This test verifies that the increment/decrement actions post keyboard events that appear identical to real keyboard events.");
+
+    var atKeyEvent = 0;
+    var realKeyEvent = 0;
+    function handleKeyDown(event) {
+        if (!atKeyEvent) {
+            atKeyEvent = event;
+            debug("Received AT event");
+        }
+        else if (!realKeyEvent) {
+            realKeyEvent = event;
+            debug("Received real event");
+        }
+
+        if (realKeyEvent && atKeyEvent) {
+            shouldBe("realKeyEvent.altGraphKey", "atKeyEvent.altGraphKey");
+            shouldBe("realKeyEvent.altKey", "atKeyEvent.altKey");
+            shouldBe("realKeyEvent.bubbles", "atKeyEvent.bubbles");
+            shouldBe("realKeyEvent.cancelBubble", "atKeyEvent.cancelBubble");
+            shouldBe("realKeyEvent.cancelable", "atKeyEvent.cancelable");
+            shouldBe("realKeyEvent.charCode", "atKeyEvent.charCode");
+            shouldBe("realKeyEvent.code", "atKeyEvent.code");
+            shouldBe("realKeyEvent.composed", "atKeyEvent.composed");
+            shouldBe("realKeyEvent.ctrlKey", "atKeyEvent.ctrlKey");
+            shouldBe("realKeyEvent.detail", "atKeyEvent.detail");
+            shouldBe("realKeyEvent.isComposing", "atKeyEvent.isComposing");
+            shouldBe("realKeyEvent.isTrusted", "atKeyEvent.isTrusted");
+            shouldBe("realKeyEvent.key", "atKeyEvent.key");
+            shouldBe("realKeyEvent.keyCode", "atKeyEvent.keyCode");
+            shouldBe("realKeyEvent.keyIdentifier", "atKeyEvent.keyIdentifier");
+            shouldBe("realKeyEvent.layerX", "atKeyEvent.layerX");
+            shouldBe("realKeyEvent.layerY", "atKeyEvent.layerY");
+            shouldBe("realKeyEvent.location", "atKeyEvent.location");
+            shouldBe("realKeyEvent.metaKey", "atKeyEvent.metaKey");
+            shouldBe("realKeyEvent.pageX", "atKeyEvent.pageX");
+            shouldBe("realKeyEvent.pageY", "atKeyEvent.pageY");
+            shouldBe("realKeyEvent.repeat", "atKeyEvent.repeat");
+            shouldBe("realKeyEvent.returnValue", "atKeyEvent.returnValue");
+            shouldBe("realKeyEvent.shiftKey", "atKeyEvent.shiftKey");
+            shouldBe("realKeyEvent.srcElement", "atKeyEvent.srcElement");
+            shouldBe("realKeyEvent.target", "atKeyEvent.target");
+            shouldBe("realKeyEvent.type", "atKeyEvent.type");
+            shouldBe("realKeyEvent.which", "atKeyEvent.which");
+            shouldBe("realKeyEvent.windowProxy", "atKeyEvent.windowProxy");
+            finishJSTest();
+        }
+    }
+
+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
+
+        document.getElementById("slider").addEventListener('keydown', handleKeyDown);
+        document.getElementById("slider").focus();
+        
+        // Get the parent element.
+        var axSlider = accessibilityController.accessibleElementById("slider");
+
+        // Generate a AT based key event.
+        debug("Sending AT event");
+        axSlider.increment();
+
+        // Generate a real key event.
+        debug("Sending real event");
+        eventSender.keyDown("rightArrow");
+    }
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-increment-actions-with-node-removal-expected.txt (272255 => 272256)


--- branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-increment-actions-with-node-removal-expected.txt	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/LayoutTests/accessibility/keyevents-for-increment-actions-with-node-removal-expected.txt	2021-02-03 01:39:45 UTC (rev 272256)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-Keycode received: identifier: right key name: ArrowRight
+Keycode received: identifier: Right key name: ArrowRight
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: branches/safari-611-branch/LayoutTests/accessibility/keyevents-posted-for-increment-actions-expected.txt (272255 => 272256)


--- branches/safari-611-branch/LayoutTests/accessibility/keyevents-posted-for-increment-actions-expected.txt	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/LayoutTests/accessibility/keyevents-posted-for-increment-actions-expected.txt	2021-02-03 01:39:45 UTC (rev 272256)
@@ -5,18 +5,18 @@
 
 Increment/Decrement - LTR
 Horizontal orientation
-Keycode received: identifier: right key name: ArrowRight key code: 39
-Keycode received: identifier: left key name: ArrowLeft key code: 37
+Keycode received: identifier: Right key name: ArrowRight key code: 39
+Keycode received: identifier: Left key name: ArrowLeft key code: 37
 Vertical orientation
-Keycode received: identifier: up key name: ArrowUp key code: 38
-Keycode received: identifier: down key name: ArrowDown key code: 40
+Keycode received: identifier: Up key name: ArrowUp key code: 38
+Keycode received: identifier: Down key name: ArrowDown key code: 40
 Increment/Decrement - RTL
 Horizontal orientation
-Keycode received: identifier: left key name: ArrowLeft key code: 37
-Keycode received: identifier: right key name: ArrowRight key code: 39
+Keycode received: identifier: Left key name: ArrowLeft key code: 37
+Keycode received: identifier: Right key name: ArrowRight key code: 39
 Vertical orientation
-Keycode received: identifier: up key name: ArrowUp key code: 38
-Keycode received: identifier: down key name: ArrowDown key code: 40
+Keycode received: identifier: Up key name: ArrowUp key code: 38
+Keycode received: identifier: Down key name: ArrowDown key code: 40
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: branches/safari-611-branch/LayoutTests/platform/win/TestExpectations (272255 => 272256)


--- branches/safari-611-branch/LayoutTests/platform/win/TestExpectations	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/LayoutTests/platform/win/TestExpectations	2021-02-03 01:39:45 UTC (rev 272256)
@@ -1395,6 +1395,7 @@
 accessibility/keyevents-for-increment-actions-with-node-removal.html [ Skip ]
 accessibility/keyevents-posted-for-increment-actions.html [ Skip ]
 accessibility/keyevents-posted-for-dismiss-action.html [ Skip ]
+accessibility/keyevents-for-actions-mimic-real-key-events.html [ Skip ]
 
 webkit.org/b/140796 accessibility/alt-tag-on-image-with-nonimage-role.html [ Skip ]
 webkit.org/b/140798 accessibility/aria-controls-with-tabs.html [ Skip ]

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-03 01:39:45 UTC (rev 272256)
@@ -1,5 +1,79 @@
 2021-02-02  Alan Coon  <[email protected]>
 
+        Cherry-pick r271760. rdar://problem/73890156
+
+    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
+    https://bugs.webkit.org/show_bug.cgi?id=220675
+    <rdar://problem/73263977>
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Test: accessibility/keyevents-for-actions-mimic-real-key-events.html
+    
+    When accessibility posts keyboard events in response to ax actions, they should mimic
+    real key events so as to be indistinguishable.
+    
+    https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional
+    
+    * accessibility/AccessibilityNodeObject.cpp:
+    (WebCore::dispatchSimulatedKeyboardUpDownEvent):
+    (WebCore::InitializeLegacyKeyInitProperties):
+    (WebCore::AccessibilityNodeObject::performDismissAction):
+    (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange):
+    * dom/KeyboardEvent.cpp:
+    (WebCore::KeyboardEvent::KeyboardEvent):
+    (WebCore::KeyboardEvent::create):
+    * dom/KeyboardEvent.h:
+    * dom/UIEvent.cpp:
+    (WebCore::UIEvent::UIEvent):
+    * dom/UIEvent.h:
+    (WebCore::UIEvent::create):
+    * dom/UIEventWithKeyState.h:
+    (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+    
+    LayoutTests:
+    
+    * accessibility/keyevents-for-actions-mimic-real-key-events-expected.txt: Added.
+    * accessibility/keyevents-for-actions-mimic-real-key-events.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-01-22  Chris Fleizach  <[email protected]>
+
+            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
+            https://bugs.webkit.org/show_bug.cgi?id=220675
+            <rdar://problem/73263977>
+
+            Reviewed by Zalan Bujtas.
+
+            Test: accessibility/keyevents-for-actions-mimic-real-key-events.html
+
+            When accessibility posts keyboard events in response to ax actions, they should mimic
+            real key events so as to be indistinguishable.
+
+            https://github.com/WICG/aom/blob/gh-pages/explainer.md#deprecated-keyboardevent-object-properties-optional
+
+            * accessibility/AccessibilityNodeObject.cpp:
+            (WebCore::dispatchSimulatedKeyboardUpDownEvent):
+            (WebCore::InitializeLegacyKeyInitProperties):
+            (WebCore::AccessibilityNodeObject::performDismissAction):
+            (WebCore::AccessibilityNodeObject::postKeyboardKeysForValueChange):
+            * dom/KeyboardEvent.cpp:
+            (WebCore::KeyboardEvent::KeyboardEvent):
+            (WebCore::KeyboardEvent::create):
+            * dom/KeyboardEvent.h:
+            * dom/UIEvent.cpp:
+            (WebCore::UIEvent::UIEvent):
+            * dom/UIEvent.h:
+            (WebCore::UIEvent::create):
+            * dom/UIEventWithKeyState.h:
+            (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+
+2021-02-02  Alan Coon  <[email protected]>
+
         Cherry-pick r271751. rdar://problem/73890346
 
     Crash under FFTFrame::fftSetupForSize()

Modified: branches/safari-611-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2021-02-03 01:39:45 UTC (rev 272256)
@@ -38,6 +38,7 @@
 #include "AccessibilityTable.h"
 #include "Editing.h"
 #include "ElementIterator.h"
+#include "Event.h"
 #include "EventNames.h"
 #include "FloatRect.h"
 #include "Frame.h"
@@ -1104,7 +1105,7 @@
     
     bool handled = false;
     if (auto* node = object->node()) {
-        auto event = KeyboardEvent::create(eventNames().keydownEvent, keyInit);
+        auto event = KeyboardEvent::create(eventNames().keydownEvent, keyInit, Event::IsTrusted::Yes);
         node->dispatchEvent(event);
         handled |= event->defaultHandled();
     }
@@ -1111,7 +1112,7 @@
     
     // Ensure node is still valid and wasn't removed after the keydown.
     if (auto* node = object->node()) {
-        auto event = KeyboardEvent::create(eventNames().keyupEvent, keyInit);
+        auto event = KeyboardEvent::create(eventNames().keyupEvent, keyInit, Event::IsTrusted::Yes);
         node->dispatchEvent(event);
         handled |= event->defaultHandled();
     }
@@ -1118,12 +1119,25 @@
     return handled;
 }
 
+static void InitializeLegacyKeyInitProperties(KeyboardEvent::Init &keyInit, const AccessibilityObject& object)
+{
+    keyInit.which = keyInit.keyCode;
+    keyInit.code = keyInit.key;
+
+    keyInit.view = object.document()->windowProxy();
+    keyInit.cancelable = true;
+    keyInit.composed = true;
+    keyInit.bubbles = true;
+}
+
 bool AccessibilityNodeObject::performDismissAction()
 {
     auto keyInit = KeyboardEvent::Init();
     keyInit.key = "Escape"_s;
     keyInit.keyCode = 0x1b;
-    
+    keyInit.keyIdentifier = "U+001B"_s;
+    InitializeLegacyKeyInitProperties(keyInit, *this);
+
     return dispatchSimulatedKeyboardUpDownEvent(this, keyInit);
 }
 
@@ -1134,11 +1148,14 @@
     bool vertical = orientation() == AccessibilityOrientation::Vertical;
     bool isLTR = page()->userInterfaceLayoutDirection() == UserInterfaceLayoutDirection::LTR;
     
+    // The goal is to mimic existing keyboard dispatch completely, so that this is indistinguishable from a real key press.
     typedef enum { left = 37, up = 38, right = 39, down = 40 } keyCode;
     keyInit.key = increase ? (vertical ? "ArrowUp"_s : (isLTR ? "ArrowRight"_s : "ArrowLeft"_s)) : (vertical ? "ArrowDown"_s : (isLTR ? "ArrowLeft"_s : "ArrowRight"_s));
     keyInit.keyCode = increase ? (vertical ? keyCode::up : (isLTR ? keyCode::right : keyCode::left)) : (vertical ? keyCode::down : (isLTR ? keyCode::left : keyCode::right));
-    keyInit.keyIdentifier = increase ? (vertical ? "up"_s : (isLTR ? "right"_s : "left"_s)) : (vertical ? "down"_s : (isLTR ? "left"_s : "right"_s));
+    keyInit.keyIdentifier = increase ? (vertical ? "Up"_s : (isLTR ? "Right"_s : "Left"_s)) : (vertical ? "Down"_s : (isLTR ? "Left"_s : "Right"_s));
 
+    InitializeLegacyKeyInitProperties(keyInit, *this);
+
     return dispatchSimulatedKeyboardUpDownEvent(this, keyInit);
 }
 

Modified: branches/safari-611-branch/Source/WebCore/dom/KeyboardEvent.cpp (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/dom/KeyboardEvent.cpp	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/dom/KeyboardEvent.cpp	2021-02-03 01:39:45 UTC (rev 272256)
@@ -121,8 +121,8 @@
 {
 }
 
-inline KeyboardEvent::KeyboardEvent(const AtomString& eventType, const Init& initializer)
-    : UIEventWithKeyState(eventType, initializer)
+inline KeyboardEvent::KeyboardEvent(const AtomString& eventType, const Init& initializer, IsTrusted isTrusted)
+    : UIEventWithKeyState(eventType, initializer, isTrusted)
     , m_key(initializer.key)
     , m_code(initializer.code)
     , m_keyIdentifier(initializer.keyIdentifier)
@@ -147,9 +147,9 @@
     return adoptRef(*new KeyboardEvent);
 }
 
-Ref<KeyboardEvent> KeyboardEvent::create(const AtomString& type, const Init& initializer)
+Ref<KeyboardEvent> KeyboardEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
 {
-    return adoptRef(*new KeyboardEvent(type, initializer));
+    return adoptRef(*new KeyboardEvent(type, initializer, isTrusted));
 }
 
 void KeyboardEvent::initKeyboardEvent(const AtomString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&& view,

Modified: branches/safari-611-branch/Source/WebCore/dom/KeyboardEvent.h (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/dom/KeyboardEvent.h	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/dom/KeyboardEvent.h	2021-02-03 01:39:45 UTC (rev 272256)
@@ -62,7 +62,7 @@
         unsigned which;
     };
 
-    static Ref<KeyboardEvent> create(const AtomString& type, const Init&);
+    static Ref<KeyboardEvent> create(const AtomString& type, const Init&, IsTrusted = IsTrusted::No);
 
     virtual ~KeyboardEvent();
     
@@ -97,7 +97,7 @@
 private:
     KeyboardEvent();
     KeyboardEvent(const PlatformKeyboardEvent&, RefPtr<WindowProxy>&&);
-    KeyboardEvent(const AtomString&, const Init&);
+    KeyboardEvent(const AtomString&, const Init&, IsTrusted = IsTrusted::No);
 
     std::unique_ptr<PlatformKeyboardEvent> m_underlyingPlatformEvent;
     String m_key;

Modified: branches/safari-611-branch/Source/WebCore/dom/UIEvent.cpp (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/dom/UIEvent.cpp	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/dom/UIEvent.cpp	2021-02-03 01:39:45 UTC (rev 272256)
@@ -49,8 +49,8 @@
 {
 }
 
-UIEvent::UIEvent(const AtomString& eventType, const UIEventInit& initializer)
-    : Event(eventType, initializer, IsTrusted::No)
+UIEvent::UIEvent(const AtomString& eventType, const UIEventInit& initializer, IsTrusted isTrusted)
+    : Event(eventType, initializer, isTrusted)
     , m_view(initializer.view.get())
     , m_detail(initializer.detail)
 {

Modified: branches/safari-611-branch/Source/WebCore/dom/UIEvent.h (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/dom/UIEvent.h	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/dom/UIEvent.h	2021-02-03 01:39:45 UTC (rev 272256)
@@ -43,7 +43,7 @@
     {
         return adoptRef(*new UIEvent);
     }
-    static Ref<UIEvent> create(const AtomString& type, const UIEventInit& initializer)
+    static Ref<UIEvent> create(const AtomString& type, const UIEventInit& initializer, IsTrusted = IsTrusted::No)
     {
         return adoptRef(*new UIEvent(type, initializer));
     }
@@ -69,7 +69,7 @@
 
     UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail);
     UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, IsTrusted = IsTrusted::Yes);
-    UIEvent(const AtomString&, const UIEventInit&);
+    UIEvent(const AtomString&, const UIEventInit&, IsTrusted = IsTrusted::No);
 
 private:
     bool isUIEvent() const final;

Modified: branches/safari-611-branch/Source/WebCore/dom/UIEventWithKeyState.h (272255 => 272256)


--- branches/safari-611-branch/Source/WebCore/dom/UIEventWithKeyState.h	2021-02-03 01:39:41 UTC (rev 272255)
+++ branches/safari-611-branch/Source/WebCore/dom/UIEventWithKeyState.h	2021-02-03 01:39:45 UTC (rev 272256)
@@ -62,8 +62,8 @@
     {
     }
 
-    UIEventWithKeyState(const AtomString& type, const EventModifierInit& initializer)
-        : UIEvent(type, initializer)
+    UIEventWithKeyState(const AtomString& type, const EventModifierInit& initializer, IsTrusted isTrusted = IsTrusted::No)
+        : UIEvent(type, initializer, isTrusted)
         , m_modifiers(modifiersFromInitializer(initializer))
     {
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to