<!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>[160501] branches/safari-537.74-branch</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/160501">160501</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2013-12-12 11:57:27 -0800 (Thu, 12 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged patch from &lt;rdar://problems/15474133&gt;.  This patch is a port of <a href="http://trac.webkit.org/projects/webkit/changeset/157821">r157821</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari53774branchLayoutTestsChangeLog">branches/safari-537.74-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari53774branchLayoutTestsplatformmacaccessibilityboundsforrangeexpectedtxt">branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt</a></li>
<li><a href="#branchessafari53774branchSourceWebCoreChangeLog">branches/safari-537.74-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari53774branchSourceWebCoreaccessibilityAccessibilityObjectcpp">branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#branchessafari53774branchSourceWebCoreaccessibilityAccessibilityObjecth">branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#branchessafari53774branchSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#branchessafari53774branchSourceWebCoreaccessibilityAccessibilityRenderObjecth">branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.h</a></li>
<li><a href="#branchessafari53774branchSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm">branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm</a></li>
<li><a href="#branchessafari53774branchToolsChangeLog">branches/safari-537.74-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari53774branchToolsDumpRenderTreeAccessibilityUIElementcpp">branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp</a></li>
<li><a href="#branchessafari53774branchToolsDumpRenderTreeAccessibilityUIElementh">branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h</a></li>
<li><a href="#branchessafari53774branchToolsDumpRenderTreemacAccessibilityUIElementMacmm">branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#branchessafari53774branchToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp">branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp</a></li>
<li><a href="#branchessafari53774branchToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh">branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h</a></li>
<li><a href="#branchessafari53774branchToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl">branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl</a></li>
<li><a href="#branchessafari53774branchToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp">branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp</a></li>
<li><a href="#branchessafari53774branchToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari53774branchLayoutTestsplatformmacaccessibilitytextmarkerforboundsexpectedtxt">branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt</a></li>
<li><a href="#branchessafari53774branchLayoutTestsplatformmacaccessibilitytextmarkerforboundshtml">branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari53774branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/LayoutTests/ChangeLog (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/LayoutTests/ChangeLog        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/LayoutTests/ChangeLog        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2013-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merged patch from &lt;rdar://problems/15474133&gt;.  This patch is a port of r157821.
+
+    2013-10-22  Samuel White  &lt;samuel_white@apple.com&gt;
+
+            AX: Add paramAttrs to fetch start and end text markers in a given rect.
+            https://bugs.webkit.org/show_bug.cgi?id=122164
+
+            Unreviewed change.
+
+            Added test to ensure end/start text marker for bounds works as
+            expected. Updated bounds for range test to include new API.
+
+            * platform/mac/accessibility/bounds-for-range-expected.txt:
+            * platform/mac/accessibility/text-marker-for-bounds-expected.txt: Added.
+            * platform/mac/accessibility/text-marker-for-bounds.html: Added.
+
+2013-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Rollout r160469.  Not rolling out from trunk because r160469 was
</span><span class="cx">         applied on the branch from a patch file.
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari53774branchLayoutTestsplatformmacaccessibilityboundsforrangeexpectedtxt"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/bounds-for-range-expected.txt        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -53,6 +53,8 @@
</span><span class="cx"> AXBoundsForRange
</span><span class="cx"> AXStringForRange
</span><span class="cx"> AXUIElementsForSearchPredicate
</span><ins>+AXEndTextMarkerForBounds
+AXStartTextMarkerForBounds
</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="branchessafari53774branchLayoutTestsplatformmacaccessibilitytextmarkerforboundsexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt (0 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt                                (rev 0)
+++ branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds-expected.txt        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Text text text text text text text text text text.
+This tests that endTextMarkerForBounds and startTextMarkerForBounds work correctly.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS rangeFromBounds is rangeFromElement
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari53774branchLayoutTestsplatformmacaccessibilitytextmarkerforboundshtml"></a>
<div class="addfile"><h4>Added: branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html (0 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html                                (rev 0)
+++ branches/safari-537.74-branch/LayoutTests/platform/mac/accessibility/text-marker-for-bounds.html        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -0,0 +1,33 @@
</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;Text Marker for Bounds&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+&lt;div id=&quot;text&quot;&gt;Text text text text text text text text text text.&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 endTextMarkerForBounds and startTextMarkerForBounds work correctly.&quot;);
+    
+    if (window.accessibilityController) {
+        var text = accessibilityController.accessibleElementById(&quot;text&quot;);
+        
+        var startMarker = text.startTextMarkerForBounds(text.x, text.y, text.width, text.height);
+        var endMarker = text.endTextMarkerForBounds(text.x, text.y, text.width, text.height);
+        // Get text range from boundary markers.
+        var rangeFromBounds = text.textMarkerRangeLength(text.textMarkerRangeForMarkers(startMarker, endMarker));
+        // Get text range from element.
+        var rangeFromElement = text.textMarkerRangeLength(text.textMarkerRangeForElement(text));
+        
+        shouldBe(&quot;rangeFromBounds&quot;, &quot;rangeFromElement&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="branchessafari53774branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Source/WebCore/ChangeLog (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Source/WebCore/ChangeLog        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Source/WebCore/ChangeLog        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2013-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merged patch from &lt;rdar://problems/15474133&gt;.  This patch is a port of r157821.
+
+    2013-10-22  Samuel White  &lt;samuel_white@apple.com&gt;
+
+            AX: Add paramAttrs to fetch start and end text markers in a given rect.
+            https://bugs.webkit.org/show_bug.cgi?id=122164
+
+            Unreviewed change.
+
+            Added ability to fetch end and start text markers inside a given bounds. This gives ScreenReaders
+            like VoiceOver a way to retrieve the text markers for a specified column of page text.
+
+            Test: platform/mac/accessibility/text-marker-for-bounds.html
+
+            * accessibility/AccessibilityObject.cpp:
+            (WebCore::AccessibilityObject::mainFrame):
+            (WebCore::AccessibilityObject::topDocument):
+            (WebCore::AccessibilityObject::visiblePositionForBounds):
+            * accessibility/AccessibilityObject.h:
+            * accessibility/AccessibilityRenderObject.cpp:
+            * accessibility/AccessibilityRenderObject.h:
+            * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+            (-[WebAccessibilityObjectWrapper screenToContents:]):
+            (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
+            (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
+
+2013-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r154513
</span><span class="cx"> 
</span><span class="cx">     2013-08-23  Alex Christensen  &lt;achristensen@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari53774branchSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.cpp        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -584,7 +584,27 @@
</span><span class="cx">     actionElem-&gt;accessKeyAction(true);
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><ins>+
+Frame* AccessibilityObject::mainFrame() const
+{
+    Document* document = topDocument();
+    if (!document)
+        return 0;
</ins><span class="cx">     
</span><ins>+    Page* page = document-&gt;page();
+    if (!page)
+        return 0;
+    
+    return page-&gt;mainFrame();
+}
+
+Document* AccessibilityObject::topDocument() const
+{
+    if (!document())
+        return 0;
+    return document()-&gt;topDocument();
+}
+
</ins><span class="cx"> String AccessibilityObject::language() const
</span><span class="cx"> {
</span><span class="cx">     const AtomicString&amp; lang = getAttribute(langAttr);
</span><span class="lines">@@ -914,6 +934,38 @@
</span><span class="cx">     return length;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+VisiblePosition AccessibilityObject::visiblePositionForBounds(const IntRect&amp; rect, AccessibilityVisiblePositionForBounds visiblePositionForBounds) const
+{
+    if (rect.isEmpty())
+        return VisiblePosition();
+    
+    Frame* mainFrame = this-&gt;mainFrame();
+    if (!mainFrame)
+        return VisiblePosition();
+    
+    // FIXME: Add support for right-to-left languages.
+    IntPoint corner = (visiblePositionForBounds == FirstVisiblePositionForBounds) ? rect.minXMinYCorner() : rect.maxXMaxYCorner();
+    VisiblePosition position = mainFrame-&gt;visiblePositionForPoint(corner);
+    
+    if (rect.contains(position.absoluteCaretBounds().center()))
+        return position;
+    
+    // If the initial position is located outside the bounds adjust it incrementally as needed.
+    VisiblePosition nextPosition = position.next();
+    VisiblePosition previousPosition = position.previous();
+    while (nextPosition.isNotNull() || previousPosition.isNotNull()) {
+        if (rect.contains(nextPosition.absoluteCaretBounds().center()))
+            return nextPosition;
+        if (rect.contains(previousPosition.absoluteCaretBounds().center()))
+            return previousPosition;
+        
+        nextPosition = nextPosition.next();
+        previousPosition = previousPosition.previous();
+    }
+    
+    return VisiblePosition();
+}
+
</ins><span class="cx"> VisiblePosition AccessibilityObject::nextWordEnd(const VisiblePosition&amp; visiblePos) const
</span><span class="cx"> {
</span><span class="cx">     if (visiblePos.isNull())
</span></span></pre></div>
<a id="branchessafari53774branchSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityObject.h        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -311,6 +311,11 @@
</span><span class="cx">     VisitedLinkSearchKey
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum AccessibilityVisiblePositionForBounds {
+    FirstVisiblePositionForBounds,
+    LastVisiblePositionForBounds
+};
+
</ins><span class="cx"> struct AccessibilitySearchCriteria {
</span><span class="cx">     AccessibilityObject* startObject;
</span><span class="cx">     AccessibilitySearchDirection searchDirection;
</span><span class="lines">@@ -633,6 +638,8 @@
</span><span class="cx">     virtual Document* document() const;
</span><span class="cx">     virtual FrameView* topDocumentFrameView() const { return 0; }
</span><span class="cx">     virtual FrameView* documentFrameView() const;
</span><ins>+    Frame* mainFrame() const;
+    Document* topDocument() const;
</ins><span class="cx">     String language() const;
</span><span class="cx">     // 1-based, to match the aria-level spec.
</span><span class="cx">     virtual unsigned hierarchicalLevel() const { return 0; }
</span><span class="lines">@@ -705,6 +712,7 @@
</span><span class="cx">     int lengthForVisiblePositionRange(const VisiblePositionRange&amp;) const;
</span><span class="cx">     virtual void setSelectedVisiblePositionRange(const VisiblePositionRange&amp;) const { }
</span><span class="cx"> 
</span><ins>+    VisiblePosition visiblePositionForBounds(const IntRect&amp;, AccessibilityVisiblePositionForBounds) const;
</ins><span class="cx">     virtual VisiblePosition visiblePositionForPoint(const IntPoint&amp;) const { return VisiblePosition(); }
</span><span class="cx">     VisiblePosition nextVisiblePosition(const VisiblePosition&amp; visiblePos) const { return visiblePos.next(); }
</span><span class="cx">     VisiblePosition previousVisiblePosition(const VisiblePosition&amp; visiblePos) const { return visiblePos.previous(); }
</span></span></pre></div>
<a id="branchessafari53774branchSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -1692,13 +1692,6 @@
</span><span class="cx">     return m_renderer-&gt;document();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Document* AccessibilityRenderObject::topDocument() const
-{
-    if (!document())
-        return 0;
-    return document()-&gt;topDocument();
-}
-    
</del><span class="cx"> FrameView* AccessibilityRenderObject::topDocumentFrameView() const
</span><span class="cx"> {
</span><span class="cx">     RenderView* renderView = topRenderer();
</span></span></pre></div>
<a id="branchessafari53774branchSourceWebCoreaccessibilityAccessibilityRenderObjecth"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.h (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.h        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/AccessibilityRenderObject.h        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -136,7 +136,6 @@
</span><span class="cx">     RenderView* topRenderer() const;
</span><span class="cx">     RenderTextControl* textControl() const;
</span><span class="cx">     FrameView* topDocumentFrameView() const;  
</span><del>-    Document* topDocument() const;
</del><span class="cx">     HTMLLabelElement* labelElementContainer() const;
</span><span class="cx">     
</span><span class="cx">     virtual KURL url() const;
</span></span></pre></div>
<a id="branchessafari53774branchSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -195,6 +195,15 @@
</span><span class="cx"> #define NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute @&quot;AXUIElementsForSearchPredicate&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// Text
+#ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @&quot;AXEndTextMarkerForBounds&quot;
+#endif
+
+#ifndef NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute @&quot;AXStartTextMarkerForBounds&quot;
+#endif
+
</ins><span class="cx"> // Search Keys
</span><span class="cx"> #ifndef NSAccessibilityAnyTypeSearchKey
</span><span class="cx"> #define NSAccessibilityAnyTypeSearchKey @&quot;AXAnyTypeSearchKey&quot;
</span><span class="lines">@@ -437,6 +446,23 @@
</span><span class="cx">     return HardAutorelease(wkCopyAXTextMarkerRangeEnd(range));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#pragma mark Other helpers
+
+- (IntRect)screenToContents:(const IntRect&amp;)rect
+{
+    Document* document = m_object-&gt;document();
+    if (!document)
+        return IntRect();
+    
+    FrameView* frameView = document-&gt;view();
+    if (!frameView)
+        return IntRect();
+    
+    IntPoint startPoint = frameView-&gt;screenToContents(rect.minXMaxYCorner());
+    IntPoint endPoint = frameView-&gt;screenToContents(rect.maxXMinYCorner());
+    return IntRect(startPoint.x(), startPoint.y(), endPoint.x() - startPoint.x(), endPoint.y() - startPoint.y());
+}
+
</ins><span class="cx"> #pragma mark Search helpers
</span><span class="cx"> 
</span><span class="cx"> typedef HashMap&lt;String, AccessibilitySearchKey&gt; AccessibilitySearchKeyMap;
</span><span class="lines">@@ -2904,6 +2930,8 @@
</span><span class="cx">                       NSAccessibilityBoundsForRangeParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityStringForRangeParameterizedAttribute,
</span><span class="cx">                       NSAccessibilityUIElementsForSearchPredicateParameterizedAttribute,
</span><ins>+                      NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute,
+                      NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute,
</ins><span class="cx">                       nil];
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -3243,6 +3271,8 @@
</span><span class="cx">     bool pointSet = false;
</span><span class="cx">     NSRange range = {0, 0};
</span><span class="cx">     bool rangeSet = false;
</span><ins>+    NSRect rect = NSZeroRect;
+    bool rectSet = false;
</ins><span class="cx">     
</span><span class="cx">     // basic parameter validation
</span><span class="cx">     if (!m_object || !attribute || !parameter)
</span><span class="lines">@@ -3279,6 +3309,9 @@
</span><span class="cx">     } else if ([parameter isKindOfClass:[NSValue self]] &amp;&amp; strcmp([(NSValue*)parameter objCType], @encode(NSRange)) == 0) {
</span><span class="cx">         rangeSet = true;
</span><span class="cx">         range = [(NSValue*)parameter rangeValue];
</span><ins>+    } else if ([parameter isKindOfClass:[NSValue self]] &amp;&amp; strcmp([(NSValue*)parameter objCType], @encode(NSRect)) == 0) {
+        rectSet = true;
+        rect = [(NSValue*)parameter rectValue];
</ins><span class="cx">     } else {
</span><span class="cx">         // Attribute type is not supported. Allow super to handle.
</span><span class="cx">         return [super accessibilityAttributeValue:attribute forParameter:parameter];
</span><span class="lines">@@ -3327,6 +3360,15 @@
</span><span class="cx">         return convertToNSArray(results);
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    if ([attribute isEqualToString:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute]) {
+        IntRect webCoreRect = [self screenToContents:enclosingIntRect(rect)];
+        return [self textMarkerForVisiblePosition:m_object-&gt;visiblePositionForBounds(webCoreRect, LastVisiblePositionForBounds)];
+    }
+    if ([attribute isEqualToString:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute]) {
+        IntRect webCoreRect = [self screenToContents:enclosingIntRect(rect)];
+        return [self textMarkerForVisiblePosition:m_object-&gt;visiblePositionForBounds(webCoreRect, FirstVisiblePositionForBounds)];
+    }
+    
</ins><span class="cx">     if ([attribute isEqualToString:NSAccessibilityTextMarkerIsValidParameterizedAttribute]) {
</span><span class="cx">         VisiblePosition pos = [self visiblePositionForTextMarker:textMarker];
</span><span class="cx">         return [NSNumber numberWithBool:!pos.isNull()];
</span></span></pre></div>
<a id="branchessafari53774branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/ChangeLog (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/ChangeLog        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/ChangeLog        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -1,5 +1,40 @@
</span><span class="cx"> 2013-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merged patch from &lt;rdar://problems/15474133&gt;.  This patch is a port of r157821.
+
+    2013-10-22  Samuel White  &lt;samuel_white@apple.com&gt;
+
+            AX: Add paramAttrs to fetch start and end text markers in a given rect.
+            https://bugs.webkit.org/show_bug.cgi?id=122164
+
+            Unreviewed change.
+
+            Added accessibility element hooks to test endTextMarkerForBounds and startTextMarkerForBounds.
+
+            * DumpRenderTree/AccessibilityUIElement.cpp:
+            (endTextMarkerForBoundsCallback):
+            (startTextMarkerForBoundsCallback):
+            (AccessibilityUIElement::endTextMarkerForBounds):
+            (AccessibilityUIElement::startTextMarkerForBounds):
+            (AccessibilityUIElement::getJSClass):
+            * DumpRenderTree/AccessibilityUIElement.h:
+            * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+            (AccessibilityUIElement::endTextMarkerForBounds):
+            (AccessibilityUIElement::startTextMarkerForBounds):
+            * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+            (WTR::AccessibilityUIElement::endTextMarkerForBounds):
+            (WTR::AccessibilityUIElement::startTextMarkerForBounds):
+            * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+            * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+            * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+            (WTR::AccessibilityUIElement::endTextMarkerForBounds):
+            (WTR::AccessibilityUIElement::startTextMarkerForBounds):
+            * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+            (WTR::AccessibilityUIElement::endTextMarkerForBounds):
+            (WTR::AccessibilityUIElement::startTextMarkerForBounds):
+
+2013-12-11  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merged r156290.
</span><span class="cx"> 
</span><span class="cx">     2013-09-23  Alex Christensen  &lt;alex.christensen@flexsim.com&gt;
</span></span></pre></div>
<a id="branchessafari53774branchToolsDumpRenderTreeAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.cpp        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -664,6 +664,38 @@
</span><span class="cx">     return JSValueMakeString(context, markerRangeString.get());    
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef endTextMarkerForBoundsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    int x = 0;
+    int y = 0;
+    int width = 0;
+    int height = 0;
+    if (argumentCount == 4) {
+        x = JSValueToNumber(context, arguments[0], exception);
+        y = JSValueToNumber(context, arguments[1], exception);
+        width = JSValueToNumber(context, arguments[2], exception);
+        height = JSValueToNumber(context, arguments[3], exception);
+    }
+    
+    return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)-&gt;endTextMarkerForBounds(x, y, width, height));
+}
+
+static JSValueRef startTextMarkerForBoundsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    int x = 0;
+    int y = 0;
+    int width = 0;
+    int height = 0;
+    if (argumentCount == 4) {
+        x = JSValueToNumber(context, arguments[0], exception);
+        y = JSValueToNumber(context, arguments[1], exception);
+        width = JSValueToNumber(context, arguments[2], exception);
+        height = JSValueToNumber(context, arguments[3], exception);
+    }
+    
+    return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)-&gt;startTextMarkerForBounds(x, y, width, height));
+}
+
</ins><span class="cx"> static JSValueRef textMarkerForPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     int x = 0;
</span><span class="lines">@@ -1164,6 +1196,16 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+    return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
</span><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="lines">@@ -1373,6 +1415,8 @@
</span><span class="cx">         { &quot;endTextMarkerForTextMarkerRange&quot;, endTextMarkerForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;accessibilityElementForTextMarker&quot;, accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;textMarkerRangeLength&quot;, textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+        { &quot;endTextMarkerForBounds&quot;, endTextMarkerForBoundsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { &quot;startTextMarkerForBounds&quot;, startTextMarkerForBoundsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { &quot;textMarkerForPoint&quot;, textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;nextTextMarker&quot;, nextTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { &quot;previousTextMarker&quot;, previousTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span></span></pre></div>
<a id="branchessafari53774branchToolsDumpRenderTreeAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/DumpRenderTree/AccessibilityUIElement.h        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -221,6 +221,8 @@
</span><span class="cx">     AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
</span><span class="cx">     AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><ins>+    AccessibilityTextMarker endTextMarkerForBounds(int x, int y, int width, int height);
+    AccessibilityTextMarker startTextMarkerForBounds(int x, int y, int width, int height);
</ins><span class="cx">     AccessibilityTextMarker textMarkerForPoint(int x, int y);
</span><span class="cx">     AccessibilityTextMarker previousTextMarker(AccessibilityTextMarker*);
</span><span class="cx">     AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker*);
</span></span></pre></div>
<a id="branchessafari53774branchToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -56,6 +56,15 @@
</span><span class="cx"> #define NSAccessibilityPathAttribute @&quot;AXPath&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// Text
+#ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @&quot;AXEndTextMarkerForBounds&quot;
+#endif
+
+#ifndef NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute @&quot;AXStartTextMarkerForBounds&quot;
+#endif
+
</ins><span class="cx"> typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
</span><span class="cx"> 
</span><span class="cx"> @interface NSObject (WebKitAccessibilityAdditions)
</span><span class="lines">@@ -1495,6 +1504,26 @@
</span><span class="cx">     return 0;    
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+    return AccessibilityTextMarker(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+    return AccessibilityTextMarker(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
</ins><span class="cx"> AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span></span></pre></div>
<a id="branchessafari53774branchToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -171,6 +171,8 @@
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityUIElement&gt; AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker*) { return 0; }
</span><ins>+PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height) { return 0; }
+PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height) { return 0; }
</ins><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::textMarkerForPoint(int, int) { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*) { return 0; }
</span><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*) { return 0; }
</span></span></pre></div>
<a id="branchessafari53774branchToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -219,6 +219,8 @@
</span><span class="cx">     PassRefPtr&lt;AccessibilityTextMarkerRange&gt; textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
</span><span class="cx">     PassRefPtr&lt;AccessibilityTextMarker&gt; startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     PassRefPtr&lt;AccessibilityTextMarker&gt; endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><ins>+    PassRefPtr&lt;AccessibilityTextMarker&gt; endTextMarkerForBounds(int x, int y, int width, int height);
+    PassRefPtr&lt;AccessibilityTextMarker&gt; startTextMarkerForBounds(int x, int y, int width, int height);
</ins><span class="cx">     PassRefPtr&lt;AccessibilityTextMarker&gt; textMarkerForPoint(int x, int y);
</span><span class="cx">     PassRefPtr&lt;AccessibilityTextMarker&gt; previousTextMarker(AccessibilityTextMarker*);
</span><span class="cx">     PassRefPtr&lt;AccessibilityTextMarker&gt; nextTextMarker(AccessibilityTextMarker*);
</span></span></pre></div>
<a id="branchessafari53774branchToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -155,6 +155,8 @@
</span><span class="cx">     AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker startMarker, AccessibilityTextMarker endMarker);
</span><span class="cx">     AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange range);
</span><span class="cx">     AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange range);
</span><ins>+    AccessibilityTextMarker endTextMarkerForBounds(int x, int y, int width, int height);
+    AccessibilityTextMarker startTextMarkerForBounds(int x, int y, int width, int height);
</ins><span class="cx">     AccessibilityTextMarker textMarkerForPoint(int x, int y);
</span><span class="cx">     AccessibilityTextMarker previousTextMarker(AccessibilityTextMarker marker);
</span><span class="cx">     AccessibilityTextMarker nextTextMarker(AccessibilityTextMarker marker);
</span></span></pre></div>
<a id="branchessafari53774branchToolsWebKitTestRunnerInjectedBundleatkAccessibilityUIElementAtkcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -1155,6 +1155,18 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+    // FIXME: implement
+    return 0;
+}
+
+PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+    // FIXME: implement
+    return 0;
+}
+
</ins><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::textMarkerForPoint(int x, int y)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: implement
</span></span></pre></div>
<a id="branchessafari53774branchToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (160500 => 160501)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2013-12-12 19:52:46 UTC (rev 160500)
+++ branches/safari-537.74-branch/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2013-12-12 19:57:27 UTC (rev 160501)
</span><span class="lines">@@ -57,6 +57,15 @@
</span><span class="cx"> #define NSAccessibilityPathAttribute @&quot;AXPath&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// Text
+#ifndef NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute @&quot;AXEndTextMarkerForBounds&quot;
+#endif
+
+#ifndef NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute
+#define NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute @&quot;AXStartTextMarkerForBounds&quot;
+#endif
+
</ins><span class="cx"> typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
</span><span class="cx"> 
</span><span class="cx"> @interface NSObject (WebKitAccessibilityAdditions)
</span><span class="lines">@@ -1428,6 +1437,26 @@
</span><span class="cx">     return 0;    
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::endTextMarkerForBounds(int x, int y, int width, int height)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityEndTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+    return AccessibilityTextMarker::create(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:NSAccessibilityStartTextMarkerForBoundsParameterizedAttribute forParameter:[NSValue valueWithRect:NSMakeRect(x, y, width, height)]];
+    return AccessibilityTextMarker::create(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
</ins><span class="cx"> PassRefPtr&lt;AccessibilityTextMarker&gt; AccessibilityUIElement::textMarkerForPoint(int x, int y)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span></span></pre>
</div>
</div>

</body>
</html>