Bug 261799 - AX: AXWebSessionID, AXIsMultiline, AXReadOnlyValue, AXDocumentURIAttribute, and AXDocumentEncodingAttribute are unused by AX clients
Summary: AX: AXWebSessionID, AXIsMultiline, AXReadOnlyValue, AXDocumentURIAttribute, a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-19 21:35 PDT by Tyler Wilcock
Modified: 2023-09-21 09:32 PDT (History)
10 users (show)

See Also:


Attachments
Patch (27.20 KB, patch)
2023-09-19 21:41 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (37.40 KB, patch)
2023-09-19 23:12 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (37.34 KB, patch)
2023-09-20 17:31 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (39.18 KB, patch)
2023-09-20 18:03 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (39.20 KB, patch)
2023-09-20 18:04 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (39.20 KB, patch)
2023-09-20 22:39 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (39.16 KB, patch)
2023-09-20 22:48 PDT, 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-09-19 21:35:14 PDT
We should remove the effectively dead code supporting these attributes.
Comment 1 Radar WebKit Bug Importer 2023-09-19 21:35:28 PDT
<rdar://problem/115764193>
Comment 2 Tyler Wilcock 2023-09-19 21:41:30 PDT
Created attachment 467777 [details]
Patch
Comment 3 Tyler Wilcock 2023-09-19 23:12:13 PDT
Created attachment 467778 [details]
Patch
Comment 4 Andres Gonzalez 2023-09-20 17:19:21 PDT
(In reply to Tyler Wilcock from comment #3)
> Created attachment 467778 [details]
> Patch

diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp
index bed612dfe2e1..d8895c0805d9 100644
--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ b/Source/WebCore/accessibility/AXObjectCache.cpp
@@ -4132,7 +4132,7 @@ void AXObjectCache::updateIsolatedTree(const Vector<std::pair<RefPtr<Accessibili
             tree->updateNodeProperty(*notification.first, AXPropertyName::IdentifierAttribute);
             break;
         case AXReadOnlyStatusChanged:
-            tree->updateNodeProperties(*notification.first, { AXPropertyName::CanSetValueAttribute, AXPropertyName::ReadOnlyValue });
+            tree->updateNodeProperty(*notification.first, AXPropertyName::CanSetValueAttribute);

AG: can we do it the other way around? i.e., remove AXPropertyName::CanSetValueAttribute and keep AXPropertyName::ReadOnlyValue or simply AXPropertyName::ReadOnly.

             break;
         case AXRequiredStatusChanged:
             tree->updateNodeProperty(*notification.first, AXPropertyName::IsRequired);
diff --git a/Source/WebCore/accessibility/AccessibilityObjectInterface.h b/Source/WebCore/accessibility/AccessibilityObjectInterface.h
index e727148f9bbb..5a0f1723343c 100644
--- a/Source/WebCore/accessibility/AccessibilityObjectInterface.h
+++ b/Source/WebCore/accessibility/AccessibilityObjectInterface.h
@@ -66,10 +66,6 @@ typedef WebCore::AccessibilityObjectAtspi AccessibilityObjectWrapper;
 class AccessibilityObjectWrapper;
 #endif

-namespace PAL {
-class SessionID;
-}
-
 namespace WTF {
 class TextStream;
 }
@@ -1053,7 +1049,7 @@ public:
     virtual String popupValue() const = 0;
     virtual bool supportsHasPopup() const = 0;
     virtual bool pressedIsPresent() const = 0;
-    virtual bool ariaIsMultiline() const = 0;
+    virtual bool ariaIsMultiline() const { return false; }

AG: why do we want to expose a client method that always return false?

     virtual String invalidStatus() const = 0;
     virtual bool supportsExpanded() const = 0;
     virtual bool supportsChecked() const = 0;
@@ -1327,7 +1323,7 @@ public:
     virtual const String liveRegionRelevant() const = 0;
     virtual bool liveRegionAtomic() const = 0;
     virtual bool isBusy() const = 0;
-    virtual String readOnlyValue() const = 0;
+    virtual String readOnlyValue() const { return { }; }

AG: same here?

     virtual String autoCompleteValue() const = 0;

     // Make this object visible by scrolling as many nested scrollable views as needed.
@@ -1427,9 +1423,6 @@ public:
     virtual AXCoreObject* highestEditableAncestor() = 0;
     virtual AXCoreObject* exposedTableAncestor(bool includeSelf = false) const = 0;

-    virtual PAL::SessionID sessionID() const = 0;
-    virtual String documentURI() const = 0;
-    virtual String documentEncoding() const = 0;
     virtual AccessibilityChildrenVector documentLinks() = 0;

     virtual String innerHTML() const = 0;
Comment 5 Tyler Wilcock 2023-09-20 17:29:52 PDT
(In reply to Andres Gonzalez from comment #4)
> (In reply to Tyler Wilcock from comment #3)
> > Created attachment 467778 [details]
> > Patch
> 
> diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp
> b/Source/WebCore/accessibility/AXObjectCache.cpp
> index bed612dfe2e1..d8895c0805d9 100644
> --- a/Source/WebCore/accessibility/AXObjectCache.cpp
> +++ b/Source/WebCore/accessibility/AXObjectCache.cpp
> @@ -4132,7 +4132,7 @@ void AXObjectCache::updateIsolatedTree(const
> Vector<std::pair<RefPtr<Accessibili
>              tree->updateNodeProperty(*notification.first,
> AXPropertyName::IdentifierAttribute);
>              break;
>          case AXReadOnlyStatusChanged:
> -            tree->updateNodeProperties(*notification.first, {
> AXPropertyName::CanSetValueAttribute, AXPropertyName::ReadOnlyValue });
> +            tree->updateNodeProperty(*notification.first,
> AXPropertyName::CanSetValueAttribute);
> 
> AG: can we do it the other way around? i.e., remove
> AXPropertyName::CanSetValueAttribute and keep AXPropertyName::ReadOnlyValue
> or simply AXPropertyName::ReadOnly.
I don't think we could do it with this patch. The other components of CanSetValueAttribute besides readOnlyValue are not available off the main-thread, so caching readOnlyValue wouldn't have any use. We could consider trying to change that,  but seems like work for a future patch.

> @@ -1053,7 +1049,7 @@ public:
>      virtual String popupValue() const = 0;
>      virtual bool supportsHasPopup() const = 0;
>      virtual bool pressedIsPresent() const = 0;
> -    virtual bool ariaIsMultiline() const = 0;
> +    virtual bool ariaIsMultiline() const { return false; }
> 
> AG: why do we want to expose a client method that always return false?
It's virtual, so this declares the default implementation as returning false. It's overridden in AccessibilityObject. The only reason I kept it around at all is because ATSPI uses it, but they don't have ITM enabled, so I feel this is appropriate. Same situation for readOnlyValue().
Comment 6 Tyler Wilcock 2023-09-20 17:31:08 PDT
Created attachment 467799 [details]
Patch
Comment 7 Andres Gonzalez 2023-09-20 17:39:09 PDT
(In reply to Tyler Wilcock from comment #5)
> (In reply to Andres Gonzalez from comment #4)
> > (In reply to Tyler Wilcock from comment #3)
> > > Created attachment 467778 [details]
> > > Patch
> > 
> > diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp
> > b/Source/WebCore/accessibility/AXObjectCache.cpp
> > index bed612dfe2e1..d8895c0805d9 100644
> > --- a/Source/WebCore/accessibility/AXObjectCache.cpp
> > +++ b/Source/WebCore/accessibility/AXObjectCache.cpp
> > @@ -4132,7 +4132,7 @@ void AXObjectCache::updateIsolatedTree(const
> > Vector<std::pair<RefPtr<Accessibili
> >              tree->updateNodeProperty(*notification.first,
> > AXPropertyName::IdentifierAttribute);
> >              break;
> >          case AXReadOnlyStatusChanged:
> > -            tree->updateNodeProperties(*notification.first, {
> > AXPropertyName::CanSetValueAttribute, AXPropertyName::ReadOnlyValue });
> > +            tree->updateNodeProperty(*notification.first,
> > AXPropertyName::CanSetValueAttribute);
> > 
> > AG: can we do it the other way around? i.e., remove
> > AXPropertyName::CanSetValueAttribute and keep AXPropertyName::ReadOnlyValue
> > or simply AXPropertyName::ReadOnly.
> I don't think we could do it with this patch. The other components of
> CanSetValueAttribute besides readOnlyValue are not available off the
> main-thread, so caching readOnlyValue wouldn't have any use. We could
> consider trying to change that,  but seems like work for a future patch.

Fine to leave for another patch, but I was actually referring to the naming ReadOnly vs. CanSetValue.
> 
> > @@ -1053,7 +1049,7 @@ public:
> >      virtual String popupValue() const = 0;
> >      virtual bool supportsHasPopup() const = 0;
> >      virtual bool pressedIsPresent() const = 0;
> > -    virtual bool ariaIsMultiline() const = 0;
> > +    virtual bool ariaIsMultiline() const { return false; }
> > 
> > AG: why do we want to expose a client method that always return false?
> It's virtual, so this declares the default implementation as returning
> false. It's overridden in AccessibilityObject. The only reason I kept it
> around at all is because ATSPI uses it, but they don't have ITM enabled, so
> I feel this is appropriate. Same situation for readOnlyValue().

The right thing would be to change ATSPI to use the AccessibilityObject, not the AXCoreObject in these cases and remove them from the AXCoreObject interface.
Comment 8 Tyler Wilcock 2023-09-20 18:03:40 PDT
Created attachment 467801 [details]
Patch
Comment 9 Tyler Wilcock 2023-09-20 18:04:55 PDT
Created attachment 467802 [details]
Patch
Comment 10 Tyler Wilcock 2023-09-20 18:07:16 PDT
> > > AG: can we do it the other way around? i.e., remove
> > > AXPropertyName::CanSetValueAttribute and keep AXPropertyName::ReadOnlyValue
> > > or simply AXPropertyName::ReadOnly.
> > I don't think we could do it with this patch. The other components of
> > CanSetValueAttribute besides readOnlyValue are not available off the
> > main-thread, so caching readOnlyValue wouldn't have any use. We could
> > consider trying to change that,  but seems like work for a future patch.
> 
> Fine to leave for another patch, but I was actually referring to the naming
> ReadOnly vs. CanSetValue.
Ahh, yes I misunderstood. Yes let's consider this for a future patch.

> > > @@ -1053,7 +1049,7 @@ public:
> > >      virtual String popupValue() const = 0;
> > >      virtual bool supportsHasPopup() const = 0;
> > >      virtual bool pressedIsPresent() const = 0;
> > > -    virtual bool ariaIsMultiline() const = 0;
> > > +    virtual bool ariaIsMultiline() const { return false; }
> > > 
> > > AG: why do we want to expose a client method that always return false?
> > It's virtual, so this declares the default implementation as returning
> > false. It's overridden in AccessibilityObject. The only reason I kept it
> > around at all is because ATSPI uses it, but they don't have ITM enabled, so
> > I feel this is appropriate. Same situation for readOnlyValue().
> 
> The right thing would be to change ATSPI to use the AccessibilityObject, not
> the AXCoreObject in these cases and remove them from the AXCoreObject
> interface.
Fixed in latest patch. There are existing casts to AccessibilityObject in ATSPI code, so we can use those.
Comment 11 Andres Gonzalez 2023-09-20 18:17:40 PDT
(In reply to Tyler Wilcock from comment #10)
> > > > AG: can we do it the other way around? i.e., remove
> > > > AXPropertyName::CanSetValueAttribute and keep AXPropertyName::ReadOnlyValue
> > > > or simply AXPropertyName::ReadOnly.
> > > I don't think we could do it with this patch. The other components of
> > > CanSetValueAttribute besides readOnlyValue are not available off the
> > > main-thread, so caching readOnlyValue wouldn't have any use. We could
> > > consider trying to change that,  but seems like work for a future patch.
> > 
> > Fine to leave for another patch, but I was actually referring to the naming
> > ReadOnly vs. CanSetValue.
> Ahh, yes I misunderstood. Yes let's consider this for a future patch.
> 
> > > > @@ -1053,7 +1049,7 @@ public:
> > > >      virtual String popupValue() const = 0;
> > > >      virtual bool supportsHasPopup() const = 0;
> > > >      virtual bool pressedIsPresent() const = 0;
> > > > -    virtual bool ariaIsMultiline() const = 0;
> > > > +    virtual bool ariaIsMultiline() const { return false; }
> > > > 
> > > > AG: why do we want to expose a client method that always return false?
> > > It's virtual, so this declares the default implementation as returning
> > > false. It's overridden in AccessibilityObject. The only reason I kept it
> > > around at all is because ATSPI uses it, but they don't have ITM enabled, so
> > > I feel this is appropriate. Same situation for readOnlyValue().
> > 
> > The right thing would be to change ATSPI to use the AccessibilityObject, not
> > the AXCoreObject in these cases and remove them from the AXCoreObject
> > interface.
> Fixed in latest patch. There are existing casts to AccessibilityObject in
> ATSPI code, so we can use those.

Great, Thanks!
Comment 12 Tyler Wilcock 2023-09-20 22:39:53 PDT
Created attachment 467806 [details]
Patch
Comment 13 Tyler Wilcock 2023-09-20 22:48:12 PDT
Created attachment 467807 [details]
Patch
Comment 14 EWS 2023-09-21 09:32:38 PDT
Committed 268256@main (3fc18de4dfcd): <https://commits.webkit.org/268256@main>

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