Bug 253289 - AX: Remove boundingBoxRect and computedLabel from the AXCoreObject interface
Summary: AX: Remove boundingBoxRect and computedLabel from the AXCoreObject interface
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-03-02 18:29 PST by Tyler Wilcock
Modified: 2023-03-03 20:45 PST (History)
10 users (show)

See Also:


Attachments
Patch (14.07 KB, patch)
2023-03-02 18:43 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (11.66 KB, patch)
2023-03-03 00:56 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (11.80 KB, patch)
2023-03-03 10:00 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].