AX: [iOS] Implement a way to retrieve a text marker range with desired text that...
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 17:58:25 +0000 (17:58 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Jul 2017 17:58:25 +0000 (17:58 +0000)
commit9ce7003e1bc27bbbf5c554fdbf46ce3aec9ad8cb
tree137626828503379b34b68adef8ec4dd6ad1cba28
parent6e869eade78aa2483947450b9eed1bb43b3b47a9
AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
https://bugs.webkit.org/show_bug.cgi?id=174393
<rdar://problem/33248006>

Reviewed by Chris Fleizach.

Source/WebCore:

Used the existing findClosestPlainText function to search the range on iOS.
Also exposed a function on the iOS wrapper to return the selection rects of
the result range from the searching.

Test: accessibility/ios-simulator/text-marker-range-matches-text.html

* accessibility/AXObjectCache.cpp:
(WebCore::visiblePositionForPositionWithOffset):
(WebCore::AXObjectCache::rangeMatchesTextNearRange):
* accessibility/AXObjectCache.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
(-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
(-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
(-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(textMarkerRangeMatchesTextNearMarkersCallback):
(AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers):

LayoutTests:

* accessibility/ios-simulator/text-marker-range-matches-text-expected.txt: Added.
* accessibility/ios-simulator/text-marker-range-matches-text.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/ios-simulator/text-marker-range-matches-text-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/ios-simulator/text-marker-range-matches-text.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm