[ATK] Avoid unneeded call to to core(selection) in listObjectForSelection()
authoraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jul 2019 10:08:57 +0000 (10:08 +0000)
committeraperez@igalia.com <aperez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Jul 2019 10:08:57 +0000 (10:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199748
<rdar://problem/52995908>

Reviewed by Konstantin Tokarev.

No new tests needed.

* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(listObjectForCoreSelection): Renamed from listObjectForSelection() and remove the
unneeded call to core() now that coreSelection is passed directly to the function.
(optionFromList): Change to pass coreSelection directly to listObjectForCoreSelection().

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

Source/WebCore/ChangeLog
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceSelection.cpp

index d404d74..d4b20ee 100644 (file)
@@ -1,3 +1,18 @@
+2019-07-12  Adrian Perez de Castro  <aperez@igalia.com>
+
+        [ATK] Avoid unneeded call to to core(selection) in listObjectForSelection()
+        https://bugs.webkit.org/show_bug.cgi?id=199748
+        <rdar://problem/52995908>
+
+        Reviewed by Konstantin Tokarev.
+
+        No new tests needed.
+
+        * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
+        (listObjectForCoreSelection): Renamed from listObjectForSelection() and remove the
+        unneeded call to core() now that coreSelection is passed directly to the function.
+        (optionFromList): Change to pass coreSelection directly to listObjectForCoreSelection().
+
 2019-07-11  Chris Dumez  <cdumez@apple.com>
 
         Fix non-thread safe use of makeWeakPtr() under MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify()
index 39bc98e..17b9806 100644 (file)
@@ -50,10 +50,8 @@ static AccessibilityObject* core(AtkSelection* selection)
     return &webkitAccessibleGetAccessibilityObject(WEBKIT_ACCESSIBLE(selection));
 }
 
-static AccessibilityObject* listObjectForSelection(AtkSelection* selection)
+static AccessibilityObject* listObjectForCoreSelection(AccessibilityObject* coreSelection)
 {
-    AccessibilityObject* coreSelection = core(selection);
-
     // Only list boxes and menu lists supported so far.
     if (!coreSelection->isListBox() && !coreSelection->isMenuList())
         return nullptr;
@@ -83,7 +81,7 @@ static AccessibilityObject* optionFromList(AtkSelection* selection, gint index)
         return nullptr;
 
     // Need to select the proper list object depending on the type.
-    AccessibilityObject* listObject = listObjectForSelection(selection);
+    AccessibilityObject* listObject = listObjectForCoreSelection(coreSelection);
     if (!listObject)
         return nullptr;