AX: Spell check and style attributes should be optional when fetching attributed...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2018 22:57:14 +0000 (22:57 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2018 22:57:14 +0000 (22:57 +0000)
commit5a507a8bd23b96535c407b83296348889cdcd39e
tree452f25de01c8524ff0a6f7d76e9290e70a026f54
parent2a1adf53857bd0a114f1a005d4c0d5edfc70b81f
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
18 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/mac/attributed-string/attributed-string-for-range-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/attributed-string/attributed-string-for-range-with-options-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/attributed-string/attributed-string-for-range-with-options.html [new file with mode: 0644]
LayoutTests/accessibility/mac/attributed-string/attributed-string-for-range.html [new file with mode: 0644]
LayoutTests/accessibility/mac/bounds-for-range-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm