Skip to content
Permalink
Browse files
AX: VoiceOver double reads list markers, doesn't output braille for l…
…ist items

https://bugs.webkit.org/show_bug.cgi?id=246188
rdar://100855009

Reviewed by Chris Fleizach.

This is a regression from:

3395d79
(AX: Expose suggestion, insertion, deletion roles and attributes)

That commit allowed static text elements to return attributed strings.
Due to some quirks in VoiceOver (and also a different bug in
WebKit), this causes issues that will need to be addressed at a later time.

This patch effectively reverts the Mac portion of that commit by
removing the code that allowed AccessibilityRole::StaticText elements
to return attributed strings.

* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::text const):
Stop allowing isStaticText() elements to return textUnderElement.
* Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
Stop allowing isStaticText() elements to doAXAttributedStringForRange.

Canonical link: https://commits.webkit.org/255276@main
  • Loading branch information
twilco committed Oct 7, 2022
1 parent 4a7ae87 commit 8089baaa58f200f1e4c6ac08da07326d3a794531
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
@@ -2220,9 +2220,6 @@ String AccessibilityNodeObject::text() const
return textOrder[0].text;
}

if (isStaticText())
return textUnderElement();

if (!isTextControl())
return String();

@@ -4024,11 +4024,6 @@ - (id)accessibilityAttributeValue:(NSString*)attribute forParameter:(id)paramete
}
}

if (backingObject->isTextControl() || backingObject->isStaticText()) {
if ([attribute isEqualToString:(NSString *)kAXAttributedStringForRangeParameterizedAttribute])
return rangeSet ? [self doAXAttributedStringForRange:range] : nil;
}

if (backingObject->isTextControl()) {
if ([attribute isEqualToString: (NSString *)kAXLineForIndexParameterizedAttribute]) {
int lineNumber = backingObject->doAXLineForIndex([number intValue]);
@@ -4072,6 +4067,9 @@ - (id)accessibilityAttributeValue:(NSString*)attribute forParameter:(id)paramete
if ([attribute isEqualToString: (NSString*)kAXRTFForRangeParameterizedAttribute])
return rangeSet ? [self doAXRTFForRange:range] : nil;

if ([attribute isEqualToString:(NSString *)kAXAttributedStringForRangeParameterizedAttribute])
return rangeSet ? [self doAXAttributedStringForRange:range] : nil;

if ([attribute isEqualToString: (NSString*)kAXStyleRangeForIndexParameterizedAttribute]) {
PlainTextRange textRange = backingObject->doAXStyleRangeForIndex([number intValue]);
return [NSValue valueWithRange: NSMakeRange(textRange.start, textRange.length)];

0 comments on commit 8089baa

Please sign in to comment.