AX: [IOS] Implement next/previous text marker functions using TextIterator
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jan 2016 08:35:10 +0000 (08:35 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jan 2016 08:35:10 +0000 (08:35 +0000)
commit315aef7f69d7680223ada1752b453c189cfd19e8
tree1876cf536b90f26cb416cbb2e41c9bbd5fcefd25
parent6cf9720e8571b54b65677cb1c24abc7b866bbe82
AX: [IOS] Implement next/previous text marker functions using TextIterator
https://bugs.webkit.org/show_bug.cgi?id=153292
<rdar://problem/24268243>

Reviewed by Chris Fleizach.

Source/WebCore:

Added support for the refactored next/previous text marker functions on iOS. And
made text marker tests working on iOS.
Also, fixed an issue in AXObjectCache where creating a range with a replaced node
at the start or end might exclude that node.

Tests: accessibility/text-marker/text-marker-previous-next.html
       accessibility/text-marker/text-marker-with-user-select-none.html

* accessibility/AXObjectCache.cpp:
(WebCore::characterOffsetsInOrder):
(WebCore::resetNodeAndOffsetForReplacedNode):
(WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):
(+[WebAccessibilityTextMarker textMarkerWithCharacterOffset:cache:]):
(+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]):
(-[WebAccessibilityTextMarker dataRepresentation]):
(-[WebAccessibilityTextMarker visiblePosition]):
(-[WebAccessibilityTextMarker characterOffset]):
(-[WebAccessibilityTextMarker isIgnored]):
(-[WebAccessibilityTextMarker accessibilityObject]):
(-[WebAccessibilityTextMarker description]):
(-[WebAccessibilityObjectWrapper stringForTextMarkers:]):
(blockquoteLevel):
(-[WebAccessibilityObjectWrapper textMarkerRange]):
(-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
(-[WebAccessibilityObjectWrapper nextMarkerForMarker:]):
(-[WebAccessibilityObjectWrapper previousMarkerForMarker:]):
(-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
(-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
(-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
(-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
(-[WebAccessibilityObjectWrapper lengthForTextMarkers:]):
(-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]):
(-[WebAccessibilityObjectWrapper textMarkerRangeForMarkers:]):
(-[WebAccessibilityObjectWrapper accessibilityIdentifier]):

Tools:

Made text marker tests available on iOS.

* DumpRenderTree/AccessibilityTextMarker.h:
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/ios/AccessibilityTextMarkerIOS.mm: Added.
(AccessibilityTextMarker::AccessibilityTextMarker):
(AccessibilityTextMarker::~AccessibilityTextMarker):
(AccessibilityTextMarker::isEqual):
(AccessibilityTextMarker::platformTextMarker):
(AccessibilityTextMarkerRange::AccessibilityTextMarkerRange):
(AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange):
(AccessibilityTextMarkerRange::isEqual):
(AccessibilityTextMarkerRange::platformTextMarkerRange):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::pathDescription):
(AccessibilityUIElement::lineTextMarkerRangeForTextMarker):
(AccessibilityUIElement::textMarkerRangeForElement):
(AccessibilityUIElement::selectedTextMarkerRange):
(AccessibilityUIElement::resetSelectedTextMarkerRange):
(AccessibilityUIElement::textMarkerRangeLength):
(AccessibilityUIElement::textMarkerRangeForMarkers):
(AccessibilityUIElement::startTextMarkerForTextMarkerRange):
(AccessibilityUIElement::endTextMarkerForTextMarkerRange):
(AccessibilityUIElement::accessibilityElementForTextMarker):
(AccessibilityUIElement::endTextMarkerForBounds):
(AccessibilityUIElement::startTextMarkerForBounds):
(AccessibilityUIElement::textMarkerForPoint):
(AccessibilityUIElement::previousTextMarker):
(AccessibilityUIElement::nextTextMarker):
(AccessibilityUIElement::stringForTextMarkerRange):
(AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute):
(AccessibilityUIElement::indexForTextMarker):
(AccessibilityUIElement::isTextMarkerValid):
(AccessibilityUIElement::textMarkerForIndex):
(AccessibilityUIElement::startTextMarker):
(AccessibilityUIElement::endTextMarker):
(AccessibilityUIElement::setSelectedVisibleTextRange):
(AccessibilityUIElement::getLinkedUIElements):
* DumpRenderTree/mac/AccessibilityTextMarkerMac.mm:
(AccessibilityTextMarkerRange::platformTextMarkerRange):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::removeSelection):
(AccessibilityUIElement::lineTextMarkerRangeForTextMarker):
(AccessibilityUIElement::setSelectedVisibleTextRange):
(AccessibilityUIElement::supportedActions):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::textMarkerRangeForElement):
(WTR::AccessibilityUIElement::textMarkerRangeLength):
(WTR::AccessibilityUIElement::previousTextMarker):
(WTR::AccessibilityUIElement::nextTextMarker):
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::endTextMarkerForBounds):
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
(WTR::AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute):

LayoutTests:

* accessibility/mac/previous-next-text-marker-expected.txt: Removed.
* accessibility/mac/previous-next-text-marker.html: Removed.
* accessibility/mac/text-marker-with-user-select-none-expected.txt: Removed.
* accessibility/mac/text-marker-with-user-select-none.html: Removed.
* accessibility/text-marker: Added.
* accessibility/text-marker/text-marker-previous-next-expected.txt: Added.
* accessibility/text-marker/text-marker-previous-next.html: Added.
* accessibility/text-marker/text-marker-with-user-select-none-expected.txt: Added.
* accessibility/text-marker/text-marker-with-user-select-none.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/text-marker/text-marker-previous-next-expected.txt [moved from LayoutTests/accessibility/mac/previous-next-text-marker-expected.txt with 73% similarity]
LayoutTests/accessibility/text-marker/text-marker-previous-next.html [moved from LayoutTests/accessibility/mac/previous-next-text-marker.html with 76% similarity]
LayoutTests/accessibility/text-marker/text-marker-with-user-select-none-expected.txt [moved from LayoutTests/accessibility/mac/text-marker-with-user-select-none-expected.txt with 100% similarity]
LayoutTests/accessibility/text-marker/text-marker-with-user-select-none.html [moved from LayoutTests/accessibility/mac/text-marker-with-user-select-none.html with 100% similarity]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityTextMarker.h
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/DumpRenderTree/ios/AccessibilityTextMarkerIOS.mm [new file with mode: 0644]
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm