<!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>[159980] 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/159980">159980</a></dd>
<dt>Author</dt> <dd>samuel_white@apple.com</dd>
<dt>Date</dt> <dd>2013-12-02 16:36:23 -0800 (Mon, 02 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>    AX: Add AXUIElementCountForSearchPredicate parameterized attribute.
    https://bugs.webkit.org/show_bug.cgi?id=124561

    Reviewed by Chris Fleizach.

    Added test to verify that NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute
    works as it should and updated existing test that has exposes this new attribute.

    * platform/mac/accessibility/bounds-for-range-expected.txt:
    * platform/mac/accessibility/search-predicate-element-count-expected.txt: Added.
    * platform/mac/accessibility/search-predicate-element-count.html: Added.

    Added ability to fetch the number of elements that match a specific criteria. This will enable VoiceOver
    to interface with WebKit much more dynamically. We can now get an idea of how many interesting elements
    exist on a page, and then fetch them in chunks as needed.

    Test: platform/mac/accessibility/search-predicate-element-count.html

    * accessibility/AccessibilityObject.cpp:
    (WebCore::AccessibilityObject::isAccessibilityTextSearchMatch):
    * accessibility/AccessibilityObject.h:
    (WebCore::AccessibilitySearchCriteria::AccessibilitySearchCriteria):
    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
    (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
    (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
    (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

    Added function to verify that NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute works as it should.

    * DumpRenderTree/AccessibilityUIElement.cpp:
    (uiElementCountForSearchPredicateCallback):
    (uiElementForSearchPredicateCallback):
    (AccessibilityUIElement::getJSClass):
    * DumpRenderTree/AccessibilityUIElement.h:
    * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
    (AccessibilityUIElement::uiElementCountForSearchPredicate):
    * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
    (AccessibilityUIElement::uiElementCountForSearchPredicate):
    * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
    (searchPredicateParameterizedAttributeForSearchCriteria):
    (AccessibilityUIElement::uiElementCountForSearchPredicate):
    (AccessibilityUIElement::uiElementForSearchPredicate):
    * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
    (AccessibilityUIElement::uiElementCountForSearchPredicate):
    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
    (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
    * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
    * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
    * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
    (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
    * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
    (WTR::searchPredicateParameterizedAttributeForSearchCriteria):
    (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
    (WTR::AccessibilityUIElement::uiElementForSearchPredicate):</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="#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="#trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp">trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitysearchpredicateelementcountexpectedtxt">trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacaccessibilitysearchpredicateelementcounthtml">trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/LayoutTests/ChangeLog        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2013-12-02  Samuel White  &lt;samuel_white@apple.com&gt;
+
+        AX: Add AXUIElementCountForSearchPredicate parameterized attribute.
+        https://bugs.webkit.org/show_bug.cgi?id=124561
+
+        Reviewed by Chris Fleizach.
+
+        Added test to verify that NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute
+        works as it should and updated existing test that has exposes this new attribute.
+
+        * platform/mac/accessibility/bounds-for-range-expected.txt:
+        * platform/mac/accessibility/search-predicate-element-count-expected.txt: Added.
+        * platform/mac/accessibility/search-predicate-element-count.html: Added.
+
</ins><span class="cx"> 2013-12-02  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css shapes] Layout support for new circle shape syntax
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilityboundsforrangeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx"> AXLengthForTextMarkerRange
</span><span class="cx"> AXBoundsForRange
</span><span class="cx"> AXStringForRange
</span><ins>+AXUIElementCountForSearchPredicate
</ins><span class="cx"> AXUIElementsForSearchPredicate
</span><span class="cx"> AXEndTextMarkerForBounds
</span><span class="cx"> AXStartTextMarkerForBounds
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilitysearchpredicateelementcountexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count-expected.txt (0 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count-expected.txt        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This tests that search predicate based element count results are accurate.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS elementCount is 2
+PASS elementCount is 3
+PASS elementCount is 4
+PASS elementCount is 5
+PASS elementCount is 6
+PASS elementCount is 6
+PASS elementCount is 4
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacaccessibilitysearchpredicateelementcounthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count.html (0 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count.html                                (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/search-predicate-element-count.html        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -0,0 +1,101 @@
</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;style&gt;
+    .offscreen {
+        position:relative;
+        top:9999px;
+    }
+&lt;/style&gt;
+&lt;title&gt;Search Predicate Element Count&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div id=&quot;container&quot;&gt;
+&lt;p id=&quot;start&quot;&gt;Start&lt;/p&gt;
+&lt;!-- Tables. --&gt;
+&lt;table border=&quot;1&quot;&gt;
+&lt;tr&gt;&lt;th&gt;A&lt;/th&gt;&lt;th&gt;B&lt;/th&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;C&lt;/td&gt;&lt;td&gt;D&lt;/td&gt;&lt;/tr&gt;
+&lt;/table&gt;
+&lt;table border=&quot;1&quot;&gt;
+&lt;tr&gt;&lt;th&gt;W&lt;/th&gt;&lt;th&gt;X&lt;/th&gt;&lt;/tr&gt;
+&lt;tr&gt;&lt;td&gt;Y&lt;/td&gt;&lt;td&gt;Z&lt;/td&gt;&lt;/tr&gt;
+&lt;/table&gt;
+&lt;br&gt;
+&lt;!-- Links. --&gt;
+&lt;a href=&quot;#&quot;&gt;Link 1&lt;/a&gt;
+&lt;a href=&quot;#&quot;&gt;Link 2&lt;/a&gt;
+&lt;a href=&quot;#&quot;&gt;Link 3&lt;/a&gt;
+&lt;br&gt;
+&lt;!-- Images. --&gt;
+&lt;img alt=&quot;Cake&quot; src=&quot;resources/cake.png&quot;&gt;
+&lt;img alt=&quot;Cake&quot; src=&quot;resources/cake.png&quot;&gt;
+&lt;img alt=&quot;Cake&quot; src=&quot;resources/cake.png&quot;&gt;
+&lt;img alt=&quot;Cake&quot; src=&quot;resources/cake.png&quot;&gt;
+&lt;br&gt;
+&lt;!-- Inputs. --&gt;
+&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
+&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
+&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
+&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
+&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
+&lt;br&gt;
+&lt;!-- Headings. --&gt;
+&lt;h1&gt;Heading 1&lt;/h1&gt;
+&lt;h2&gt;Heading 2&lt;/h2&gt;
+&lt;h3&gt;Heading 3&lt;/h3&gt;
+&lt;h4&gt;Heading 4&lt;/h4&gt;
+&lt;h5 class=&quot;offscreen&quot;&gt;Heading 5&lt;/h5&gt;
+&lt;h6 class=&quot;offscreen&quot;&gt;Heading 6&lt;/h6&gt;
+&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 search predicate based element count results are accurate.&quot;);
+    
+    if (window.accessibilityController) {
+        document.getElementById(&quot;container&quot;).focus();
+        var containerElement = accessibilityController.focusedElement;
+        var elementCount = 0;
+        var startElement = accessibilityController.accessibleElementById(&quot;start&quot;);
+        
+        // Tables.
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXTableSearchKey&quot;, &quot;&quot;, false);
+        shouldBe(&quot;elementCount&quot;, &quot;2&quot;);
+        
+        // Links.
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXLinkSearchKey&quot;, &quot;&quot;, false);
+        shouldBe(&quot;elementCount&quot;, &quot;3&quot;);
+        
+        // Images.
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXGraphicSearchKey&quot;, &quot;&quot;, false);
+        shouldBe(&quot;elementCount&quot;, &quot;4&quot;);
+        
+        // Inputs.
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXButtonSearchKey&quot;, &quot;&quot;, false);
+        shouldBe(&quot;elementCount&quot;, &quot;5&quot;);
+        
+        // Headings.
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXHeadingSearchKey&quot;, &quot;&quot;, false);
+        shouldBe(&quot;elementCount&quot;, &quot;6&quot;);
+        
+        // Onscreen
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXHeadingSearchKey&quot;, &quot;&quot;, false);
+        shouldBe(&quot;elementCount&quot;, &quot;6&quot;);
+        
+        // Offscreen
+        elementCount = containerElement.uiElementCountForSearchPredicate(startElement, true, &quot;AXHeadingSearchKey&quot;, &quot;&quot;, true);
+        shouldBe(&quot;elementCount&quot;, &quot;4&quot;);
+        
+        // Hide superfluous text.
+        document.getElementById(&quot;container&quot;).style.display = &quot;none&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 (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Source/WebCore/ChangeLog        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2013-12-02  Samuel White  &lt;samuel_white@apple.com&gt;
+
+        AX: Add AXUIElementCountForSearchPredicate parameterized attribute.
+        https://bugs.webkit.org/show_bug.cgi?id=124561
+
+        Reviewed by Chris Fleizach.
+
+        Added ability to fetch the number of elements that match a specific criteria. This will enable VoiceOver
+        to interface with WebKit much more dynamically. We can now get an idea of how many interesting elements
+        exist on a page, and then fetch them in chunks as needed.
+
+        Test: platform/mac/accessibility/search-predicate-element-count.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isAccessibilityTextSearchMatch):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilitySearchCriteria::AccessibilitySearchCriteria):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
+        (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+
</ins><span class="cx"> 2013-12-02  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css shapes] Layout support for new circle shape syntax
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx">     if (!axObject || !criteria)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    return axObject-&gt;accessibilityObjectContainsText(criteria-&gt;searchText);
</del><ins>+    return axObject-&gt;accessibilityObjectContainsText(&amp;criteria-&gt;searchText);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityObject::accessibilityObjectContainsText(String* text) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -339,16 +339,16 @@
</span><span class="cx">     AccessibilityObject* startObject;
</span><span class="cx">     AccessibilitySearchDirection searchDirection;
</span><span class="cx">     Vector&lt;AccessibilitySearchKey&gt; searchKeys;
</span><del>-    String* searchText;
</del><ins>+    String searchText;
</ins><span class="cx">     unsigned resultsLimit;
</span><span class="cx">     bool visibleOnly;
</span><span class="cx">     
</span><del>-    AccessibilitySearchCriteria(AccessibilityObject* o, AccessibilitySearchDirection d, String* t, unsigned l, bool v)
-    : startObject(o)
-    , searchDirection(d)
-    , searchText(t)
-    , resultsLimit(l)
-    , visibleOnly(v)
</del><ins>+    AccessibilitySearchCriteria(AccessibilityObject* startObject, AccessibilitySearchDirection searchDirection, String searchText, unsigned resultsLimit, bool visibleOnly)
+    : startObject(startObject)
+    , searchDirection(searchDirection)
+    , searchText(searchText)
+    , resultsLimit(resultsLimit)
+    , visibleOnly(visibleOnly)
</ins><span class="cx">     { }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -190,6 +190,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> // Search
</span><ins>+#ifndef NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute
+#define NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute @&quot;AXUIElementCountForSearchPredicate&quot;
+#endif
+
</ins><span class="cx"> #ifndef NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute
</span><span class="cx"> #define NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute @&quot;AXUIElementsForSearchPredicate&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -536,6 +540,52 @@
</span><span class="cx">     return searchKey ? searchKey : AnyTypeSearchKey;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static AccessibilitySearchCriteria accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(const NSDictionary *parameterizedAttribute)
+{
+    NSString *directionParameter = [parameterizedAttribute objectForKey:@&quot;AXDirection&quot;];
+    NSNumber *resultsLimitParameter = [parameterizedAttribute objectForKey:@&quot;AXResultsLimit&quot;];
+    NSString *searchTextParameter = [parameterizedAttribute objectForKey:@&quot;AXSearchText&quot;];
+    WebAccessibilityObjectWrapper *startElementParameter = [parameterizedAttribute objectForKey:@&quot;AXStartElement&quot;];
+    NSNumber *visibleOnlyParameter = [parameterizedAttribute objectForKey:@&quot;AXVisibleOnly&quot;];
+    id searchKeyParameter = [parameterizedAttribute objectForKey:@&quot;AXSearchKey&quot;];
+    
+    AccessibilitySearchDirection direction = SearchDirectionNext;
+    if ([directionParameter isKindOfClass:[NSString class]])
+        direction = [directionParameter isEqualToString:@&quot;AXDirectionNext&quot;] ? SearchDirectionNext : SearchDirectionPrevious;
+    
+    unsigned resultsLimit = 0;
+    if ([resultsLimitParameter isKindOfClass:[NSNumber class]])
+        resultsLimit = [resultsLimitParameter unsignedIntValue];
+    
+    String searchText;
+    if ([searchTextParameter isKindOfClass:[NSString class]])
+        searchText = searchTextParameter;
+    
+    AccessibilityObject *startElement = nullptr;
+    if ([startElementParameter isKindOfClass:[WebAccessibilityObjectWrapper class]])
+        startElement = [startElementParameter accessibilityObject];
+    
+    BOOL visibleOnly = NO;
+    if ([visibleOnlyParameter isKindOfClass:[NSNumber class]])
+        visibleOnly = [visibleOnlyParameter boolValue];
+    
+    AccessibilitySearchCriteria criteria = AccessibilitySearchCriteria(startElement, direction, searchText, resultsLimit, visibleOnly);
+    
+    if ([searchKeyParameter isKindOfClass:[NSString class]])
+        criteria.searchKeys.append(accessibilitySearchKeyForString(searchKeyParameter));
+    else if ([searchKeyParameter isKindOfClass:[NSArray class]]) {
+        size_t searchKeyCount = static_cast&lt;size_t&gt;([searchKeyParameter count]);
+        criteria.searchKeys.reserveInitialCapacity(searchKeyCount);
+        for (size_t i = 0; i &lt; searchKeyCount; ++i) {
+            NSString *searchKey = [searchKeyParameter objectAtIndex:i];
+            if ([searchKey isKindOfClass:[NSString class]])
+                criteria.searchKeys.uncheckedAppend(accessibilitySearchKeyForString(searchKey));
+        }
+    }
+    
+    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">@@ -2865,6 +2915,7 @@
</span><span class="cx">                       @&quot;AXLengthForTextMarkerRange&quot;,
</span><span class="cx">                       NSAccessibilityBoundsForRangeParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityStringForRangeParameterizedAttribute,
</span><ins>+                      NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute,
</ins><span class="cx">                       NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute,
</span><span class="lines">@@ -3254,45 +3305,17 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // dispatch
</span><ins>+    if ([attribute isEqualToString:NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute]) {
+        AccessibilitySearchCriteria criteria = accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(dictionary);
+        AccessibilityObject::AccessibilityChildrenVector results;
+        m_object-&gt;findMatchingObjects(&amp;criteria, results);
+        return @(results.size());
+    }
+    
</ins><span class="cx">     if ([attribute isEqualToString:NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute]) {
</span><del>-        AccessibilityObject* startObject = 0;
-        if ([[dictionary objectForKey:@&quot;AXStartElement&quot;] isKindOfClass:[WebAccessibilityObjectWrapper self]])
-            startObject = [(WebAccessibilityObjectWrapper*)[dictionary objectForKey:@&quot;AXStartElement&quot;] accessibilityObject];
-        
-        AccessibilitySearchDirection searchDirection = SearchDirectionNext;
-        if ([[dictionary objectForKey:@&quot;AXDirection&quot;] isKindOfClass:[NSString self]])
-            searchDirection = ([(NSString*)[dictionary objectForKey:@&quot;AXDirection&quot;] isEqualToString:@&quot;AXDirectionNext&quot;]) ? SearchDirectionNext : SearchDirectionPrevious;
-
-        String searchText;
-        if ([[dictionary objectForKey:@&quot;AXSearchText&quot;] isKindOfClass:[NSString self]])
-            searchText = (CFStringRef)[dictionary objectForKey:@&quot;AXSearchText&quot;];
-        
-        unsigned resultsLimit = 0;
-        if ([[dictionary objectForKey:@&quot;AXResultsLimit&quot;] isKindOfClass:[NSNumber self]])
-            resultsLimit = [(NSNumber*)[dictionary objectForKey:@&quot;AXResultsLimit&quot;] unsignedIntValue];
-        
-        BOOL visibleOnly = NO;
-        if ([[dictionary objectForKey:@&quot;AXVisibleOnly&quot;] isKindOfClass:[NSNumber self]])
-            visibleOnly = [(NSNumber*)[dictionary objectForKey:@&quot;AXVisibleOnly&quot;] boolValue];
-        
-        AccessibilitySearchCriteria criteria = AccessibilitySearchCriteria(startObject, searchDirection, &amp;searchText, resultsLimit, visibleOnly);
-                
-        id searchKeyEntry = [dictionary objectForKey:@&quot;AXSearchKey&quot;];
-        if ([searchKeyEntry isKindOfClass:[NSString class]])
-            criteria.searchKeys.append(accessibilitySearchKeyForString((CFStringRef)searchKeyEntry));
-        else if ([searchKeyEntry isKindOfClass:[NSArray class]]) {
-            size_t length = static_cast&lt;size_t&gt;([(NSArray *)searchKeyEntry count]);
-            criteria.searchKeys.reserveInitialCapacity(length);
-            for (size_t i = 0; i &lt; length; ++i) {
-                id searchKey = [(NSArray *)searchKeyEntry objectAtIndex:i];
-                if ([searchKey isKindOfClass:[NSString class]])
-                    criteria.searchKeys.append(accessibilitySearchKeyForString((CFStringRef)searchKey));
-            }
-        }
-        
</del><ins>+        AccessibilitySearchCriteria criteria = accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(dictionary);
</ins><span class="cx">         AccessibilityObject::AccessibilityChildrenVector results;
</span><span class="cx">         m_object-&gt;findMatchingObjects(&amp;criteria, results);
</span><del>-        
</del><span class="cx">         return convertToNSArray(results);
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/ChangeLog        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2013-12-02  Samuel White  &lt;samuel_white@apple.com&gt;
+
+        AX: Add AXUIElementCountForSearchPredicate parameterized attribute.
+        https://bugs.webkit.org/show_bug.cgi?id=124561
+
+        Reviewed by Chris Fleizach.
+
+        Added function to verify that NSAccessibilityUIElementCountForSearchPredicateParameterizedAttribute works as it should.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (uiElementCountForSearchPredicateCallback):
+        (uiElementForSearchPredicateCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
+        (AccessibilityUIElement::uiElementCountForSearchPredicate):
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::uiElementCountForSearchPredicate):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (searchPredicateParameterizedAttributeForSearchCriteria):
+        (AccessibilityUIElement::uiElementCountForSearchPredicate):
+        (AccessibilityUIElement::uiElementForSearchPredicate):
+        * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+        (AccessibilityUIElement::uiElementCountForSearchPredicate):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+        (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::searchPredicateParameterizedAttributeForSearchCriteria):
+        (WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
+        (WTR::AccessibilityUIElement::uiElementForSearchPredicate):
+
</ins><span class="cx"> 2013-12-02  Dániel Bátyai  &lt;Batyai.Daniel@stud.u-szeged.hu&gt;
</span><span class="cx"> 
</span><span class="cx">         Instead of a large 'if' block, each failure class should write it's own result in test_result_writer.py
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -202,32 +202,52 @@
</span><span class="cx">     return JSValueMakeBoolean(context, toAXElement(thisObject)-&gt;attributedStringRangeIsMisspelled(location, length));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef uiElementCountForSearchPredicateCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    AccessibilityUIElement* startElement = nullptr;
+    bool isDirectionNext = true;
+    JSValueRef searchKey = nullptr;
+    JSRetainPtr&lt;JSStringRef&gt; searchText = nullptr;
+    bool visibleOnly = false;
+    if (argumentCount == 5) {
+        if (JSValueIsObject(context, arguments[0]))
+            startElement = toAXElement(JSValueToObject(context, arguments[0], exception));
+        
+        isDirectionNext = JSValueToBoolean(context, arguments[1]);
+        
+        searchKey = arguments[2];
+        
+        if (JSValueIsString(context, arguments[3]))
+            searchText.adopt(JSValueToStringCopy(context, arguments[3], exception));
+        
+        visibleOnly = JSValueToBoolean(context, arguments[4]);
+    }
+    
+    return JSValueMakeNumber(context, toAXElement(thisObject)-&gt;uiElementCountForSearchPredicate(context, startElement, isDirectionNext, searchKey, searchText.get(), visibleOnly));
+}
+
</ins><span class="cx"> static JSValueRef uiElementForSearchPredicateCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><del>-    AccessibilityUIElement* startElement = 0;
</del><ins>+    AccessibilityUIElement* startElement = nullptr;
</ins><span class="cx">     bool isDirectionNext = true;
</span><ins>+    JSValueRef searchKey = nullptr;
+    JSRetainPtr&lt;JSStringRef&gt; searchText = nullptr;
</ins><span class="cx">     bool visibleOnly = false;
</span><del>-    JSValueRef searchKey = 0;
-    JSStringRef searchText = 0;
</del><span class="cx">     if (argumentCount == 5) {
</span><del>-        JSObjectRef startElementObject = JSValueToObject(context, arguments[0], exception);
-        if (startElementObject)
-            startElement = toAXElement(startElementObject);
-        isDirectionNext = JSValueToBoolean(context, arguments[1]);      
</del><ins>+        if (JSValueIsObject(context, arguments[0]))
+            startElement = toAXElement(JSValueToObject(context, arguments[0], exception));
</ins><span class="cx">         
</span><ins>+        isDirectionNext = JSValueToBoolean(context, arguments[1]);
+        
</ins><span class="cx">         searchKey = arguments[2];
</span><span class="cx">         
</span><span class="cx">         if (JSValueIsString(context, arguments[3]))
</span><del>-            searchText = JSValueToStringCopy(context, arguments[3], exception);
</del><ins>+            searchText.adopt(JSValueToStringCopy(context, arguments[3], exception));
</ins><span class="cx">         
</span><span class="cx">         visibleOnly = JSValueToBoolean(context, arguments[4]);
</span><span class="cx">     }
</span><del>-    JSObjectRef resultObject = AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)-&gt;uiElementForSearchPredicate(context, startElement, isDirectionNext, searchKey, searchText, visibleOnly));
-
-    if (searchText)
-        JSStringRelease(searchText);
</del><span class="cx">     
</span><del>-    return resultObject;
</del><ins>+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)-&gt;uiElementForSearchPredicate(context, startElement, isDirectionNext, searchKey, searchText.get(), visibleOnly));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static JSValueRef indexOfChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="lines">@@ -1390,6 +1410,7 @@
</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><ins>+        { &quot;uiElementCountForSearchPredicate&quot;, uiElementCountForSearchPredicateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeReadOnly },
</ins><span class="cx">         { &quot;uiElementForSearchPredicate&quot;, uiElementForSearchPredicateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;childAtIndex&quot;, childAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;linkedUIElementAtIndex&quot;, linkedUIElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.h (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.h        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.h        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -203,6 +203,7 @@
</span><span class="cx">     JSStringRef stringForRange(unsigned location, unsigned length);
</span><span class="cx">     JSStringRef attributedStringForRange(unsigned location, unsigned length);
</span><span class="cx">     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
</span><ins>+    unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</ins><span class="cx">     AccessibilityUIElement uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     void elementsForRange(unsigned location, unsigned length, Vector&lt;AccessibilityUIElement&gt;&amp; elements);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -1092,6 +1092,12 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    // FIXME: implement
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -797,6 +797,12 @@
</span><span class="cx">     // FIXME: implement
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    // FIXME: implement
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</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 (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -195,6 +195,56 @@
</span><span class="cx">     return [allElementString createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, unsigned resultsLimit, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    NSMutableDictionary *parameterizedAttribute = [NSMutableDictionary dictionary];
+    
+    if (startElement &amp;&amp; startElement-&gt;platformUIElement())
+        [parameterizedAttribute setObject:(id)startElement-&gt;platformUIElement() forKey:@&quot;AXStartElement&quot;];
+    
+    [parameterizedAttribute setObject:(isDirectionNext) ? @&quot;AXDirectionNext&quot; : @&quot;AXDirectionPrevious&quot; forKey:@&quot;AXDirection&quot;];
+    
+    [parameterizedAttribute setObject:@(resultsLimit) forKey:@&quot;AXResultsLimit&quot;];
+    
+    if (searchKey) {
+        id searchKeyParameter = nil;
+        if (JSValueIsString(context, searchKey)) {
+            JSRetainPtr&lt;JSStringRef&gt; searchKeyString(Adopt, JSValueToStringCopy(context, searchKey, nullptr));
+            if (searchKeyString)
+                searchKeyParameter = [NSString stringWithJSStringRef:searchKeyString.get()];
+        }
+        else if (JSValueIsObject(context, searchKey)) {
+            JSObjectRef searchKeyArray = JSValueToObject(context, searchKey, nullptr);
+            unsigned searchKeyArrayLength = 0;
+            
+            JSRetainPtr&lt;JSStringRef&gt; lengthPropertyString(Adopt, JSStringCreateWithUTF8CString(&quot;length&quot;));
+            JSValueRef searchKeyArrayLengthValue = JSObjectGetProperty(context, searchKeyArray, lengthPropertyString.get(), nullptr);
+            if (searchKeyArrayLengthValue &amp;&amp; JSValueIsNumber(context, searchKeyArrayLengthValue))
+                searchKeyArrayLength = static_cast&lt;unsigned&gt;(JSValueToNumber(context, searchKeyArrayLengthValue, nullptr));
+            
+            for (unsigned i = 0; i &lt; searchKeyArrayLength; ++i) {
+                JSValueRef searchKeyValue = JSObjectGetPropertyAtIndex(context, searchKeyArray, i, nullptr);
+                JSStringRef searchKeyString = JSValueToStringCopy(context, searchKeyValue, nullptr);
+                if (searchKeyString) {
+                    if (!searchKeyParameter)
+                        searchKeyParameter = [NSMutableArray array];
+                    [searchKeyParameter addObject:[NSString stringWithJSStringRef:searchKeyString]];
+                    JSStringRelease(searchKeyString);
+                }
+            }
+        }
+        if (searchKeyParameter)
+            [parameterizedAttribute setObject:searchKeyParameter forKey:@&quot;AXSearchKey&quot;];
+    }
+    
+    if (searchText &amp;&amp; JSStringGetLength(searchText))
+        [parameterizedAttribute setObject:[NSString stringWithJSStringRef:searchText] forKey:@&quot;AXSearchText&quot;];
+    
+    [parameterizedAttribute setObject:@(visibleOnly) forKey:@&quot;AXVisibleOnly&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">@@ -960,60 +1010,25 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, 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">     BEGIN_AX_OBJC_EXCEPTIONS
</span><del>-    NSMutableDictionary* parameter = [NSMutableDictionary dictionary];
-    [parameter setObject:(isDirectionNext) ? @&quot;AXDirectionNext&quot; : @&quot;AXDirectionPrevious&quot; forKey:@&quot;AXDirection&quot;];
-    if (visibleOnly)
-        [parameter setObject:[NSNumber numberWithBool:YES] forKey:@&quot;AXVisibleOnly&quot;];
-    [parameter setObject:[NSNumber numberWithInt:1] forKey:@&quot;AXResultsLimit&quot;];
-    if (startElement &amp;&amp; startElement-&gt;platformUIElement())
-        [parameter setObject:(id)startElement-&gt;platformUIElement() forKey:@&quot;AXStartElement&quot;];
-    if (searchKey) {
-        if (JSValueIsString(context, searchKey)) {
-            NSString *searchKeyParameter = nil;
-            JSStringRef singleSearchKey = JSValueToStringCopy(context, searchKey, 0);
-            if (singleSearchKey) {
-                searchKeyParameter = [NSString stringWithJSStringRef:singleSearchKey];
-                JSStringRelease(singleSearchKey);
-                if (searchKeyParameter)
-                    [parameter setObject:searchKeyParameter forKey:@&quot;AXSearchKey&quot;];
-            }
-        }
-        else if (JSValueIsObject(context, searchKey)) {
-            NSMutableArray *searchKeyParameter = nil;
-            JSObjectRef array = const_cast&lt;JSObjectRef&gt;(searchKey);
-            unsigned arrayLength = 0;
-            JSRetainPtr&lt;JSStringRef&gt; arrayLengthString(Adopt, JSStringCreateWithUTF8CString(&quot;length&quot;));
-            JSValueRef arrayLengthValue = JSObjectGetProperty(context, array, arrayLengthString.get(), 0);
-            if (arrayLengthValue &amp;&amp; JSValueIsNumber(context, arrayLengthValue))
-                arrayLength = static_cast&lt;unsigned&gt;(JSValueToNumber(context, arrayLengthValue, 0));
-            
-            for (unsigned i = 0; i &lt; arrayLength; ++i) {
-                JSValueRef exception = 0;
-                JSValueRef value = JSObjectGetPropertyAtIndex(context, array, i, &amp;exception);
-                if (exception)
-                    break;
-                JSStringRef singleSearchKey = JSValueToStringCopy(context, value, &amp;exception);
-                if (exception)
-                    break;
-                if (singleSearchKey) {
-                    if (!searchKeyParameter)
-                        searchKeyParameter = [NSMutableArray array];
-                    [searchKeyParameter addObject:[NSString stringWithJSStringRef:singleSearchKey]];
-                    JSStringRelease(singleSearchKey);
-                }
-            }
-            if (searchKeyParameter)
-                [parameter setObject:searchKeyParameter forKey:@&quot;AXSearchKey&quot;];
-        }
-    }
-    if (searchText &amp;&amp; JSStringGetLength(searchText))
-        [parameter setObject:[NSString stringWithJSStringRef:searchText] forKey:@&quot;AXSearchText&quot;];
</del><ins>+    NSDictionary *parameterizedAttribute = searchPredicateParameterizedAttributeForSearchCriteria(context, startElement, isDirectionNext, UINT_MAX, searchKey, searchText, visibleOnly);
+    id value = [m_element accessibilityAttributeValue:@&quot;AXUIElementCountForSearchPredicate&quot; forParameter:parameterizedAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value unsignedIntValue];
+    END_AX_OBJC_EXCEPTIONS
</ins><span class="cx">     
</span><del>-    id uiElement = [[m_element accessibilityAttributeValue:@&quot;AXUIElementsForSearchPredicate&quot; forParameter:parameter] lastObject];
-    return AccessibilityUIElement(uiElement);
</del><ins>+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSDictionary *parameterizedAttribute = searchPredicateParameterizedAttributeForSearchCriteria(context, startElement, isDirectionNext, 1, searchKey, searchText, visibleOnly);
+    id value = [m_element accessibilityAttributeValue:@&quot;AXUIElementsForSearchPredicate&quot; forParameter:parameterizedAttribute];
+    if ([value isKindOfClass:[NSArray class]])
+        return AccessibilityUIElement([value lastObject]);
</ins><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinAccessibilityUIElementWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -592,6 +592,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</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 (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -162,6 +162,7 @@
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::stringForRange(unsigned, unsigned) { return 0; }
</span><span class="cx"> JSRetainPtr&lt;JSStringRef&gt; AccessibilityUIElement::attributedStringForRange(unsigned, unsigned) { return 0; }
</span><span class="cx"> bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
</span><ins>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool) { return 0; }
</ins><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement*, bool, JSValueRef, JSStringRef, bool) { return 0; }
</span><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></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -199,6 +199,7 @@
</span><span class="cx">     JSRetainPtr&lt;JSStringRef&gt; stringForRange(unsigned location, unsigned length);
</span><span class="cx">     JSRetainPtr&lt;JSStringRef&gt; attributedStringForRange(unsigned location, unsigned length);
</span><span class="cx">     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
</span><ins>+    unsigned uiElementCountForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</ins><span class="cx">     PassRefPtr&lt;AccessibilityUIElement&gt; uiElementForSearchPredicate(JSContextRef, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly);
</span><span class="cx">     
</span><span class="cx">     // Table-specific
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx">     DOMString stringForRange(unsigned long location, unsigned long length);
</span><span class="cx">     DOMString attributedStringForRange(unsigned long location, unsigned long length);
</span><span class="cx">     boolean attributedStringRangeIsMisspelled(unsigned long location, unsigned long length);
</span><ins>+    [PassContext] unsigned int uiElementCountForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly);
</ins><span class="cx">     [PassContext] AccessibilityUIElement uiElementForSearchPredicate(AccessibilityUIElement startElement, boolean isDirectionNext, object searchKey, DOMString searchText, boolean visibleOnly);
</span><span class="cx">     void setSelectedTextRange(unsigned long location, unsigned long length);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -1157,6 +1157,12 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    // FIXME: implement
+    return 0;
+}
+
</ins><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement* startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (159979 => 159980)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2013-12-03 00:10:21 UTC (rev 159979)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2013-12-03 00:36:23 UTC (rev 159980)
</span><span class="lines">@@ -210,6 +210,56 @@
</span><span class="cx">     return [allElementString createJSStringRef];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static NSDictionary *searchPredicateParameterizedAttributeForSearchCriteria(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, unsigned resultsLimit, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    NSMutableDictionary *parameterizedAttribute = [NSMutableDictionary dictionary];
+    
+    if (startElement &amp;&amp; startElement-&gt;platformUIElement())
+        [parameterizedAttribute setObject:(id)startElement-&gt;platformUIElement() forKey:@&quot;AXStartElement&quot;];
+    
+    [parameterizedAttribute setObject:(isDirectionNext) ? @&quot;AXDirectionNext&quot; : @&quot;AXDirectionPrevious&quot; forKey:@&quot;AXDirection&quot;];
+    
+    [parameterizedAttribute setObject:@(resultsLimit) forKey:@&quot;AXResultsLimit&quot;];
+    
+    if (searchKey) {
+        id searchKeyParameter = nil;
+        if (JSValueIsString(context, searchKey)) {
+            JSRetainPtr&lt;JSStringRef&gt; searchKeyString(Adopt, JSValueToStringCopy(context, searchKey, nullptr));
+            if (searchKeyString)
+                searchKeyParameter = [NSString stringWithJSStringRef:searchKeyString.get()];
+        }
+        else if (JSValueIsObject(context, searchKey)) {
+            JSObjectRef searchKeyArray = JSValueToObject(context, searchKey, nullptr);
+            unsigned searchKeyArrayLength = 0;
+            
+            JSRetainPtr&lt;JSStringRef&gt; lengthPropertyString(Adopt, JSStringCreateWithUTF8CString(&quot;length&quot;));
+            JSValueRef searchKeyArrayLengthValue = JSObjectGetProperty(context, searchKeyArray, lengthPropertyString.get(), nullptr);
+            if (searchKeyArrayLengthValue &amp;&amp; JSValueIsNumber(context, searchKeyArrayLengthValue))
+                searchKeyArrayLength = static_cast&lt;unsigned&gt;(JSValueToNumber(context, searchKeyArrayLengthValue, nullptr));
+            
+            for (unsigned i = 0; i &lt; searchKeyArrayLength; ++i) {
+                JSValueRef searchKeyValue = JSObjectGetPropertyAtIndex(context, searchKeyArray, i, nullptr);
+                JSStringRef searchKeyString = JSValueToStringCopy(context, searchKeyValue, nullptr);
+                if (searchKeyString) {
+                    if (!searchKeyParameter)
+                        searchKeyParameter = [NSMutableArray array];
+                    [searchKeyParameter addObject:[NSString stringWithJSStringRef:searchKeyString]];
+                    JSStringRelease(searchKeyString);
+                }
+            }
+        }
+        if (searchKeyParameter)
+            [parameterizedAttribute setObject:searchKeyParameter forKey:@&quot;AXSearchKey&quot;];
+    }
+    
+    if (searchText &amp;&amp; JSStringGetLength(searchText))
+        [parameterizedAttribute setObject:[NSString stringWithJSStringRef:searchText] forKey:@&quot;AXSearchText&quot;];
+    
+    [parameterizedAttribute setObject:@(visibleOnly) forKey:@&quot;AXVisibleOnly&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">@@ -995,60 +1045,25 @@
</span><span class="cx">     return false;
</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>+unsigned AccessibilityUIElement::uiElementCountForSearchPredicate(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span><del>-    NSMutableDictionary* parameter = [NSMutableDictionary dictionary];
-    [parameter setObject:(isDirectionNext) ? @&quot;AXDirectionNext&quot; : @&quot;AXDirectionPrevious&quot; forKey:@&quot;AXDirection&quot;];
-    if (visibleOnly)
-        [parameter setObject:[NSNumber numberWithBool:YES] forKey:@&quot;AXVisibleOnly&quot;];
-    [parameter setObject:[NSNumber numberWithInt:1] forKey:@&quot;AXResultsLimit&quot;];
-    if (startElement &amp;&amp; startElement-&gt;platformUIElement())
-        [parameter setObject:(id)startElement-&gt;platformUIElement() forKey:@&quot;AXStartElement&quot;];
-    if (searchKey) {
-        if (JSValueIsString(context, searchKey)) {
-            NSString *searchKeyParameter = nil;
-            JSStringRef singleSearchKey = JSValueToStringCopy(context, searchKey, 0);
-            if (singleSearchKey) {
-                searchKeyParameter = [NSString stringWithJSStringRef:singleSearchKey];
-                JSStringRelease(singleSearchKey);
-                if (searchKeyParameter)
-                    [parameter setObject:searchKeyParameter forKey:@&quot;AXSearchKey&quot;];
-            }
-        }
-        else if (JSValueIsObject(context, searchKey)) {
-            NSMutableArray *searchKeyParameter = nil;
-            JSObjectRef array = const_cast&lt;JSObjectRef&gt;(searchKey);
-            unsigned arrayLength = 0;
-            JSRetainPtr&lt;JSStringRef&gt; arrayLengthString(Adopt, JSStringCreateWithUTF8CString(&quot;length&quot;));
-            JSValueRef arrayLengthValue = JSObjectGetProperty(context, array, arrayLengthString.get(), 0);
-            if (arrayLengthValue &amp;&amp; JSValueIsNumber(context, arrayLengthValue))
-                arrayLength = static_cast&lt;unsigned&gt;(JSValueToNumber(context, arrayLengthValue, 0));
-            
-            for (unsigned i = 0; i &lt; arrayLength; ++i) {
-                JSValueRef exception = 0;
-                JSValueRef value = JSObjectGetPropertyAtIndex(context, array, i, &amp;exception);
-                if (exception)
-                    break;
-                JSStringRef singleSearchKey = JSValueToStringCopy(context, value, &amp;exception);
-                if (exception)
-                    break;
-                if (singleSearchKey) {
-                    if (!searchKeyParameter)
-                        searchKeyParameter = [NSMutableArray array];
-                    [searchKeyParameter addObject:[NSString stringWithJSStringRef:singleSearchKey]];
-                    JSStringRelease(singleSearchKey);
-                }
-            }
-            if (searchKeyParameter)
-                [parameter setObject:searchKeyParameter forKey:@&quot;AXSearchKey&quot;];
-        }
-    }
-    if (searchText &amp;&amp; JSStringGetLength(searchText))
-        [parameter setObject:[NSString stringWithJSStringRef:searchText] forKey:@&quot;AXSearchText&quot;];
</del><ins>+    NSDictionary *parameterizedAttribute = searchPredicateParameterizedAttributeForSearchCriteria(context, startElement, isDirectionNext, UINT_MAX, searchKey, searchText, visibleOnly);
+    id value = [m_element accessibilityAttributeValue:@&quot;AXUIElementCountForSearchPredicate&quot; forParameter:parameterizedAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value unsignedIntValue];
+    END_AX_OBJC_EXCEPTIONS
</ins><span class="cx">     
</span><del>-    id uiElement = [[m_element accessibilityAttributeValue:@&quot;AXUIElementsForSearchPredicate&quot; forParameter:parameter] lastObject];
-    return AccessibilityUIElement::create(uiElement);
</del><ins>+    return 0;
+}
+
+PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::uiElementForSearchPredicate(JSContextRef context, AccessibilityUIElement *startElement, bool isDirectionNext, JSValueRef searchKey, JSStringRef searchText, bool visibleOnly)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSDictionary *parameterizedAttribute = searchPredicateParameterizedAttributeForSearchCriteria(context, startElement, isDirectionNext, 1, searchKey, searchText, visibleOnly);
+    id value = [m_element accessibilityAttributeValue:@&quot;AXUIElementsForSearchPredicate&quot; forParameter:parameterizedAttribute];
+    if ([value isKindOfClass:[NSArray class]])
+        return AccessibilityUIElement::create([value lastObject]);
</ins><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span></span></pre>
</div>
</div>

</body>
</html>