<!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>[210109] 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/210109">210109</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2016-12-22 13:10:26 -0800 (Thu, 22 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make WebCore::EditorInsertAction an enum class
https://bugs.webkit.org/show_bug.cgi?id=166424

Reviewed by Brent Fulgham.

Source/WebCore:

* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/Editor.cpp:
(WebCore::Editor::pasteAsPlainTextWithPasteboard):
(WebCore::Editor::shouldInsertText):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::insertLineBreak):
(WebCore::Editor::insertParagraphSeparator):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::handleAcceptedCandidate):
* editing/EditorInsertAction.h:
(): Deleted.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::replaceSelectionWithAttributedString):
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::replaceNodeFromPasteboard):
(WebCore::Editor::replaceSelectionWithAttributedString):
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard):
* page/ContextMenuController.cpp:
(WebCore::insertUnicodeCharacter):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(kit):

Source/WebKit/win:

* WebCoreSupport/WebEditorClient.cpp:
(kit):
(WebEditorClient::shouldInsertNode):
(WebEditorClient::shouldInsertText):

Source/WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
(WebKit::toAPI):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(toWK):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingAlternativeTextControllercpp">trunk/Source/WebCore/editing/AlternativeTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorInsertActionh">trunk/Source/WebCore/editing/EditorInsertAction.h</a></li>
<li><a href="#trunkSourceWebCoreeditinggtkEditorGtkcpp">trunk/Source/WebCore/editing/gtk/EditorGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingiosEditorIOSmm">trunk/Source/WebCore/editing/ios/EditorIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmacEditorMacmm">trunk/Source/WebCore/editing/mac/EditorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingwinEditorWincpp">trunk/Source/WebCore/editing/win/EditorWin.cpp</a></li>
<li><a href="#trunkSourceWebCorepageContextMenuControllercpp">trunk/Source/WebCore/page/ContextMenuController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebEditorClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebEditorClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundleAPICasth">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/ChangeLog        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2016-12-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Make WebCore::EditorInsertAction an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=166424
+
+        Reviewed by Brent Fulgham.
+
+        * editing/AlternativeTextController.cpp:
+        (WebCore::AlternativeTextController::applyDictationAlternative):
+        * editing/Editor.cpp:
+        (WebCore::Editor::pasteAsPlainTextWithPasteboard):
+        (WebCore::Editor::shouldInsertText):
+        (WebCore::Editor::insertTextWithoutSendingTextEvent):
+        (WebCore::Editor::insertLineBreak):
+        (WebCore::Editor::insertParagraphSeparator):
+        (WebCore::Editor::markMisspellingsAfterTypingToWord):
+        (WebCore::Editor::markAndReplaceFor):
+        (WebCore::Editor::changeBackToReplacedString):
+        (WebCore::Editor::transpose):
+        (WebCore::Editor::handleAcceptedCandidate):
+        * editing/EditorInsertAction.h:
+        (): Deleted.
+        * editing/gtk/EditorGtk.cpp:
+        (WebCore::Editor::pasteWithPasteboard):
+        * editing/ios/EditorIOS.mm:
+        (WebCore::Editor::pasteWithPasteboard):
+        (WebCore::Editor::replaceSelectionWithAttributedString):
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::pasteWithPasteboard):
+        (WebCore::Editor::replaceNodeFromPasteboard):
+        (WebCore::Editor::replaceSelectionWithAttributedString):
+        * editing/win/EditorWin.cpp:
+        (WebCore::Editor::pasteWithPasteboard):
+        * page/ContextMenuController.cpp:
+        (WebCore::insertUnicodeCharacter):
+        (WebCore::ContextMenuController::contextMenuItemSelected):
+        * page/DragController.cpp:
+        (WebCore::DragController::concludeEditDrag):
+
</ins><span class="cx"> 2016-12-22  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Only include those parts of AVFoundation.framework which are strictly needed.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAlternativeTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AlternativeTextController.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AlternativeTextController.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/AlternativeTextController.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2008, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -729,7 +729,7 @@
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><span class="cx">     Editor&amp; editor = m_frame.editor();
</span><span class="cx">     RefPtr&lt;Range&gt; selection = editor.selectedRange();
</span><del>-    if (!selection || !editor.shouldInsertText(alternativeString, selection.get(), EditorInsertActionPasted))
</del><ins>+    if (!selection || !editor.shouldInsertText(alternativeString, selection.get(), EditorInsertAction::Pasted))
</ins><span class="cx">         return;
</span><span class="cx">     DocumentMarkerController&amp; markers = selection-&gt;startContainer().document().markers();
</span><span class="cx">     Vector&lt;RenderedDocumentMarker*&gt; dictationAlternativesMarkers = markers.markersInRange(selection.get(), DocumentMarker::DictationAlternatives);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/Editor.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx"> void Editor::pasteAsPlainTextWithPasteboard(Pasteboard&amp; pasteboard)
</span><span class="cx"> {
</span><span class="cx">     String text = readPlainTextFromPasteboard(pasteboard);
</span><del>-    if (client() &amp;&amp; client()-&gt;shouldInsertText(text, selectedRange().get(), EditorInsertActionPasted))
</del><ins>+    if (client() &amp;&amp; client()-&gt;shouldInsertText(text, selectedRange().get(), EditorInsertAction::Pasted))
</ins><span class="cx">         pasteAsPlainText(text, canSmartReplaceWithPasteboard(pasteboard));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -575,7 +575,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool Editor::shouldInsertText(const String&amp; text, Range* range, EditorInsertAction action) const
</span><span class="cx"> {
</span><del>-    if (m_frame.loader().shouldSuppressKeyboardInput() &amp;&amp; action == EditorInsertActionTyped)
</del><ins>+    if (m_frame.loader().shouldSuppressKeyboardInput() &amp;&amp; action == EditorInsertAction::Typed)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return client() &amp;&amp; client()-&gt;shouldInsertText(text, range, action);
</span><span class="lines">@@ -1091,7 +1091,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     RefPtr&lt;Range&gt; range = selection.toNormalizedRange();
</span><span class="cx"> 
</span><del>-    if (!shouldInsertText(text, range.get(), EditorInsertActionTyped))
</del><ins>+    if (!shouldInsertText(text, range.get(), EditorInsertAction::Typed))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     updateMarkersForWordsAffectedByEditing(isSpaceOrNewline(text[0]));
</span><span class="lines">@@ -1148,7 +1148,7 @@
</span><span class="cx">     if (!canEdit())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!shouldInsertText(&quot;\n&quot;, m_frame.selection().toNormalizedRange().get(), EditorInsertActionTyped))
</del><ins>+    if (!shouldInsertText(&quot;\n&quot;, m_frame.selection().toNormalizedRange().get(), EditorInsertAction::Typed))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     VisiblePosition caret = m_frame.selection().selection().visibleStart();
</span><span class="lines">@@ -1168,7 +1168,7 @@
</span><span class="cx">     if (!canEditRichly())
</span><span class="cx">         return insertLineBreak();
</span><span class="cx"> 
</span><del>-    if (!shouldInsertText(&quot;\n&quot;, m_frame.selection().toNormalizedRange().get(), EditorInsertActionTyped))
</del><ins>+    if (!shouldInsertText(&quot;\n&quot;, m_frame.selection().toNormalizedRange().get(), EditorInsertAction::Typed))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     VisiblePosition caret = m_frame.selection().selection().visibleStart();
</span><span class="lines">@@ -2263,7 +2263,7 @@
</span><span class="cx">             m_frame.selection().setSelection(newSelection);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (!m_frame.editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertActionTyped))
</del><ins>+        if (!m_frame.editor().shouldInsertText(autocorrectedString, misspellingRange.get(), EditorInsertAction::Typed))
</ins><span class="cx">             return;
</span><span class="cx">         m_frame.editor().replaceSelectionWithText(autocorrectedString, false, false, EditActionInsert);
</span><span class="cx"> 
</span><span class="lines">@@ -2560,7 +2560,7 @@
</span><span class="cx">                 restoreSelectionAfterChange = false;
</span><span class="cx">                 if (canEditRichly())
</span><span class="cx">                     applyCommand(CreateLinkCommand::create(document(), replacement));
</span><del>-            } else if (canEdit() &amp;&amp; shouldInsertText(replacement, rangeToReplace.get(), EditorInsertActionTyped)) {
</del><ins>+            } else if (canEdit() &amp;&amp; shouldInsertText(replacement, rangeToReplace.get(), EditorInsertAction::Typed)) {
</ins><span class="cx">                 correctSpellcheckingPreservingTextCheckingParagraph(paragraph, rangeToReplace, replacement, resultLocation, resultLength);
</span><span class="cx"> 
</span><span class="cx">                 if (AXObjectCache* cache = document().existingAXObjectCache()) {
</span><span class="lines">@@ -2610,7 +2610,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Range&gt; selection = selectedRange();
</span><del>-    if (!shouldInsertText(replacedString, selection.get(), EditorInsertActionPasted))
</del><ins>+    if (!shouldInsertText(replacedString, selection.get(), EditorInsertAction::Pasted))
</ins><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     m_alternativeTextController-&gt;recordAutocorrectionResponseReversed(replacedString, selection);
</span><span class="lines">@@ -2853,7 +2853,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Insert the transposed characters.
</span><del>-    if (!shouldInsertText(transposed, range.get(), EditorInsertActionTyped))
</del><ins>+    if (!shouldInsertText(transposed, range.get(), EditorInsertAction::Typed))
</ins><span class="cx">         return;
</span><span class="cx">     replaceSelectionWithText(transposed, false, false, EditActionInsert);
</span><span class="cx"> }
</span><span class="lines">@@ -3601,7 +3601,7 @@
</span><span class="cx">     m_isHandlingAcceptedCandidate = true;
</span><span class="cx"> 
</span><span class="cx">     if (auto range = rangeForTextCheckingResult(acceptedCandidate)) {
</span><del>-        if (shouldInsertText(acceptedCandidate.replacement, range.get(), EditorInsertActionTyped)) {
</del><ins>+        if (shouldInsertText(acceptedCandidate.replacement, range.get(), EditorInsertAction::Typed)) {
</ins><span class="cx">             Ref&lt;ReplaceRangeWithTextCommand&gt; replaceCommand = ReplaceRangeWithTextCommand::create(range.get(), acceptedCandidate.replacement);
</span><span class="cx">             applyCommand(replaceCommand.ptr());
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorInsertActionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorInsertAction.h (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorInsertAction.h        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/EditorInsertAction.h        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,11 +27,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// This must be kept in sync with WebViewInsertAction defined in WebEditingDelegate.h
-enum EditorInsertAction {
-    EditorInsertActionTyped,
-    EditorInsertActionPasted,
-    EditorInsertActionDropped
</del><ins>+enum class EditorInsertAction {
+    Typed,
+    Pasted,
+    Dropped,
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinggtkEditorGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/gtk/EditorGtk.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/gtk/EditorGtk.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/gtk/EditorGtk.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool chosePlainText;
</span><span class="cx">     RefPtr&lt;DocumentFragment&gt; fragment = createFragmentFromPasteboardData(*pasteboard, m_frame, *range, allowPlainText, chosePlainText);
</span><del>-    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertActionPasted))
</del><ins>+    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertAction::Pasted))
</ins><span class="cx">         pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingiosEditorIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ios/EditorIOS.mm (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/EditorIOS.mm        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -530,7 +530,7 @@
</span><span class="cx">         fragment = webContentFromPasteboard(*pasteboard, *range, allowPlainText, chosePlainTextIgnored);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertActionPasted))
</del><ins>+    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertAction::Pasted))
</ins><span class="cx">         pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), false, mailBlockquoteHandling);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -596,11 +596,11 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_frame.selection().selection().isContentRichlyEditable()) {
</span><span class="cx">         RefPtr&lt;DocumentFragment&gt; fragment = createFragmentAndAddResources(attributedString);
</span><del>-        if (fragment &amp;&amp; shouldInsertFragment(fragment, selectedRange(), EditorInsertActionPasted))
</del><ins>+        if (fragment &amp;&amp; shouldInsertFragment(fragment, selectedRange(), EditorInsertAction::Pasted))
</ins><span class="cx">             pasteAsFragment(fragment.releaseNonNull(), false, false, mailBlockquoteHandling);
</span><span class="cx">     } else {
</span><span class="cx">         String text = [attributedString string];
</span><del>-        if (shouldInsertText(text, selectedRange().get(), EditorInsertActionPasted))
</del><ins>+        if (shouldInsertText(text, selectedRange().get(), EditorInsertAction::Pasted))
</ins><span class="cx">             pasteAsPlainText(text, false);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacEditorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/EditorMac.mm        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     bool chosePlainText;
</span><span class="cx">     RefPtr&lt;DocumentFragment&gt; fragment = webContentFromPasteboard(*pasteboard, *range, allowPlainText, chosePlainText);
</span><span class="cx"> 
</span><del>-    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertActionPasted))
</del><ins>+    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertAction::Pasted))
</ins><span class="cx">         pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), false, mailBlockquoteHandling);
</span><span class="cx"> 
</span><span class="cx">     client()-&gt;setInsertionPasteboard(String());
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx">     bool chosePlainText;
</span><span class="cx">     if (RefPtr&lt;DocumentFragment&gt; fragment = webContentFromPasteboard(pasteboard, *range, true, chosePlainText)) {
</span><span class="cx">         maybeCopyNodeAttributesToFragment(*node, *fragment);
</span><del>-        if (shouldInsertFragment(fragment, range, EditorInsertActionPasted))
</del><ins>+        if (shouldInsertFragment(fragment, range, EditorInsertAction::Pasted))
</ins><span class="cx">             pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(pasteboard), false, MailBlockquoteHandling::IgnoreBlockquote);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -724,11 +724,11 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_frame.selection().selection().isContentRichlyEditable()) {
</span><span class="cx">         RefPtr&lt;DocumentFragment&gt; fragment = createFragmentAndAddResources(attributedString);
</span><del>-        if (fragment &amp;&amp; shouldInsertFragment(fragment, selectedRange(), EditorInsertActionPasted))
</del><ins>+        if (fragment &amp;&amp; shouldInsertFragment(fragment, selectedRange(), EditorInsertAction::Pasted))
</ins><span class="cx">             pasteAsFragment(fragment.releaseNonNull(), false, false, mailBlockquoteHandling);
</span><span class="cx">     } else {
</span><span class="cx">         String text = [attributedString string];
</span><del>-        if (shouldInsertText(text, selectedRange().get(), EditorInsertActionPasted))
</del><ins>+        if (shouldInsertText(text, selectedRange().get(), EditorInsertAction::Pasted))
</ins><span class="cx">             pasteAsPlainText(text, false);
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingwinEditorWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/win/EditorWin.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/win/EditorWin.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/editing/win/EditorWin.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool chosePlainText;
</span><span class="cx">     RefPtr&lt;DocumentFragment&gt; fragment = pasteboard-&gt;documentFragment(m_frame, *range, allowPlainText, chosePlainText);
</span><del>-    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertActionPasted))
</del><ins>+    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertAction::Pasted))
</ins><span class="cx">         pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageContextMenuControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ContextMenuController.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2007, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 Igalia S.L
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -202,7 +202,7 @@
</span><span class="cx"> static void insertUnicodeCharacter(UChar character, Frame* frame)
</span><span class="cx"> {
</span><span class="cx">     String text(&amp;character, 1);
</span><del>-    if (!frame-&gt;editor().shouldInsertText(text, frame-&gt;selection().toNormalizedRange().get(), EditorInsertActionTyped))
</del><ins>+    if (!frame-&gt;editor().shouldInsertText(text, frame-&gt;selection().toNormalizedRange().get(), EditorInsertAction::Typed))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(frame-&gt;document());
</span><span class="lines">@@ -356,7 +356,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     case ContextMenuItemTagSpellingGuess: {
</span><span class="cx">         VisibleSelection selection = frame-&gt;selection().selection();
</span><del>-        if (frame-&gt;editor().shouldInsertText(title, selection.toNormalizedRange().get(), EditorInsertActionPasted)) {
</del><ins>+        if (frame-&gt;editor().shouldInsertText(title, selection.toNormalizedRange().get(), EditorInsertAction::Pasted)) {
</ins><span class="cx">             ReplaceSelectionCommand::CommandOptions replaceOptions = ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting;
</span><span class="cx"> 
</span><span class="cx">             if (frame-&gt;editor().behavior().shouldAllowSpellingSuggestionsWithoutSelection()) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebCore/page/DragController.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2009-2010, 2013, 2015-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2007-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -514,7 +514,7 @@
</span><span class="cx">     if (dragIsMove(innerFrame-&gt;selection(), dragData) || dragCaret.isContentRichlyEditable()) {
</span><span class="cx">         bool chosePlainText = false;
</span><span class="cx">         RefPtr&lt;DocumentFragment&gt; fragment = documentFragmentFromDragData(dragData, *innerFrame, *range, true, chosePlainText);
</span><del>-        if (!fragment || !innerFrame-&gt;editor().shouldInsertFragment(fragment, range, EditorInsertActionDropped)) {
</del><ins>+        if (!fragment || !innerFrame-&gt;editor().shouldInsertFragment(fragment, range, EditorInsertAction::Dropped)) {
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -537,7 +537,7 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         String text = dragData.asPlainText();
</span><del>-        if (text.isEmpty() || !innerFrame-&gt;editor().shouldInsertText(text, range.get(), EditorInsertActionDropped)) {
</del><ins>+        if (text.isEmpty() || !innerFrame-&gt;editor().shouldInsertText(text, range.get(), EditorInsertAction::Dropped)) {
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-12-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Make WebCore::EditorInsertAction an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=166424
+
+        Reviewed by Brent Fulgham.
+
+        * WebCoreSupport/WebEditorClient.mm:
+        (kit):
+
</ins><span class="cx"> 2016-12-21  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Holding down on candidates in the TouchBar should show panel on screen
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebEditorClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -102,9 +102,16 @@
</span><span class="cx"> - (DOMDocumentFragment *)_documentFromRange:(NSRange)range document:(DOMDocument *)document documentAttributes:(NSDictionary *)attributes subresources:(NSArray **)subresources;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-static WebViewInsertAction kit(EditorInsertAction coreAction)
</del><ins>+static WebViewInsertAction kit(EditorInsertAction action)
</ins><span class="cx"> {
</span><del>-    return static_cast&lt;WebViewInsertAction&gt;(coreAction);
</del><ins>+    switch (action) {
+    case EditorInsertAction::Typed:
+        return WebViewInsertActionTyped;
+    case EditorInsertAction::Pasted:
+        return WebViewInsertActionPasted;
+    case EditorInsertAction::Dropped:
+        return WebViewInsertActionDropped;
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @interface WebUndoStep : NSObject
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit/win/ChangeLog        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-12-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Make WebCore::EditorInsertAction an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=166424
+
+        Reviewed by Brent Fulgham.
+
+        * WebCoreSupport/WebEditorClient.cpp:
+        (kit):
+        (WebEditorClient::shouldInsertNode):
+        (WebEditorClient::shouldInsertText):
+
</ins><span class="cx"> 2016-12-19  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ES6] Enable ES6 Modules
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebEditorClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -284,6 +284,21 @@
</span><span class="cx">     return shouldDelete;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static WebViewInsertAction kit(EditorInsertAction action)
+{
+    switch (action) {
+    case EditorInsertAction::Typed:
+        return WebViewInsertActionTyped;
+    case EditorInsertAction::Pasted:
+        return WebViewInsertActionPasted;
+    case EditorInsertAction::Dropped:
+        return WebViewInsertActionDropped;
+    }
+
+    ASSERT_NOT_REACHED();
+    return WebViewInsertActionTyped;
+}
+
</ins><span class="cx"> bool WebEditorClient::shouldInsertNode(Node* node, Range* insertingRange, EditorInsertAction givenAction)
</span><span class="cx"> { 
</span><span class="cx">     COMPtr&lt;IWebEditingDelegate&gt; editingDelegate;
</span><span class="lines">@@ -301,7 +316,7 @@
</span><span class="cx">     BOOL shouldInsert = FALSE;
</span><span class="cx">     COMPtr&lt;IWebEditingDelegate2&gt; editingDelegate2(Query, editingDelegate);
</span><span class="cx">     if (editingDelegate2) {
</span><del>-        if (FAILED(editingDelegate2-&gt;shouldInsertNode(m_webView, insertDOMNode.get(), insertingDOMRange.get(), static_cast&lt;WebViewInsertAction&gt;(givenAction), &amp;shouldInsert)))
</del><ins>+        if (FAILED(editingDelegate2-&gt;shouldInsertNode(m_webView, insertDOMNode.get(), insertingDOMRange.get(), kit(givenAction), &amp;shouldInsert)))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -320,7 +335,7 @@
</span><span class="cx"> 
</span><span class="cx">     BString text(str);
</span><span class="cx">     BOOL shouldInsert = FALSE;
</span><del>-    if (FAILED(editingDelegate-&gt;shouldInsertText(m_webView, text, insertingDOMRange.get(), static_cast&lt;WebViewInsertAction&gt;(givenAction), &amp;shouldInsert)))
</del><ins>+    if (FAILED(editingDelegate-&gt;shouldInsertText(m_webView, text, insertingDOMRange.get(), kit(givenAction), &amp;shouldInsert)))
</ins><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     return shouldInsert;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-12-22  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Make WebCore::EditorInsertAction an enum class
+        https://bugs.webkit.org/show_bug.cgi?id=166424
+
+        Reviewed by Brent Fulgham.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        (WebKit::toAPI):
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        (toWK):
+
</ins><span class="cx"> 2016-12-22  Zhuo Li  &lt;zachli@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] SPI for setloadsImagesAutomatically
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundleAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef WKBundleAPICast_h
-#define WKBundleAPICast_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;WKSharedAPICast.h&quot;
</span><span class="cx"> #include &quot;WKBundlePage.h&quot;
</span><span class="lines">@@ -74,11 +73,11 @@
</span><span class="cx"> inline WKInsertActionType toAPI(WebCore::EditorInsertAction action)
</span><span class="cx"> {
</span><span class="cx">     switch (action) {
</span><del>-    case WebCore::EditorInsertActionTyped:
</del><ins>+    case WebCore::EditorInsertAction::Typed:
</ins><span class="cx">         return kWKInsertActionTyped;
</span><del>-    case WebCore::EditorInsertActionPasted:
</del><ins>+    case WebCore::EditorInsertAction::Pasted:
</ins><span class="cx">         return kWKInsertActionPasted;
</span><del>-    case WebCore::EditorInsertActionDropped:
</del><ins>+    case WebCore::EditorInsertAction::Dropped:
</ins><span class="cx">         return kWKInsertActionDropped;
</span><span class="cx">     }
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="lines">@@ -98,5 +97,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><del>-
-#endif // WKBundleAPICast_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (210108 => 210109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2016-12-22 20:45:09 UTC (rev 210108)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2016-12-22 21:10:26 UTC (rev 210109)
</span><span class="lines">@@ -576,11 +576,11 @@
</span><span class="cx"> static inline WKEditorInsertAction toWK(EditorInsertAction action)
</span><span class="cx"> {
</span><span class="cx">     switch (action) {
</span><del>-    case EditorInsertActionTyped:
</del><ins>+    case EditorInsertAction::Typed:
</ins><span class="cx">         return WKEditorInsertActionTyped;
</span><del>-    case EditorInsertActionPasted:
</del><ins>+    case EditorInsertAction::Pasted:
</ins><span class="cx">         return WKEditorInsertActionPasted;
</span><del>-    case EditorInsertActionDropped:
</del><ins>+    case EditorInsertAction::Dropped:
</ins><span class="cx">         return WKEditorInsertActionDropped;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>