<!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>[196452] trunk/Source</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/196452">196452</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2016-02-11 15:39:15 -0800 (Thu, 11 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Soft spaces are often tracked in the wrong spot
https://bugs.webkit.org/show_bug.cgi?id=154127
-and corresponding-
rdar://problem/24493140

Reviewed by Sam Weinig.

Soft spaces are in the wrong space now for two reasons. First of all, the 
NSRange we get from the accepted candidate is relative to the paragraph 
start, so without this patch, soft spaces are only ever right for the first 
paragraph. Secondly, if focus changes for any reason other than text 
insertion, soft spaces are also wrong because they need to be re-set.

Source/WebKit/mac:

New version of _convertToDOMRange takes a NSRangeIsRelativeTo so that it can 
handle ranges relative to both the document and the paragraph. 
* WebView/WebFrame.mm:
(-[WebFrame _convertToDOMRange:rangeIsRelativeTo:]):
(-[WebFrame _convertNSRangeToDOMRange:]):

New enum NSRangeIsRelativeTo.
* WebView/WebFrameInternal.h:

Re-set the softSpaceRange on selection changes so long as the WebCore::Editor 
is not currently handling an accepted candidate.
* WebView/WebHTMLView.mm:
(-[WebHTMLView _selectionChanged]):

If needToRemoveSoftSpace is true, then the replacementRange is 
relative to the paragraph.
(-[WebHTMLView insertText:]):

Source/WebKit2:

New enum can be used to indicate what an EditingRange is relative to.
* Shared/EditingRange.h:
(WebKit::EditingRange::EditingRange):

didHandleAcceptedCandidate is a new message that gets sent from the 
WebProcess. This lets us track a bool m_isHandlingAcceptedCandidate.
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::didHandleAcceptedCandidate):

Re-set the m_softSpaceRange on selection changes so long as 
m_isHandlingAcceptedCandidate is false.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::selectionDidChange):

Set m_isHandlingAcceptedCandidate to true.
(WebKit::WebViewImpl::handleAcceptedCandidate):

Set m_isHandlingAcceptedCandidate to false.
(WebKit::WebViewImpl::didHandleAcceptedCandidate):

insertTextAsync takes a new parameter indicating what the replacementRange is 
relative to. If needToRemoveSoftSpace is true, then the replacementRange is 
relative to the paragraph.
(WebKit::WebViewImpl::insertText):

Pipe didHandleAcceptedCandidate through to WebViewImpl.
* UIProcess/PageClient.h:

insertTextAsync takes an EditingRangeIsRelativeTo.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::insertTextAsync):

Pipe didHandleAcceptedCandidate through to WebViewImpl.
(WebKit::WebPageProxy::didHandleAcceptedCandidate):
* UIProcess/WebPageProxy.h:

New message lets the WebProcess tell the UIProcess when the candidate has 
been accepted.
* UIProcess/WebPageProxy.messages.in:

Pipe didHandleAcceptedCandidate through to WebViewImpl.
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didHandleAcceptedCandidate):

insertTextAsync takes an EditingRangeIsRelativeTo. Pass that through to 
rangeFromEditingRange to get the correct range.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):

Use the EditingRangeIsRelativeTo to find the right WebCore::Range.
(WebKit::WebPage::rangeFromEditingRange):

Take EditingRangeIsRelativeTo in a few places. 
* WebProcess/WebPage/WebPage.h:

InsertTextAsync takes a EditingRangeIsRelativeTo.
* WebProcess/WebPage/WebPage.messages.in:

