Summary: | [GTK][a11y] Add a build option to enable ATSPI | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||||||||||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||||||
Severity: | Normal | CC: | aboxhall, andresg_22, annulen, aperez, apinheiro, bugs-noreply, cfleizach, dmazzoni, ews-watchlist, gyuyoung.kim, jcraig, jdiggs, mifenton, ryuan.choi, samuel_white, sergio | ||||||||||||||||||
Priority: | P2 | Keywords: | Gtk | ||||||||||||||||||
Version: | WebKit Nightly Build | ||||||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||||||
OS: | Unspecified | ||||||||||||||||||||
Bug Depends on: | 230299, 230301 | ||||||||||||||||||||
Bug Blocks: | 230253, 230255 | ||||||||||||||||||||
Attachments: |
|
Description
Carlos Garcia Campos
2021-09-14 05:31:27 PDT
Created attachment 438125 [details]
Patch
Created attachment 438127 [details]
Patch
Created attachment 438128 [details]
Patch
Created attachment 438130 [details]
Patch
Created attachment 438131 [details]
Patch
Created attachment 438134 [details]
Patch
(In reply to Carlos Garcia Campos from comment #6) > Created attachment 438134 [details] > Patch --- a/Source/WebCore/accessibility/AXObjectCache.cpp +++ a/Source/WebCore/accessibility/AXObjectCache.cpp @@ -770,9 +770,13 @@ AccessibilityObject* AXObjectCache::getOrCreate(RenderObject* renderer) #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) bool AXObjectCache::clientSupportsIsolatedTree() { +#if USE(APPLE_INTERNAL_SDK) Instead of adding more #if throughout the platform-independent source, it would be cleaner to move this mac implementation to AXObjectCacheMac.mm, and add a new implementation for atspi. Same comment for AXObjectCache::isIsolatedTreeEnabled, initializeSecondaryAXThread and usedOnAXThread. (In reply to Carlos Garcia Campos from comment #6) > Created attachment 438134 [details] > Patch --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ a/Source/WebCore/accessibility/AccessibilityObject.cpp @@ -3782,7 +3782,14 @@ static bool isAccessibilityTextSearchMatch(AXCoreObject* axObject, Accessibility { if (!axObject) return false; - return axObject->containsText(criteria.searchText); + + // If text is empty we return true. + if (criteria.searchText.isEmpty()) + return true; + + return containsPlainText(axObject->title(), criteria.searchText, CaseInsensitive) + || containsPlainText(axObject->accessibilityDescription(), criteria.searchText, CaseInsensitive) + || containsPlainText(axObject->stringValue(), criteria.searchText, CaseInsensitive); } This doesn't seem related to enabling isolated tree, so perhaps you can submit this change as a separate patch. (In reply to Carlos Garcia Campos from comment #6) > Created attachment 438134 [details] > Patch --- a/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp +++ a/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp @@ -71,11 +71,15 @@ void AXIsolatedObject::initializeAttributeData(AXCoreObject& object, bool isRoot setProperty(AXPropertyName::ARIALandmarkRoleDescription, object.ariaLandmarkRoleDescription().isolatedCopy()); setProperty(AXPropertyName::AccessibilityDescription, object.accessibilityDescription().isolatedCopy()); setProperty(AXPropertyName::BoundingBoxRect, object.boundingBoxRect()); +#if PLATFORM(COCOA) setProperty(AXPropertyName::Description, object.descriptionAttributeValue().isolatedCopy()); +#endif Could we move these platform-specific properties to initializePlatformProperties? That way we wouldn't have to #if throughout here. (In reply to Andres Gonzalez from comment #7) > (In reply to Carlos Garcia Campos from comment #6) > > Created attachment 438134 [details] > > Patch > > --- a/Source/WebCore/accessibility/AXObjectCache.cpp > +++ a/Source/WebCore/accessibility/AXObjectCache.cpp > @@ -770,9 +770,13 @@ AccessibilityObject* > AXObjectCache::getOrCreate(RenderObject* renderer) > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) > bool AXObjectCache::clientSupportsIsolatedTree() > { > +#if USE(APPLE_INTERNAL_SDK) > > Instead of adding more #if throughout the platform-independent source, it > would be cleaner to move this mac implementation to AXObjectCacheMac.mm, and > add a new implementation for atspi. > > Same comment for AXObjectCache::isIsolatedTreeEnabled, > initializeSecondaryAXThread and usedOnAXThread. Ok (In reply to Andres Gonzalez from comment #8) > (In reply to Carlos Garcia Campos from comment #6) > > Created attachment 438134 [details] > > Patch > > --- a/Source/WebCore/accessibility/AccessibilityObject.cpp > +++ a/Source/WebCore/accessibility/AccessibilityObject.cpp > @@ -3782,7 +3782,14 @@ static bool > isAccessibilityTextSearchMatch(AXCoreObject* axObject, Accessibility > { > if (!axObject) > return false; > - return axObject->containsText(criteria.searchText); > + > + // If text is empty we return true. > + if (criteria.searchText.isEmpty()) > + return true; > + > + return containsPlainText(axObject->title(), criteria.searchText, > CaseInsensitive) > + || containsPlainText(axObject->accessibilityDescription(), > criteria.searchText, CaseInsensitive) > + || containsPlainText(axObject->stringValue(), criteria.searchText, > CaseInsensitive); > } > > This doesn't seem related to enabling isolated tree, so perhaps you can > submit this change as a separate patch. Right, this is weird here, The reason of this change is because WTR uses the WebCore wrappers, and including TextIterator.h from the header pulled too many things that caused linking errors. I'll split the patch. Created attachment 438324 [details]
Patch
Created attachment 438326 [details]
Patch
Comment on attachment 438326 [details]
Patch
Approved, as it seems all the review concerns have been adressed :)
Committed r282643 (241797@main): <https://commits.webkit.org/241797@main> |