Title: [250509] branches/safari-608-branch/Source/WebCore
Revision
250509
Author
bshaf...@apple.com
Date
2019-09-30 01:30:51 -0700 (Mon, 30 Sep 2019)

Log Message

Cherry-pick r249930. rdar://problem/55826316

    AX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
    https://bugs.webkit.org/show_bug.cgi?id=201840

    Patch by Eric Liang <ericli...@apple.com> on 2019-09-16
    Reviewed by Chris Fleizach.

    menuForEvent: expects event-position in window's space, but we pass the position in Core's space. In this case, we need to convert core's space to window's space.
    Tested that existing tests passed with WK1 and WK2

    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
    (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (250508 => 250509)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-30 08:30:48 UTC (rev 250508)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-09-30 08:30:51 UTC (rev 250509)
@@ -1,5 +1,36 @@
 2019-09-30  Babak Shafiei  <bshaf...@apple.com>
 
+        Cherry-pick r249930. rdar://problem/55826316
+
+    AX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
+    https://bugs.webkit.org/show_bug.cgi?id=201840
+    
+    Patch by Eric Liang <ericli...@apple.com> on 2019-09-16
+    Reviewed by Chris Fleizach.
+    
+    menuForEvent: expects event-position in window's space, but we pass the position in Core's space. In this case, we need to convert core's space to window's space.
+    Tested that existing tests passed with WK1 and WK2
+    
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-16  Eric Liang  <ericli...@apple.com>
+
+            AX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
+            https://bugs.webkit.org/show_bug.cgi?id=201840
+
+            Reviewed by Chris Fleizach.
+
+            menuForEvent: expects event-position in window's space, but we pass the position in Core's space. In this case, we need to convert core's space to window's space.
+            Tested that existing tests passed with WK1 and WK2
+
+            * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+            (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
+
+2019-09-30  Babak Shafiei  <bshaf...@apple.com>
+
         Cherry-pick r249077. rdar://problem/55826882
 
     Crash under TimerBase::setNextFireTime() in the NetworkProcess

Modified: branches/safari-608-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (250508 => 250509)


--- branches/safari-608-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-09-30 08:30:48 UTC (rev 250508)
+++ branches/safari-608-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2019-09-30 08:30:51 UTC (rev 250509)
@@ -3777,19 +3777,23 @@
     IntRect rect = snappedIntRect(m_object->elementRect());
     FrameView* frameView = m_object->documentFrameView();
     
-    // On WK2, we need to account for the scroll position.
-    // On WK1, this isn't necessary, it's taken care of by the attachment views.
-    if (frameView && !frameView->platformWidget()) {
+    // On WK2, we need to account for the scroll position with regards to root view.
+    // On WK1, we need to convert rect to window space to match mouse clicking.
+    if (frameView) {
         // Find the appropriate scroll view to use to convert the contents to the window.
         for (AccessibilityObject* parent = m_object->parentObject(); parent; parent = parent->parentObject()) {
             if (is<AccessibilityScrollView>(*parent)) {
-                ScrollView* scrollView = downcast<AccessibilityScrollView>(*parent).scrollView();
-                rect = scrollView->contentsToRootView(rect);
+                if (auto scrollView = downcast<AccessibilityScrollView>(*parent).scrollView()) {
+                    if (!frameView->platformWidget())
+                        rect = scrollView->contentsToRootView(rect);
+                    else
+                        rect = scrollView->contentsToWindow(rect);
+                }
                 break;
             }
         }
     }
-    
+
     page->contextMenuController().showContextMenuAt(page->mainFrame(), rect.center());
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to