Title: [205797] branches/safari-602-branch

Diff

Modified: branches/safari-602-branch/LayoutTests/ChangeLog (205796 => 205797)


--- branches/safari-602-branch/LayoutTests/ChangeLog	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/LayoutTests/ChangeLog	2016-09-12 07:53:49 UTC (rev 205797)
@@ -1,3 +1,23 @@
+2016-09-12  Babak Shafiei  <[email protected]>
+
+        Merge r205765. rdar://problem/28033492
+
+    2016-09-09  Tim Horton  <[email protected]>
+
+            Text replacement candidates don't always overwrite the entire original string
+            https://bugs.webkit.org/show_bug.cgi?id=161779
+            <rdar://problem/28033492>
+
+            Reviewed by Simon Fraser.
+
+            * editing/mac/spelling/accept-candidate-without-crossing-editing-boundary.html:
+            * editing/mac/spelling/accept-misspelled-candidate.html:
+            Adjust tests to send the correct replacement range.
+
+            * editing/mac/spelling/accept-candidate-replacing-multiple-words.html:
+            Add a test that ensures that we will replace the entire string for a
+            candidate that replaces multiple words.
+
 2016-09-09  Babak Shafiei  <[email protected]>
 
         Merge r204107. rdar://problem/27860536

Added: branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words-expected.txt (0 => 205797)


--- branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words-expected.txt	                        (rev 0)
+++ branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words-expected.txt	2016-09-12 07:53:49 UTC (rev 205797)
@@ -0,0 +1,48 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 1 of #text > DIV > DIV > BODY > HTML > #document to 1 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 2 of #text > DIV > DIV > BODY > HTML > #document to 2 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 4 of #text > DIV > DIV > BODY > HTML > #document to 4 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 3 of #text > DIV > DIV > BODY > HTML > #document to 3 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 5 of #text > DIV > DIV > BODY > HTML > #document to 5 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 6 of #text > DIV > DIV > BODY > HTML > #document to 6 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 7 of #text > DIV > DIV > BODY > HTML > #document to 7 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 8 of #text > DIV > DIV > BODY > HTML > #document to 8 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertText:good idea replacingDOMRange:range from 0 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionTyped
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > DIV > BODY > HTML > #document to 0 of DIV > DIV > BODY > HTML > #document toDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: shouldInsertText:  replacingDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document givenAction:WebViewInsertActionTyped
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 9 of #text > DIV > DIV > BODY > HTML > #document to 9 of #text > DIV > DIV > BODY > HTML > #document toDOMRange:range from 10 of #text > DIV > DIV > BODY > HTML > #document to 10 of #text > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+PASS successfullyParsed is true
+
+TEST COMPLETE
+This test verifies that accepted candidates replace the entire range of the candidate source.
+
+good idea 

Copied: branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words.html (from rev 205795, branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-without-crossing-editing-boundary.html) (0 => 205797)


--- branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words.html	                        (rev 0)
+++ branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-replacing-multiple-words.html	2016-09-12 07:53:49 UTC (rev 205797)
@@ -0,0 +1,39 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function editingTest() {
+    edit = document.getElementById('edit');
+    edit.focus();
+    typeCharacterCommand('g');
+    typeCharacterCommand('o');
+    typeCharacterCommand('o');
+    typeCharacterCommand(' ');
+    typeCharacterCommand('d');
+    typeCharacterCommand('i');
+    typeCharacterCommand('d');
+    typeCharacterCommand('e');
+    typeCharacterCommand('a');
+    
+    if (window.internals)
+        internals.handleAcceptedCandidate("good idea", 0, 9);
+
+    if (window.testRunner)
+        testRunner.dumpAsText(true);
+}
+
+</script>
+</head>
+<body>
+<p>This test verifies that accepted candidates replace the entire range of the candidate source.</p>
+<div style="border:1px solid black;">
+    <div contenteditable="true" id="edit"></div>
+</div>
+<script>
+runEditingTest();
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-without-crossing-editing-boundary.html (205796 => 205797)


--- branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-without-crossing-editing-boundary.html	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-candidate-without-crossing-editing-boundary.html	2016-09-12 07:53:49 UTC (rev 205797)
@@ -10,7 +10,7 @@
     typeCharacterCommand('h');
     typeCharacterCommand('a');
     if (window.internals)