Send didHandleAccpetedCandidate to the UIProcess
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleAcceptedCandidate):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFramemm">trunk/Source/WebKit/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFrameInternalh">trunk/Source/WebKit/mac/WebView/WebFrameInternal.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedEditingRangeh">trunk/Source/WebKit2/Shared/EditingRange.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplh">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplmm">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-02-11  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Soft spaces are often tracked in the wrong spot
+        https://bugs.webkit.org/show_bug.cgi?id=154127
+        -and corresponding-
+        rdar://problem/24493140
+
+        Reviewed by Sam Weinig.
+
+        Soft spaces are in the wrong space now for two reasons. First of all, the 
+        NSRange we get from the accepted candidate is relative to the paragraph 
+        start, so without this patch, soft spaces are only ever right for the first 
+        paragraph. Secondly, if focus changes for any reason other than text 
+        insertion, soft spaces are also wrong because they need to be re-set.
+
+        New version of _convertToDOMRange takes a NSRangeIsRelativeTo so that it can 
+        handle ranges relative to both the document and the paragraph. 
+        * WebView/WebFrame.mm:
+        (-[WebFrame _convertToDOMRange:rangeIsRelativeTo:]):
+        (-[WebFrame _convertNSRangeToDOMRange:]):
+
+        New enum NSRangeIsRelativeTo.
+        * WebView/WebFrameInternal.h:
+
+        Re-set the softSpaceRange on selection changes so long as the WebCore::Editor 
+        is not currently handling an accepted candidate.
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _selectionChanged]):
+
+        If needToRemoveSoftSpace is true, then the replacementRange is 
+        relative to the paragraph.
+        (-[WebHTMLView insertText:]):
+
</ins><span class="cx"> 2016-02-10  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture: should assert that it is being called from the &quot;main&quot; thread.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrame.mm        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -793,21 +793,43 @@
</span><span class="cx"> 
</span><span class="cx"> - (PassRefPtr&lt;Range&gt;)_convertToDOMRange:(NSRange)nsrange
</span><span class="cx"> {
</span><ins>+    return [self _convertToDOMRange:nsrange rangeIsRelativeTo:NSRangeIsRelativeTo::Document];
+}
+
+- (PassRefPtr&lt;Range&gt;)_convertToDOMRange:(NSRange)nsrange rangeIsRelativeTo:(NSRangeIsRelativeTo)rangeIsRelativeTo
+{
</ins><span class="cx">     if (nsrange.location &gt; INT_MAX)
</span><span class="cx">         return 0;
</span><span class="cx">     if (nsrange.length &gt; INT_MAX || nsrange.location + nsrange.length &gt; INT_MAX)
</span><span class="cx">         nsrange.length = INT_MAX - nsrange.location;
</span><span class="cx"> 
</span><del>-    // our critical assumption is that we are only called by input methods that
-    // concentrate on a given area containing the selection
-    // We have to do this because of text fields and textareas. The DOM for those is not
-    // directly in the document DOM, so serialization is problematic. Our solution is
-    // to use the root editable element of the selection start as the positional base.
-    // That fits with AppKit's idea of an input context.
-    Element* element = _private-&gt;coreFrame-&gt;selection().rootEditableElementOrDocumentElement();
-    if (!element)
-        return nil;
-    return TextIterator::rangeFromLocationAndLength(element, nsrange.location, nsrange.length);
</del><ins>+    if (rangeIsRelativeTo == NSRangeIsRelativeTo::Document) {
+        // Our critical assumption is that this code path is only called by input methods that
+        // concentrate on a given area containing the selection
+        // We have to do this because of text fields and textareas. The DOM for those is not
+        // directly in the document DOM, so serialization is problematic. Our solution is
+        // to use the root editable element of the selection start as the positional base.
+        // That fits with AppKit's idea of an input context.
+        Element* element = _private-&gt;coreFrame-&gt;selection().rootEditableElementOrDocumentElement();
+        if (!element)
+            return nil;
+        return TextIterator::rangeFromLocationAndLength(element, nsrange.location, nsrange.length);
+    }
+
+    ASSERT(rangeIsRelativeTo == NSRangeIsRelativeTo::Paragraph);
+
+    const VisibleSelection&amp; selection = _private-&gt;coreFrame-&gt;selection().selection();
+    RefPtr&lt;Range&gt; selectedRange = selection.toNormalizedRange();
+    if (!selectedRange)
+        return 0;
+
+    RefPtr&lt;Range&gt; paragraphRange = makeRange(startOfParagraph(selection.visibleStart()), selection.visibleEnd());
+    if (!paragraphRange)
+        return 0;
+
+    ContainerNode&amp; rootNode = paragraphRange.get()-&gt;startContainer().treeScope().rootNode();
+    int paragraphStartIndex = TextIterator::rangeLength(Range::create(rootNode.document(), &amp;rootNode, 0, &amp;paragraphRange-&gt;startContainer(), paragraphRange-&gt;startOffset()).ptr());
+    return TextIterator::rangeFromLocationAndLength(&amp;rootNode, paragraphStartIndex + static_cast&lt;int&gt;(nsrange.location), nsrange.length);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (DOMRange *)_convertNSRangeToDOMRange:(NSRange)nsrange
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFrameInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrameInternal.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrameInternal.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit/mac/WebView/WebFrameInternal.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -63,6 +63,11 @@
</span><span class="cx"> 
</span><span class="cx"> typedef WebCore::HistoryItem WebCoreHistoryItem;
</span><span class="cx"> 
</span><ins>+enum class NSRangeIsRelativeTo : uint8_t {
+    Document,
+    Paragraph,
+};
+
</ins><span class="cx"> WebCore::Frame* core(WebFrame *);
</span><span class="cx"> WebFrame *kit(WebCore::Frame *);
</span><span class="cx"> 
</span><span class="lines">@@ -160,6 +165,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> - (NSRange)_convertToNSRange:(WebCore::Range*)range;
</span><span class="cx"> - (PassRefPtr&lt;WebCore::Range&gt;)_convertToDOMRange:(NSRange)nsrange;
</span><ins>+- (PassRefPtr&lt;WebCore::Range&gt;)_convertToDOMRange:(NSRange)nsrange rangeIsRelativeTo:(NSRangeIsRelativeTo)rangeIsRelativeTo;
</ins><span class="cx"> 
</span><span class="cx"> - (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString;
</span><span class="cx"> - (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -6097,6 +6097,10 @@
</span><span class="cx">     [self _updateSelectionForInputManager];
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     [self _updateFontPanel];
</span><ins>+    if (Frame* coreFrame = core([self _frame])) {
+        if (!coreFrame-&gt;editor().isHandlingAcceptedCandidate())
+            _private-&gt;softSpaceRange = NSMakeRange(NSNotFound, 0);
+    }
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -7098,16 +7102,23 @@
</span><span class="cx">     if (!coreFrame || !coreFrame-&gt;editor().canEdit())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    BOOL needToRemoveSoftSpace = NO;
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
</span><del>-    if (_private-&gt;softSpaceRange.location != NSNotFound &amp;&amp; (replacementRange.location == NSMaxRange(_private-&gt;softSpaceRange) || replacementRange.location == NSNotFound) &amp;&amp; replacementRange.length == 0 &amp;&amp; [[NSSpellChecker sharedSpellChecker] deletesAutospaceBeforeString:text language:nil])
</del><ins>+    if (_private-&gt;softSpaceRange.location != NSNotFound &amp;&amp; (replacementRange.location == NSMaxRange(_private-&gt;softSpaceRange) || replacementRange.location == NSNotFound) &amp;&amp; !replacementRange.length &amp;&amp; [[NSSpellChecker sharedSpellChecker] deletesAutospaceBeforeString:text language:nil]) {
</ins><span class="cx">         replacementRange = _private-&gt;softSpaceRange;
</span><ins>+        needToRemoveSoftSpace = YES;
+    }
</ins><span class="cx"> #endif
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     _private-&gt;softSpaceRange = NSMakeRange(NSNotFound, 0);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (replacementRange.location != NSNotFound)
-        [[self _frame] _selectNSRange:replacementRange];
</del><ins>+    if (replacementRange.location != NSNotFound) {
+        NSRangeIsRelativeTo rangeIsRelativeTo = needToRemoveSoftSpace ? NSRangeIsRelativeTo::Paragraph : NSRangeIsRelativeTo::Document;
+        RefPtr&lt;Range&gt; domRange = [[self _frame] _convertToDOMRange:replacementRange rangeIsRelativeTo:rangeIsRelativeTo];
+        if (domRange)
+            coreFrame-&gt;selection().setSelection(VisibleSelection(*domRange, SEL_DEFAULT_AFFINITY));
+    }
</ins><span class="cx"> 
</span><span class="cx">     bool eventHandled = false;
</span><span class="cx">     String eventText = text;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/ChangeLog        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2016-02-11  Beth Dakin  &lt;bdakin@apple.com&gt;
+
+        Soft spaces are often tracked in the wrong spot
+        https://bugs.webkit.org/show_bug.cgi?id=154127
+        -and corresponding-
+        rdar://problem/24493140
+
+        Reviewed by Sam Weinig.
+
+        Soft spaces are in the wrong space now for two reasons. First of all, the 
+        NSRange we get from the accepted candidate is relative to the paragraph 
+        start, so without this patch, soft spaces are only ever right for the first 
+        paragraph. Secondly, if focus changes for any reason other than text 
+        insertion, soft spaces are also wrong because they need to be re-set.
+
+        New enum can be used to indicate what an EditingRange is relative to.
+        * Shared/EditingRange.h:
+        (WebKit::EditingRange::EditingRange):
+
+        didHandleAcceptedCandidate is a new message that gets sent from the 
+        WebProcess. This lets us track a bool m_isHandlingAcceptedCandidate.
+        * UIProcess/Cocoa/WebViewImpl.h:
+        (WebKit::WebViewImpl::didHandleAcceptedCandidate):
+
+        Re-set the m_softSpaceRange on selection changes so long as 
+        m_isHandlingAcceptedCandidate is false.
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::selectionDidChange):
+
+        Set m_isHandlingAcceptedCandidate to true.
+        (WebKit::WebViewImpl::handleAcceptedCandidate):
+
+        Set m_isHandlingAcceptedCandidate to false.
+        (WebKit::WebViewImpl::didHandleAcceptedCandidate):
+
+        insertTextAsync takes a new parameter indicating what the replacementRange is 
+        relative to. If needToRemoveSoftSpace is true, then the replacementRange is 
+        relative to the paragraph.
+        (WebKit::WebViewImpl::insertText):
+
+        Pipe didHandleAcceptedCandidate through to WebViewImpl.
+        * UIProcess/PageClient.h:
+
+        insertTextAsync takes an EditingRangeIsRelativeTo.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::insertTextAsync):
+
+        Pipe didHandleAcceptedCandidate through to WebViewImpl.
+        (WebKit::WebPageProxy::didHandleAcceptedCandidate):
+        * UIProcess/WebPageProxy.h:
+
+        New message lets the WebProcess tell the UIProcess when the candidate has 
+        been accepted.
+        * UIProcess/WebPageProxy.messages.in:
+
+        Pipe didHandleAcceptedCandidate through to WebViewImpl.
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::didHandleAcceptedCandidate):
+
+        insertTextAsync takes an EditingRangeIsRelativeTo. Pass that through to 
+        rangeFromEditingRange to get the correct range.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::insertTextAsync):
+
+        Use the EditingRangeIsRelativeTo to find the right WebCore::Range.
+        (WebKit::WebPage::rangeFromEditingRange):
+
+        Take EditingRangeIsRelativeTo in a few places. 
+        * WebProcess/WebPage/WebPage.h:
+
+        InsertTextAsync takes a EditingRangeIsRelativeTo.
+        * WebProcess/WebPage/WebPage.messages.in:
+
+        Send didHandleAccpetedCandidate to the UIProcess
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::handleAcceptedCandidate):
+
</ins><span class="cx"> 2016-02-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Use BlobResourceHandle when loading blob urls, even when using NetworkSession
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedEditingRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/EditingRange.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/EditingRange.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/Shared/EditingRange.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -31,6 +31,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+enum class EditingRangeIsRelativeTo : uint8_t {
+    Document,
+    Paragraph,
+};
+
</ins><span class="cx"> struct EditingRange {
</span><span class="cx">     EditingRange()
</span><span class="cx">         : location(notFound)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -323,6 +323,7 @@
</span><span class="cx">     void cancelImmediateActionAnimation();
</span><span class="cx">     void completeImmediateActionAnimation();
</span><span class="cx">     void didChangeContentSize(CGSize);
</span><ins>+    void didHandleAcceptedCandidate();
</ins><span class="cx"> 
</span><span class="cx">     void setIgnoresNonWheelEvents(bool);
</span><span class="cx">     bool ignoresNonWheelEvents() const { return m_ignoresNonWheelEvents; }
</span><span class="lines">@@ -638,6 +639,7 @@
</span><span class="cx">     String m_lastStringForCandidateRequest;
</span><span class="cx"> #endif
</span><span class="cx">     NSRange m_softSpaceRange { NSNotFound, 0 };
</span><ins>+    bool m_isHandlingAcceptedCandidate { false };
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -1747,6 +1747,8 @@
</span><span class="cx"> void WebViewImpl::selectionDidChange()
</span><span class="cx"> {
</span><span class="cx">     updateFontPanelIfNeeded();
</span><ins>+    if (!m_isHandlingAcceptedCandidate)
+        m_softSpaceRange = NSMakeRange(NSNotFound, 0);
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
</span><span class="cx">     updateWebViewImplAdditions();
</span><span class="cx">     if (!m_page-&gt;editorState().isMissingPostLayoutData)
</span><span class="lines">@@ -2210,6 +2212,7 @@
</span><span class="cx">     if (m_lastStringForCandidateRequest != postLayoutData.stringForCandidateRequest)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    m_isHandlingAcceptedCandidate = true;
</ins><span class="cx">     NSRange range = [acceptedCandidate range];
</span><span class="cx">     if (acceptedCandidate.replacementString &amp;&amp; [acceptedCandidate.replacementString length] &gt; 0) {
</span><span class="cx">         NSRange replacedRange = NSMakeRange(range.location, [acceptedCandidate.replacementString length]);
</span><span class="lines">@@ -2363,6 +2366,11 @@
</span><span class="cx">     [m_view _web_didChangeContentSize:NSSizeFromCGSize(newSize)];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebViewImpl::didHandleAcceptedCandidate()
+{
+    m_isHandlingAcceptedCandidate = false;
+}
+
</ins><span class="cx"> void WebViewImpl::setIgnoresNonWheelEvents(bool ignoresNonWheelEvents)
</span><span class="cx"> {
</span><span class="cx">     if (m_ignoresNonWheelEvents == ignoresNonWheelEvents)
</span><span class="lines">@@ -3548,7 +3556,7 @@
</span><span class="cx">     if (!dictationAlternatives.isEmpty())
</span><span class="cx">         m_page-&gt;insertDictatedTextAsync(eventText, replacementRange, dictationAlternatives, registerUndoGroup);
</span><span class="cx">     else
</span><del>-        m_page-&gt;insertTextAsync(eventText, replacementRange, registerUndoGroup);
</del><ins>+        m_page-&gt;insertTextAsync(eventText, replacementRange, registerUndoGroup, needToRemoveSoftSpace ? EditingRangeIsRelativeTo::Paragraph : EditingRangeIsRelativeTo::Document);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebViewImpl::selectedRangeWithCompletionHandler(void(^completionHandlerPtr)(NSRange selectedRange))
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -345,6 +345,8 @@
</span><span class="cx">     virtual void didPerformImmediateActionHitTest(const WebHitTestResultData&amp;, bool contentPreventsDefault, API::Object*) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual void* immediateActionAnimationControllerForHitTestResult(RefPtr&lt;API::HitTestResult&gt;, uint64_t, RefPtr&lt;API::Object&gt;) = 0;
</span><ins>+
+    virtual void didHandleAcceptedCandidate() = 0;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -5811,12 +5811,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> 
</span><del>-void WebPageProxy::insertTextAsync(const String&amp; text, const EditingRange&amp; replacementRange, bool registerUndoGroup)
</del><ins>+void WebPageProxy::insertTextAsync(const String&amp; text, const EditingRange&amp; replacementRange, bool registerUndoGroup, EditingRangeIsRelativeTo editingRangeIsRelativeTo)
</ins><span class="cx"> {
</span><span class="cx">     if (!isValid())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    process().send(Messages::WebPage::InsertTextAsync(text, replacementRange, registerUndoGroup), m_pageID);
</del><ins>+    process().send(Messages::WebPage::InsertTextAsync(text, replacementRange, registerUndoGroup, static_cast&lt;uint32_t&gt;(editingRangeIsRelativeTo)), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::getMarkedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt; callbackFunction)
</span><span class="lines">@@ -6064,6 +6064,11 @@
</span><span class="cx"> {
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::HandleAcceptedCandidate(acceptedCandidate), m_pageID);
</span><span class="cx"> }
</span><ins>+
+void WebPageProxy::didHandleAcceptedCandidate()
+{
+    m_pageClient.didHandleAcceptedCandidate();
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::imageOrMediaDocumentSizeChanged(const WebCore::IntSize&amp; newSize)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -561,7 +561,7 @@
</span><span class="cx">     void setAcceleratedCompositingRootLayer(LayerOrView*);
</span><span class="cx">     LayerOrView* acceleratedCompositingRootLayer() const;
</span><span class="cx"> 
</span><del>-    void insertTextAsync(const String&amp; text, const EditingRange&amp; replacementRange, bool registerUndoGroup = false);
</del><ins>+    void insertTextAsync(const String&amp; text, const EditingRange&amp; replacementRange, bool registerUndoGroup = false, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::Document);
</ins><span class="cx">     void getMarkedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt;);
</span><span class="cx">     void getSelectedRangeAsync(std::function&lt;void (EditingRange, CallbackBase::Error)&gt;);
</span><span class="cx">     void characterIndexForPointAsync(const WebCore::IntPoint&amp;, std::function&lt;void (uint64_t, CallbackBase::Error)&gt;);
</span><span class="lines">@@ -1042,6 +1042,7 @@
</span><span class="cx">     void installViewStateChangeCompletionHandler(void(^completionHandler)());
</span><span class="cx"> 
</span><span class="cx">     void handleAcceptedCandidate(WebCore::TextCheckingResult);
</span><ins>+    void didHandleAcceptedCandidate();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(EFL) &amp;&amp; HAVE(ACCESSIBILITY) &amp;&amp; defined(HAVE_ECORE_X)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -451,4 +451,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     DidRestoreScrollPosition()
</span><ins>+
+#if PLATFORM(MAC)
+    DidHandleAcceptedCandidate()
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -209,6 +209,8 @@
</span><span class="cx">     virtual void didPerformImmediateActionHitTest(const WebHitTestResultData&amp;, bool contentPreventsDefault, API::Object*) override;
</span><span class="cx">     virtual void* immediateActionAnimationControllerForHitTestResult(RefPtr&lt;API::HitTestResult&gt;, uint64_t, RefPtr&lt;API::Object&gt;) override;
</span><span class="cx"> 
</span><ins>+    virtual void didHandleAcceptedCandidate() override;
+
</ins><span class="cx">     virtual void showPlatformContextMenu(NSMenu *, WebCore::IntPoint) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void didChangeBackgroundColor() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -780,6 +780,11 @@
</span><span class="cx">     return m_impl-&gt;immediateActionAnimationControllerForHitTestResult(hitTestResult.get(), type, userData.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageClientImpl::didHandleAcceptedCandidate()
+{
+    m_impl-&gt;didHandleAcceptedCandidate();
+}
+
</ins><span class="cx"> void PageClientImpl::showPlatformContextMenu(NSMenu *menu, IntPoint location)
</span><span class="cx"> {
</span><span class="cx">     [menu popUpMenuPositioningItem:nil atLocation:location inView:m_view];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #include &quot;DragControllerAction.h&quot;
</span><span class="cx"> #include &quot;DrawingArea.h&quot;
</span><span class="cx"> #include &quot;DrawingAreaMessages.h&quot;
</span><del>-#include &quot;EditingRange.h&quot;
</del><span class="cx"> #include &quot;EditorState.h&quot;
</span><span class="cx"> #include &quot;EventDispatcher.h&quot;
</span><span class="cx"> #include &quot;InjectedBundle.h&quot;
</span><span class="lines">@@ -4327,12 +4326,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> 
</span><del>-void WebPage::insertTextAsync(const String&amp; text, const EditingRange&amp; replacementEditingRange, bool registerUndoGroup)
</del><ins>+void WebPage::insertTextAsync(const String&amp; text, const EditingRange&amp; replacementEditingRange, bool registerUndoGroup, uint32_t editingRangeIsRelativeTo)
</ins><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = m_page-&gt;focusController().focusedOrMainFrame();
</span><span class="cx"> 
</span><span class="cx">     if (replacementEditingRange.location != notFound) {
</span><del>-        RefPtr&lt;Range&gt; replacementRange = rangeFromEditingRange(frame, replacementEditingRange);
</del><ins>+        RefPtr&lt;Range&gt; replacementRange = rangeFromEditingRange(frame, replacementEditingRange, static_cast&lt;EditingRangeIsRelativeTo&gt;(editingRangeIsRelativeTo));
</ins><span class="cx">         if (replacementRange)
</span><span class="cx">             frame.selection().setSelection(VisibleSelection(*replacementRange, SEL_DEFAULT_AFFINITY));
</span><span class="cx">     }
</span><span class="lines">@@ -5026,7 +5025,7 @@
</span><span class="cx">     send(Messages::WebPageProxy::StringCallback(result, callbackID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;WebCore::Range&gt; WebPage::rangeFromEditingRange(WebCore::Frame&amp; frame, const EditingRange&amp; range)
</del><ins>+PassRefPtr&lt;WebCore::Range&gt; WebPage::rangeFromEditingRange(WebCore::Frame&amp; frame, const EditingRange&amp; range, EditingRangeIsRelativeTo editingRangeIsRelativeTo)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(range.location != notFound);
</span><span class="cx"> 
</span><span class="lines">@@ -5039,13 +5038,30 @@
</span><span class="cx">     else
</span><span class="cx">         length = INT_MAX - range.location;
</span><span class="cx"> 
</span><del>-    // Our critical assumption is that we are only called by input methods that
-    // concentrate on a given area containing the selection.
-    // We have to do this because of text fields and textareas. The DOM for those is not
-    // directly in the document DOM, so serialization is problematic. Our solution is
-    // to use the root editable element of the selection start as the positional base.
-    // That fits with AppKit's idea of an input context.
-    return TextIterator::rangeFromLocationAndLength(frame.selection().rootEditableElementOrDocumentElement(), static_cast&lt;int&gt;(range.location), length);
</del><ins>+    if (editingRangeIsRelativeTo == EditingRangeIsRelativeTo::Document) {
+        // Our critical assumption is that this code path is called by input methods that
+        // concentrate on a given area containing the selection.
+        // We have to do this because of text fields and textareas. The DOM for those is not
+        // directly in the document DOM, so serialization is problematic. Our solution is
+        // to use the root editable element of the selection start as the positional base.
+        // That fits with AppKit's idea of an input context.
+        return TextIterator::rangeFromLocationAndLength(frame.selection().rootEditableElementOrDocumentElement(), static_cast&lt;int&gt;(range.location), length);
+    }
+
+    ASSERT(editingRangeIsRelativeTo == EditingRangeIsRelativeTo::Paragraph);
+
+    const VisibleSelection&amp; selection = frame.selection().selection();
+    RefPtr&lt;Range&gt; selectedRange = selection.toNormalizedRange();
+    if (!selectedRange)
+        return 0;
+
+    RefPtr&lt;Range&gt; paragraphRange = makeRange(startOfParagraph(selection.visibleStart()), selection.visibleEnd());
+    if (!paragraphRange)
+        return 0;
+
+    ContainerNode&amp; rootNode = paragraphRange.get()-&gt;startContainer().treeScope().rootNode();
+    int paragraphStartIndex = TextIterator::rangeLength(Range::create(rootNode.document(), &amp;rootNode, 0, &amp;paragraphRange-&gt;startContainer(), paragraphRange-&gt;startOffset()).ptr());
+    return TextIterator::rangeFromLocationAndLength(&amp;rootNode, paragraphStartIndex + static_cast&lt;int&gt;(range.location), length);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void WebPage::didChangeScrollOffsetForFrame(Frame* frame)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;APIInjectedBundlePageUIClient.h&quot;
</span><span class="cx"> #include &quot;APIObject.h&quot;
</span><span class="cx"> #include &quot;Download.h&quot;
</span><ins>+#include &quot;EditingRange.h&quot;
</ins><span class="cx"> #include &quot;FindController.h&quot;
</span><span class="cx"> #include &quot;GeolocationPermissionRequestManager.h&quot;
</span><span class="cx"> #include &quot;ImageOptions.h&quot;
</span><span class="lines">@@ -646,7 +647,7 @@
</span><span class="cx">     
</span><span class="cx">     void sendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, const String&amp; textInput);
</span><span class="cx"> 
</span><del>-    void insertTextAsync(const String&amp; text, const EditingRange&amp; replacementRange, bool registerUndoGroup = false);
</del><ins>+    void insertTextAsync(const String&amp; text, const EditingRange&amp; replacementRange, bool registerUndoGroup = false, uint32_t editingRangeIsRelativeTo = (uint32_t)EditingRangeIsRelativeTo::Document);
</ins><span class="cx">     void getMarkedRangeAsync(uint64_t callbackID);
</span><span class="cx">     void getSelectedRangeAsync(uint64_t callbackID);
</span><span class="cx">     void characterIndexForPointAsync(const WebCore::IntPoint&amp;, uint64_t callbackID);
</span><span class="lines">@@ -1135,7 +1136,7 @@
</span><span class="cx">     static PluginView* focusedPluginViewForFrame(WebCore::Frame&amp;);
</span><span class="cx">     static PluginView* pluginViewForFrame(WebCore::Frame*);
</span><span class="cx"> 
</span><del>-    static PassRefPtr&lt;WebCore::Range&gt; rangeFromEditingRange(WebCore::Frame&amp;, const EditingRange&amp;);
</del><ins>+    static PassRefPtr&lt;WebCore::Range&gt; rangeFromEditingRange(WebCore::Frame&amp;, const EditingRange&amp;, EditingRangeIsRelativeTo = EditingRangeIsRelativeTo::Document);
</ins><span class="cx"> 
</span><span class="cx">     void reportUsedFeatures();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -357,7 +357,7 @@
</span><span class="cx">     ShouldDelayWindowOrderingEvent(WebKit::WebMouseEvent event) -&gt; (bool result)
</span><span class="cx">     AcceptsFirstMouse(int eventNumber, WebKit::WebMouseEvent event) -&gt; (bool result)
</span><span class="cx"> 
</span><del>-    InsertTextAsync(String text, struct WebKit::EditingRange replacementRange, bool registerUndoGroup)
</del><ins>+    InsertTextAsync(String text, struct WebKit::EditingRange replacementRange, bool registerUndoGroup, uint32_t editingRangeIsRelativeTo)
</ins><span class="cx">     GetMarkedRangeAsync(uint64_t callbackID)
</span><span class="cx">     GetSelectedRangeAsync(uint64_t callbackID)
</span><span class="cx">     CharacterIndexForPointAsync(WebCore::IntPoint point, uint64_t callbackID);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (196451 => 196452)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2016-02-11 23:17:19 UTC (rev 196451)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2016-02-11 23:39:15 UTC (rev 196452)
</span><span class="lines">@@ -155,6 +155,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     frame-&gt;editor().handleAcceptedCandidate(acceptedCandidate);
</span><ins>+    send(Messages::WebPageProxy::DidHandleAcceptedCandidate());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NSObject *WebPage::accessibilityObjectForMainFramePlugin()
</span></span></pre>
</div>
</div>

</body>
</html>