<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195405] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195405">195405</a></dd>
<dt>Author</dt> <dd>n_wang@apple.com</dd>
<dt>Date</dt> <dd>2016-01-21 00:35:10 -0800 (Thu, 21 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: [IOS] Implement next/previous text marker functions using TextIterator
https://bugs.webkit.org/show_bug.cgi?id=153292
&lt;rdar://problem/24268243&gt;

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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm">trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityTextMarkerh">trunk/Tools/DumpRenderTree/AccessibilityTextMarker.h</a></li>
<li><a href="#trunkToolsDumpRenderTreeDumpRenderTreexcodeprojprojectpbxproj">trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityTextMarkerMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm">trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/accessibility/text-marker/</li>
<li><a href="#trunkLayoutTestsaccessibilitytextmarkertextmarkerpreviousnextexpectedtxt">trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytextmarkertextmarkerpreviousnexthtml">trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytextmarkertextmarkerwithuserselectnoneexpectedtxt">trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitytextmarkertextmarkerwithuserselectnonehtml">trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none.html</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosAccessibilityTextMarkerIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityTextMarkerIOS.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitymacpreviousnexttextmarkerexpectedtxt">trunk/LayoutTests/accessibility/mac/previous-next-text-marker-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacpreviousnexttextmarkerhtml">trunk/LayoutTests/accessibility/mac/previous-next-text-marker.html</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymactextmarkerwithuserselectnoneexpectedtxt">trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymactextmarkerwithuserselectnonehtml">trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/ChangeLog        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-01-21  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: [IOS] Implement next/previous text marker functions using TextIterator
+        https://bugs.webkit.org/show_bug.cgi?id=153292
+        &lt;rdar://problem/24268243&gt;
+
+        Reviewed by Chris Fleizach.
+
+        * 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:
+
</ins><span class="cx"> 2016-01-20  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http://victordarras.fr/cssgame/ doesn't work in Safari.
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacpreviousnexttextmarkerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/accessibility/mac/previous-next-text-marker-expected.txt (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/previous-next-text-marker-expected.txt        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/accessibility/mac/previous-next-text-marker-expected.txt        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-text
-
-text1
-c  d
-
-can't select
-This tests the next/previous text marker functions are implemented correctly.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS text.textMarkerRangeLength(textMarkerRange) is 4
-PASS text.accessibilityElementForTextMarker(startMarker).isEqual(text) is true
-PASS text.accessibilityElementForTextMarker(endMarker).isEqual(text) is true
-PASS element.stringValue is 'AXValue: '
-PASS element.stringValue is 'AXValue: text1'
-PASS element.stringValue is 'AXValue: '
-PASS element.stringValue is 'AXValue: text'
-PASS text2.textMarkerRangeLength(textMarkerRange2) is 5
-Object string for range: c [ATTACHMENT] d
-AXValue: c 
-AXValue: c 
-AXValue: 
-AXValue:  d
-AXValue: 
-AXValue: c 
-AXValue: c 
-AXValue: text1
-PASS text3.stringForTextMarkerRange(markerRange) is 'ect'
-PASS text3.stringForTextMarkerRange(markerRange) is 'sel'
-PASS !psw.accessibilityElementForTextMarker(start) is true
-PASS text2.accessibilityElementForTextMarker(currentMarker).isEqual(text3) is true
-PASS text2.accessibilityElementForTextMarker(currentMarker).isEqual(text2.childAtIndex(2)) is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacpreviousnexttextmarkerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/accessibility/mac/previous-next-text-marker.html (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/previous-next-text-marker.html        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/accessibility/mac/previous-next-text-marker.html        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,136 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;style&gt;
-.userselect { user-select: none; -webkit-user-select: none; }
-&lt;/style&gt;
-&lt;body id=&quot;body&quot;&gt;
-
-&lt;div id=&quot;text&quot; tabindex=&quot;0&quot;&gt;text&lt;/div&gt;
-&lt;br&gt;
-text1
-
-&lt;div id=&quot;text2&quot;&gt;
-c &lt;img src=&quot;#&quot; aria-label=&quot;blah&quot; style=&quot;background-color: #aaaaaa; width: 100px; height: 100px;&quot;&gt; d
-&lt;/div&gt;
-
-&lt;input type=&quot;password&quot; id=&quot;psw&quot;&gt;
-
-&lt;div class=&quot;userselect&quot; id=&quot;text3&quot;&gt;can't select&lt;/div&gt;
-
-&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-
-&lt;script&gt;
-
-    description(&quot;This tests the next/previous text marker functions are implemented correctly.&quot;);
-    
-    if (window.accessibilityController) {
-        
-        var text = accessibilityController.accessibleElementById(&quot;text&quot;);
-        // Get the actual text node.
-        text = text.childAtIndex(0);
-        
-        // Check that we can get the start/end marker for this range.
-        var textMarkerRange = text.textMarkerRangeForElement(text);
-        shouldBe(&quot;text.textMarkerRangeLength(textMarkerRange)&quot;, &quot;4&quot;);
-        
-        var startMarker = text.startTextMarkerForTextMarkerRange(textMarkerRange);
-        var endMarker = text.endTextMarkerForTextMarkerRange(textMarkerRange);
-        shouldBeTrue(&quot;text.accessibilityElementForTextMarker(startMarker).isEqual(text)&quot;);
-        shouldBeTrue(&quot;text.accessibilityElementForTextMarker(endMarker).isEqual(text)&quot;);
-        
-        // Check next text marker. (Advance 5 characters, it will land at &lt;br&gt;.)
-        var currentMarker = startMarker;
-        for (var i = 0; i &lt; 5; i++) {
-            currentMarker = text.nextTextMarker(currentMarker);
-        }
-        var element = text.accessibilityElementForTextMarker(currentMarker);
-        shouldBe(&quot;element.stringValue&quot;, &quot;'AXValue: '&quot;);
-        
-        // Advance one more character, it will lande at &quot;t&quot; in &quot;text1&quot;.
-        currentMarker = text.nextTextMarker(currentMarker);
-        element = text.accessibilityElementForTextMarker(currentMarker);
-        shouldBe(&quot;element.stringValue&quot;, &quot;'AXValue: text1'&quot;);
-        
-        // Check previous text marker. (Traverse backwards one character, it will land at &lt;br&gt;.)
-        currentMarker = text.previousTextMarker(currentMarker);
-        element = text.accessibilityElementForTextMarker(currentMarker);
-        shouldBe(&quot;element.stringValue&quot;, &quot;'AXValue: '&quot;);
-        
-        // Traverse backwards one more character, it will land at the last character of &quot;text&quot;.
-        currentMarker = text.previousTextMarker(currentMarker);
-        element = text.accessibilityElementForTextMarker(currentMarker);
-        shouldBe(&quot;element.stringValue&quot;, &quot;'AXValue: text'&quot;);
-        
-        // Check the case with replaced node
-        var text2 = accessibilityController.accessibleElementById(&quot;text2&quot;);
-        var textMarkerRange2 = text2.textMarkerRangeForElement(text2);
-        shouldBe(&quot;text2.textMarkerRangeLength(textMarkerRange2)&quot;, &quot;5&quot;);
-        var str = text2.stringForTextMarkerRange(textMarkerRange2).replace(String.fromCharCode(65532), &quot;[ATTACHMENT]&quot;);
-        debug(&quot;Object string for range: &quot; + str);
-        
-        currentMarker = text2.startTextMarkerForTextMarkerRange(textMarkerRange2);
-        // Advance 4 characters, it will land at first character of &quot; d&quot;.
-        for (var i = 0; i &lt; 4; i++) {
-            currentMarker = text2.nextTextMarker(currentMarker);
-            element = text2.accessibilityElementForTextMarker(currentMarker);
-            debug(element.stringValue);
-        }
-        
-        // Traverse backwards 4 characters, it will land at the last character of &quot;text1&quot;.
-        for (var i = 0; i &lt; 4; i++) {
-            currentMarker = text2.previousTextMarker(currentMarker);
-            element = text2.accessibilityElementForTextMarker(currentMarker);
-            debug(element.stringValue);
-        }
-        
-        // Check the case with user-select:none, nextTextMarker/previousTextMarker should still work.
-        var text3 = accessibilityController.accessibleElementById(&quot;text3&quot;);
-        text3 = text3.childAtIndex(0);
-        // Advance to land at user-select:none node.
-        var marker1, marker2;
-        for (var i = 0; i &lt; 17; i++) {
-            currentMarker = text3.nextTextMarker(currentMarker);
-            // i == 13, it should land on &quot;e&quot;, and i == 16, it should land on &quot;t&quot;
-            if (i == 13) {
-                marker1 = currentMarker;
-            }
-        }
-        marker2 = currentMarker;
-        var markerRange = text3.textMarkerRangeForMarkers(marker1, marker2);
-        shouldBe(&quot;text3.stringForTextMarkerRange(markerRange)&quot;, &quot;'ect'&quot;);
-        // Iterate backwards the second marker for 6 characters, the range should be &quot;sel&quot;
-        for (var i = 0; i &lt; 6; i++) {
-            currentMarker = text3.previousTextMarker(currentMarker);
-        }
-        marker2 = currentMarker;
-        markerRange = text3.textMarkerRangeForMarkers(marker1, marker2);
-        shouldBe(&quot;text3.stringForTextMarkerRange(markerRange)&quot;, &quot;'sel'&quot;);
-
-        // Check the case with password field.
-        var psw = accessibilityController.accessibleElementById(&quot;psw&quot;);
-        var textMarkerRange3 = psw.textMarkerRangeForElement(psw);
-        var start = psw.startTextMarkerForTextMarkerRange(textMarkerRange3);
-        shouldBeTrue(&quot;!psw.accessibilityElementForTextMarker(start)&quot;);
-        
-        // Check next/previous text marker call will skip password field
-        // We start from text2 and advance 6 characters, it should skip the password field and land on text3.
-        currentMarker = text2.startTextMarkerForTextMarkerRange(textMarkerRange2);
-        for (var i = 0; i &lt; 6; i++) {
-            currentMarker = text2.nextTextMarker(currentMarker);
-        }
-        shouldBeTrue(&quot;text2.accessibilityElementForTextMarker(currentMarker).isEqual(text3)&quot;);
-        // Check previous text marker, it should land on &quot; d&quot; node.
-        currentMarker = text2.previousTextMarker(currentMarker);
-        shouldBeTrue(&quot;text2.accessibilityElementForTextMarker(currentMarker).isEqual(text2.childAtIndex(2))&quot;);
-        
-    }
-
-&lt;/script&gt;
-
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymactextmarkerwithuserselectnoneexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none-expected.txt (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none-expected.txt        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none-expected.txt        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-hello test world test hello
-link to here
-test
-This tests that accessibility text markers still work even when user-select:none is set.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS textElement.textMarkerRangeLength(textMarkerRange) is 45
-PASS text is &quot;hello test world test hello\nlink to here\ntest&quot;
-PASS text is 'h'
-PASS element.isEqual(textElement.childAtIndex(0)) is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymactextmarkerwithuserselectnonehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none.html (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none.html        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none.html        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,49 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body id=&quot;body&quot;&gt;
-
-&lt;div id=&quot;text&quot; style=&quot;-webkit-user-select:none&quot;&gt;
-
-hello test &lt;b&gt;world&lt;/b&gt; test hello&lt;br&gt;
-&lt;a href=&quot;#&quot;&gt;link&lt;/a&gt; to &lt;a href=&quot;#&quot;&gt;here&lt;/a&gt;&lt;br&gt;
-test
-
-&lt;/div&gt;
-
-
-
-&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-
-&lt;script&gt;
-
-    description(&quot;This tests that accessibility text markers still work even when user-select:none is set.&quot;);
-
-    if (window.accessibilityController) {
-
-          var textElement = accessibilityController.accessibleElementById(&quot;text&quot;);
-          var textMarkerRange = textElement.textMarkerRangeForElement(textElement);
-          shouldBe(&quot;textElement.textMarkerRangeLength(textMarkerRange)&quot;, &quot;45&quot;);
-
-          var startMarker = textElement.startTextMarkerForTextMarkerRange(textMarkerRange);
-          var endMarker = textElement.endTextMarkerForTextMarkerRange(textMarkerRange);
-          textMarkerRange = textElement.textMarkerRangeForMarkers(startMarker, endMarker);
-          var text = textElement.stringForTextMarkerRange(textMarkerRange);
-          shouldBeEqualToString(&quot;text&quot;, &quot;hello test world test hello\nlink to here\ntest&quot;);
-
-          var nextMarker = textElement.nextTextMarker(startMarker);
-          textMarkerRange = textElement.textMarkerRangeForMarkers(startMarker, nextMarker);
-          text = textElement.stringForTextMarkerRange(textMarkerRange);
-          shouldBe(&quot;text&quot;, &quot;'h'&quot;);
-          var element = textElement.accessibilityElementForTextMarker(nextMarker);
-          shouldBeTrue(&quot;element.isEqual(textElement.childAtIndex(0))&quot;);
-    }
-
-&lt;/script&gt;
-
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytextmarkertextmarkerpreviousnextexpectedtxtfromrev195398trunkLayoutTestsaccessibilitymacpreviousnexttextmarkerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next-expected.txt (from rev 195398, trunk/LayoutTests/accessibility/mac/previous-next-text-marker-expected.txt) (0 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next-expected.txt        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+text
+
+text1
+c  d
+
+can't select
+This tests the next/previous text marker functions are implemented correctly.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS text.textMarkerRangeLength(textMarkerRange) is 4
+PASS text.accessibilityElementForTextMarker(startMarker).isEqual(text) is true
+PASS text.accessibilityElementForTextMarker(endMarker).isEqual(text) is true
+PASS text.stringForTextMarkerRange(markerRange) is ''
+PASS text.stringForTextMarkerRange(markerRange) is 't'
+PASS text.stringForTextMarkerRange(markerRange) is ''
+PASS text.stringForTextMarkerRange(markerRange) is 't'
+PASS text2.textMarkerRangeLength(textMarkerRange2) is 5
+Object string for range: c [ATTACHMENT] d
+PASS text2.stringForTextMarkerRange(markerRange) is 'd'
+PASS text2.stringForTextMarkerRange(markerRange) is '1'
+PASS text3.stringForTextMarkerRange(markerRange) is 'ect'
+PASS text3.stringForTextMarkerRange(markerRange) is 'sel'
+PASS !psw.accessibilityElementForTextMarker(start) is true
+PASS text2.accessibilityElementForTextMarker(currentMarker).isEqual(text3) is true
+PASS text2.accessibilityElementForTextMarker(currentMarker).isEqual(text2.childAtIndex(2)) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytextmarkertextmarkerpreviousnexthtmlfromrev195398trunkLayoutTestsaccessibilitymacpreviousnexttextmarkerhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next.html (from rev 195398, trunk/LayoutTests/accessibility/mac/previous-next-text-marker.html) (0 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/text-marker/text-marker-previous-next.html        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;style&gt;
+.userselect { user-select: none; -webkit-user-select: none; }
+&lt;/style&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div id=&quot;text&quot; tabindex=&quot;0&quot;&gt;text&lt;/div&gt;
+&lt;br&gt;
+text1
+
+&lt;div id=&quot;text2&quot;&gt;
+c &lt;img src=&quot;#&quot; aria-label=&quot;blah&quot; style=&quot;background-color: #aaaaaa; width: 100px; height: 100px;&quot;&gt; d
+&lt;/div&gt;
+
+&lt;input type=&quot;password&quot; id=&quot;psw&quot;&gt;
+
+&lt;div class=&quot;userselect&quot; id=&quot;text3&quot;&gt;can't select&lt;/div&gt;
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+    description(&quot;This tests the next/previous text marker functions are implemented correctly.&quot;);
+    
+    if (window.accessibilityController) {
+        
+        var text = accessibilityController.accessibleElementById(&quot;text&quot;);
+        // Get the actual text node.
+        text = text.childAtIndex(0);
+        
+        // Check that we can get the start/end marker for this range.
+        var textMarkerRange = text.textMarkerRangeForElement(text);
+        shouldBe(&quot;text.textMarkerRangeLength(textMarkerRange)&quot;, &quot;4&quot;);
+        
+        var startMarker = text.startTextMarkerForTextMarkerRange(textMarkerRange);
+        var endMarker = text.endTextMarkerForTextMarkerRange(textMarkerRange);
+        shouldBeTrue(&quot;text.accessibilityElementForTextMarker(startMarker).isEqual(text)&quot;);
+        shouldBeTrue(&quot;text.accessibilityElementForTextMarker(endMarker).isEqual(text)&quot;);
+        
+        // Check next text marker. (Advance 5 characters, it will land at &lt;br&gt;.)
+        var currentMarker = startMarker;
+        var previousMarker, markerRange;
+        for (var i = 0; i &lt; 5; i++) {
+            previousMarker = currentMarker;
+            currentMarker = text.nextTextMarker(currentMarker);
+        }
+        markerRange = text.textMarkerRangeForMarkers(previousMarker, currentMarker);
+        shouldBe(&quot;text.stringForTextMarkerRange(markerRange)&quot;, &quot;''&quot;);
+        
+        // Advance one more character, it will lande at &quot;t&quot; in &quot;text1&quot;.
+        previousMarker = currentMarker;
+        currentMarker = text.nextTextMarker(currentMarker);
+        markerRange = text.textMarkerRangeForMarkers(previousMarker, currentMarker);
+        shouldBe(&quot;text.stringForTextMarkerRange(markerRange)&quot;, &quot;'t'&quot;);
+        
+        // Check previous text marker. (Traverse backwards one character, it will land at &lt;br&gt;.)
+        previousMarker = text.previousTextMarker(previousMarker);
+        currentMarker = text.previousTextMarker(currentMarker);
+        markerRange = text.textMarkerRangeForMarkers(previousMarker, currentMarker);
+        shouldBe(&quot;text.stringForTextMarkerRange(markerRange)&quot;, &quot;''&quot;);
+        
+        // Traverse backwards one more character, it will land at the last character of &quot;text&quot;.
+        previousMarker = text.previousTextMarker(previousMarker);
+        currentMarker = text.previousTextMarker(currentMarker);
+        markerRange = text.textMarkerRangeForMarkers(previousMarker, currentMarker);
+        shouldBe(&quot;text.stringForTextMarkerRange(markerRange)&quot;, &quot;'t'&quot;);
+        
+        // Check the case with replaced node
+        var text2 = accessibilityController.accessibleElementById(&quot;text2&quot;);
+        var textMarkerRange2 = text2.textMarkerRangeForElement(text2);
+        shouldBe(&quot;text2.textMarkerRangeLength(textMarkerRange2)&quot;, &quot;5&quot;);
+        var str = text2.stringForTextMarkerRange(textMarkerRange2).replace(String.fromCharCode(65532), &quot;[ATTACHMENT]&quot;);
+        debug(&quot;Object string for range: &quot; + str);
+        
+        currentMarker = text2.startTextMarkerForTextMarkerRange(textMarkerRange2);
+        // Advance 5 characters, it will land at &quot;d&quot;.
+        for (var i = 0; i &lt; 5; i++) {
+            previousMarker = currentMarker;
+            currentMarker = text2.nextTextMarker(currentMarker);
+        }
+        markerRange = text2.textMarkerRangeForMarkers(previousMarker, currentMarker);
+        shouldBe(&quot;text2.stringForTextMarkerRange(markerRange)&quot;, &quot;'d'&quot;);
+        
+        // Traverse backwards 5 characters, it will land at the last character of &quot;text1&quot;.
+        for (var i = 0; i &lt; 5; i++) {
+            previousMarker = text2.previousTextMarker(previousMarker);
+            currentMarker = text2.previousTextMarker(currentMarker);
+        }
+        markerRange = text2.textMarkerRangeForMarkers(previousMarker, currentMarker);
+        shouldBe(&quot;text2.stringForTextMarkerRange(markerRange)&quot;, &quot;'1'&quot;);
+        
+        // Check the case with user-select:none, nextTextMarker/previousTextMarker should still work.
+        var text3 = accessibilityController.accessibleElementById(&quot;text3&quot;);
+        text3 = text3.childAtIndex(0);
+        // Advance to land at user-select:none node.
+        var marker1, marker2;
+        for (var i = 0; i &lt; 17; i++) {
+            currentMarker = text3.nextTextMarker(currentMarker);
+            // i == 13, it should land on &quot;e&quot;, and i == 16, it should land on &quot;t&quot;
+            if (i == 13) {
+                marker1 = currentMarker;
+            }
+        }
+        marker2 = currentMarker;
+        markerRange = text3.textMarkerRangeForMarkers(marker1, marker2);
+        shouldBe(&quot;text3.stringForTextMarkerRange(markerRange)&quot;, &quot;'ect'&quot;);
+        // Iterate backwards the second marker for 6 characters, the range should be &quot;sel&quot;
+        for (var i = 0; i &lt; 6; i++) {
+            currentMarker = text3.previousTextMarker(currentMarker);
+        }
+        marker2 = currentMarker;
+        markerRange = text3.textMarkerRangeForMarkers(marker1, marker2);
+        shouldBe(&quot;text3.stringForTextMarkerRange(markerRange)&quot;, &quot;'sel'&quot;);
+
+        // Check the case with password field.
+        var psw = accessibilityController.accessibleElementById(&quot;psw&quot;);
+        var textMarkerRange3 = psw.textMarkerRangeForElement(psw);
+        var start = psw.startTextMarkerForTextMarkerRange(textMarkerRange3);
+        shouldBeTrue(&quot;!psw.accessibilityElementForTextMarker(start)&quot;);
+        
+        // Check next/previous text marker call will skip password field
+        // We start from text2 and advance 6 characters, it should skip the password field and land on text3.
+        currentMarker = text2.startTextMarkerForTextMarkerRange(textMarkerRange2);
+        for (var i = 0; i &lt; 6; i++) {
+            currentMarker = text2.nextTextMarker(currentMarker);
+        }
+        shouldBeTrue(&quot;text2.accessibilityElementForTextMarker(currentMarker).isEqual(text3)&quot;);
+        // Check previous text marker, it should land on &quot; d&quot; node.
+        currentMarker = text2.previousTextMarker(currentMarker);
+        shouldBeTrue(&quot;text2.accessibilityElementForTextMarker(currentMarker).isEqual(text2.childAtIndex(2))&quot;);
+        
+    }
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytextmarkertextmarkerwithuserselectnoneexpectedtxtfromrev195398trunkLayoutTestsaccessibilitymactextmarkerwithuserselectnoneexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none-expected.txt (from rev 195398, trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none-expected.txt) (0 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none-expected.txt                                (rev 0)
+++ trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none-expected.txt        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+hello test world test hello
+link to here
+test
+This tests that accessibility text markers still work even when user-select:none is set.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS textElement.textMarkerRangeLength(textMarkerRange) is 45
+PASS text is &quot;hello test world test hello\nlink to here\ntest&quot;
+PASS text is 'h'
+PASS element.isEqual(textElement.childAtIndex(0)) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitytextmarkertextmarkerwithuserselectnonehtmlfromrev195398trunkLayoutTestsaccessibilitymactextmarkerwithuserselectnonehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none.html (from rev 195398, trunk/LayoutTests/accessibility/mac/text-marker-with-user-select-none.html) (0 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none.html                                (rev 0)
+++ trunk/LayoutTests/accessibility/text-marker/text-marker-with-user-select-none.html        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body id=&quot;body&quot;&gt;
+
+&lt;div id=&quot;text&quot; style=&quot;-webkit-user-select:none&quot;&gt;
+
+hello test &lt;b&gt;world&lt;/b&gt; test hello&lt;br&gt;
+&lt;a href=&quot;#&quot;&gt;link&lt;/a&gt; to &lt;a href=&quot;#&quot;&gt;here&lt;/a&gt;&lt;br&gt;
+test
+
+&lt;/div&gt;
+
+
+
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+
+&lt;script&gt;
+
+    description(&quot;This tests that accessibility text markers still work even when user-select:none is set.&quot;);
+
+    if (window.accessibilityController) {
+
+          var textElement = accessibilityController.accessibleElementById(&quot;text&quot;);
+          var textMarkerRange = textElement.textMarkerRangeForElement(textElement);
+          shouldBe(&quot;textElement.textMarkerRangeLength(textMarkerRange)&quot;, &quot;45&quot;);
+
+          var startMarker = textElement.startTextMarkerForTextMarkerRange(textMarkerRange);
+          var endMarker = textElement.endTextMarkerForTextMarkerRange(textMarkerRange);
+          textMarkerRange = textElement.textMarkerRangeForMarkers(startMarker, endMarker);
+          var text = textElement.stringForTextMarkerRange(textMarkerRange);
+          shouldBeEqualToString(&quot;text&quot;, &quot;hello test world test hello\nlink to here\ntest&quot;);
+
+          var nextMarker = textElement.nextTextMarker(startMarker);
+          textMarkerRange = textElement.textMarkerRangeForMarkers(startMarker, nextMarker);
+          text = textElement.stringForTextMarkerRange(textMarkerRange);
+          shouldBe(&quot;text&quot;, &quot;'h'&quot;);
+          var element = textElement.accessibilityElementForTextMarker(nextMarker);
+          shouldBeTrue(&quot;element.isEqual(textElement.childAtIndex(0))&quot;);
+    }
+
+&lt;/script&gt;
+
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -2346,6 +2346,9 @@
</span><span class="cx"> webkit.org/b/146887 accessibility/aria-roledescription.html [ Failure ]
</span><span class="cx"> webkit.org/b/146887 accessibility/list-detection.html [ Failure ]
</span><span class="cx"> 
</span><ins>+# Text marker tests are not supported
+webkit.org/b/153292 accessibility/text-marker [ Skip ]
+
</ins><span class="cx"> # This test hardcodes the result of a platform-dependent font lookup algorithm.
</span><span class="cx"> fast/text/fallback-language-han.html [ Skip ]
</span><span class="cx"> fast/text/fallback-language-han-2.html [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -609,6 +609,9 @@
</span><span class="cx"> # ARIA 1.1 table related attributes are not supported
</span><span class="cx"> webkit.org/b/148967 accessibility/aria-table-attributes.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Text marker tests are not supported
+webkit.org/b/153292 accessibility/text-marker [ Skip ]
+
</ins><span class="cx"> # WebKitGTK+ needs WOFF2 support.
</span><span class="cx"> webkit.org/b/152616 fast/text/woff2.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -2764,6 +2764,9 @@
</span><span class="cx"> # Enable &quot;aria-table-attributes&quot; test for iOS
</span><span class="cx"> webkit.org/b/150366 accessibility/aria-table-attributes.html [ Pass ]
</span><span class="cx"> 
</span><ins>+# Enable Text marker tests for iOS
+webkit.org/b/153292 accessibility/text-marker [ Pass ]
+
</ins><span class="cx"> # More flaky tests (Sept 18, 2015)
</span><span class="cx"> 
</span><span class="cx"> fast/forms/select-element-focus-ring.html [ Failure Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1718,6 +1718,9 @@
</span><span class="cx"> webkit.org/b/138566 accessibility/aria-modal.html [ Skip ]
</span><span class="cx"> webkit.org/b/138566 accessibility/aria-modal-multiple-dialogs.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# Text marker tests are not supported
+webkit.org/b/153292 accessibility/text-marker [ Skip ]
+
</ins><span class="cx"> ################################################################################
</span><span class="cx"> #######################   End Accessibility Issues   ###########################
</span><span class="cx"> ################################################################################
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Source/WebCore/ChangeLog        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-01-21  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: [IOS] Implement next/previous text marker functions using TextIterator
+        https://bugs.webkit.org/show_bug.cgi?id=153292
+        &lt;rdar://problem/24268243&gt;
+
+        Reviewed by Chris Fleizach.
+
+        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]):
+
</ins><span class="cx"> 2016-01-20  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         http://victordarras.fr/cssgame/ doesn't work in Safari.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1545,6 +1545,23 @@
</span><span class="cx">     return range1-&gt;compareBoundaryPoints(Range::START_TO_START, range2.get(), IGNORE_EXCEPTION) &lt;= 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static Node* resetNodeAndOffsetForReplacedNode(Node* replacedNode, int&amp; offset, int characterCount)
+{
+    // Use this function to include the replaced node itself in the range we are creating.
+    if (!replacedNode)
+        return nullptr;
+    
+    RefPtr&lt;Range&gt; nodeRange = AXObjectCache::rangeForNodeContents(replacedNode);
+    int nodeLength = TextIterator::rangeLength(nodeRange.get());
+    offset = characterCount &lt;= nodeLength ? replacedNode-&gt;computeNodeIndex() : replacedNode-&gt;computeNodeIndex() + 1;
+    return replacedNode-&gt;parentNode();
+}
+
+static bool isReplacedNodeOrBR(Node* node)
+{
+    return AccessibilityObject::replacedNodeNeedsCharacter(node) || node-&gt;hasTagName(brTag);
+}
+
</ins><span class="cx"> RefPtr&lt;Range&gt; AXObjectCache::rangeForUnorderedCharacterOffsets(const CharacterOffset&amp; characterOffset1, const CharacterOffset&amp; characterOffset2)
</span><span class="cx"> {
</span><span class="cx">     if (characterOffset1.isNull() || characterOffset2.isNull())
</span><span class="lines">@@ -1554,30 +1571,33 @@
</span><span class="cx">     CharacterOffset startCharacterOffset = alreadyInOrder ? characterOffset1 : characterOffset2;
</span><span class="cx">     CharacterOffset endCharacterOffset = alreadyInOrder ? characterOffset2 : characterOffset1;
</span><span class="cx">     
</span><del>-    int endOffset = endCharacterOffset.offset;
-    
-    // endOffset can be out of bounds sometimes if the node is a replaced node or has brTag.
-    if (startCharacterOffset.node == endCharacterOffset.node) {
-        RefPtr&lt;Range&gt; nodeRange = AXObjectCache::rangeForNodeContents(startCharacterOffset.node);
-        int nodeLength = TextIterator::rangeLength(nodeRange.get());
-        if (endOffset &gt; nodeLength)
-            endOffset = nodeLength;
-    }
-    
</del><span class="cx">     int startOffset = startCharacterOffset.startIndex + startCharacterOffset.offset;
</span><del>-    endOffset = endCharacterOffset.startIndex + endOffset;
</del><ins>+    int endOffset = endCharacterOffset.startIndex + endCharacterOffset.offset;
+    Node* startNode = startCharacterOffset.node;
+    Node* endNode = endCharacterOffset.node;
</ins><span class="cx">     
</span><del>-    // If start node is a replaced node and it has children, we want to include the replaced node itself in the range.
-    Node* startNode = startCharacterOffset.node;
-    if (AccessibilityObject::replacedNodeNeedsCharacter(startNode) &amp;&amp; (startNode-&gt;hasChildNodes() || startNode != endCharacterOffset.node)) {
-        startOffset = startNode-&gt;computeNodeIndex();
-        startNode = startNode-&gt;parentNode();
</del><ins>+    // Consider the case when the replaced node is at the start/end of the range.
+    bool startNodeIsReplacedOrBR = isReplacedNodeOrBR(startNode);
+    bool endNodeIsReplacedOrBR = isReplacedNodeOrBR(endNode);
+    if (startNodeIsReplacedOrBR || endNodeIsReplacedOrBR) {
+        // endOffset can be out of bounds sometimes if the node is a replaced node or has brTag and it has no children.
+        if (startNode == endNode &amp;&amp; !startNode-&gt;hasChildNodes()) {
+            RefPtr&lt;Range&gt; nodeRange = AXObjectCache::rangeForNodeContents(startNode);
+            int nodeLength = TextIterator::rangeLength(nodeRange.get());
+            if (endCharacterOffset.offset &gt; nodeLength)
+                endOffset = endCharacterOffset.startIndex + nodeLength;
+        } else {
+            if (startNodeIsReplacedOrBR)
+                startNode = resetNodeAndOffsetForReplacedNode(startNode, startOffset, startCharacterOffset.offset);
+            if (endNodeIsReplacedOrBR)
+                endNode = resetNodeAndOffsetForReplacedNode(startNode, endOffset, startCharacterOffset.offset);
+        }
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;Range&gt; result = Range::create(m_document);
</span><span class="cx">     ExceptionCode ecStart = 0, ecEnd = 0;
</span><span class="cx">     result-&gt;setStart(startNode, startOffset, ecStart);
</span><del>-    result-&gt;setEnd(endCharacterOffset.node, endOffset, ecEnd);
</del><ins>+    result-&gt;setEnd(endNode, endOffset, ecEnd);
</ins><span class="cx">     if (ecStart || ecEnd)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -134,6 +134,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (WebAccessibilityTextMarker *)textMarkerWithVisiblePosition:(VisiblePosition&amp;)visiblePos cache:(AXObjectCache*)cache;
</span><ins>++ (WebAccessibilityTextMarker *)textMarkerWithCharacterOffset:(CharacterOffset&amp;)characterOffset cache:(AXObjectCache*)cache;
++ (WebAccessibilityTextMarker *)startOrEndTextMarkerForRange:(const RefPtr&lt;Range&gt;)range isStart:(BOOL)isStart cache:(AXObjectCache*)cache;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="lines">@@ -178,6 +180,33 @@
</span><span class="cx">     return [[[WebAccessibilityTextMarker alloc] initWithTextMarker:&amp;textMarkerData cache:cache] autorelease];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>++ (WebAccessibilityTextMarker *)textMarkerWithCharacterOffset:(CharacterOffset&amp;)characterOffset cache:(AXObjectCache*)cache
+{
+    if (!cache)
+        return nil;
+    
+    if (characterOffset.isNull())
+        return nil;
+    
+    TextMarkerData textMarkerData;
+    cache-&gt;textMarkerDataForCharacterOffset(textMarkerData, *characterOffset.node, characterOffset.offset, false);
+    if (!textMarkerData.axID &amp;&amp; !textMarkerData.ignored)
+        return nil;
+    return [[[WebAccessibilityTextMarker alloc] initWithTextMarker:&amp;textMarkerData cache:cache] autorelease];
+}
+
++ (WebAccessibilityTextMarker *)startOrEndTextMarkerForRange:(const RefPtr&lt;Range&gt;)range isStart:(BOOL)isStart cache:(AXObjectCache*)cache
+{
+    if (!cache)
+        return nil;
+    
+    TextMarkerData textMarkerData;
+    cache-&gt;startOrEndTextMarkerDataForRange(textMarkerData, range, isStart);
+    if (!textMarkerData.axID)
+        return nil;
+    return [[[WebAccessibilityTextMarker alloc] initWithTextMarker:&amp;textMarkerData cache:cache] autorelease];
+}
+
</ins><span class="cx"> - (NSData *)dataRepresentation
</span><span class="cx"> {
</span><span class="cx">     return [NSData dataWithBytes:&amp;_textMarkerData length:sizeof(TextMarkerData)];
</span><span class="lines">@@ -188,6 +217,25 @@
</span><span class="cx">     return _cache-&gt;visiblePositionForTextMarkerData(_textMarkerData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (CharacterOffset)characterOffset
+{
+    if (_textMarkerData.ignored)
+        return CharacterOffset();
+    return CharacterOffset(_textMarkerData.node, _textMarkerData.characterStartIndex, _textMarkerData.characterOffset);
+}
+
+- (BOOL)isIgnored
+{
+    return _textMarkerData.ignored;
+}
+
+- (AccessibilityObject*)accessibilityObject
+{
+    if (_textMarkerData.ignored)
+        return nullptr;
+    return _cache-&gt;accessibilityObjectForTextMarkerData(_textMarkerData);
+}
+
</ins><span class="cx"> - (NSString *)description
</span><span class="cx"> {
</span><span class="cx">     return [NSString stringWithFormat:@&quot;[AXTextMarker %p] = node: %p offset: %d&quot;, self, _textMarkerData.node, _textMarkerData.offset];
</span><span class="lines">@@ -1831,25 +1879,11 @@
</span><span class="cx">     if (![self _prepareAccessibilityCall])
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    if ([markers count] != 2)
</del><ins>+    RefPtr&lt;Range&gt; range = [self rangeForTextMarkers:markers];
+    if (!range)
</ins><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    WebAccessibilityTextMarker* startMarker = [markers objectAtIndex:0];
-    WebAccessibilityTextMarker* endMarker = [markers objectAtIndex:1];
-    if (![startMarker isKindOfClass:[WebAccessibilityTextMarker class]] || ![endMarker isKindOfClass:[WebAccessibilityTextMarker class]])
-        return nil;
-    
-    // extract the start and end VisiblePosition
-    VisiblePosition startVisiblePosition = [startMarker visiblePosition];
-    if (startVisiblePosition.isNull())
-        return nil;
-    
-    VisiblePosition endVisiblePosition = [endMarker visiblePosition];
-    if (endVisiblePosition.isNull())
-        return nil;
-
-    VisiblePositionRange visiblePosRange = VisiblePositionRange(startVisiblePosition, endVisiblePosition);
-    return m_object-&gt;stringForVisiblePositionRange(visiblePosRange);
</del><ins>+    return m_object-&gt;stringForRange(range);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static int blockquoteLevel(RenderObject* renderer)
</span><span class="lines">@@ -2124,13 +2158,8 @@
</span><span class="cx">     if (![self _prepareAccessibilityCall])
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    VisiblePositionRange range = m_object-&gt;visiblePositionRange();
-    VisiblePosition startPosition = range.start;
-    VisiblePosition endPosition = range.end;
-    WebAccessibilityTextMarker* start = [WebAccessibilityTextMarker textMarkerWithVisiblePosition:startPosition cache:m_object-&gt;axObjectCache()];
-    WebAccessibilityTextMarker* end = [WebAccessibilityTextMarker textMarkerWithVisiblePosition:endPosition cache:m_object-&gt;axObjectCache()];
-    
-    return [NSArray arrayWithObjects:start, end, nil];
</del><ins>+    RefPtr&lt;Range&gt; range = m_object-&gt;elementRange();
+    return [self textMarkersForRange:range];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // A method to get the normalized text cursor range of an element. Used in DumpRenderTree.
</span><span class="lines">@@ -2160,8 +2189,7 @@
</span><span class="cx">     if (!marker)
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    VisiblePosition visiblePosition = [marker visiblePosition];
-    AccessibilityObject* obj = m_object-&gt;accessibilityObjectForPosition(visiblePosition);
</del><ins>+    AccessibilityObject* obj = [marker accessibilityObject];
</ins><span class="cx">     if (!obj)
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><span class="lines">@@ -2354,14 +2382,10 @@
</span><span class="cx">     if (!marker)
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    VisiblePosition start = [marker visiblePosition];
-    VisiblePosition nextMarker = m_object-&gt;nextVisiblePosition(start);
-    
-    return [WebAccessibilityTextMarker textMarkerWithVisiblePosition:nextMarker cache:m_object-&gt;axObjectCache()];
</del><ins>+    CharacterOffset start = [marker characterOffset];
+    return [self nextMarkerForCharacterOffset:start];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// This method is intended to return the marker at the start of the line starting at
-// the marker that is passed into the method.
</del><span class="cx"> - (WebAccessibilityTextMarker *)previousMarkerForMarker:(WebAccessibilityTextMarker *)marker
</span><span class="cx"> {
</span><span class="cx">     if (![self _prepareAccessibilityCall])
</span><span class="lines">@@ -2370,10 +2394,8 @@
</span><span class="cx">     if (!marker)
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    VisiblePosition start = [marker visiblePosition];
-    VisiblePosition previousMarker = m_object-&gt;previousVisiblePosition(start);
-    
-    return [WebAccessibilityTextMarker textMarkerWithVisiblePosition:previousMarker cache:m_object-&gt;axObjectCache()];
</del><ins>+    CharacterOffset start = [marker characterOffset];
+    return [self previousMarkerForCharacterOffset:start];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This method is intended to return the bounds of a text marker range in screen coordinates.
</span><span class="lines">@@ -2403,6 +2425,87 @@
</span><span class="cx">     return [WebAccessibilityTextMarker textMarkerWithVisiblePosition:pos cache:m_object-&gt;axObjectCache()];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (WebAccessibilityTextMarker *)nextMarkerForCharacterOffset:(CharacterOffset&amp;)characterOffset
+{
+    characterOffset.offset = characterOffset.offset + 1;
+    WebAccessibilityTextMarker *textMarker = [WebAccessibilityTextMarker textMarkerWithCharacterOffset:characterOffset cache:m_object-&gt;axObjectCache()];
+    if (textMarker &amp;&amp; textMarker.isIgnored)
+        textMarker = [self nextMarkerForCharacterOffset:characterOffset];
+    return textMarker;
+}
+
+- (WebAccessibilityTextMarker *)previousMarkerForCharacterOffset:(CharacterOffset&amp;)characterOffset
+{
+    characterOffset.offset = characterOffset.offset - 1;
+    WebAccessibilityTextMarker *textMarker = [WebAccessibilityTextMarker textMarkerWithCharacterOffset:characterOffset cache:m_object-&gt;axObjectCache()];
+    if (textMarker &amp;&amp; textMarker.isIgnored)
+        textMarker = [self previousMarkerForCharacterOffset:characterOffset];
+    return textMarker;
+}
+
+- (RefPtr&lt;Range&gt;)rangeForTextMarkers:(NSArray *)textMarkers
+{
+    if ([textMarkers count] != 2)
+        return nullptr;
+    
+    WebAccessibilityTextMarker *startMarker = [textMarkers objectAtIndex:0];
+    WebAccessibilityTextMarker *endMarker = [textMarkers objectAtIndex:1];
+    
+    if (![startMarker isKindOfClass:[WebAccessibilityTextMarker class]] || ![endMarker isKindOfClass:[WebAccessibilityTextMarker class]])
+        return nullptr;
+    
+    AXObjectCache* cache = m_object-&gt;axObjectCache();
+    if (!cache)
+        return nullptr;
+    
+    CharacterOffset startCharacterOffset = [startMarker characterOffset];
+    CharacterOffset endCharacterOffset = [endMarker characterOffset];
+    return cache-&gt;rangeForUnorderedCharacterOffsets(startCharacterOffset, endCharacterOffset);
+}
+
+- (NSInteger)lengthForTextMarkers:(NSArray *)textMarkers
+{
+    if (![self _prepareAccessibilityCall])
+        return 0;
+    
+    RefPtr&lt;Range&gt; range = [self rangeForTextMarkers:textMarkers];
+    int length = AXObjectCache::lengthForRange(range.get());
+    return length &lt; 0 ? 0 : length;
+}
+
+- (WebAccessibilityTextMarker *)startOrEndTextMarkerForTextMarkers:(NSArray *)textMarkers isStart:(BOOL)isStart
+{
+    if (![self _prepareAccessibilityCall])
+        return nil;
+    
+    RefPtr&lt;Range&gt; range = [self rangeForTextMarkers:textMarkers];
+    if (!range)
+        return nil;
+    
+    return [WebAccessibilityTextMarker startOrEndTextMarkerForRange:range isStart:isStart cache:m_object-&gt;axObjectCache()];
+}
+
+- (NSArray *)textMarkerRangeForMarkers:(NSArray *)textMarkers
+{
+    if (![self _prepareAccessibilityCall])
+        return nil;
+    
+    RefPtr&lt;Range&gt; range = [self rangeForTextMarkers:textMarkers];
+    return [self textMarkersForRange:range];
+}
+
+- (NSArray *)textMarkersForRange:(RefPtr&lt;Range&gt;)range
+{
+    if (!range)
+        return nil;
+    
+    WebAccessibilityTextMarker* start = [WebAccessibilityTextMarker startOrEndTextMarkerForRange:range isStart:YES cache:m_object-&gt;axObjectCache()];
+    WebAccessibilityTextMarker* end = [WebAccessibilityTextMarker startOrEndTextMarkerForRange:range isStart:NO cache:m_object-&gt;axObjectCache()];
+    if (!start || !end)
+        return nil;
+    return [NSArray arrayWithObjects:start, end, nil];
+}
+
</ins><span class="cx"> - (NSString *)accessibilityIdentifier
</span><span class="cx"> {
</span><span class="cx">     if (![self _prepareAccessibilityCall])
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/ChangeLog        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1,3 +1,69 @@
</span><ins>+2016-01-21  Nan Wang  &lt;n_wang@apple.com&gt;
+
+        AX: [IOS] Implement next/previous text marker functions using TextIterator
+        https://bugs.webkit.org/show_bug.cgi?id=153292
+        &lt;rdar://problem/24268243&gt;
+
+        Reviewed by Chris Fleizach.
+
+        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):
+
</ins><span class="cx"> 2016-01-20  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, revert accidental unreviewed commit.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityTextMarkerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityTextMarker.h (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityTextMarker.h        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/DumpRenderTree/AccessibilityTextMarker.h        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;JavaScriptCore/JSObjectRef.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</del><ins>+#if PLATFORM(MAC) || PLATFORM(IOS)
</ins><span class="cx"> #define SUPPORTS_AX_TEXTMARKERS 1
</span><span class="cx"> #else
</span><span class="cx"> #define SUPPORTS_AX_TEXTMARKERS 0
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     static JSClassRef getJSClass();
</span><del>-#if SUPPORTS_AX_TEXTMARKERS
</del><ins>+#if SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(MAC)
</ins><span class="cx">     RetainPtr&lt;PlatformTextMarker&gt; m_textMarker;
</span><span class="cx"> #else
</span><span class="cx">     PlatformTextMarker m_textMarker;
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     
</span><span class="cx"> private:
</span><span class="cx">     static JSClassRef getJSClass();
</span><del>-#if SUPPORTS_AX_TEXTMARKERS
</del><ins>+#if SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(MAC)
</ins><span class="cx">     RetainPtr&lt;PlatformTextMarkerRange&gt; m_textMarkerRange;
</span><span class="cx"> #else
</span><span class="cx">     PlatformTextMarkerRange m_textMarkerRange;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeDumpRenderTreexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx">                 A8B91ADC0CF3B32F008F91FF /* DumpRenderTreeWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = A8B91AD90CF3B32F008F91FF /* DumpRenderTreeWindow.mm */; };
</span><span class="cx">                 A8B91BFD0CF522B4008F91FF /* CheckedMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8B91BF70CF522B4008F91FF /* CheckedMalloc.cpp */; };
</span><span class="cx">                 A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */; };
</span><ins>+                A9BB7C5C1C505278002C525B /* AccessibilityTextMarkerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9BB7C5B1C505278002C525B /* AccessibilityTextMarkerIOS.mm */; };
</ins><span class="cx">                 AA5A15EF16E15CD000F7C561 /* AccessibilityControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA5A15ED16E15CD000F7C561 /* AccessibilityControllerIOS.mm */; };
</span><span class="cx">                 AA5A15F016E15CD000F7C561 /* AccessibilityUIElementIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA5A15EE16E15CD000F7C561 /* AccessibilityUIElementIOS.mm */; };
</span><span class="cx">                 BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* TestRunner.cpp */; };
</span><span class="lines">@@ -309,6 +310,7 @@
</span><span class="cx">                 A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CheckedMalloc.h; path = mac/CheckedMalloc.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreeFileDraggingSource.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DumpRenderTreeFileDraggingSource.m; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A9BB7C5B1C505278002C525B /* AccessibilityTextMarkerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityTextMarkerIOS.mm; path = ios/AccessibilityTextMarkerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 AA5A15ED16E15CD000F7C561 /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerIOS.mm; path = ios/AccessibilityControllerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AA5A15EE16E15CD000F7C561 /* AccessibilityUIElementIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementIOS.mm; path = ios/AccessibilityUIElementIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = &quot;AHEM____.TTF&quot;; path = &quot;fonts/AHEM____.TTF&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -499,6 +501,7 @@
</span><span class="cx">                                 80045AEC147718E7008290A8 /* AccessibilityNotificationHandler.mm */,
</span><span class="cx">                                 29CFBA0F122736E600BC30C0 /* AccessibilityTextMarker.cpp */,
</span><span class="cx">                                 29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */,
</span><ins>+                                A9BB7C5B1C505278002C525B /* AccessibilityTextMarkerIOS.mm */,
</ins><span class="cx">                                 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */,
</span><span class="cx">                                 BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */,
</span><span class="cx">                                 BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */,
</span><span class="lines">@@ -974,6 +977,7 @@
</span><span class="cx">                                 BCA18C470C9B5B9400114369 /* DumpRenderTree.mm in Sources */,
</span><span class="cx">                                 9830F31F15C81181005AB206 /* DumpRenderTreeCommon.cpp in Sources */,
</span><span class="cx">                                 BCA18B7B0C9B08F100114369 /* DumpRenderTreeDraggingInfo.mm in Sources */,
</span><ins>+                                A9BB7C5C1C505278002C525B /* AccessibilityTextMarkerIOS.mm in Sources */,
</ins><span class="cx">                                 A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */,
</span><span class="cx">                                 A8B91ADA0CF3B32F008F91FF /* DumpRenderTreePasteboard.m in Sources */,
</span><span class="cx">                                 A8B91ADC0CF3B32F008F91FF /* DumpRenderTreeWindow.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityTextMarkerIOSmmfromrev195398trunkToolsDumpRenderTreemacAccessibilityTextMarkerMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Tools/DumpRenderTree/ios/AccessibilityTextMarkerIOS.mm (from rev 195398, trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm) (0 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityTextMarkerIOS.mm                                (rev 0)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityTextMarkerIOS.mm        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;AccessibilityTextMarker.h&quot;
+
+#import &quot;DumpRenderTree.h&quot;
+
+#if SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(IOS)
+
+// MARK: AccessibilityTextMarker
+
+AccessibilityTextMarker::AccessibilityTextMarker(PlatformTextMarker marker)
+    : m_textMarker(marker)
+{
+}
+
+AccessibilityTextMarker::AccessibilityTextMarker(const AccessibilityTextMarker&amp; marker)
+    : m_textMarker(marker.platformTextMarker())
+{
+}
+
+AccessibilityTextMarker::~AccessibilityTextMarker()
+{
+}
+
+bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker* other)
+{
+    return [(id)platformTextMarker() isEqual:(id)other-&gt;platformTextMarker()];
+}
+
+PlatformTextMarker AccessibilityTextMarker::platformTextMarker() const 
+{ 
+    return m_textMarker;
+}
+
+// MARK: AccessibilityTextMarkerRange
+
+AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(PlatformTextMarkerRange markerRange)
+    : m_textMarkerRange(markerRange)
+{
+}
+
+AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(const AccessibilityTextMarkerRange&amp; markerRange)
+    : m_textMarkerRange(markerRange.platformTextMarkerRange())
+{
+}
+
+AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange()
+{
+}
+
+bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange* other)
+{
+    return [(id)platformTextMarkerRange() isEqual:(id)other-&gt;platformTextMarkerRange()];
+}
+
+PlatformTextMarkerRange AccessibilityTextMarkerRange::platformTextMarkerRange() const
+{
+    return m_textMarkerRange;
+}
+
+#endif // SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -94,6 +94,16 @@
</span><span class="cx"> - (NSUInteger)accessibilityARIAColumnIndex;
</span><span class="cx"> - (UIAccessibilityTraits)_axContainedByFieldsetTrait;
</span><span class="cx"> - (id)_accessibilityFieldsetAncestor;
</span><ins>+
+// TextMarker related
+- (NSArray *)textMarkerRange;
+- (NSInteger)lengthForTextMarkers:(NSArray *)textMarkers;
+- (NSString *)stringForTextMarkers:(NSArray *)markers;
+- (id)startOrEndTextMarkerForTextMarkers:(NSArray*)textMarkers isStart:(BOOL)isStart;
+- (NSArray *)textMarkerRangeForMarkers:(NSArray *)textMarkers;
+- (id)nextMarkerForMarker:(id)marker;
+- (id)previousMarkerForMarker:(id)marker;
+- (id)accessibilityObjectForTextMarker:(id)marker;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSObject (WebAccessibilityObjectWrapperPrivate)
</span><span class="lines">@@ -411,6 +421,137 @@
</span><span class="cx">     return [result createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(IOS)
+
+// Text markers
+
+AccessibilityTextMarkerRange AccessibilityUIElement::lineTextMarkerRangeForTextMarker(AccessibilityTextMarker*)
+{
+    return nullptr;
+}
+
+AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element)
+{
+    id textMarkerRange = [element-&gt;platformUIElement() textMarkerRange];
+    return AccessibilityTextMarkerRange(textMarkerRange);
+}
+
+AccessibilityTextMarkerRange AccessibilityUIElement::selectedTextMarkerRange()
+{
+    return nullptr;
+}
+
+void AccessibilityUIElement::resetSelectedTextMarkerRange()
+{
+}
+
+int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
+{
+    id textMarkers = (id)range-&gt;platformTextMarkerRange();
+    return [m_element lengthForTextMarkers:textMarkers];
+}
+
+AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
+{
+    NSArray *textMarkers = [NSArray arrayWithObjects:(id)startMarker-&gt;platformTextMarker(), (id)endMarker-&gt;platformTextMarker(), nil];
+    id textMarkerRange = [m_element textMarkerRangeForMarkers:textMarkers];
+    return AccessibilityTextMarkerRange(textMarkerRange);
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
+{
+    id textMarkers = (id)range-&gt;platformTextMarkerRange();
+    id textMarker = [m_element startOrEndTextMarkerForTextMarkers:textMarkers isStart:YES];
+    return AccessibilityTextMarker(textMarker);
+}
+
+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
+{
+    id textMarkers = (id)range-&gt;platformTextMarkerRange();
+    id textMarker = [m_element startOrEndTextMarkerForTextMarkers:textMarkers isStart:NO];
+    return AccessibilityTextMarker(textMarker);
+}
+
+AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
+{
+    id obj = [m_element accessibilityObjectForTextMarker:(id)marker-&gt;platformTextMarker()];
+    if (obj)
+        return AccessibilityUIElement(obj);
+    return nullptr;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+    return nullptr;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+    return nullptr;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+    return nullptr;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
+{
+    id previousMarker = [m_element previousMarkerForMarker:(id)textMarker-&gt;platformTextMarker()];
+    return AccessibilityTextMarker(previousMarker);
+}
+
+AccessibilityTextMarker AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
+{
+    id nextMarker = [m_element nextMarkerForMarker:(id)textMarker-&gt;platformTextMarker()];
+    return AccessibilityTextMarker(nextMarker);
+}
+
+JSStringRef AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
+{
+    id textMarkers = (id)markerRange-&gt;platformTextMarkerRange();
+    if (!textMarkers || ![textMarkers isKindOfClass:[NSArray class]])
+        return JSStringCreateWithCharacters(0, 0);
+    return [[m_element stringForTextMarkers:textMarkers] createJSStringRef];
+}
+
+bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef, AccessibilityTextMarkerRange*)
+{
+    return false;
+}
+
+int AccessibilityUIElement::indexForTextMarker(AccessibilityTextMarker*)
+{
+    return -1;
+}
+
+bool AccessibilityUIElement::isTextMarkerValid(AccessibilityTextMarker*)
+{
+    return false;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForIndex(int)
+{
+    return nullptr;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarker()
+{
+    return nullptr;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::endTextMarker()
+{
+    return nullptr;
+}
+
+bool AccessibilityUIElement::setSelectedVisibleTextRange(AccessibilityTextMarkerRange*)
+{
+    return false;
+}
+
+#endif // SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(IOS)
+
</ins><span class="cx"> #pragma mark Unused
</span><span class="cx"> 
</span><span class="cx"> void AccessibilityUIElement::getLinkedUIElements(Vector&lt;AccessibilityUIElement&gt;&amp; elementVector)
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityTextMarkerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> #import &quot;AccessibilityTextMarker.h&quot;
</span><span class="cx"> #import &quot;DumpRenderTree.h&quot;
</span><span class="cx"> 
</span><del>-#if SUPPORTS_AX_TEXTMARKERS
</del><ins>+#if SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(MAC)
</ins><span class="cx"> 
</span><span class="cx"> // MARK: AccessibilityTextMarker
</span><span class="cx"> 
</span><span class="lines">@@ -82,4 +82,4 @@
</span><span class="cx">     return m_textMarkerRange.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif // SUPPORTS_AX_TEXTMARKERS
</del><ins>+#endif // SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(MAC)
</ins></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -1612,7 +1612,7 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if SUPPORTS_AX_TEXTMARKERS
</del><ins>+#if SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(MAC)
</ins><span class="cx"> 
</span><span class="cx"> // Text markers
</span><span class="cx"> AccessibilityTextMarkerRange AccessibilityUIElement::lineTextMarkerRangeForTextMarker(AccessibilityTextMarker* textMarker)
</span><span class="lines">@@ -1846,7 +1846,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#endif // SUPPORTS_AX_TEXTMARKERS
</del><ins>+#endif // SUPPORTS_AX_TEXTMARKERS &amp;&amp; PLATFORM(MAC)
</ins><span class="cx"> 
</span><span class="cx"> JSStringRef AccessibilityUIElement::supportedActions()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (195404 => 195405)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2016-01-21 07:59:26 UTC (rev 195404)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2016-01-21 08:35:10 UTC (rev 195405)
</span><span class="lines">@@ -71,6 +71,16 @@
</span><span class="cx"> - (NSUInteger)accessibilityARIAColumnIndex;
</span><span class="cx"> - (UIAccessibilityTraits)_axContainedByFieldsetTrait;
</span><span class="cx"> - (id)_accessibilityFieldsetAncestor;
</span><ins>+
+// TextMarker related
+- (NSArray *)textMarkerRange;
+- (NSInteger)lengthForTextMarkers:(NSArray *)textMarkers;
+- (NSString *)stringForTextMarkers:(NSArray *)markers;
+- (id)startOrEndTextMarkerForTextMarkers:(NSArray*)textMarkers isStart:(BOOL)isStart;
+- (NSArray *)textMarkerRangeForMarkers:(NSArray *)textMarkers;
+- (id)nextMarkerForMarker:(id)marker;
+- (id)previousMarkerForMarker:(id)marker;
+- (id)accessibilityObjectForTextMarker:(id)marker;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSObject (WebAccessibilityObjectWrapperPrivate)
</span><span class="lines">@@ -982,42 +992,55 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarkerRange&gt; AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id textMarkerRange = [element-&gt;platformUIElement() textMarkerRange];
+    return AccessibilityTextMarkerRange::create(textMarkerRange);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id textMarkers = (id)range-&gt;platformTextMarkerRange();    
+    return [m_element lengthForTextMarkers:textMarkers];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id previousMarker = [m_element previousMarkerForMarker:(id)textMarker-&gt;platformTextMarker()];
+    return AccessibilityTextMarker::create(previousMarker);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id nextMarker = [m_element nextMarkerForMarker:(id)textMarker-&gt;platformTextMarker()];
+    return AccessibilityTextMarker::create(nextMarker);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id textMarkers = (id)markerRange-&gt;platformTextMarkerRange();
+    if (!textMarkers || ![textMarkers isKindOfClass:[NSArray class]])
+        return JSStringCreateWithCharacters(0, 0);
+    return [[m_element stringForTextMarkers:textMarkers] createJSStringRef];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarkerRange&gt; AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    NSArray *textMarkers = [NSArray arrayWithObjects:(id)startMarker-&gt;platformTextMarker(), (id)endMarker-&gt;platformTextMarker(), nil];
+    id textMarkerRange = [m_element textMarkerRangeForMarkers:textMarkers];
+    return AccessibilityTextMarkerRange::create(textMarkerRange);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id textMarkers = (id)range-&gt;platformTextMarkerRange();
+    id textMarker = [m_element startOrEndTextMarkerForTextMarkers:textMarkers isStart:YES];
+    return AccessibilityTextMarker::create(textMarker);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id textMarkers = (id)range-&gt;platformTextMarkerRange();
+    id textMarker = [m_element startOrEndTextMarkerForTextMarkers:textMarkers isStart:NO];
+    return AccessibilityTextMarker::create(textMarker);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
</span><span class="lines">@@ -1037,7 +1060,10 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
</span><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    id obj = [m_element accessibilityObjectForTextMarker:(id)marker-&gt;platformTextMarker()];
+    if (obj)
+        return AccessibilityUIElement::create(obj);
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityUIElement::attributedStringForTextMarkerRangeContainsAttribute(JSStringRef attribute, AccessibilityTextMarkerRange* range)
</span></span></pre>
</div>
</div>

</body>
</html>