<!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>[244059] 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/244059">244059</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2019-04-08 17:39:50 -0700 (Mon, 08 Apr 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Support API: accessibilityReplaceRange:withText
https://bugs.webkit.org/show_bug.cgi?id=196636

Reviewed by Daniel Bates.

Source/WebCore:

Support this platform API on mac to provide a way to replace a range of editable text.

Test: accessibility/mac/replace-text-with-range.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::replaceTextInRange):
* accessibility/AccessibilityObject.h:
* accessibility/mac/AccessibilityObjectBase.mm:
(WebCore::PlainTextRange::PlainTextRange):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(replaceTextInRangeCallback):
(AccessibilityUIElement::replaceTextInRange):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::replaceTextInRange):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::replaceTextInRange):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::replaceTextInRange):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::replaceTextInRange):</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCoreaccessibilitymacAccessibilityObjectBasemm">trunk/Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm</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="#trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm">trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm">trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh">trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm">trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilitymacreplacetextwithrangeexpectedtxt">trunk/LayoutTests/accessibility/mac/replace-text-with-range-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilitymacreplacetextwithrangehtml">trunk/LayoutTests/accessibility/mac/replace-text-with-range.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsaccessibilitymacreplacetextwithrangeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/replace-text-with-range-expected.txt (0 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/replace-text-with-range-expected.txt                         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/replace-text-with-range-expected.txt    2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This tests that the replace with range API functions as expected.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS contenteditable.replaceTextInRange("Blurb", 5, 5) is true
+PASS contenteditable.stringValue is 'AXValue: HelloBlurb'
+PASS contenteditable.replaceTextInRange("Blorg", 5, 5) is true
+PASS contenteditable.stringValue is 'AXValue: HelloBlorg'
+PASS text.replaceTextInRange("blurb", 6, 5) is true
+PASS text.stringValue is 'AXValue: Hello blurb'
+PASS textarea.replaceTextInRange("blurb", 6, 5) is true
+PASS textarea.stringValue is 'AXValue: Hello blurb'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilitymacreplacetextwithrangehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/mac/replace-text-with-range.html (0 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/mac/replace-text-with-range.html                         (rev 0)
+++ trunk/LayoutTests/accessibility/mac/replace-text-with-range.html    2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body id="body">
+<div id="content">
+
+<div id="contenteditable" contenteditable="true" role="textbox">HelloWorld</div>
+<input type="text" id="text" value="Hello world">
+<textarea id="textarea">Hello world</textarea>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that the replace with range API functions as expected.");
+
+    if (window.accessibilityController) {
+        var contenteditable = accessibilityController.accessibleElementById("contenteditable");
+        shouldBeTrue('contenteditable.replaceTextInRange("Blurb", 5, 5)');
+        shouldBe("contenteditable.stringValue", "'AXValue: HelloBlurb'");
+
+        // now test what happens when a control has focus
+        document.getElementById("contenteditable").focus();
+        shouldBeTrue('contenteditable.replaceTextInRange("Blorg", 5, 5)');
+        shouldBe("contenteditable.stringValue", "'AXValue: HelloBlorg'");
+        document.getElementById("contenteditable").blur();
+
+        var text = accessibilityController.accessibleElementById("text");
+        shouldBeTrue('text.replaceTextInRange("blurb", 6, 5)');
+        shouldBe("text.stringValue", "'AXValue: Hello blurb'");
+
+        var textarea = accessibilityController.accessibleElementById("textarea");
+        shouldBeTrue('textarea.replaceTextInRange("blurb", 6, 5)');
+        shouldBe("textarea.stringValue", "'AXValue: Hello blurb'");
+
+        document.getElementById("content").style.visibility = "hidden";
+    }
+
+</script>
+
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Source/WebCore/ChangeLog      2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2019-04-08  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Support API: accessibilityReplaceRange:withText
+        https://bugs.webkit.org/show_bug.cgi?id=196636
+
+        Reviewed by Daniel Bates.
+
+        Support this platform API on mac to provide a way to replace a range of editable text.
+
+        Test: accessibility/mac/replace-text-with-range.html
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::replaceTextInRange):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/mac/AccessibilityObjectBase.mm:
+        (WebCore::PlainTextRange::PlainTextRange):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
+
</ins><span class="cx"> 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Do not allow starting selection drags when selection views are not visible
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp       2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp  2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -2274,7 +2274,35 @@
</span><span class="cx">     auto event = Event::create(eventName, Event::CanBubble::Yes, Event::IsCancelable::Yes);
</span><span class="cx">     return dispatchAccessibilityEvent(event);
</span><span class="cx"> }
</span><ins>+    
+bool AccessibilityObject::replaceTextInRange(const String& replacementString, const PlainTextRange& range)
+{
+    if (!renderer() || !is<Element>(node()))
+        return false;
</ins><span class="cx"> 
</span><ins>+    auto& element = downcast<Element>(*renderer()->node());
+
+    // We should use the editor's insertText to mimic typing into the field.
+    // Also only do this when the field is in editing mode.
+    auto& frame = renderer()->frame();
+    if (element.shouldUseInputMethod()) {
+        frame.selection().setSelectedRange(rangeForPlainTextRange(range).get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::Yes);
+        frame.editor().replaceSelectionWithText(replacementString, Editor::SelectReplacement::No, Editor::SmartReplace::No);
+        return true;
+    }
+    
+    if (is<HTMLInputElement>(element)) {
+        downcast<HTMLInputElement>(element).setRangeText(replacementString, range.start, range.length, "");
+        return true;
+    }
+    if (is<HTMLTextAreaElement>(element)) {
+        downcast<HTMLTextAreaElement>(element).setRangeText(replacementString, range.start, range.length, "");
+        return true;
+    }
+
+    return false;
+}
+    
</ins><span class="cx"> bool AccessibilityObject::dispatchAccessibleSetValueEvent(const String& value) const
</span><span class="cx"> {
</span><span class="cx">     if (!canSetValueAttribute())
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h    2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -297,6 +297,10 @@
</span><span class="cx">         , length(l)
</span><span class="cx">     { }
</span><span class="cx">     
</span><ins>+#if PLATFORM(COCOA)
+    PlainTextRange(NSRange);
+#endif
+    
</ins><span class="cx">     bool isNull() const { return !start && !length; }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -701,6 +705,8 @@
</span><span class="cx">     virtual void setSelectedText(const String&) { }
</span><span class="cx">     virtual void setSelectedTextRange(const PlainTextRange&) { }
</span><span class="cx">     virtual void setValue(const String&) { }
</span><ins>+    bool replaceTextInRange(const String&, const PlainTextRange&);
+
</ins><span class="cx">     virtual void setValue(float) { }
</span><span class="cx">     virtual void setSelected(bool) { }
</span><span class="cx">     virtual void setSelectedRows(AccessibilityChildrenVector&) { }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacAccessibilityObjectBasemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm        2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm   2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -32,6 +32,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+PlainTextRange::PlainTextRange(NSRange r)
+    : start(r.location)
+    , length(r.length)
+{
+}
+    
</ins><span class="cx"> String AccessibilityObject::speechHintAttributeValue() const
</span><span class="cx"> {
</span><span class="cx">     auto speak = speakAsProperty();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm       2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm  2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -3642,6 +3642,14 @@
</span><span class="cx">         [self accessibilityScrollToVisible];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)accessibilityReplaceRange:(NSRange)range withText:(NSString *)string
+{
+    if (![self updateObjectBackingStore])
+        return NO;
+    
+    return m_object->replaceTextInRange(string, PlainTextRange(range));
+}
+
</ins><span class="cx"> IGNORE_WARNINGS_BEGIN("deprecated-implementations")
</span><span class="cx"> - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attributeName
</span><span class="cx"> IGNORE_WARNINGS_END
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/ChangeLog       2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2019-04-08  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Support API: accessibilityReplaceRange:withText
+        https://bugs.webkit.org/show_bug.cgi?id=196636
+
+        Reviewed by Daniel Bates.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (replaceTextInRangeCallback):
+        (AccessibilityUIElement::replaceTextInRange):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::replaceTextInRange):
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::replaceTextInRange):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (WTR::AccessibilityUIElement::replaceTextInRange):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
+        (WTR::AccessibilityUIElement::replaceTextInRange):
+
</ins><span class="cx"> 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] Do not allow starting selection drags when selection views are not visible
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp    2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.cpp       2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -806,6 +806,18 @@
</span><span class="cx">     return JSValueMakeUndefined(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static JSValueRef replaceTextInRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 3)
+        return JSValueMakeUndefined(context);
+
+    auto text = adopt(JSValueToStringCopy(context, arguments[0], exception));
+    int position = JSValueToNumber(context, arguments[1], exception);
+    int length = JSValueToNumber(context, arguments[2], exception);
+
+    return JSValueMakeBoolean(context, toAXElement(thisObject)->replaceTextInRange(text.get(), position, length));
+}
+
</ins><span class="cx"> static JSValueRef attributedStringForTextMarkerRangeContainsAttributeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     AccessibilityTextMarkerRange* markerRange = 0;
</span><span class="lines">@@ -1609,6 +1621,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void AccessibilityUIElement::replaceTextInRange(JSStringRef, int, int)
+{
+    return false;
+}
+
</ins><span class="cx"> int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange*)
</span><span class="cx"> {
</span><span class="cx">     return 0;
</span><span class="lines">@@ -1931,6 +1948,7 @@
</span><span class="cx">         { "textMarkerRangeForElement", textMarkerRangeForElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { "selectedTextMarkerRange", selectedTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { "resetSelectedTextMarkerRange", resetSelectedTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><ins>+        { "replaceTextInRange", replaceTextInRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</ins><span class="cx">         { "attributedStringForTextMarkerRangeContainsAttribute", attributedStringForTextMarkerRangeContainsAttributeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { "indexForTextMarker", indexForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span><span class="cx">         { "isTextMarkerValid", isTextMarkerValidCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/AccessibilityUIElement.h (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/AccessibilityUIElement.h      2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/DumpRenderTree/AccessibilityUIElement.h 2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -277,7 +277,8 @@
</span><span class="cx">     AccessibilityTextMarkerRange selectedTextMarkerRange();
</span><span class="cx">     void resetSelectedTextMarkerRange();
</span><span class="cx">     bool setSelectedVisibleTextRange(AccessibilityTextMarkerRange*);
</span><del>-    
</del><ins>+    bool replaceTextInRange(JSStringRef, int position, int length);
+
</ins><span class="cx">     JSRetainPtr<JSStringRef> stringForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     JSRetainPtr<JSStringRef> attributedStringForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     JSRetainPtr<JSStringRef> attributedStringForTextMarkerRangeWithOptions(AccessibilityTextMarkerRange*, bool includeSpellCheck);
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm      2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm 2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -477,6 +477,11 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AccessibilityUIElement::replaceTextInRange(JSStringRef, int, int)
+{
+    return false;
+}
+
</ins><span class="cx"> void AccessibilityUIElement::resetSelectedTextMarkerRange()
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm      2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm 2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
</span><span class="cx"> 
</span><span class="cx"> @interface NSObject (WebKitAccessibilityAdditions)
</span><ins>+- (BOOL)accessibilityReplaceRange:(NSRange)range withText:(NSString *)string;
</ins><span class="cx"> - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
</span><span class="cx"> - (NSUInteger)accessibilityIndexOfChild:(id)child;
</span><span class="cx"> - (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
</span><span class="lines">@@ -1633,6 +1634,14 @@
</span><span class="cx">     END_AX_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AccessibilityUIElement::replaceTextInRange(JSStringRef string, int location, int length)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [m_element accessibilityReplaceRange:NSMakeRange(location, length) withText:[NSString stringWithJSStringRef:string]];
+    END_AX_OBJC_EXCEPTIONS
+    return false;
+}
+
</ins><span class="cx"> int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleAccessibilityUIElementh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h     2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h        2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -279,6 +279,7 @@
</span><span class="cx">     RefPtr<AccessibilityTextMarkerRange> textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
</span><span class="cx">     RefPtr<AccessibilityTextMarkerRange> selectedTextMarkerRange();
</span><span class="cx">     void resetSelectedTextMarkerRange();
</span><ins>+    bool replaceTextInRange(JSStringRef, int position, int length);
</ins><span class="cx">     RefPtr<AccessibilityTextMarker> startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     RefPtr<AccessibilityTextMarker> endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
</span><span class="cx">     RefPtr<AccessibilityTextMarker> endTextMarkerForBounds(int x, int y, int width, int height);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleBindingsAccessibilityUIElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl  2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl     2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -205,6 +205,7 @@
</span><span class="cx">     AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker startMarker, AccessibilityTextMarker endMarker);
</span><span class="cx">     AccessibilityTextMarkerRange selectedTextMarkerRange();
</span><span class="cx">     void resetSelectedTextMarkerRange();
</span><ins>+    boolean replaceTextInRange(DOMString string, long position, long length);
</ins><span class="cx">     AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange range);
</span><span class="cx">     AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange range);
</span><span class="cx">     AccessibilityTextMarker endTextMarkerForBounds(long x, long y, long width, long height);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleiosAccessibilityUIElementIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm     2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm        2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -1144,6 +1144,11 @@
</span><span class="cx"> {
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><ins>+    
+bool AccessibilityUIElement::replaceTextInRange(JSStringRef, int, int)
+{
+    return false;
+}
</ins><span class="cx"> 
</span><span class="cx"> RefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x, int y)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacAccessibilityUIElementMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm (244058 => 244059)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm     2019-04-09 00:00:24 UTC (rev 244058)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm        2019-04-09 00:39:50 UTC (rev 244059)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx"> typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
</span><span class="cx"> 
</span><span class="cx"> @interface NSObject (WebKitAccessibilityAdditions)
</span><ins>+- (BOOL)accessibilityReplaceRange:(NSRange)range withText:(NSString *)string;
</ins><span class="cx"> - (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
</span><span class="cx"> - (NSUInteger)accessibilityIndexOfChild:(id)child;
</span><span class="cx"> - (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
</span><span class="lines">@@ -1806,6 +1807,14 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool AccessibilityUIElement::replaceTextInRange(JSStringRef string, int location, int length)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [m_element accessibilityReplaceRange:NSMakeRange(location, length) withText:[NSString stringWithJSStringRef:string]];
+    END_AX_OBJC_EXCEPTIONS
+    return false;
+}
+    
</ins><span class="cx"> RefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForBounds(int x, int y, int width, int height)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_AX_OBJC_EXCEPTIONS
</span></span></pre>
</div>
</div>

</body>
</html>