-        internals.handleAcceptedCandidate("happy");
+        internals.handleAcceptedCandidate("happy", 0, 2);
 
     if (window.testRunner)
         testRunner.dumpAsText(true);

Modified: branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-misspelled-candidate.html (205796 => 205797)


--- branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-misspelled-candidate.html	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/LayoutTests/editing/mac/spelling/accept-misspelled-candidate.html	2016-09-12 07:53:49 UTC (rev 205797)
@@ -16,7 +16,7 @@
     typeCharacterCommand('a');
     typeCharacterCommand(' ');
     if (window.internals)
-        internals.handleAcceptedCandidate("mesage");
+        internals.handleAcceptedCandidate("mesage", 0, 0);
     typeCharacterCommand(' ');
 
     if (window.testRunner)

Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (205796 => 205797)


--- branches/safari-602-branch/Source/WebCore/ChangeLog	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog	2016-09-12 07:53:49 UTC (rev 205797)
@@ -1,3 +1,45 @@
+2016-09-12  Babak Shafiei  <[email protected]>
+
+        Merge r205765. rdar://problem/28033492
+
+    2016-09-09  Tim Horton  <[email protected]>
+
+            Text replacement candidates don't always overwrite the entire original string
+            https://bugs.webkit.org/show_bug.cgi?id=161779
+            <rdar://problem/28033492>
+
+            Reviewed by Simon Fraser.
+
+            New test: editing/mac/spelling/accept-candidate-replacing-multiple-words.html.
+
+            * editing/Editor.cpp:
+            (WebCore::Editor::contextRangeForCandidateRequest):
+            Factor contextRangeForCandidateRequest out of the WebKits, into Editor.
+            This just expands to paragraph boundaries from the cursor.
+
+            (WebCore::Editor::selectTextCheckingResult):
+            Add selectTextCheckingResult, which, given a TextCheckingResult,
+            selects the range represented by the result's location and length, which
+            indicate the portion of the context string that the result refers to.
+            In the case of accepting a candidate, we want to select that range
+            so that our insertion will overwrite it.
+
+            (WebCore::Editor::handleAcceptedCandidate):
+            Make use of selectTextCheckingResult instead of just assuming that we want
+            to replace the word to the left of the insertion point.
+
+            (WebCore::Editor::stringForCandidateRequest): Deleted.
+            * editing/Editor.h:
+
+            * testing/Internals.cpp:
+            (WebCore::Internals::handleAcceptedCandidate):
+            * testing/Internals.h:
+            * testing/Internals.idl:
+            Internals' handleAcceptedCandidate assumed (wrongly) that the length
+            of a TextCheckerResult was the length of the candidate, when really it is
+            the length of the text that the candidate would replace. Adjust this,
+            and expose the replacement range to _javascript_, so we can test this.
+
 2016-09-09  Babak Shafiei  <[email protected]>
 
         Merge r204456. rdar://problem/27860536

Modified: branches/safari-602-branch/Source/WebCore/editing/Editor.cpp (205796 => 205797)


--- branches/safari-602-branch/Source/WebCore/editing/Editor.cpp	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebCore/editing/Editor.cpp	2016-09-12 07:53:49 UTC (rev 205797)
@@ -3613,18 +3613,37 @@
 
     return String();
 }
