<!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>[238454] 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/238454">238454</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2018-11-22 19:10:34 -0800 (Thu, 22 Nov 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>Address post-review feedback after <a href="http://trac.webkit.org/projects/webkit/changeset/238438">r238438</a>
https://bugs.webkit.org/show_bug.cgi?id=191913

Reviewed by Ryosuke Niwa.

Source/WebCore:

Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
`Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:

FrameSelection::ShouldCloseTyping { No, Yes }
Editor::SelectReplacement { No, Yes }
Editor::SmartReplace { No, Yes }
Editor::MatchStyle { No, Yes }

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):
* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::replaceSelectionWithText):
(WebCore::Editor::setComposition):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::insertAttachment):

At various call sites, replace boolean arguments with named enums.

* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity):
(WebCore::executeDeleteToMark):
(WebCore::executeSelectToMark):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectedRange):
* editing/FrameSelection.h:
* page/Page.cpp:
(WebCore::replaceRanges):

Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.

(WebCore::Page::replaceRangesWithText):
(WebCore::Page::replaceSelectionWithText):
* page/Page.h:

Source/WebKit:

Replace boolean arguments to setSelectedRange, replaceSelectionWithText and replaceSelectionWithFragment with
enum flags, and tweak a couple of functions to take `const Vector&` instead of `Vector&&`.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageReplaceStringMatches):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::replaceMatches):
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
(WebKit::WebPage::replaceMatches):
(WebKit::WebPage::replaceSelectionWithText):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::selectWithGesture):
(WebKit::WebPage::updateSelectionWithTouches):
(WebKit::WebPage::selectWithTwoTouches):
(WebKit::WebPage::extendSelection):
(WebKit::WebPage::selectWordBackward):
(WebKit::WebPage::moveSelectionByOffset):
(WebKit::WebPage::selectPositionAtPoint):
(WebKit::WebPage::selectPositionAtBoundaryWithDirection):
(WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
(WebKit::WebPage::selectTextWithGranularityAtPoint):
(WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
(WebKit::WebPage::updateSelectionWithExtentPoint):
(WebKit::WebPage::replaceSelectedText):
(WebKit::WebPage::replaceDictatedText):
(WebKit::WebPage::syncApplyAutocorrection):

Source/WebKitLegacy/mac:

* WebView/WebFrame.mm:
(-[WebFrame setSelectedDOMRange:affinity:closeTyping:]):
(-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
* WebView/WebView.mm:
(-[WebView setSelectedDOMRange:affinity:]):

Source/WebKitLegacy/win:

* AccessibleTextImpl.cpp:
(AccessibleText::replaceText):</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="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectionh">trunk/Source/WebCore/editing/FrameSelection.h</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebProcessInjectedBundleAPIcWKBundlePagecpp">trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageFindControllercpp">trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageFindControllerh">trunk/Source/WebKit/WebProcess/WebPage/FindController.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebFramemm">trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebViewmm">trunk/Source/WebKitLegacy/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitLegacywinAccessibleTextImplcpp">trunk/Source/WebKitLegacy/win/AccessibleTextImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/ChangeLog      2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Address post-review feedback after r238438
+        https://bugs.webkit.org/show_bug.cgi?id=191913
+
+        Reviewed by Ryosuke Niwa.
+
+        Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
+        `Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:
+
+        FrameSelection::ShouldCloseTyping { No, Yes }
+        Editor::SelectReplacement { No, Yes }
+        Editor::SmartReplace { No, Yes }
+        Editor::MatchStyle { No, Yes }
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::selectText):
+        * editing/Editor.cpp:
+        (WebCore::Editor::handleTextEvent):
+        (WebCore::Editor::replaceSelectionWithFragment):
+        (WebCore::Editor::replaceSelectionWithText):
+        (WebCore::Editor::setComposition):
+        (WebCore::Editor::markMisspellingsAfterTypingToWord):
+        (WebCore::Editor::changeBackToReplacedString):
+        (WebCore::Editor::transpose):
+        (WebCore::Editor::insertAttachment):
+
+        At various call sites, replace boolean arguments with named enums.
+
+        * editing/Editor.h:
+        * editing/EditorCommand.cpp:
+        (WebCore::expandSelectionToGranularity):
+        (WebCore::executeDeleteToMark):
+        (WebCore::executeSelectToMark):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::setSelectedRange):
+        * editing/FrameSelection.h:
+        * page/Page.cpp:
+        (WebCore::replaceRanges):
+
+        Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.
+
+        (WebCore::Page::replaceRangesWithText):
+        (WebCore::Page::replaceSelectionWithText):
+        * page/Page.h:
+
</ins><span class="cx"> 2018-11-21  Ryosuke Niwa  <rniwa@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Modernize SVGURIReference::targetElementFromIRIString
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp       2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp  2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -838,7 +838,7 @@
</span><span class="cx">         
</span><span class="cx">         String closestString = closestStringRange->text();
</span><span class="cx">         bool replaceSelection = false;
</span><del>-        if (frame->selection().setSelectedRange(closestStringRange.get(), DOWNSTREAM, true)) {
</del><ins>+        if (frame->selection().setSelectedRange(closestStringRange.get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::Yes)) {
</ins><span class="cx">             switch (activity) {
</span><span class="cx">             case AccessibilitySelectTextActivity::FindAndCapitalize:
</span><span class="cx">                 replacementString = capitalize(closestString, ' '); // FIXME: Needs to take locale into account to work correctly.
</span><span class="lines">@@ -871,7 +871,7 @@
</span><span class="cx">             // A bit obvious, but worth noting the API contract for this method is that we should
</span><span class="cx">             // return the replacement string when replacing, but the selected string if not.
</span><span class="cx">             if (replaceSelection) {
</span><del>-                frame->editor().replaceSelectionWithText(replacementString, true, true);
</del><ins>+                frame->editor().replaceSelectionWithText(replacementString, Editor::SelectReplacement::Yes, Editor::SmartReplace::Yes);
</ins><span class="cx">                 return replacementString;
</span><span class="cx">             }
</span><span class="cx">             
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp  2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/editing/Editor.cpp     2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -310,9 +310,9 @@
</span><span class="cx">             if (client()->performsTwoStepPaste(event.pastingFragment()))
</span><span class="cx">                 return true;
</span><span class="cx"> #endif
</span><del>-            replaceSelectionWithFragment(*event.pastingFragment(), false, event.shouldSmartReplace(), event.shouldMatchStyle(), EditAction::Paste, event.mailBlockquoteHandling());
</del><ins>+            replaceSelectionWithFragment(*event.pastingFragment(), SelectReplacement::No, event.shouldSmartReplace() ? SmartReplace::Yes : SmartReplace::No, event.shouldMatchStyle() ? MatchStyle::Yes : MatchStyle::No, EditAction::Paste, event.mailBlockquoteHandling());
</ins><span class="cx">         } else
</span><del>-            replaceSelectionWithText(event.data(), false, event.shouldSmartReplace(), EditAction::Paste);
</del><ins>+            replaceSelectionWithText(event.data(), SelectReplacement::No, event.shouldSmartReplace() ? SmartReplace::Yes : SmartReplace::No, EditAction::Paste);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -639,7 +639,7 @@
</span><span class="cx">     return client()->shouldInsertNode(&fragment, replacingDOMRange, givenAction);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Editor::replaceSelectionWithFragment(DocumentFragment& fragment, bool selectReplacement, bool smartReplace, bool matchStyle, EditAction editingAction, MailBlockquoteHandling mailBlockquoteHandling)
</del><ins>+void Editor::replaceSelectionWithFragment(DocumentFragment& fragment, SelectReplacement selectReplacement, SmartReplace smartReplace, MatchStyle matchStyle, EditAction editingAction, MailBlockquoteHandling mailBlockquoteHandling)
</ins><span class="cx"> {
</span><span class="cx">     VisibleSelection selection = m_frame.selection().selection();
</span><span class="cx">     if (selection.isNone() || !selection.isContentEditable())
</span><span class="lines">@@ -650,11 +650,11 @@
</span><span class="cx">         replacedText = AccessibilityReplacedText(selection);
</span><span class="cx"> 
</span><span class="cx">     OptionSet<ReplaceSelectionCommand::CommandOption> options { ReplaceSelectionCommand::PreventNesting, ReplaceSelectionCommand::SanitizeFragment };
</span><del>-    if (selectReplacement)
</del><ins>+    if (selectReplacement == SelectReplacement::Yes)
</ins><span class="cx">         options.add(ReplaceSelectionCommand::SelectReplacement);
</span><del>-    if (smartReplace)
</del><ins>+    if (smartReplace == SmartReplace::Yes)
</ins><span class="cx">         options.add(ReplaceSelectionCommand::SmartReplace);
</span><del>-    if (matchStyle)
</del><ins>+    if (matchStyle == MatchStyle::Yes)
</ins><span class="cx">         options.add(ReplaceSelectionCommand::MatchStyle);
</span><span class="cx">     if (mailBlockquoteHandling == MailBlockquoteHandling::IgnoreBlockquote)
</span><span class="cx">         options.add(ReplaceSelectionCommand::IgnoreMailBlockquote);
</span><span class="lines">@@ -685,13 +685,13 @@
</span><span class="cx">         m_spellChecker->requestCheckingFor(request.releaseNonNull());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Editor::replaceSelectionWithText(const String& text, bool selectReplacement, bool smartReplace, EditAction editingAction)
</del><ins>+void Editor::replaceSelectionWithText(const String& text, SelectReplacement selectReplacement, SmartReplace smartReplace, EditAction editingAction)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr<Range> range = selectedRange();
</span><span class="cx">     if (!range)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    replaceSelectionWithFragment(createFragmentFromText(*range, text), selectReplacement, smartReplace, true, editingAction);
</del><ins>+    replaceSelectionWithFragment(createFragmentFromText(*range, text), selectReplacement, smartReplace, MatchStyle::Yes, editingAction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<Range> Editor::selectedRange()
</span><span class="lines">@@ -2023,7 +2023,7 @@
</span><span class="cx">             unsigned start = std::min(baseOffset + selectionStart, extentOffset);
</span><span class="cx">             unsigned end = std::min(std::max(start, baseOffset + selectionEnd), extentOffset);
</span><span class="cx">             RefPtr<Range> selectedRange = Range::create(baseNode->document(), baseNode, start, baseNode, end);
</span><del>-            m_frame.selection().setSelectedRange(selectedRange.get(), DOWNSTREAM, false);
</del><ins>+            m_frame.selection().setSelectedRange(selectedRange.get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::No);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -2517,7 +2517,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (!m_frame.editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertAction::Typed))
</span><span class="cx">             return;
</span><del>-        m_frame.editor().replaceSelectionWithText(autocorrectedString, false, false, EditAction::Insert);
</del><ins>+        m_frame.editor().replaceSelectionWithText(autocorrectedString, SelectReplacement::No, SmartReplace::No, EditAction::Insert);
</ins><span class="cx"> 
</span><span class="cx">         // Reset the charet one character further.
</span><span class="cx">         m_frame.selection().moveTo(m_frame.selection().selection().end());
</span><span class="lines">@@ -2875,7 +2875,7 @@
</span><span class="cx">     
</span><span class="cx">     m_alternativeTextController->recordAutocorrectionResponse(AutocorrectionResponse::Reverted, replacedString, selection.get());
</span><span class="cx">     TextCheckingParagraph paragraph(*selection);
</span><del>-    replaceSelectionWithText(replacedString, false, false, EditAction::Insert);
</del><ins>+    replaceSelectionWithText(replacedString, SelectReplacement::No, SmartReplace::No, EditAction::Insert);
</ins><span class="cx">     auto changedRange = paragraph.subrange(paragraph.checkingStart(), replacedString.length());
</span><span class="cx">     changedRange->startContainer().document().markers().addMarker(changedRange.ptr(), DocumentMarker::Replacement, String());
</span><span class="cx">     m_alternativeTextController->markReversed(changedRange);
</span><span class="lines">@@ -3121,7 +3121,7 @@
</span><span class="cx">     // Insert the transposed characters.
</span><span class="cx">     if (!shouldInsertText(transposed, range.get(), EditorInsertAction::Typed))
</span><span class="cx">         return;
</span><del>-    replaceSelectionWithText(transposed, false, false, EditAction::Insert);
</del><ins>+    replaceSelectionWithText(transposed, SelectReplacement::No, SmartReplace::No, EditAction::Insert);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Editor::addRangeToKillRing(const Range& range, KillRingInsertionMode mode)
</span><span class="lines">@@ -4098,7 +4098,7 @@
</span><span class="cx">     auto fragmentToInsert = document().createDocumentFragment();
</span><span class="cx">     fragmentToInsert->appendChild(attachment.get());
</span><span class="cx"> 
</span><del>-    replaceSelectionWithFragment(fragmentToInsert.get(), false, false, true);
</del><ins>+    replaceSelectionWithFragment(fragmentToInsert.get(), SelectReplacement::No, SmartReplace::No, MatchStyle::Yes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ATTACHMENT_ELEMENT)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h    2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/editing/Editor.h       2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -438,8 +438,11 @@
</span><span class="cx">     void textDidChangeInTextArea(Element*);
</span><span class="cx">     WEBCORE_EXPORT WritingDirection baseWritingDirectionForSelectionStart() const;
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void replaceSelectionWithFragment(DocumentFragment&, bool selectReplacement, bool smartReplace, bool matchStyle, EditAction = EditAction::Insert, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);
-    WEBCORE_EXPORT void replaceSelectionWithText(const String&, bool selectReplacement, bool smartReplace, EditAction = EditAction::Insert);
</del><ins>+    enum class SelectReplacement : bool { No, Yes };
+    enum class SmartReplace : bool { No, Yes };
+    enum class MatchStyle : bool { No, Yes };
+    WEBCORE_EXPORT void replaceSelectionWithFragment(DocumentFragment&, SelectReplacement, SmartReplace, MatchStyle, EditAction = EditAction::Insert, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);
+    WEBCORE_EXPORT void replaceSelectionWithText(const String&, SelectReplacement, SmartReplace, EditAction = EditAction::Insert);
</ins><span class="cx">     WEBCORE_EXPORT bool selectionStartHasMarkerFor(DocumentMarker::MarkerType, int from, int length) const;
</span><span class="cx">     void updateMarkersForWordsAffectedByEditing(bool onlyHandleWordsContainingSelection);
</span><span class="cx">     void deletedAutocorrectionAtPosition(const Position&, const String& originalString);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp   2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp      2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx">     EAffinity affinity = selection.affinity();
</span><span class="cx">     if (!frame.editor().client()->shouldChangeSelectedRange(oldRange.get(), newRange.get(), affinity, false))
</span><span class="cx">         return false;
</span><del>-    frame.selection().setSelectedRange(newRange.get(), affinity, true);
</del><ins>+    frame.selection().setSelectedRange(newRange.get(), affinity, FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -355,7 +355,7 @@
</span><span class="cx">     RefPtr<Range> mark = frame.editor().mark().toNormalizedRange();
</span><span class="cx">     FrameSelection& selection = frame.selection();
</span><span class="cx">     if (mark && frame.editor().selectedRange()) {
</span><del>-        bool selected = selection.setSelectedRange(unionDOMRanges(*mark, *frame.editor().selectedRange()).get(), DOWNSTREAM, true);
</del><ins>+        bool selected = selection.setSelectedRange(unionDOMRanges(*mark, *frame.editor().selectedRange()).get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">         ASSERT(selected);
</span><span class="cx">         if (!selected)
</span><span class="cx">             return false;
</span><span class="lines">@@ -1030,7 +1030,7 @@
</span><span class="cx">         PAL::systemBeep();
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><del>-    frame.selection().setSelectedRange(unionDOMRanges(*mark, *selection).get(), DOWNSTREAM, true);
</del><ins>+    frame.selection().setSelectedRange(unionDOMRanges(*mark, *selection).get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp  2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp     2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1979,7 +1979,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool closeTyping, EUserTriggered userTriggered)
</del><ins>+bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, ShouldCloseTyping closeTyping, EUserTriggered userTriggered)
</ins><span class="cx"> {
</span><span class="cx">     if (!range)
</span><span class="cx">         return false;
</span><span class="lines">@@ -1994,7 +1994,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     OptionSet<SetSelectionOption> selectionOptions {  ClearTypingStyle };
</span><del>-    if (closeTyping)
</del><ins>+    if (closeTyping == ShouldCloseTyping::Yes)
</ins><span class="cx">         selectionOptions.add(CloseTyping);
</span><span class="cx"> 
</span><span class="cx">     if (userTriggered == UserTriggered) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.h (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.h    2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/editing/FrameSelection.h       2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -150,7 +150,9 @@
</span><span class="cx"> 
</span><span class="cx">     const VisibleSelection& selection() const { return m_selection; }
</span><span class="cx">     WEBCORE_EXPORT void setSelection(const VisibleSelection&, OptionSet<SetSelectionOption> = defaultSetSelectionOptions(), AXTextStateChangeIntent = AXTextStateChangeIntent(), CursorAlignOnScroll = AlignCursorOnScrollIfNeeded, TextGranularity = CharacterGranularity);
</span><del>-    WEBCORE_EXPORT bool setSelectedRange(Range*, EAffinity, bool closeTyping, EUserTriggered = NotUserTriggered);
</del><ins>+
+    enum class ShouldCloseTyping : bool { No, Yes };
+    WEBCORE_EXPORT bool setSelectedRange(Range*, EAffinity, ShouldCloseTyping, EUserTriggered = NotUserTriggered);
</ins><span class="cx">     WEBCORE_EXPORT void selectAll();
</span><span class="cx">     WEBCORE_EXPORT void clear();
</span><span class="cx">     void prepareForDestruction();
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp       2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/page/Page.cpp  2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -772,7 +772,7 @@
</span><span class="cx">     size_t length { 0 };
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void replaceRanges(Page& page, Vector<FindReplacementRange>&& ranges, const String& replacementText)
</del><ins>+static void replaceRanges(Page& page, const Vector<FindReplacementRange>& ranges, const String& replacementText)
</ins><span class="cx"> {
</span><span class="cx">     HashMap<RefPtr<ContainerNode>, Vector<FindReplacementRange>> rangesByContainerNode;
</span><span class="cx">     for (auto& range : ranges) {
</span><span class="lines">@@ -819,7 +819,7 @@
</span><span class="cx">         return frameToTraversalIndexMap.get(firstFrame) > frameToTraversalIndexMap.get(secondFrame);
</span><span class="cx">     });
</span><span class="cx"> 
</span><del>-    for (auto container : containerNodesInOrderOfReplacement) {
</del><ins>+    for (auto& container : containerNodesInOrderOfReplacement) {
</ins><span class="cx">         auto frame = makeRefPtr(container->document().frame());
</span><span class="cx">         if (!frame)
</span><span class="cx">             continue;
</span><span class="lines">@@ -831,13 +831,13 @@
</span><span class="cx">             if (!range || range->collapsed())
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><del>-            frame->selection().setSelectedRange(range.get(), DOWNSTREAM, true);
-            frame->editor().replaceSelectionWithText(replacementText, true, false, EditAction::InsertReplacement);
</del><ins>+            frame->selection().setSelectedRange(range.get(), DOWNSTREAM, FrameSelection::ShouldCloseTyping::Yes);
+            frame->editor().replaceSelectionWithText(replacementText, Editor::SelectReplacement::Yes, Editor::SmartReplace::No, EditAction::InsertReplacement);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-uint32_t Page::replaceRangesWithText(Vector<Ref<Range>>&& rangesToReplace, const String& replacementText, bool selectionOnly)
</del><ins>+uint32_t Page::replaceRangesWithText(const Vector<Ref<Range>>& rangesToReplace, const String& replacementText, bool selectionOnly)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: In the future, we should respect the `selectionOnly` flag by checking whether each range being replaced is
</span><span class="cx">     // contained within its frame's selection.
</span><span class="lines">@@ -866,7 +866,7 @@
</span><span class="cx">         replacementRanges.append({ WTFMove(highestRoot), replacementLocation, replacementLength });
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    replaceRanges(*this, WTFMove(replacementRanges), replacementText);
</del><ins>+    replaceRanges(*this, replacementRanges, replacementText);
</ins><span class="cx">     return rangesToReplace.size();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -878,7 +878,7 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     auto editAction = selection.isRange() ? EditAction::InsertReplacement : EditAction::Insert;
</span><del>-    frame->editor().replaceSelectionWithText(replacementText, true, false, editAction);
</del><ins>+    frame->editor().replaceSelectionWithText(replacementText, Editor::SelectReplacement::Yes, Editor::SmartReplace::No, editAction);
</ins><span class="cx">     return 1;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h 2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebCore/page/Page.h    2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">     bool tabKeyCyclesThroughElements() const { return m_tabKeyCyclesThroughElements; }
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT bool findString(const String&, FindOptions, DidWrap* = nullptr);
</span><del>-    WEBCORE_EXPORT uint32_t replaceRangesWithText(Vector<Ref<Range>>&& rangesToReplace, const String& replacementText, bool selectionOnly);
</del><ins>+    WEBCORE_EXPORT uint32_t replaceRangesWithText(const Vector<Ref<Range>>& rangesToReplace, const String& replacementText, bool selectionOnly);
</ins><span class="cx">     WEBCORE_EXPORT uint32_t replaceSelectionWithText(const String& replacementText);
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT RefPtr<Range> rangeOfString(const String&, Range*, FindOptions);
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/ChangeLog       2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Address post-review feedback after r238438
+        https://bugs.webkit.org/show_bug.cgi?id=191913
+
+        Reviewed by Ryosuke Niwa.
+
+        Replace boolean arguments to setSelectedRange, replaceSelectionWithText and replaceSelectionWithFragment with
+        enum flags, and tweak a couple of functions to take `const Vector&` instead of `Vector&&`.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageReplaceStringMatches):
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::replaceMatches):
+        * WebProcess/WebPage/FindController.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::replaceStringMatchesFromInjectedBundle):
+        (WebKit::WebPage::replaceMatches):
+        (WebKit::WebPage::replaceSelectionWithText):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::selectWithGesture):
+        (WebKit::WebPage::updateSelectionWithTouches):
+        (WebKit::WebPage::selectWithTwoTouches):
+        (WebKit::WebPage::extendSelection):
+        (WebKit::WebPage::selectWordBackward):
+        (WebKit::WebPage::moveSelectionByOffset):
+        (WebKit::WebPage::selectPositionAtPoint):
+        (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
+        (WebKit::WebPage::moveSelectionAtBoundaryWithDirection):
+        (WebKit::WebPage::selectTextWithGranularityAtPoint):
+        (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
+        (WebKit::WebPage::updateSelectionWithExtentPoint):
+        (WebKit::WebPage::replaceSelectedText):
+        (WebKit::WebPage::replaceDictatedText):
+        (WebKit::WebPage::syncApplyAutocorrection):
+
</ins><span class="cx"> 2018-11-22  Mark Lam  <mark.lam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Rollout r238432: Breaks internal Mac builds.
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessInjectedBundleAPIcWKBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp     2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -461,11 +461,12 @@
</span><span class="cx">     Vector<uint32_t> indices;
</span><span class="cx">     indices.reserveInitialCapacity(matchIndices->size());
</span><span class="cx"> 
</span><del>-    for (size_t arrayIndex = 0; arrayIndex < matchIndices->size(); ++arrayIndex) {
-        if (auto* indexAsObject = matchIndices->at<API::UInt64>(arrayIndex))
</del><ins>+    auto numberOfMatchIndices = matchIndices->size();
+    for (size_t i = 0; i < numberOfMatchIndices; ++i) {
+        if (auto* indexAsObject = matchIndices->at<API::UInt64>(i))
</ins><span class="cx">             indices.uncheckedAppend(indexAsObject->value());
</span><span class="cx">     }
</span><del>-    toImpl(pageRef)->replaceStringMatchesFromInjectedBundle(WTFMove(indices), toWTFString(replacementText), selectionOnly);
</del><ins>+    toImpl(pageRef)->replaceStringMatchesFromInjectedBundle(indices, toWTFString(replacementText), selectionOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WKImageRef WKBundlePageCreateSnapshotWithOptions(WKBundlePageRef pageRef, WKRect rect, WKSnapshotOptions options)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp        2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/WebProcess/WebPage/FindController.cpp   2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     m_webPage->send(Messages::WebPageProxy::DidCountStringMatches(string, matchCount));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-uint32_t FindController::replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly)
</del><ins>+uint32_t FindController::replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly)
</ins><span class="cx"> {
</span><span class="cx">     if (matchIndices.isEmpty())
</span><span class="cx">         return m_webPage->corePage()->replaceSelectionWithText(replacementText);
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">         if (rangesToReplace.size() >= maximumNumberOfMatchesToReplace)
</span><span class="cx">             break;
</span><span class="cx">     }
</span><del>-    return m_webPage->corePage()->replaceRangesWithText(WTFMove(rangesToReplace), replacementText, selectionOnly);
</del><ins>+    return m_webPage->corePage()->replaceRangesWithText(rangesToReplace, replacementText, selectionOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static Frame* frameWithSelection(Page* page)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageFindControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/FindController.h (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/FindController.h  2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/WebProcess/WebPage/FindController.h     2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     void selectFindMatch(uint32_t matchIndex);
</span><span class="cx">     void hideFindUI();
</span><span class="cx">     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
</span><del>-    uint32_t replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly);
</del><ins>+    uint32_t replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly);
</ins><span class="cx">     
</span><span class="cx">     void hideFindIndicator();
</span><span class="cx">     void showFindIndicatorInSelection();
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -3796,9 +3796,9 @@
</span><span class="cx">     findController().findStringMatches(target, options, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::replaceStringMatchesFromInjectedBundle(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly)
</del><ins>+void WebPage::replaceStringMatchesFromInjectedBundle(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly)
</ins><span class="cx"> {
</span><del>-    findController().replaceMatches(WTFMove(matchIndices), replacementText, selectionOnly);
</del><ins>+    findController().replaceMatches(matchIndices, replacementText, selectionOnly);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::findString(const String& string, uint32_t options, uint32_t maxMatchCount)
</span><span class="lines">@@ -3831,9 +3831,9 @@
</span><span class="cx">     findController().countStringMatches(string, static_cast<FindOptions>(options), maxMatchCount);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly, CallbackID callbackID)
</del><ins>+void WebPage::replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID callbackID)
</ins><span class="cx"> {
</span><del>-    auto numberOfReplacements = findController().replaceMatches(WTFMove(matchIndices), replacementText, selectionOnly);
</del><ins>+    auto numberOfReplacements = findController().replaceMatches(matchIndices, replacementText, selectionOnly);
</ins><span class="cx">     send(Messages::WebPageProxy::UnsignedCallback(numberOfReplacements, callbackID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -4036,9 +4036,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::replaceSelectionWithText(Frame* frame, const String& text)
</span><span class="cx"> {
</span><del>-    bool selectReplacement = true;
-    bool smartReplace = false;
-    return frame->editor().replaceSelectionWithText(text, selectReplacement, smartReplace);
</del><ins>+    return frame->editor().replaceSelectionWithText(text, WebCore::Editor::SelectReplacement::Yes, WebCore::Editor::SmartReplace::No);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS_FAMILY)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -409,7 +409,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool findStringFromInjectedBundle(const String&, FindOptions);
</span><span class="cx">     void findStringMatchesFromInjectedBundle(const String&, FindOptions);
</span><del>-    void replaceStringMatchesFromInjectedBundle(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly);
</del><ins>+    void replaceStringMatchesFromInjectedBundle(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly);
</ins><span class="cx"> 
</span><span class="cx">     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
</span><span class="cx"> 
</span><span class="lines">@@ -1306,7 +1306,7 @@
</span><span class="cx">     void selectFindMatch(uint32_t matchIndex);
</span><span class="cx">     void hideFindUI();
</span><span class="cx">     void countStringMatches(const String&, uint32_t findOptions, uint32_t maxMatchCount);
</span><del>-    void replaceMatches(Vector<uint32_t>&& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
</del><ins>+    void replaceMatches(const Vector<uint32_t>& matchIndices, const String& replacementText, bool selectionOnly, CallbackID);
</ins><span class="cx"> 
</span><span class="cx"> #if USE(COORDINATED_GRAPHICS)
</span><span class="cx">     void sendViewportAttributesChanged(const WebCore::ViewportArguments&);
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm 2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm    2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1214,7 +1214,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     if (range)
</span><del>-        frame.selection().setSelectedRange(range.get(), position.affinity(), true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(range.get(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx"> 
</span><span class="cx">     send(Messages::WebPageProxy::GestureCallback(point, gestureType, gestureState, static_cast<uint32_t>(flags), callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1364,7 +1364,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     if (range)
</span><del>-        frame.selection().setSelectedRange(range.get(), position.affinity(), true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(range.get(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx"> 
</span><span class="cx">     send(Messages::WebPageProxy::TouchesCallback(point, touches, flags, callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1380,7 +1380,7 @@
</span><span class="cx">             range = Range::create(*frame.document(), fromPosition, toPosition);
</span><span class="cx">         else
</span><span class="cx">             range = Range::create(*frame.document(), toPosition, fromPosition);
</span><del>-        frame.selection().setSelectedRange(range.get(), fromPosition.affinity(), true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(range.get(), fromPosition.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // We can use the same callback for the gestures with one point.
</span><span class="lines">@@ -1395,7 +1395,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     VisiblePosition position = frame.selection().selection().start();
</span><del>-    frame.selection().setSelectedRange(wordRangeFromPosition(position).get(), position.affinity(), true, UserTriggered);
</del><ins>+    frame.selection().setSelectedRange(wordRangeFromPosition(position).get(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::selectWordBackward()
</span><span class="lines">@@ -1407,7 +1407,7 @@
</span><span class="cx">     VisiblePosition position = frame.selection().selection().start();
</span><span class="cx">     VisiblePosition startPosition = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionBackward);
</span><span class="cx">     if (startPosition.isNotNull() && startPosition != position)
</span><del>-        frame.selection().setSelectedRange(Range::create(*frame.document(), startPosition, position).ptr(), position.affinity(), true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(Range::create(*frame.document(), startPosition, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::moveSelectionByOffset(int32_t offset, CallbackID callbackID)
</span><span class="lines">@@ -1425,7 +1425,7 @@
</span><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx">     if (position.isNotNull() && startPosition != position)
</span><del>-        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     send(Messages::WebPageProxy::VoidCallback(callbackID));
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -1545,7 +1545,7 @@
</span><span class="cx">     VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithAssistedNode);
</span><span class="cx">     
</span><span class="cx">     if (position.isNotNull())
</span><del>-        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     send(Messages::WebPageProxy::VoidCallback(callbackID));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1557,7 +1557,7 @@
</span><span class="cx">     if (position.isNotNull()) {
</span><span class="cx">         position = positionOfNextBoundaryOfGranularity(position, static_cast<WebCore::TextGranularity>(granularity), static_cast<SelectionDirection>(direction));
</span><span class="cx">         if (position.isNotNull())
</span><del>-            frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), UPSTREAM, true, UserTriggered);
</del><ins>+            frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     }
</span><span class="cx">     send(Messages::WebPageProxy::VoidCallback(callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1571,7 +1571,7 @@
</span><span class="cx">         VisiblePosition position = (isForward) ? frame.selection().selection().visibleEnd() : frame.selection().selection().visibleStart();
</span><span class="cx">         position = positionOfNextBoundaryOfGranularity(position, static_cast<WebCore::TextGranularity>(granularity), static_cast<SelectionDirection>(direction));
</span><span class="cx">         if (position.isNotNull())
</span><del>-            frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), isForward? UPSTREAM : DOWNSTREAM, true, UserTriggered);
</del><ins>+            frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), isForward? UPSTREAM : DOWNSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     }
</span><span class="cx">     send(Messages::WebPageProxy::VoidCallback(callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1628,7 +1628,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (range)
</span><del>-        frame.selection().setSelectedRange(range.get(), UPSTREAM, true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     m_initialSelection = range;
</span><span class="cx">     send(Messages::WebPageProxy::VoidCallback(callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1663,7 +1663,7 @@
</span><span class="cx">         range = Range::create(*frame.document(), selectionStart, selectionEnd);
</span><span class="cx">     
</span><span class="cx">     if (range)
</span><del>-        frame.selection().setSelectedRange(range.get(), UPSTREAM, true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx">     
</span><span class="cx">     send(Messages::WebPageProxy::UnsignedCallback(selectionStart == m_initialSelection->startPosition(), callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1706,7 +1706,7 @@
</span><span class="cx">         range = Range::create(*frame.document(), selectionStart, selectionEnd);
</span><span class="cx"> 
</span><span class="cx">     if (range)
</span><del>-        frame.selection().setSelectedRange(range.get(), UPSTREAM, true, UserTriggered);
</del><ins>+        frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered);
</ins><span class="cx"> 
</span><span class="cx">     send(Messages::WebPageProxy::UnsignedCallback(m_selectionAnchor == Start, callbackID));
</span><span class="cx"> }
</span><span class="lines">@@ -1769,7 +1769,7 @@
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     frame.editor().setIgnoreSelectionChanges(true);
</span><del>-    frame.selection().setSelectedRange(wordRange.get(), UPSTREAM, true);
</del><ins>+    frame.selection().setSelectedRange(wordRange.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">     frame.editor().insertText(newText, 0);
</span><span class="cx">     frame.editor().setIgnoreSelectionChanges(false);
</span><span class="cx"> }
</span><span class="lines">@@ -1796,7 +1796,7 @@
</span><span class="cx"> 
</span><span class="cx">     // We don't want to notify the client that the selection has changed until we are done inserting the new text.
</span><span class="cx">     frame.editor().setIgnoreSelectionChanges(true);
</span><del>-    frame.selection().setSelectedRange(range.get(), UPSTREAM, true);
</del><ins>+    frame.selection().setSelectedRange(range.get(), UPSTREAM, WebCore::FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">     frame.editor().insertText(newText, 0);
</span><span class="cx">     frame.editor().setIgnoreSelectionChanges(false);
</span><span class="cx"> }
</span><span class="lines">@@ -1930,7 +1930,7 @@
</span><span class="cx">     if (range && range->collapsed())
</span><span class="cx">         affinity = VisiblePosition(range->startPosition(), UPSTREAM).affinity();
</span><span class="cx">     
</span><del>-    frame.selection().setSelectedRange(range.get(), affinity, true);
</del><ins>+    frame.selection().setSelectedRange(range.get(), affinity, WebCore::FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">     if (correction.length())
</span><span class="cx">         frame.editor().insertText(correction, 0, originalText.isEmpty() ? TextEventInputKeyboard : TextEventInputAutocompletion);
</span><span class="cx">     else
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Address post-review feedback after r238438
+        https://bugs.webkit.org/show_bug.cgi?id=191913
+
+        Reviewed by Ryosuke Niwa.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame setSelectedDOMRange:affinity:closeTyping:]):
+        (-[WebFrame _replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
+        * WebView/WebView.mm:
+        (-[WebView setSelectedDOMRange:affinity:]):
+
</ins><span class="cx"> 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: "Reload Web Inspector" button no longer partially works
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm        2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm   2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1482,7 +1482,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    frame->selection().setSelectedRange(core(range), (EAffinity)affinity, closeTyping);
</del><ins>+    frame->selection().setSelectedRange(core(range), (EAffinity)affinity, closeTyping ? FrameSelection::ShouldCloseTyping::Yes : FrameSelection::ShouldCloseTyping::No);
</ins><span class="cx">     if (!closeTyping)
</span><span class="cx">         frame->editor().ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping();
</span><span class="cx"> }
</span><span class="lines">@@ -1952,7 +1952,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (_private->coreFrame->selection().isNone() || !fragment)
</span><span class="cx">         return;
</span><del>-    _private->coreFrame->editor().replaceSelectionWithFragment(*core(fragment), selectReplacement, smartReplace, matchStyle);
</del><ins>+    _private->coreFrame->editor().replaceSelectionWithFragment(*core(fragment), selectReplacement ? Editor::SelectReplacement::Yes : Editor::SelectReplacement::No, smartReplace ? Editor::SmartReplace::Yes : Editor::SmartReplace::No, matchStyle ? Editor::MatchStyle::Yes : Editor::MatchStyle::No);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm    2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -8351,7 +8351,7 @@
</span><span class="cx">         if (!coreFrame)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        coreFrame->selection().setSelectedRange(core(range), core(selectionAffinity), true);
</del><ins>+        coreFrame->selection().setSelectedRange(core(range), core(selectionAffinity), WebCore::FrameSelection::ShouldCloseTyping::Yes);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinAccessibleTextImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/AccessibleTextImpl.cpp (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/AccessibleTextImpl.cpp     2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKitLegacy/win/AccessibleTextImpl.cpp        2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -656,7 +656,7 @@
</span><span class="cx"> 
</span><span class="cx">     addSelection(startOffset, endOffset);
</span><span class="cx"> 
</span><del>-    frame->editor().replaceSelectionWithText(*text, true, false);
</del><ins>+    frame->editor().replaceSelectionWithText(*text, Editor::SelectReplacement::Yes, Editor::SmartReplace::No);
</ins><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (238453 => 238454)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2018-11-23 01:33:40 UTC (rev 238453)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2018-11-23 03:10:34 UTC (rev 238454)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2018-11-22  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Address post-review feedback after r238438
+        https://bugs.webkit.org/show_bug.cgi?id=191913
+
+        Reviewed by Ryosuke Niwa.
+
+        * AccessibleTextImpl.cpp:
+        (AccessibleText::replaceText):
+
</ins><span class="cx"> 2018-11-19  Joseph Pecoraro  <pecoraro@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: "Reload Web Inspector" button no longer partially works
</span></span></pre>
</div>
</div>

</body>
</html>