Bug 253289

Summary: AX: Remove boundingBoxRect and computedLabel from the AXCoreObject interface
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Tyler Wilcock 2023-03-02 18:29:25 PST
These functions are only necessary for AccessibilityObjects, not AXIsolatedObjects.
Comment 1 Radar WebKit Bug Importer 2023-03-02 18:29:35 PST
<rdar://problem/106175101>
Comment 2 Tyler Wilcock 2023-03-02 18:43:19 PST
Created attachment 465272 [details]
Patch
Comment 3 Tyler Wilcock 2023-03-03 00:56:54 PST
Created attachment 465275 [details]
Patch
Comment 4 Andres Gonzalez 2023-03-03 07:10:22 PST
(In reply to Tyler Wilcock from comment #3)
> Created attachment 465275 [details]
> Patch

Also make uses of `performFunctionOnMainThread` typed with `AccessibilityObject*` instead of `AXCoreObject*`.

"make uses" -> "make use" or "uses".

--- a/Source/WebCore/accessibility/AccessibilityObject.h
+++ b/Source/WebCore/accessibility/AccessibilityObject.h

-    String computedLabel() override;
+    WEBCORE_EXPORT String computedLabel();

Why it needs WEBCORE_EXPORT, it didn't before in AXCoreObject.

-    LayoutRect boundingBoxRect() const override { return LayoutRect(); }
+    virtual LayoutRect boundingBoxRect() const { return LayoutRect(); }

return { };

--- a/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
+++ b/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp

-    performFunctionOnMainThread([&value](AXCoreObject* object) {
+    performFunctionOnMainThread([&value](AccessibilityObject* object) {

Missing space between ](

 void AXIsolatedObject::setSelected(bool value)
 {
-    performFunctionOnMainThread([&value](AXCoreObject* object) {
+    performFunctionOnMainThread([&value](AccessibilityObject* object) {

Dito.

 void AXIsolatedObject::setSelectedRows(AccessibilityChildrenVector& value)
 {
-    performFunctionOnMainThread([&value](AXCoreObject* object) {
+    performFunctionOnMainThread([&value](AccessibilityObject* object) {

Dito.

 void AXIsolatedObject::setFocused(bool value)
 {
-    performFunctionOnMainThread([&value](AXCoreObject* object) {
+    performFunctionOnMainThread([&value](AccessibilityObject* object) {

Dito.
 void AXIsolatedObject::setSelectedText(const String& value)
 {
-    performFunctionOnMainThread([&value](AXCoreObject* object) {
+    performFunctionOnMainThread([&value](AccessibilityObject* object) {

Dito.

 void AXIsolatedObject::setSelectedTextRange(const PlainTextRange& value)
 {
-    performFunctionOnMainThread([&value](AXCoreObject* object) {
+    performFunctionOnMainThread([&value](AccessibilityObject* object) {

Dito.

 void AXIsolatedObject::increment()
 {
-    performFunctionOnMainThread([](AXCoreObject* axObject) {
+    performFunctionOnMainThread([](AccessibilityObject* axObject) {

Dito.

 void AXIsolatedObject::decrement()
 {
-    performFunctionOnMainThread([](AXCoreObject* axObject) {
+    performFunctionOnMainThread([](AccessibilityObject* axObject) {

Dito.
Comment 5 Tyler Wilcock 2023-03-03 10:00:34 PST
Created attachment 465282 [details]
Patch
Comment 6 Tyler Wilcock 2023-03-03 10:04:33 PST
(In reply to Andres Gonzalez from comment #4)
> (In reply to Tyler Wilcock from comment #3)
> > Created attachment 465275 [details]
> > Patch
> 
> --- a/Source/WebCore/accessibility/AccessibilityObject.h
> +++ b/Source/WebCore/accessibility/AccessibilityObject.h
> 
> -    String computedLabel() override;
> +    WEBCORE_EXPORT String computedLabel();
> 
> Why it needs WEBCORE_EXPORT, it didn't before in AXCoreObject.
I'm not entirely sure. Before my patch the function was virtual, which may have implicitly exposed it. Without WEBCORE_EXPORT, we fail to link because WebProcess/Automation/WebAutomationSessionProxy.cpp calls `computedLabel()`.
Comment 7 EWS 2023-03-03 20:45:25 PST
Committed 261210@main (aa13aa32a983): <https://commits.webkit.org/261210@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 465282 [details].