+    
+RefPtr<Range> Editor::contextRangeForCandidateRequest() const
+{
+    const VisibleSelection& selection = m_frame.selection().selection();
+    return makeRange(startOfParagraph(selection.visibleStart()), endOfParagraph(selection.visibleEnd()));
+}
+    
+void Editor::selectTextCheckingResult(const TextCheckingResult& result)
+{
+    if (!result.length)
+        return;
+    
+    RefPtr<Range> contextRange = contextRangeForCandidateRequest();
+    if (!contextRange)
+        return;
+    
+    RefPtr<Range> replacementRange = TextIterator::subrange(contextRange.get(), result.location, result.length);
+    if (!replacementRange)
+        return;
+    
+    m_frame.selection().setSelectedRange(replacementRange.get(), UPSTREAM, true);
+}
 
 void Editor::handleAcceptedCandidate(TextCheckingResult acceptedCandidate)
 {
     const VisibleSelection& selection = m_frame.selection().selection();
-    RefPtr<Range> candidateRange = candidateRangeForSelection(m_frame);
     int candidateLength = acceptedCandidate.length;
 
     m_isHandlingAcceptedCandidate = true;
 
-    if (candidateWouldReplaceText(selection))
-        m_frame.selection().setSelectedRange(candidateRange.get(), UPSTREAM, true);
-
+    selectTextCheckingResult(acceptedCandidate);
     insertText(acceptedCandidate.replacement, 0);
 
     // Some candidates come with a space built in, and we do not need to add another space in that case.

Modified: branches/safari-602-branch/Source/WebCore/editing/Editor.h (205796 => 205797)


--- branches/safari-602-branch/Source/WebCore/editing/Editor.h	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebCore/editing/Editor.h	2016-09-12 07:53:49 UTC (rev 205797)
@@ -459,6 +459,8 @@
 
     WEBCORE_EXPORT String stringForCandidateRequest() const;
     WEBCORE_EXPORT void handleAcceptedCandidate(TextCheckingResult);
+    WEBCORE_EXPORT RefPtr<Range> contextRangeForCandidateRequest() const;
+    void selectTextCheckingResult(const TextCheckingResult&);
     bool isHandlingAcceptedCandidate() const { return m_isHandlingAcceptedCandidate; }
 
 private:

Modified: branches/safari-602-branch/Source/WebCore/testing/Internals.cpp (205796 => 205797)


--- branches/safari-602-branch/Source/WebCore/testing/Internals.cpp	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebCore/testing/Internals.cpp	2016-09-12 07:53:49 UTC (rev 205797)
@@ -1680,7 +1680,7 @@
 #endif
 }
 
-void Internals::handleAcceptedCandidate(const String& candidate, ExceptionCode&)
+void Internals::handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length, ExceptionCode&)
 {
     if (!contextDocument() || !contextDocument()->frame())
         return;
@@ -1687,7 +1687,8 @@
 
     TextCheckingResult result;
     result.type = TextCheckingTypeNone;
-    result.length = candidate.length();
+    result.location = location;
+    result.length = length;
     result.replacement = candidate;
     contextDocument()->frame()->editor().handleAcceptedCandidate(result);
 }

Modified: branches/safari-602-branch/Source/WebCore/testing/Internals.h (205796 => 205797)


--- branches/safari-602-branch/Source/WebCore/testing/Internals.h	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebCore/testing/Internals.h	2016-09-12 07:53:49 UTC (rev 205797)
@@ -218,7 +218,7 @@
     void setAutomaticTextReplacementEnabled(bool enabled, ExceptionCode&);
     void setAutomaticSpellingCorrectionEnabled(bool enabled, ExceptionCode&);
 
-    void handleAcceptedCandidate(const String& candidate, ExceptionCode&);
+    void handleAcceptedCandidate(const String& candidate, unsigned location, unsigned length, ExceptionCode&);
 
     bool isOverwriteModeEnabled(ExceptionCode&);
     void toggleOverwriteModeEnabled(ExceptionCode&);

Modified: branches/safari-602-branch/Source/WebCore/testing/Internals.idl (205796 => 205797)


--- branches/safari-602-branch/Source/WebCore/testing/Internals.idl	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebCore/testing/Internals.idl	2016-09-12 07:53:49 UTC (rev 205797)
@@ -214,7 +214,7 @@
     [RaisesException] void setAutomaticTextReplacementEnabled(boolean enabled);
     [RaisesException] void setAutomaticSpellingCorrectionEnabled(boolean enabled);
 
-    [RaisesException] void handleAcceptedCandidate(DOMString candidate);
+    [RaisesException] void handleAcceptedCandidate(DOMString candidate, unsigned long location, unsigned long length);
 
     [RaisesException] boolean isOverwriteModeEnabled();
     [RaisesException] void toggleOverwriteModeEnabled();

Modified: branches/safari-602-branch/Source/WebKit/mac/ChangeLog (205796 => 205797)


