Closed Bug 914052 Opened 7 years ago Closed 9 days ago

Implement necessary text retrieval bits of NSAccessibility protocol

Categories

(Core :: Disability Access APIs, defect, P1)

x86_64
macOS
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: MarcoZ, Unassigned)

References

Details

(Whiteboard: [mac2020_2])

In both HTML and XUL, necessary bits are missing to retrieve the current character, text typed so far, and other text and navigation-related bits so VoiceOver can track what's been typed. The only thing that does work is, when tabbing to a field which already contains text, and the text is selected. That is spoken. But neither the removal of the selection nor arrowing through, nor newly typed text is picked up by either speech or braille.
I believe it would help to split this bug into smaller issues & provide reduced testcases and details for each issue etc

A first analysis:

On text field, WebKit exposes the following attributes (http://trac.webkit.org/browser/trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm#L1412):

NSAccessibilityAccessKeyAttribute
NSAccessibilityInsertionPointLineNumberAttribute
NSAccessibilityInvalidAttribute
NSAccessibilityNumberOfCharactersAttribute
NSAccessibilityPlaceholderValueAttribute
NSAccessibilityRequiredAttribute
NSAccessibilitySelectedTextAttribute
NSAccessibilitySelectedTextRangeAttribute
NSAccessibilityTitleUIElementAttribute
NSAccessibilityValueAutofilledAttribute
NSAccessibilityVisibleCharacterRangeAttribute

While we currently only exposes the following attributes (http://hg.mozilla.org/mozilla-central/file/5f16c6c2b969/accessible/mac/mozTextAccessible.mm#l66):

NSAccessibilityInsertionPointLineNumberAttribute
NSAccessibilityInvalidAttribute
NSAccessibilityNumberOfCharactersAttribute
NSAccessibilityRequiredAttribute
NSAccessibilitySelectedTextAttribute
NSAccessibilitySelectedTextRangeAttribute
NSAccessibilityVisibleCharacterRangeAttribute
Whiteboard: [mac2020_2]
Priority: -- → P3

According to the Apple header file listing a11y constants, these are the current text-attributes:

/* Text-specific attributes
 */
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedTextAttribute;		//(NSString *) - selected text
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedTextRangeAttribute;	//(NSValue *)  - (rangeValue) range of selected text
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityNumberOfCharactersAttribute;	//(NSNumber *) - number of characters
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityVisibleCharacterRangeAttribute;	//(NSValue *)  - (rangeValue) range of visible text
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySharedTextUIElementsAttribute;	//(NSArray *)  - text views sharing text
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySharedCharacterRangeAttribute;	//(NSValue *)  - (rangeValue) part of shared text in this view
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilityInsertionPointLineNumberAttribute;	//(NSNumber *) - line# containing caret
APPKIT_EXTERN NSAccessibilityAttributeName const NSAccessibilitySelectedTextRangesAttribute	//(NSArray<NSValue *> *) - array of NSValue (rangeValue) ranges of selected text
NS_AVAILABLE_MAC(10_5);

found in: MacOSX10.14.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityConstants.h

Severity: normal → S3
Priority: P3 → P1

This needs to be done with the undocumented TextMarker API. That work is happening in other bugs like bug 1649575. Closing this one because it is pretty broad and isn't scoped to any specific text feature.

Status: NEW → RESOLVED
Closed: 9 days ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.