<!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>[163632] 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/163632">163632</a></dd>
<dt>Author</dt> <dd>samuel_white@apple.com</dd>
<dt>Date</dt> <dd>2014-02-07 10:43:38 -0800 (Fri, 07 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Find and select text with respect to insertion point using accessibility API.
https://bugs.webkit.org/show_bug.cgi?id=128026

Reviewed by Chris Fleizach.

Source/WebCore:

Added facilities to support semi-ambiguous text selection through the accessibility API. All
requests are handled with respect to the current selection. The requests are disambiguated in
WebCore using passed parameters such as: SelectStringAfterSelection , ..Before.., ..ClosestTo...,
etc. Callers can also supply an array of strings to select and the closest that matches the
disambiguation criteria will be used.

Test: platform/mac/accessibility/select-text.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::rangeClosestToRange):
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
(WebCore::AccessibilityObject::selectionRange):
(WebCore::AccessibilityObject::selectText):
(WebCore::AccessibilityObject::frame):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilitySelectTextCriteria::AccessibilitySelectTextCriteria):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
(-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
* dom/Position.cpp:
(WebCore::Position::positionCountBetweenPositions):
* dom/Position.h:

Tools:

Added method to AccessibilityUIElement to enable testing of accessibility text selection.

* DumpRenderTree/AccessibilityUIElement.cpp:
(selectTextWithCriteriaCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::selectTextWithCriteria):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::selectTextWithCriteria):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(selectTextParameterizedAttributeForCriteria):
(AccessibilityUIElement::selectTextWithCriteria):
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
(WTR::AccessibilityUIElement::selectTextWithCriteria):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::selectTextParameterizedAttributeForCriteria):
(WTR::AccessibilityUIElement::selectTextWithCriteria):

LayoutTests:

Tests that text selection via the accessibility API works as expected.

