RESOLVED FIXED 235414
AX: Move Mac subrole logic to new subrolePlatformString AXCoreObject interface method
https://bugs.webkit.org/show_bug.cgi?id=235414
Summary AX: Move Mac subrole logic to new subrolePlatformString AXCoreObject interfac...
Tyler Wilcock
Reported 2022-01-20 12:07:50 PST
This causes string comparisons to fail unexpectedly not match here: if (backingObject->isStyleFormatGroup()) { using namespace HTMLNames; auto tagName = backingObject->tagName(); if (tagName == kbdTag) return @"AXKeyboardInputStyleGroup"; if (tagName == codeTag) return @"AXCodeStyleGroup"; if (tagName == preTag) return @"AXPreformattedStyleGroup"; if (tagName == sampTag) return @"AXSampleStyleGroup"; if (tagName == varTag) return @"AXVariableStyleGroup"; if (tagName == citeTag) return @"AXCiteStyleGroup"; ASSERT_NOT_REACHED(); }
Attachments
Patch (3.59 KB, patch)
2022-01-20 12:21 PST, Tyler Wilcock
no flags
Patch (3.60 KB, patch)
2022-01-20 13:14 PST, Tyler Wilcock
no flags
Patch (27.73 KB, patch)
2022-01-20 21:07 PST, Tyler Wilcock
ews-feeder: commit-queue-
Patch (27.75 KB, patch)
2022-01-20 21:51 PST, Tyler Wilcock
no flags
Patch (25.38 KB, patch)
2022-01-21 08:09 PST, Tyler Wilcock
no flags
Patch (25.46 KB, patch)
2022-01-21 12:25 PST, Tyler Wilcock
no flags
Patch (25.46 KB, patch)
2022-01-21 12:31 PST, Tyler Wilcock
no flags
Radar WebKit Bug Importer
Comment 1 2022-01-20 12:08:10 PST
Tyler Wilcock
Comment 2 2022-01-20 12:21:47 PST
Tyler Wilcock
Comment 3 2022-01-20 13:14:25 PST
chris fleizach
Comment 4 2022-01-20 13:33:37 PST
Comment on attachment 449605 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449605&action=review > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:2020 > + return Accessibility::retrieveValueFromMainThread<String>([protectedSelf = retainPtr(self)] () -> String { should we cache this rather than hitting main thread?
Tyler Wilcock
Comment 5 2022-01-20 21:07:44 PST
Tyler Wilcock
Comment 6 2022-01-20 21:51:02 PST
chris fleizach
Comment 7 2022-01-20 22:18:07 PST
Comment on attachment 449639 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=449639&action=review > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1807 > + && (!backingObject->isModel() || backingObject->modelElementChildren().isEmpty()) I think even if the model is empty we want to return the special subrole so that VO can land on it directly and know that it's a model
Tyler Wilcock
Comment 8 2022-01-21 08:09:48 PST
Tyler Wilcock
Comment 9 2022-01-21 08:11:20 PST
(In reply to chris fleizach from comment #7) > Comment on attachment 449639 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=449639&action=review > > > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1807 > > + && (!backingObject->isModel() || backingObject->modelElementChildren().isEmpty()) > > I think even if the model is empty we want to return the special subrole so > that VO can land on it directly and know that it's a model Fixed.
Andres Gonzalez
Comment 10 2022-01-21 11:22:49 PST
(In reply to Tyler Wilcock from comment #8) > Created attachment 449658 [details] > Patch --- a/Source/WebCore/accessibility/AccessibilityObject.cpp +++ a/Source/WebCore/accessibility/AccessibilityObject.cpp +String AccessibilityObject::subrolePlatformString() const +{ + return String(); +} + I think we do these hallowed implementations as inlines in the header. --- a/Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm +++ a/Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm + setProperty(AXPropertyName::SubrolePlatformString, object.subrolePlatformString().isolatedCopy()); We can do this in the cross-platform initializeData since it is the same for all platforms. --- a/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm +++ a/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm +String AccessibilityObject::subrolePlatformString() const +{ This can not be implemented twice in AccessibilityObject.cpp and Mac.mm. --- a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm +++ a/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm + if (subrole != String()) + return subrole; Change to if (!subrole.isEmpty())
Tyler Wilcock
Comment 11 2022-01-21 12:25:20 PST
Tyler Wilcock
Comment 12 2022-01-21 12:30:18 PST
> +String AccessibilityObject::subrolePlatformString() const > +{ > + return String(); > +} > + > I think we do these hallowed implementations as inlines in the header. > --- a/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm > +++ a/Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm > > +String AccessibilityObject::subrolePlatformString() const > +{ > > This can not be implemented twice in AccessibilityObject.cpp and Mac.mm. The patch diff doesn't show enough context for you to have seen this, but it's not implemented twice. I added the hollow implementation of subrolePlatformString to the .cpp source file to match how we do it for roles, as that is already wrapped in an #if !PLATFORM(MAC) guard: #if !PLATFORM(MAC) String AccessibilityObject::rolePlatformString() const { return Accessibility::roleToPlatformString(roleValue()); } String AccessibilityObject::rolePlatformDescription() const { // FIXME: implement in other platforms. return String(); } String AccessibilityObject::subrolePlatformString() const { return String(); } #endif Then we provide the real implementation in AccessibilityObjectMac.mm. I can still change it if you'd like, though. Fixed your other two comments, thanks!
Tyler Wilcock
Comment 13 2022-01-21 12:31:35 PST
EWS
Comment 14 2022-01-21 17:25:01 PST
Committed r288390 (246287@main): <https://commits.webkit.org/246287@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 449686 [details].
Note You need to log in before you can comment on or make changes to this bug.