AX: Spell check and style attributes should be optional when fetching attributed string
https://bugs.webkit.org/show_bug.cgi?id=160744
Patch by Doug Russell <doug@getitdownonpaper.com> on 2018-02-27
Reviewed by Chris Fleizach.
The overhead of fetching a spell checked attributed string via AX API is substantial.
In some cases on the order of 7/8 of the total time spent fetching the string.
This change introduces the new attribute AXAttributedStringForTextMarkerRangeWithOptions which accepts an NSDictionary as it's parameter with keys "AXTextMarkerRange" (AXTextMarkerRangeRef) and "AXSpellCheck" (NSNumber(BOOL)).
AXAttributedStringForTextMarkerRange will remain unchanged.
Source/WebCore:
Tests: accessibility/mac/attributed-string/attributed-string-for-range-with-options.html
accessibility/mac/attributed-string/attributed-string-for-range.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributedStringAppendText):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
(-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Deleted.
Tools:
* DumpRenderTree/AccessibilityUIElement.cpp:
(attributedStringForTextMarkerRangeCallback):
(attributedStringForTextMarkerRangeWithOptionsCallback):
(AccessibilityUIElement::attributedStringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::attributedStringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(createJSStringRef):
(AccessibilityUIElement::attributedStringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::createJSStringRef):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRange):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeWithOptions):
LayoutTests:
* accessibility/mac/attributed-string: Added.
* accessibility/mac/attributed-string/attributed-string-for-range-expected.txt: Added.
* accessibility/mac/attributed-string/attributed-string-for-range-with-options-expected.txt: Added.
* accessibility/mac/attributed-string/attributed-string-for-range-with-options.html: Added.
* accessibility/mac/attributed-string/attributed-string-for-range.html: Added.
* accessibility/mac/bounds-for-range-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229080
268f45cc-cd09-0410-ab3c-
d52691b4dbfc