* platform/mac/accessibility/bounds-for-range-expected.txt:
* platform/mac/accessibility/select-text-expected.txt: Added.
* platform/mac/accessibility/select-text.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityboundsforrangeexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#trunkSourceWebCoredomPositioncpp">trunk/Source/WebCore/dom/Position.cpp</a></li>
<li><a href="#trunkSourceWebCoredomPositionh">trunk/Source/WebCore/dom/Position.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityUIElementcpp">trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeAccessibilityUIElementh">trunk/Tools/DumpRenderTree/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsDumpRenderTreeatkAccessibilityUIElementAtkcpp">trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp">trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm">trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityselecttextexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/select-text-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilityselecttexthtml">trunk/LayoutTests/platform/mac/accessibility/select-text.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/LayoutTests/ChangeLog        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-02-07  Samuel White  &lt;samuel_white@apple.com&gt;
+
+        AX: Find and select text with respect to insertion point using accessibility API.
+        https://bugs.webkit.org/show_bug.cgi?id=128026
+
+        Reviewed by Chris Fleizach.
+
+        Tests that text selection via the accessibility API works as expected.
+
+        * platform/mac/accessibility/bounds-for-range-expected.txt:
+        * platform/mac/accessibility/select-text-expected.txt: Added.
+        * platform/mac/accessibility/select-text.html: Added.
+
</ins><span class="cx"> 2014-02-06  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         IDB: storage/indexeddb/create-index-with-integer-keys.html fails
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityboundsforrangeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> AXUIElementsForSearchPredicate
</span><span class="cx"> AXEndTextMarkerForBounds
</span><span class="cx"> AXStartTextMarkerForBounds
</span><ins>+AXSelectTextWithCriteria
</ins><span class="cx"> 
</span><span class="cx"> ----------------------
</span><span class="cx"> {{-1.000000, -1.000000}, {59.000000, 18.000000}}
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityselecttextexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/select-text-expected.txt (0 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/select-text-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/select-text-expected.txt        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+The quick brown fox jumps over the lazy dog.
+
+This tests the ability to select text with respect to selection.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS result is 'lazy'
+PASS selection is 'lazy'
+PASS result is 'over'
+PASS selection is 'over'
+PASS result is 'quick'
+PASS selection is 'quick'
+PASS result is 'fox'
+PASS selection is 'fox'
+PASS result is 'dog'
+PASS selection is 'dog'
+PASS result is 'fox'
+PASS selection is 'fox'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityselecttexthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/select-text.html (0 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/select-text.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/select-text.html        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -0,0 +1,82 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;title&gt;Select Text&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;p id=&quot;text&quot;&gt;The quick brown fox &lt;span id=&quot;target&quot;&gt;jumps&lt;/span&gt; over the lazy dog.&lt;/p&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 ability to select text with respect to selection.&quot;);
+    
+    function selectedText() {
+        return window.getSelection().toString();
+    }
+    
+    function selectElementText(element) {
+        var range = document.createRange();
+        range.selectNodeContents(element);
+        
+        var selection = window.getSelection();
+        selection.removeAllRanges();
+        selection.addRange(range);
+    }
+    
+    if (window.accessibilityController) {
+        var text = accessibilityController.accessibleElementById(&quot;text&quot;);
+        var result = 0;
+        var selection = 0;
+        var target = document.getElementById(&quot;target&quot;);
+        
+        // Select text after selection (single search string).
+        selectElementText(target);
+        result = text.selectTextWithCriteria(&quot;AXSelectTextAmbiguityResolutionClosestAfterSelection&quot;, &quot;lazy&quot;);
+        shouldBe(&quot;result&quot;, &quot;'lazy'&quot;);
+        selection = selectedText();
+        shouldBe(&quot;selection&quot;, &quot;'lazy'&quot;);
+        
+        // Select text after selection (multiple search strings).
+        selectElementText(target);
+        result = text.selectTextWithCriteria(&quot;AXSelectTextAmbiguityResolutionClosestAfterSelection&quot;, [&quot;lazy&quot;, &quot;over&quot;]);
+        shouldBe(&quot;result&quot;, &quot;'over'&quot;);
+        selection = selectedText();
+        shouldBe(&quot;selection&quot;, &quot;'over'&quot;);
+        
+        // Select text before selection (single search string).
+        selectElementText(target);
+        result = text.selectTextWithCriteria(&quot;AXSelectTextAmbiguityResolutionClosestBeforeSelection&quot;, &quot;quick&quot;);
+        shouldBe(&quot;result&quot;, &quot;'quick'&quot;);
+        selection = selectedText();
+        shouldBe(&quot;selection&quot;, &quot;'quick'&quot;);
+        
+        // Select text before selection (multiple search strings).
+        selectElementText(target);
+        result = text.selectTextWithCriteria(&quot;AXSelectTextAmbiguityResolutionClosestBeforeSelection&quot;, [&quot;quick&quot;, &quot;fox&quot;]);
+        shouldBe(&quot;result&quot;, &quot;'fox'&quot;);
+        selection = selectedText();
+        shouldBe(&quot;selection&quot;, &quot;'fox'&quot;);
+        
+        // Select text closest to selection (single search string).
+        selectElementText(target);
+        result = text.selectTextWithCriteria(&quot;AXSelectTextAmbiguityResolutionClosestToSelection&quot;, &quot;dog&quot;);
+        shouldBe(&quot;result&quot;, &quot;'dog'&quot;);
+        selection = selectedText();
+        shouldBe(&quot;selection&quot;, &quot;'dog'&quot;);
+        
+        // Select text closest to selection (multiple search strings).
+        selectElementText(target);
+        result = text.selectTextWithCriteria(&quot;AXSelectTextAmbiguityResolutionClosestToSelection&quot;, [&quot;dog&quot;, &quot;fox&quot;]);
+        shouldBe(&quot;result&quot;, &quot;'fox'&quot;);
+        selection = selectedText();
+        shouldBe(&quot;selection&quot;, &quot;'fox'&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></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Source/WebCore/ChangeLog        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-02-07  Samuel White  &lt;samuel_white@apple.com&gt;
+
+        AX: Find and select text with respect to insertion point using accessibility API.
+        https://bugs.webkit.org/show_bug.cgi?id=128026
+
+        Reviewed by Chris Fleizach.
+
+        Added facilities to support semi-ambiguous text selection through the accessibility API. All
+        requests are handled with respect to the current selection. The requests are disambiguated in
+        WebCore using passed parameters such as: SelectStringAfterSelection , ..Before.., ..ClosestTo...,
+        etc. Callers can also supply an array of strings to select and the closest that matches the
+        disambiguation criteria will be used.
+
+        Test: platform/mac/accessibility/select-text.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::rangeClosestToRange):
+        (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
+        (WebCore::AccessibilityObject::selectionRange):
+        (WebCore::AccessibilityObject::selectText):
+        (WebCore::AccessibilityObject::frame):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilitySelectTextCriteria::AccessibilitySelectTextCriteria):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
+        (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+        * dom/Position.cpp:
+        (WebCore::Position::positionCountBetweenPositions):
+        * dom/Position.h:
+
</ins><span class="cx"> 2014-02-07  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         FloatingObject m_paginationStrut should be LayoutUnit
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -516,6 +516,117 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// Returns the range that is fewer positions away from the reference range.
+// NOTE: The after range is expected to ACTUALLY be after the reference range and the before
+// range is expected to ACTUALLY be before. These are not checked for performance reasons.
+static PassRefPtr&lt;Range&gt; rangeClosestToRange(Range* referenceRange, PassRefPtr&lt;Range&gt; afterRange, PassRefPtr&lt;Range&gt; beforeRange)
+{
+    ASSERT(referenceRange);
+    ASSERT(!afterRange || afterRange-&gt;startPosition() &gt; referenceRange-&gt;startPosition());
+    ASSERT(!beforeRange || beforeRange-&gt;endPosition() &lt; referenceRange-&gt;endPosition());
+    
+    if (!referenceRange || (!afterRange &amp;&amp; !beforeRange))
+        return nullptr;
+    if (afterRange &amp;&amp; !beforeRange)
+        return afterRange;
+    if (!afterRange &amp;&amp; beforeRange)
+        return beforeRange;
+    
+    unsigned positionsToAfterRange = Position::positionCountBetweenPositions(afterRange-&gt;startPosition(), referenceRange-&gt;startPosition());
+    unsigned positionsToBeforeRange = Position::positionCountBetweenPositions(afterRange-&gt;endPosition(), referenceRange-&gt;endPosition());
+    
+    return positionsToAfterRange &lt; positionsToBeforeRange ? afterRange : beforeRange;
+}
+
+PassRefPtr&lt;Range&gt; AccessibilityObject::rangeOfStringClosestToRangeInDirection(Range* referenceRange, AccessibilitySearchDirection searchDirection, Vector&lt;String&gt;&amp; searchStrings) const
+{
+    Frame* frame = this-&gt;frame();
+    if (!frame)
+        return nullptr;
+    
+    if (!referenceRange)
+        return nullptr;
+    
+    bool isBackwardSearch = searchDirection == SearchDirectionPrevious;
+    FindOptions findOptions = AtWordStarts | CaseInsensitive | StartInSelection;
+    if (isBackwardSearch)
+        findOptions |= Backwards;
+    
+    RefPtr&lt;Range&gt; closestStringRange = nullptr;
+    for (const auto&amp; searchString : searchStrings) {
+        if (RefPtr&lt;Range&gt; searchStringRange = frame-&gt;editor().rangeOfString(searchString, referenceRange, findOptions)) {
+            if (!closestStringRange)
+                closestStringRange = searchStringRange;
+            else {
+                // If searching backward, use the trailing range edges to correctly determine which
+                // range is closest. Similarly, if searching forward, use the leading range edges.
+                Position closestStringPosition = isBackwardSearch ? closestStringRange-&gt;endPosition() : closestStringRange-&gt;startPosition();
+                Position searchStringPosition = isBackwardSearch ? searchStringRange-&gt;endPosition() : searchStringRange-&gt;startPosition();
+                
+                int closestPositionOffset = closestStringPosition.computeOffsetInContainerNode();
+                int searchPositionOffset = searchStringPosition.computeOffsetInContainerNode();
+                Node* closestContainerNode = closestStringPosition.containerNode();
+                Node* searchContainerNode = searchStringPosition.containerNode();
+                
+                short result = Range::compareBoundaryPoints(closestContainerNode, closestPositionOffset, searchContainerNode, searchPositionOffset, ASSERT_NO_EXCEPTION);
+                if ((!isBackwardSearch &amp;&amp; result &gt; 0) || (isBackwardSearch &amp;&amp; result &lt; 0))
+                    closestStringRange = searchStringRange;
+            }
+        }
+    }
+    return closestStringRange;
+}
+
+// Returns the range of the entire document if there is no selection.
+PassRefPtr&lt;Range&gt; AccessibilityObject::selectionRange() const
+{
+    Frame* frame = this-&gt;frame();
+    if (!frame)
+        return nullptr;
+    
+    const VisibleSelection&amp; selection = frame-&gt;selection().selection();
+    if (!selection.isNone())
+        return selection.firstRange();
+    
+    return Range::create(*frame-&gt;document());
+}
+
+String AccessibilityObject::selectText(AccessibilitySelectTextCriteria* criteria)
+{
+    ASSERT(criteria);
+    
+    if (!criteria)
+        return String();
+    
+    Frame* frame = this-&gt;frame();
+    if (!frame)
+        return String();
+    
+    AccessibilitySelectTextActivity&amp; activity = criteria-&gt;activity;
+    AccessibilitySelectTextAmbiguityResolution&amp; ambiguityResolution = criteria-&gt;ambiguityResolution;
+    Vector&lt;String&gt;&amp; searchStrings = criteria-&gt;searchStrings;
+    RefPtr&lt;Range&gt; selectedStringRange = selectionRange();
+    
+    RefPtr&lt;Range&gt; closestAfterStringRange = nullptr;
+    RefPtr&lt;Range&gt; closestBeforeStringRange = nullptr;
+    // Search forward if necessary.
+    if (ambiguityResolution == ClosestAfterSelectionAmbiguityResolution || ambiguityResolution == ClosestToSelectionAmbiguityResolution)
+        closestAfterStringRange = rangeOfStringClosestToRangeInDirection(selectedStringRange.get(), SearchDirectionNext, searchStrings);
+    // Search backward if necessary.
+    if (ambiguityResolution == ClosestBeforeSelectionAmbiguityResolution || ambiguityResolution == ClosestToSelectionAmbiguityResolution)
+        closestBeforeStringRange = rangeOfStringClosestToRangeInDirection(selectedStringRange.get(), SearchDirectionPrevious, searchStrings);
+    
+    // Determine which candidate is closest to the selection and perform the activity.
+    if (RefPtr&lt;Range&gt; closestStringRange = rangeClosestToRange(selectedStringRange.get(), closestAfterStringRange, closestBeforeStringRange)) {
+        if (activity == FindAndSelectActivity) {
+            frame-&gt;selection().setSelectedRange(closestStringRange.get(), DOWNSTREAM, true);
+            return closestStringRange-&gt;text();
+        }
+    }
+    
+    return String();
+}
+
</ins><span class="cx"> bool AccessibilityObject::hasAttributesRequiredForInclusion() const
</span><span class="cx"> {
</span><span class="cx">     // These checks are simplified in the interest of execution speed.
</span><span class="lines">@@ -608,6 +719,15 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Frame* AccessibilityObject::frame() const
+{
+    Node* node = this-&gt;node();
+    if (!node)
+        return nullptr;
+    
+    return node-&gt;document().frame();
+}
+
</ins><span class="cx"> MainFrame* AccessibilityObject::mainFrame() const
</span><span class="cx"> {
</span><span class="cx">     Document* document = topDocument();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -386,6 +386,27 @@
</span><span class="cx">     bool isNull() const { return !start &amp;&amp; !length; }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum AccessibilitySelectTextActivity {
+    FindAndSelectActivity
+};
+
+enum AccessibilitySelectTextAmbiguityResolution {
+    ClosestAfterSelectionAmbiguityResolution,
+    ClosestBeforeSelectionAmbiguityResolution,
+    ClosestToSelectionAmbiguityResolution
+};
+
+struct AccessibilitySelectTextCriteria {
+    AccessibilitySelectTextActivity activity;
+    AccessibilitySelectTextAmbiguityResolution ambiguityResolution;
+    Vector&lt;String&gt; searchStrings;
+    
+    AccessibilitySelectTextCriteria(AccessibilitySelectTextActivity activity, AccessibilitySelectTextAmbiguityResolution ambiguityResolution)
+        : activity(activity)
+        , ambiguityResolution(ambiguityResolution)
+    { }
+};
+
</ins><span class="cx"> class AccessibilityObject : public RefCounted&lt;AccessibilityObject&gt; {
</span><span class="cx"> protected:
</span><span class="cx">     AccessibilityObject();
</span><span class="lines">@@ -596,6 +617,11 @@
</span><span class="cx">     void findMatchingObjects(AccessibilitySearchCriteria*, AccessibilityChildrenVector&amp;);
</span><span class="cx">     virtual bool isDescendantOfBarrenParent() const { return false; }
</span><span class="cx">     
</span><ins>+    // Text selection
+    PassRefPtr&lt;Range&gt; rangeOfStringClosestToRangeInDirection(Range*, AccessibilitySearchDirection, Vector&lt;String&gt;&amp;) const;
+    PassRefPtr&lt;Range&gt; selectionRange() const;
+    String selectText(AccessibilitySelectTextCriteria*);
+    
</ins><span class="cx">     virtual AccessibilityObject* observableObject() const { return 0; }
</span><span class="cx">     virtual void linkedUIElements(AccessibilityChildrenVector&amp;) const { }
</span><span class="cx">     virtual AccessibilityObject* titleUIElement() const { return 0; }
</span><span class="lines">@@ -670,6 +696,7 @@
</span><span class="cx">     Page* page() const;
</span><span class="cx">     virtual Document* document() const;
</span><span class="cx">     virtual FrameView* documentFrameView() const;
</span><ins>+    Frame* frame() const;
</ins><span class="cx">     MainFrame* mainFrame() const;
</span><span class="cx">     Document* topDocument() const;
</span><span class="cx">     String language() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -185,6 +185,21 @@
</span><span class="cx"> #define NSAccessibilityPlaceholderValueAttribute @&quot;AXPlaceholderValue&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#define NSAccessibilityTextMarkerIsValidParameterizedAttribute @&quot;AXTextMarkerIsValid&quot;
+#define NSAccessibilityIndexForTextMarkerParameterizedAttribute @&quot;AXIndexForTextMarker&quot;
+#define NSAccessibilityTextMarkerForIndexParameterizedAttribute @&quot;AXTextMarkerForIndex&quot;
+
+#ifndef NSAccessibilityScrollToVisibleAction
+#define NSAccessibilityScrollToVisibleAction @&quot;AXScrollToVisible&quot;
+#endif
+
+#ifndef NSAccessibilityPathAttribute
+#define NSAccessibilityPathAttribute @&quot;AXPath&quot;
+#endif
+
+#define NSAccessibilityDOMIdentifierAttribute @&quot;AXDOMIdentifier&quot;
+#define NSAccessibilityDOMClassListAttribute @&quot;AXDOMClassList&quot;
+
</ins><span class="cx"> // Search
</span><span class="cx"> #ifndef NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute
</span><span class="cx"> #define NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute @&quot;AXUIElementCountForSearchPredicate&quot;
</span><span class="lines">@@ -356,21 +371,39 @@
</span><span class="cx"> #define NSAccessibilityVisitedLinkSearchKey @&quot;AXVisitedLinkSearchKey&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#define NSAccessibilityTextMarkerIsValidParameterizedAttribute @&quot;AXTextMarkerIsValid&quot;
-#define NSAccessibilityIndexForTextMarkerParameterizedAttribute @&quot;AXIndexForTextMarker&quot;
-#define NSAccessibilityTextMarkerForIndexParameterizedAttribute @&quot;AXTextMarkerForIndex&quot;
</del><ins>+// Text selection
+#ifndef NSAccessibilitySelectTextActivity
+#define NSAccessibilitySelectTextActivity @&quot;AXSelectTextActivity&quot;
+#endif
</ins><span class="cx"> 
</span><del>-#ifndef NSAccessibilityScrollToVisibleAction
-#define NSAccessibilityScrollToVisibleAction @&quot;AXScrollToVisible&quot;
</del><ins>+#ifndef NSAccessibilitySelectTextActivityFindAndSelect
+#define NSAccessibilitySelectTextActivityFindAndSelect @&quot;AXSelectTextActivityFindAndSelect&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#ifndef NSAccessibilityPathAttribute
-#define NSAccessibilityPathAttribute @&quot;AXPath&quot;
</del><ins>+#ifndef NSAccessibilitySelectTextAmbiguityResolution
+#define NSAccessibilitySelectTextAmbiguityResolution @&quot;AXSelectTextAmbiguityResolution&quot;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#define NSAccessibilityDOMIdentifierAttribute @&quot;AXDOMIdentifier&quot;
-#define NSAccessibilityDOMClassListAttribute @&quot;AXDOMClassList&quot;
</del><ins>+#ifndef NSAccessibilitySelectTextAmbiguityResolutionClosestAfterSelection
+#define NSAccessibilitySelectTextAmbiguityResolutionClosestAfterSelection @&quot;AXSelectTextAmbiguityResolutionClosestAfterSelection&quot;
+#endif
</ins><span class="cx"> 
</span><ins>+#ifndef NSAccessibilitySelectTextAmbiguityResolutionClosestBeforeSelection
+#define NSAccessibilitySelectTextAmbiguityResolutionClosestBeforeSelection @&quot;AXSelectTextAmbiguityResolutionClosestBeforeSelection&quot;
+#endif
+
+#ifndef NSAccessibilitySelectTextAmbiguityResolutionClosestToSelection
+#define NSAccessibilitySelectTextAmbiguityResolutionClosestToSelection @&quot;AXSelectTextAmbiguityResolutionClosestToSelection&quot;
+#endif
+
+#ifndef NSAccessibilitySelectTextSearchStrings
+#define NSAccessibilitySelectTextSearchStrings @&quot;AXSelectTextSearchStrings&quot;
+#endif
+
+#ifndef NSAccessibilitySelectTextWithCriteriaParameterizedAttribute
+#define NSAccessibilitySelectTextWithCriteriaParameterizedAttribute @&quot;AXSelectTextWithCriteria&quot;
+#endif
+
</ins><span class="cx"> // Math attributes
</span><span class="cx"> #define NSAccessibilityMathRootRadicandAttribute @&quot;AXMathRootRadicand&quot;
</span><span class="cx"> #define NSAccessibilityMathRootIndexAttribute @&quot;AXMathRootIndex&quot;
</span><span class="lines">@@ -582,6 +615,37 @@
</span><span class="cx">     return criteria;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#pragma mark Select text helpers
+
+static AccessibilitySelectTextCriteria accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute(const NSDictionary *parameterizedAttribute)
+{
+    NSString *ambiguityResolutionParameter = parameterizedAttribute[NSAccessibilitySelectTextAmbiguityResolution];
+    NSArray *searchStringsParameter = parameterizedAttribute[NSAccessibilitySelectTextSearchStrings];
+    
+    AccessibilitySelectTextActivity activity = FindAndSelectActivity;
+    
+    AccessibilitySelectTextAmbiguityResolution ambiguityResolution = ClosestToSelectionAmbiguityResolution;
+    if ([ambiguityResolutionParameter isKindOfClass:[NSString class]]) {
+        if ([ambiguityResolutionParameter isEqualToString:NSAccessibilitySelectTextAmbiguityResolutionClosestAfterSelection])
+            ambiguityResolution = ClosestAfterSelectionAmbiguityResolution;
+        else if ([ambiguityResolutionParameter isEqualToString:NSAccessibilitySelectTextAmbiguityResolutionClosestBeforeSelection])
+            ambiguityResolution = ClosestBeforeSelectionAmbiguityResolution;
+    }
+    
+    AccessibilitySelectTextCriteria criteria(activity, ambiguityResolution);
+    
+    if ([searchStringsParameter isKindOfClass:[NSArray class]]) {
+        size_t searchStringsCount = static_cast&lt;size_t&gt;([searchStringsParameter count]);
+        criteria.searchStrings.reserveInitialCapacity(searchStringsCount);
+        for (NSString *searchString in searchStringsParameter) {
+            if ([searchString isKindOfClass:[NSString class]])
+                criteria.searchStrings.uncheckedAppend(searchString);
+        }
+    }
+    
+    return criteria;
+}
+
</ins><span class="cx"> #pragma mark Text Marker helpers
</span><span class="cx"> 
</span><span class="cx"> static id textMarkerForVisiblePosition(AXObjectCache* cache, const VisiblePosition&amp; visiblePos)
</span><span class="lines">@@ -2928,6 +2992,7 @@
</span><span class="cx">                       NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute,
</span><ins>+                      NSAccessibilitySelectTextWithCriteriaParameterizedAttribute,
</ins><span class="cx">                       nil];
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -3314,6 +3379,11 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // dispatch
</span><ins>+    if ([attribute isEqualToString:NSAccessibilitySelectTextWithCriteriaParameterizedAttribute]) {
+        AccessibilitySelectTextCriteria criteria = accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute(dictionary);
+        return m_object-&gt;selectText(&amp;criteria);
+    }
+    
</ins><span class="cx">     if ([attribute isEqualToString:NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute]) {
</span><span class="cx">         AccessibilitySearchCriteria criteria = accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(dictionary);
</span><span class="cx">         AccessibilityObject::AccessibilityChildrenVector results;
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.cpp (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.cpp        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Source/WebCore/dom/Position.cpp        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -827,6 +827,30 @@
</span><span class="cx">     return lastVisible;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned Position::positionCountBetweenPositions(const Position&amp; a, const Position&amp; b)
+{
+    if (a.isNull() || b.isNull())
+        return UINT_MAX;
+    
+    Position endPos;
+    Position pos;
+    if (a &gt; b) {
+        endPos = a;
+        pos = b;
+    } else if (a &lt; b) {
+        endPos = b;
+        pos = a;
+    } else
+        return 0;
+    
+    unsigned posCount = 0;
+    while (!pos.atEndOfTree() &amp;&amp; pos != endPos) {
+        pos = pos.next();
+        ++posCount;
+    }
+    return posCount;
+}
+
</ins><span class="cx"> static int boundingBoxLogicalHeight(RenderObject *o, const IntRect &amp;rect)
</span><span class="cx"> {
</span><span class="cx">     return o-&gt;style().isHorizontalWritingMode() ? rect.height() : rect.width();
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Position.h (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Position.h        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Source/WebCore/dom/Position.h        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -186,6 +186,9 @@
</span><span class="cx"> 
</span><span class="cx">     TextDirection primaryDirection() const;
</span><span class="cx"> 
</span><ins>+    // Returns the number of positions that exist between two positions.
+    static unsigned positionCountBetweenPositions(const Position&amp;, const Position&amp;);
+
</ins><span class="cx">     static bool hasRenderedNonAnonymousDescendantsWithHeight(const RenderElement&amp;);
</span><span class="cx">     static bool nodeIsUserSelectNone(Node*);
</span><span class="cx"> #if ENABLE(USERSELECT_ALL)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/ChangeLog        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-02-07  Samuel White  &lt;samuel_white@apple.com&gt;
+
+        AX: Find and select text with respect to insertion point using accessibility API.
+        https://bugs.webkit.org/show_bug.cgi?id=128026
+
+        Reviewed by Chris Fleizach.
+
+        Added method to AccessibilityUIElement to enable testing of accessibility text selection.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (selectTextWithCriteriaCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (selectTextParameterizedAttributeForCriteria):
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
+        (WTR::AccessibilityUIElement::uiElementForSearchPredicate):
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::selectTextParameterizedAttributeForCriteria):
+        (WTR::AccessibilityUIElement::selectTextWithCriteria):
+
</ins><span class="cx"> 2014-02-07  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Disable gtk-doc in EWS
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -250,6 +250,18 @@
</span><span class="cx">     return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)-&gt;uiElementForSearchPredicate(context, startElement, isDirectionNext, searchKey, searchText.get(), visibleOnly));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef selectTextWithCriteriaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 2)
+        return JSValueMakeUndefined(context);
+    
+    JSRetainPtr&lt;JSStringRef&gt; ambiguityResolution(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    JSValueRef searchStrings = arguments[1];
+    
+    JSRetainPtr&lt;JSStringRef&gt; result(Adopt, toAXElement(thisObject)-&gt;selectTextWithCriteria(context, ambiguityResolution.get(), searchStrings));
+    return JSValueMakeString(context, result.get());
+}
+
</ins><span class="cx"> static JSValueRef indexOfChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     if (argumentCount != 1)
</span><span class="lines">@@ -1489,8 +1501,9 @@
</span><span class="cx">         { &quot;stringForRange&quot;, stringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;attributedStringForRange&quot;, attributedStringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;attributedStringRangeIsMisspelled&quot;, attributedStringRangeIsMisspelledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><del>-        { &quot;uiElementCountForSearchPredicate&quot;, uiElementCountForSearchPredicateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeReadOnly },
</del><ins>+        { &quot;uiElementCountForSearchPredicate&quot;, uiElementCountForSearchPredicateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { &quot;uiElementForSearchPredicate&quot;, uiElementForSearchPredicateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+        { &quot;selectTextWithCriteria&quot;, selectTextWithCriteriaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { &quot;childAtIndex&quot;, childAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;linkedUIElementAtIndex&quot;, linkedUIElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;indexOfChild&quot;, indexOfChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.h (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.h        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.h        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -209,6 +209,7 @@
</span><span class="cx">     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
</span><span class="cx">     unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</span><span class="cx">     AccessibilityUIElement uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</span><ins>+    JSStringRef selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void elementsForRange(unsigned location, unsigned length, Vector&lt;AccessibilityUIElement&gt;&amp; elements);
</span><span class="cx">     JSStringRef stringForSelection();
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -1203,6 +1203,12 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    // FIXME: implement
+    return nullptr;
+}
+
</ins><span class="cx"> AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
</span><span class="cx"> {
</span><span class="cx">     if (!ATK_IS_TABLE(m_element))
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -822,6 +822,12 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    // FIXME: Implement.
+    return nullptr;
+}
+
</ins><span class="cx"> double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -245,6 +245,41 @@
</span><span class="cx">     return parameterizedAttribute;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    NSMutableDictionary *parameterizedAttribute = [NSMutableDictionary dictionary];
+    
+    if (ambiguityResolution)
+        [parameterizedAttribute setObject:[NSString stringWithJSStringRef:ambiguityResolution] forKey:@&quot;AXSelectTextAmbiguityResolution&quot;];
+    
+    if (searchStrings) {
+        NSMutableArray *searchStringsParameter = [NSMutableArray array];
+        if (JSValueIsString(context, searchStrings)) {
+            JSRetainPtr&lt;JSStringRef&gt; searchStringsString(Adopt, JSValueToStringCopy(context, searchStrings, nullptr));
+            if (searchStringsString)
+                [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
+        }
+        else if (JSValueIsObject(context, searchStrings)) {
+            JSObjectRef searchStringsArray = JSValueToObject(context, searchStrings, nullptr);
+            unsigned searchStringsArrayLength = 0;
+            
+            JSRetainPtr&lt;JSStringRef&gt; lengthPropertyString(Adopt, JSStringCreateWithUTF8CString(&quot;length&quot;));
+            JSValueRef searchStringsArrayLengthValue = JSObjectGetProperty(context, searchStringsArray, lengthPropertyString.get(), nullptr);
+            if (searchStringsArrayLengthValue &amp;&amp; JSValueIsNumber(context, searchStringsArrayLengthValue))
+                searchStringsArrayLength = static_cast&lt;unsigned&gt;(JSValueToNumber(context, searchStringsArrayLengthValue, nullptr));
+            
+            for (unsigned i = 0; i &lt; searchStringsArrayLength; ++i) {
+                JSRetainPtr&lt;JSStringRef&gt; searchStringsString(Adopt, JSValueToStringCopy(context, JSObjectGetPropertyAtIndex(context, searchStringsArray, i, nullptr), nullptr));
+                if (searchStringsString)
+                    [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
+            }
+        }
+        [parameterizedAttribute setObject:searchStringsParameter forKey:@&quot;AXSelectTextSearchStrings&quot;];
+    }
+    
+    return parameterizedAttribute;
+}
+
</ins><span class="cx"> void AccessibilityUIElement::getLinkedUIElements(Vector&lt;AccessibilityUIElement&gt;&amp; elementVector)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1058,6 +1093,18 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings);
+    id result = [m_element accessibilityAttributeValue:@&quot;AXSelectTextWithCriteria&quot; forParameter:parameterizedAttribute];
+    if ([result isKindOfClass:[NSString class]])
+        return [result createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return nullptr;
+}
+
</ins><span class="cx"> JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
</span><span class="cx"> {
</span><span class="cx">     // not yet defined in AppKit... odd
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -608,6 +608,11 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSStringRef AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
</span><span class="cx"> {
</span><span class="cx">     return 0;
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -172,6 +172,7 @@
</span><span class="cx"> bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
</span><span class="cx"> unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool) { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool) { return 0; }
</span><ins>+JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::selectTextWithCriteria(JSContextRef, JSStringRef, JSValueRef) { return nullptr; }
</ins><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::cellForColumnAndRow(unsigned, unsigned) { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::horizontalScrollbar() const { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::verticalScrollbar() const { return 0; }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -205,6 +205,7 @@
</span><span class="cx">     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
</span><span class="cx">     unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</span><span class="cx">     PassRefPtr&lt;AccessibilityUIElement&gt; uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</span><ins>+    JSRetainPtr&lt;JSStringRef&gt; selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings);
</ins><span class="cx"> 
</span><span class="cx">     // Text-specific
</span><span class="cx">     JSRetainPtr&lt;JSStringRef&gt; characterAtOffset(int offset);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -157,6 +157,7 @@
</span><span class="cx">     boolean attributedStringRangeIsMisspelled(unsigned long location, unsigned long length);
</span><span class="cx">     [PassContext] unsigned int uiElementCountForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly);
</span><span class="cx">     [PassContext] AccessibilityUIElement uiElementForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly);
</span><ins>+    [PassContext] DOMString selectTextWithCriteria(DOMString ambiguityResolution, object searchStrings);
</ins><span class="cx">     void setSelectedTextRange(unsigned long location, unsigned long length);
</span><span class="cx"> 
</span><span class="cx">     // Scroll area attributes.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -462,19 +462,19 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</del><ins>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</del><ins>+PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</ins><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</del><ins>+JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::selectTextWithCriteria(JSContextRef, JSStringRef ambiguityResolution, JSValueRef searchStrings)
</ins><span class="cx"> {
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::attributesOfColumnHeaders()
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (163631 => 163632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2014-02-07 18:37:55 UTC (rev 163631)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2014-02-07 18:43:38 UTC (rev 163632)
</span><span class="lines">@@ -270,6 +270,41 @@
</span><span class="cx">     return parameterizedAttribute;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSDictionary *selectTextParameterizedAttributeForCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    NSMutableDictionary *parameterizedAttribute = [NSMutableDictionary dictionary];
+    
+    if (ambiguityResolution)
+        [parameterizedAttribute setObject:[NSString stringWithJSStringRef:ambiguityResolution] forKey:@&quot;AXSelectTextAmbiguityResolution&quot;];
+    
+    if (searchStrings) {
+        NSMutableArray *searchStringsParameter = [NSMutableArray array];
+        if (JSValueIsString(context, searchStrings)) {
+            JSRetainPtr&lt;JSStringRef&gt; searchStringsString(Adopt, JSValueToStringCopy(context, searchStrings, nullptr));
+            if (searchStringsString)
+                [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
+        }
+        else if (JSValueIsObject(context, searchStrings)) {
+            JSObjectRef searchStringsArray = JSValueToObject(context, searchStrings, nullptr);
+            unsigned searchStringsArrayLength = 0;
+            
+            JSRetainPtr&lt;JSStringRef&gt; lengthPropertyString(Adopt, JSStringCreateWithUTF8CString(&quot;length&quot;));
+            JSValueRef searchStringsArrayLengthValue = JSObjectGetProperty(context, searchStringsArray, lengthPropertyString.get(), nullptr);
+            if (searchStringsArrayLengthValue &amp;&amp; JSValueIsNumber(context, searchStringsArrayLengthValue))
+                searchStringsArrayLength = static_cast&lt;unsigned&gt;(JSValueToNumber(context, searchStringsArrayLengthValue, nullptr));
+            
+            for (unsigned i = 0; i &lt; searchStringsArrayLength; ++i) {
+                JSRetainPtr&lt;JSStringRef&gt; searchStringsString(Adopt, JSValueToStringCopy(context, JSObjectGetPropertyAtIndex(context, searchStringsArray, i, nullptr), nullptr));
+                if (searchStringsString)
+                    [searchStringsParameter addObject:[NSString stringWithJSStringRef:searchStringsString.get()]];
+            }
+        }
+        [parameterizedAttribute setObject:searchStringsParameter forKey:@&quot;AXSelectTextSearchStrings&quot;];
+    }
+    
+    return parameterizedAttribute;
+}
+
</ins><span class="cx"> void AccessibilityUIElement::getLinkedUIElements(Vector&lt;RefPtr&lt;AccessibilityUIElement&gt; &gt;&amp; elementVector)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><span class="lines">@@ -1113,6 +1148,18 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::selectTextWithCriteria(JSContextRef context, JSStringRef ambiguityResolution, JSValueRef searchStrings)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSDictionary *parameterizedAttribute = selectTextParameterizedAttributeForCriteria(context, ambiguityResolution, searchStrings);
+    id result = [m_element accessibilityAttributeValue:@&quot;AXSelectTextWithCriteria&quot; forParameter:parameterizedAttribute];
+    if ([result isKindOfClass:[NSString class]])
+        return [result createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return nullptr;
+}
+
</ins><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::attributesOfColumnHeaders()
</span><span class="cx"> {
</span><span class="cx">     // not yet defined in AppKit... odd
</span></span></pre>
</div>
</div>

</body>
</html>