--- branches/safari-602-branch/Source/WebKit/mac/ChangeLog	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebKit/mac/ChangeLog	2016-09-12 07:53:49 UTC (rev 205797)
@@ -1,3 +1,19 @@
+2016-09-12  Babak Shafiei  <[email protected]>
+
+        Merge r205765. rdar://problem/28033492
+
+    2016-09-09  Tim Horton  <[email protected]>
+
+            Text replacement candidates don't always overwrite the entire original string
+            https://bugs.webkit.org/show_bug.cgi?id=161779
+            <rdar://problem/28033492>
+
+            Reviewed by Simon Fraser.
+
+            * WebCoreSupport/WebEditorClient.mm:
+            (WebEditorClient::requestCandidatesForSelection):
+            Make use of the shared implementation of contextRangeForCandidateRequest.
+
 2016-09-09  Babak Shafiei  <[email protected]>
 
         Merge r204456. rdar://problem/27860536

Modified: branches/safari-602-branch/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (205796 => 205797)


--- branches/safari-602-branch/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm	2016-09-12 07:53:49 UTC (rev 205797)
@@ -1161,6 +1161,10 @@
     RefPtr<Range> selectedRange = selection.toNormalizedRange();
     if (!selectedRange)
         return;
+    
+    Frame* frame = core([m_webView _selectedOrMainFrame]);
+    if (!frame)
+        return;
 
     m_lastSelectionForRequestedCandidates = selection;
 
@@ -1173,7 +1177,7 @@
     int lengthToSelectionStart = TextIterator::rangeLength(makeRange(paragraphStart, selectionStart).get());
     int lengthToSelectionEnd = TextIterator::rangeLength(makeRange(paragraphStart, selectionEnd).get());
     m_rangeForCandidates = NSMakeRange(lengthToSelectionStart, lengthToSelectionEnd - lengthToSelectionStart);
-    m_paragraphContextForCandidateRequest = plainText(makeRange(paragraphStart, paragraphEnd).get());
+    m_paragraphContextForCandidateRequest = plainText(frame->editor().contextRangeForCandidateRequest().get());
 
     NSTextCheckingTypes checkingTypes = NSTextCheckingTypeSpelling | NSTextCheckingTypeReplacement | NSTextCheckingTypeCorrection;
     auto weakEditor = m_weakPtrFactory.createWeakPtr();

Modified: branches/safari-602-branch/Source/WebKit2/ChangeLog (205796 => 205797)


--- branches/safari-602-branch/Source/WebKit2/ChangeLog	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebKit2/ChangeLog	2016-09-12 07:53:49 UTC (rev 205797)
@@ -1,3 +1,19 @@
+2016-09-12  Babak Shafiei  <[email protected]>
+
+        Merge r205765. rdar://problem/28033492
+
+    2016-09-09  Tim Horton  <[email protected]>
+
+            Text replacement candidates don't always overwrite the entire original string
+            https://bugs.webkit.org/show_bug.cgi?id=161779
+            <rdar://problem/28033492>
+
+            Reviewed by Simon Fraser.
+
+            * WebProcess/WebPage/mac/WebPageMac.mm:
+            (WebKit::WebPage::platformEditorState):
+            Make use of the shared implementation of contextRangeForCandidateRequest.
+
 2016-09-09  Babak Shafiei  <[email protected]>
 
         Merge r204456. rdar://problem/27860536

Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (205796 => 205797)


--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2016-09-12 07:21:08 UTC (rev 205796)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2016-09-12 07:53:49 UTC (rev 205797)
@@ -138,7 +138,7 @@
 
     postLayoutData.candidateRequestStartPosition = TextIterator::rangeLength(makeRange(paragraphStart, selectionStart).get());
     postLayoutData.selectedTextLength = TextIterator::rangeLength(makeRange(paragraphStart, selectionEnd).get()) - postLayoutData.candidateRequestStartPosition;
-    postLayoutData.paragraphContextForCandidateRequest = plainText(makeRange(paragraphStart, paragraphEnd).get());
+    postLayoutData.paragraphContextForCandidateRequest = plainText(frame.editor().contextRangeForCandidateRequest().get());
     postLayoutData.stringForCandidateRequest = frame.editor().stringForCandidateRequest();
 
     IntRect rectForSelectionCandidates;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to