<!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>[204508] 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/204508">204508</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-08-16 09:56:07 -0700 (Tue, 16 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Cocoa] Remove dependency on Objective-C bindings in WebKit2 editing code
https://bugs.webkit.org/show_bug.cgi?id=160891
Reviewed by Anders Carlsson.
Source/WebCore:
* WebCore.xcodeproj/project.pbxproj: Removed EditorCocoa.h.
* editing/Editor.cpp: Removed member initialization for members now
initialized in the class definition.
* editing/Editor.h: Added FragmentAndResources struct, createFragment
member function, and _WebCreateFragment function. Also initialize all the
scalar data members here instead of in the constructor.
* editing/cocoa/EditorCocoa.h: Removed. This was unused.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::createFragment): Added. Calls through to WebKitLegacy
using soft linking for now, but later should be implemented here in WebCore.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::createFragmentAndAddResources): Call createFragment.
* editing/mac/EditorMac.mm:
(WebCore::Editor::createFragmentAndAddResources): Call createFragment.
* loader/EmptyClients.h: Removed documentFragmentFromAttributedString
implementation.
* page/EditorClient.h: Removed documentFragmentFromAttributedString.
Two reasons: The first is that this is now implemented in WebCore. While
there is a call through to WebKitLegacy, it's a temporary thing and done
with soft linking. The second reason is that this returned a raw pointer,
which is not safe in general. Was safe here because it was returning a
pointer owned by an autoreleased Objective-C object.
Source/WebKit/mac:
* WebCoreSupport/WebEditorClient.h: Removed documentFragmentFromAttributedString.
* WebCoreSupport/WebEditorClient.mm:
(attributesForAttributedStringConversion): Replaced the
createExcludedElementsForAttributedStringConversion function with this one.
No good reason to keep the array around instead of the dictionary.
(_WebCreateFragment): Renamed from documentFragmentFromAttributedString.
This is now a global function exported so it can be called by WebCore with
a different way of returning its value.
* WebKit.exp: Added _WebCreateFragment.
* WebView/WebHTMLView.mm:
(-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
Removed long-ago-obsolete workaround for Radar bug 5052369.
Source/WebKit2:
* WebProcess/WebCoreSupport/WebEditorClient.h: Removed documentFragmentFromAttributedString.
* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::documentFragmentFromAttributedString): Deleted.
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::createExcludedElementsForAttributedStringConversion): Deleted.
(WebKit::WebEditorClient::documentFragmentFromAttributedString): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCoreeditingcocoaEditorCocoamm">trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm</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="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCorepageEditorClienth">trunk/Source/WebCore/page/EditorClient.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebEditorClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebEditorClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebKitexp">trunk/Source/WebKit/mac/WebKit.exp</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebEditorClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportiosWebEditorClientIOSmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebEditorClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreeditingcocoaEditorCocoah">trunk/Source/WebCore/editing/cocoa/EditorCocoa.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/ChangeLog        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-08-16 Darin Adler <darin@apple.com>
+
+ [Cocoa] Remove dependency on Objective-C bindings in WebKit2 editing code
+ https://bugs.webkit.org/show_bug.cgi?id=160891
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.xcodeproj/project.pbxproj: Removed EditorCocoa.h.
+
+ * editing/Editor.cpp: Removed member initialization for members now
+ initialized in the class definition.
+
+ * editing/Editor.h: Added FragmentAndResources struct, createFragment
+ member function, and _WebCreateFragment function. Also initialize all the
+ scalar data members here instead of in the constructor.
+
+ * editing/cocoa/EditorCocoa.h: Removed. This was unused.
+
+ * editing/cocoa/EditorCocoa.mm:
+ (WebCore::Editor::createFragment): Added. Calls through to WebKitLegacy
+ using soft linking for now, but later should be implemented here in WebCore.
+
+ * editing/ios/EditorIOS.mm:
+ (WebCore::Editor::createFragmentAndAddResources): Call createFragment.
+
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::createFragmentAndAddResources): Call createFragment.
+
+ * loader/EmptyClients.h: Removed documentFragmentFromAttributedString
+ implementation.
+
+ * page/EditorClient.h: Removed documentFragmentFromAttributedString.
+ Two reasons: The first is that this is now implemented in WebCore. While
+ there is a call through to WebKitLegacy, it's a temporary thing and done
+ with soft linking. The second reason is that this returned a raw pointer,
+ which is not safe in general. Was safe here because it was returning a
+ pointer owned by an autoreleased Objective-C object.
+
</ins><span class="cx"> 2016-08-16 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Cleanup WK2 platform gamepad handling.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -11493,7 +11493,6 @@
</span><span class="cx">                 9B532EA11BA928570038A827 /* SlotAssignment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SlotAssignment.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 9B532EA21BA928570038A827 /* SlotAssignment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlotAssignment.h; sourceTree = "<group>"; };
</span><span class="cx">                 9B55EEE81B3E8898005342BC /* EditorCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorCocoa.mm; sourceTree = "<group>"; };
</span><del>-                9B55EEEA1B3F3FEF005342BC /* EditorCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EditorCocoa.h; sourceTree = "<group>"; };
</del><span class="cx">                 9B56C9A81C89312800C456DF /* LifecycleCallbackQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LifecycleCallbackQueue.h; sourceTree = "<group>"; };
</span><span class="cx">                 9B56C9A91C89329A00C456DF /* LifecycleCallbackQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LifecycleCallbackQueue.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 9B69D3B11B98FF0A00E3512B /* HTMLSlotElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLSlotElement.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -18348,7 +18347,6 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */,
</span><span class="cx">                                 C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */,
</span><del>-                                9B55EEEA1B3F3FEF005342BC /* EditorCocoa.h */,
</del><span class="cx">                                 9B55EEE81B3E8898005342BC /* EditorCocoa.mm */,
</span><span class="cx">                                 7C3E510818DF8F3500C112F7 /* HTMLConverter.h */,
</span><span class="cx">                                 7C3E510918DF8F3500C112F7 /* HTMLConverter.mm */,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/editing/Editor.cpp        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1108,18 +1108,10 @@
</span><span class="cx">
</span><span class="cx"> Editor::Editor(Frame& frame)
</span><span class="cx"> : m_frame(frame)
</span><del>- , m_ignoreCompositionSelectionChange(false)
- // This is off by default, since most editors want this behavior (this matches IE but not FF).
- , m_shouldStyleWithCSS(false)
</del><span class="cx"> , m_killRing(std::make_unique<KillRing>())
</span><span class="cx"> , m_spellChecker(std::make_unique<SpellChecker>(frame))
</span><span class="cx"> , m_alternativeTextController(std::make_unique<AlternativeTextController>(frame))
</span><del>- , m_areMarkedTextMatchesHighlighted(false)
- , m_defaultParagraphSeparator(EditorParagraphSeparatorIsDiv)
- , m_overwriteModeEnabled(false)
</del><span class="cx"> , m_editorUIUpdateTimer(*this, &Editor::editorUIUpdateTimerFired)
</span><del>- , m_editorUIUpdateTimerShouldCheckSpellingAndGrammar(false)
- , m_editorUIUpdateTimerWasTriggeredByDictation(false)
</del><span class="cx"> #if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS)
</span><span class="cx"> , m_telephoneNumberDetectionUpdateTimer(*this, &Editor::scanSelectionForTelephoneNumbers)
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/editing/Editor.h        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef Editor_h
-#define Editor_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "Color.h"
</span><span class="cx"> #include "DataTransferAccessPolicy.h"
</span><span class="lines">@@ -97,6 +96,13 @@
</span><span class="cx"> IgnoreBlockquote,
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+#if PLATFORM(COCOA)
+struct FragmentAndResources {
+ RefPtr<DocumentFragment> fragment;
+ Vector<RefPtr<ArchiveResource>> resources;
+};
+#endif
+
</ins><span class="cx"> class Editor {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -197,6 +203,7 @@
</span><span class="cx"> void reappliedEditing(PassRefPtr<EditCommandComposition>);
</span><span class="cx"> void unappliedSpellCorrection(const VisibleSelection& selectionOfCorrected, const String& corrected, const String& correction);
</span><span class="cx">
</span><ins>+ // This is off by default, since most editors want this behavior (originally matched IE but not Firefox).
</ins><span class="cx"> void setShouldStyleWithCSS(bool flag) { m_shouldStyleWithCSS = flag; }
</span><span class="cx"> bool shouldStyleWithCSS() const { return m_shouldStyleWithCSS; }
</span><span class="cx">
</span><span class="lines">@@ -265,7 +272,7 @@
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> WEBCORE_EXPORT void advanceToNextMisspelling(bool startBeforeSelection = false);
</span><del>-#endif // !PLATFORM(IOS)
</del><ins>+#endif
</ins><span class="cx"> void showSpellingGuessPanel();
</span><span class="cx"> bool spellingPanelIsShowing();
</span><span class="cx">
</span><span class="lines">@@ -498,6 +505,7 @@
</span><span class="cx"> RefPtr<Range> adjustedSelectionRange();
</span><span class="cx"> RefPtr<DocumentFragment> createFragmentForImageResourceAndAddResource(RefPtr<ArchiveResource>&&);
</span><span class="cx"> RefPtr<DocumentFragment> createFragmentAndAddResources(NSAttributedString *);
</span><ins>+ FragmentAndResources createFragment(NSAttributedString *);
</ins><span class="cx"> void fillInUserVisibleForm(PasteboardURL&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -509,21 +517,21 @@
</span><span class="cx"> unsigned m_compositionStart;
</span><span class="cx"> unsigned m_compositionEnd;
</span><span class="cx"> Vector<CompositionUnderline> m_customCompositionUnderlines;
</span><del>- bool m_ignoreCompositionSelectionChange;
- bool m_shouldStartNewKillRingSequence {false};
- bool m_shouldStyleWithCSS;
</del><ins>+ bool m_ignoreCompositionSelectionChange { false };
+ bool m_shouldStartNewKillRingSequence { false };
+ bool m_shouldStyleWithCSS { false };
</ins><span class="cx"> const std::unique_ptr<KillRing> m_killRing;
</span><span class="cx"> const std::unique_ptr<SpellChecker> m_spellChecker;
</span><span class="cx"> const std::unique_ptr<AlternativeTextController> m_alternativeTextController;
</span><span class="cx"> VisibleSelection m_mark;
</span><del>- bool m_areMarkedTextMatchesHighlighted;
- EditorParagraphSeparator m_defaultParagraphSeparator;
- bool m_overwriteModeEnabled;
</del><ins>+ bool m_areMarkedTextMatchesHighlighted { false };
+ EditorParagraphSeparator m_defaultParagraphSeparator { EditorParagraphSeparatorIsDiv };
+ bool m_overwriteModeEnabled { false };
</ins><span class="cx">
</span><span class="cx"> VisibleSelection m_oldSelectionForEditorUIUpdate;
</span><span class="cx"> Timer m_editorUIUpdateTimer;
</span><del>- bool m_editorUIUpdateTimerShouldCheckSpellingAndGrammar;
- bool m_editorUIUpdateTimerWasTriggeredByDictation;
</del><ins>+ bool m_editorUIUpdateTimerShouldCheckSpellingAndGrammar { false };
+ bool m_editorUIUpdateTimerWasTriggeredByDictation { false };
</ins><span class="cx"> bool m_isHandlingAcceptedCandidate { false };
</span><span class="cx">
</span><span class="cx"> #if ENABLE(TELEPHONE_NUMBER_DETECTION) && !PLATFORM(IOS)
</span><span class="lines">@@ -557,4 +565,8 @@
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><del>-#endif // Editor_h
</del><ins>+#if PLATFORM(COCOA)
+// This function is declared here but defined in the WebKitLegacy framework.
+// FIXME: Get rid of this and change this so it doesn't use WebKitLegacy.
+extern "C" void _WebCreateFragment(WebCore::Document&, NSAttributedString *, WebCore::FragmentAndResources&);
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaEditorCocoah"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/editing/cocoa/EditorCocoa.h (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/EditorCocoa.h        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/editing/cocoa/EditorCocoa.h        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008, 2013, 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef EditorCocoa_h
-#define EditorCocoa_h
-
-#include "Editor.h"
-
-#if PLATFORM(IOS)
-
-typedef NS_ENUM(NSInteger, NSUnderlineStyle) {
- NSUnderlineStyleNone = 0x00,
- NSUnderlineStyleSingle = 0x01,
- NSUnderlineStyleThick NS_ENUM_AVAILABLE_IOS(7_0) = 0x02,
- NSUnderlineStyleDouble NS_ENUM_AVAILABLE_IOS(7_0) = 0x09,
-
- NSUnderlinePatternSolid NS_ENUM_AVAILABLE_IOS(7_0) = 0x0000,
- NSUnderlinePatternDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0100,
- NSUnderlinePatternDash NS_ENUM_AVAILABLE_IOS(7_0) = 0x0200,
- NSUnderlinePatternDashDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0300,
- NSUnderlinePatternDashDotDot NS_ENUM_AVAILABLE_IOS(7_0) = 0x0400,
-
- NSUnderlineByWord NS_ENUM_AVAILABLE_IOS(7_0) = 0x8000
-};
-
-#endif
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreeditingcocoaEditorCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2013, 2015 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">@@ -26,8 +26,10 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "Editor.h"
</span><span class="cx">
</span><ins>+#import "ArchiveResource.h"
</ins><span class="cx"> #import "CSSValueList.h"
</span><span class="cx"> #import "CSSValuePool.h"
</span><ins>+#import "DocumentFragment.h"
</ins><span class="cx"> #import "EditingStyle.h"
</span><span class="cx"> #import "Frame.h"
</span><span class="cx"> #import "FrameSelection.h"
</span><span class="lines">@@ -38,10 +40,14 @@
</span><span class="cx"> #import "Text.h"
</span><span class="cx"> #import "htmlediting.h"
</span><span class="cx">
</span><ins>+SOFT_LINK_FRAMEWORK(WebKitLegacy)
+
+SOFT_LINK(WebKitLegacy, _WebCreateFragment, void, (WebCore::Document& document, NSAttributedString *string, WebCore::FragmentAndResources& result), (document, string, result))
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> // FIXME: This figures out the current style by inserting a <span>!
</span><del>-const RenderStyle* Editor::styleForSelectionStart(Frame* frame, Node *&nodeToRemove)
</del><ins>+const RenderStyle* Editor::styleForSelectionStart(Frame* frame, Node*& nodeToRemove)
</ins><span class="cx"> {
</span><span class="cx"> nodeToRemove = nullptr;
</span><span class="cx">
</span><span class="lines">@@ -97,4 +103,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+FragmentAndResources Editor::createFragment(NSAttributedString *string)
+{
+ // FIXME: The algorithm to convert an attributed string into HTML should be implemented here in WebCore.
+ // For now, though, we call into WebKitLegacy, which in turn calls into AppKit/TextKit.
+ FragmentAndResources result;
+ _WebCreateFragment(*m_frame.document(), string, result);
+ return result;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingiosEditorIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ios/EditorIOS.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/EditorIOS.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/editing/ios/EditorIOS.mm        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -566,11 +566,10 @@
</span><span class="cx"> if (wasImagesEnabled)
</span><span class="cx"> cachedResourceLoader.setImagesEnabled(false);
</span><span class="cx">
</span><del>- Vector<RefPtr<ArchiveResource>> resources;
- RefPtr<DocumentFragment> fragment = client()->documentFragmentFromAttributedString(string, resources);
</del><ins>+ auto fragmentAndResources = createFragment(string);
</ins><span class="cx">
</span><span class="cx"> if (DocumentLoader* loader = m_frame.loader().documentLoader()) {
</span><del>- for (auto& resource : resources) {
</del><ins>+ for (auto& resource : fragmentAndResources.resources) {
</ins><span class="cx"> if (resource)
</span><span class="cx"> loader->addArchiveResource(resource.releaseNonNull());
</span><span class="cx"> }
</span><span class="lines">@@ -581,7 +580,7 @@
</span><span class="cx"> if (!wasDeferringCallbacks)
</span><span class="cx"> m_frame.page()->setDefersLoading(false);
</span><span class="cx">
</span><del>- return fragment;
</del><ins>+ return WTFMove(fragmentAndResources.fragment);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<DocumentFragment> Editor::createFragmentForImageResourceAndAddResource(RefPtr<ArchiveResource>&& resource)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacEditorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/EditorMac.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -659,11 +659,10 @@
</span><span class="cx"> if (!wasDeferringCallbacks)
</span><span class="cx"> m_frame.page()->setDefersLoading(true);
</span><span class="cx">
</span><del>- Vector<RefPtr<ArchiveResource>> resources;
- RefPtr<DocumentFragment> fragment = client()->documentFragmentFromAttributedString(string, resources);
</del><ins>+ auto fragmentAndResources = createFragment(string);
</ins><span class="cx">
</span><span class="cx"> if (DocumentLoader* loader = m_frame.loader().documentLoader()) {
</span><del>- for (auto& resource : resources) {
</del><ins>+ for (auto& resource : fragmentAndResources.resources) {
</ins><span class="cx"> if (resource)
</span><span class="cx"> loader->addArchiveResource(resource.releaseNonNull());
</span><span class="cx"> }
</span><span class="lines">@@ -672,7 +671,7 @@
</span><span class="cx"> if (!wasDeferringCallbacks)
</span><span class="cx"> m_frame.page()->setDefersLoading(false);
</span><span class="cx">
</span><del>- return fragment;
</del><ins>+ return WTFMove(fragmentAndResources.fragment);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Editor::replaceSelectionWithAttributedString(NSAttributedString *attributedString, MailBlockquoteHandling mailBlockquoteHandling)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -510,11 +510,10 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- NSString* userVisibleString(NSURL*) override { return nullptr; }
- DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector<RefPtr<ArchiveResource>>&) override { return nullptr; };
</del><ins>+ NSString* userVisibleString(NSURL *) override { return nullptr; }
</ins><span class="cx"> void setInsertionPasteboard(const String&) override { };
</span><del>- NSURL *canonicalizeURL(NSURL*) override { return nullptr; }
- NSURL *canonicalizeURLString(NSString*) override { return nullptr; }
</del><ins>+ NSURL *canonicalizeURL(NSURL *) override { return nullptr; }
+ NSURL *canonicalizeURLString(NSString *) override { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span></span></pre></div>
<a id="trunkSourceWebCorepageEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EditorClient.h (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EditorClient.h        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebCore/page/EditorClient.h        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007 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">@@ -24,11 +24,9 @@
</span><span class="cx"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef EditorClient_h
-#define EditorClient_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include "EditorInsertAction.h"
</span><del>-#include "FloatRect.h"
</del><span class="cx"> #include "TextAffinity.h"
</span><span class="cx"> #include "TextChecking.h"
</span><span class="cx"> #include "UndoStep.h"
</span><span class="lines">@@ -36,7 +34,6 @@
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-OBJC_CLASS NSAttributedString;
</del><span class="cx"> OBJC_CLASS NSString;
</span><span class="cx"> OBJC_CLASS NSURL;
</span><span class="cx"> #endif
</span><span class="lines">@@ -143,7 +140,6 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> virtual NSString* userVisibleString(NSURL*) = 0;
</span><del>- virtual DocumentFragment* documentFragmentFromAttributedString(NSAttributedString*, Vector< RefPtr<ArchiveResource>>&) = 0;
</del><span class="cx"> virtual void setInsertionPasteboard(const String& pasteboardName) = 0;
</span><span class="cx"> virtual NSURL* canonicalizeURL(NSURL*) = 0;
</span><span class="cx"> virtual NSURL* canonicalizeURLString(NSString*) = 0;
</span><span class="lines">@@ -190,5 +186,3 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><del>-
-#endif // EditorClient_h
</del></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-08-16 Darin Adler <darin@apple.com>
+
+ [Cocoa] Remove dependency on Objective-C bindings in WebKit2 editing code
+ https://bugs.webkit.org/show_bug.cgi?id=160891
+
+ Reviewed by Anders Carlsson.
+
+ * WebCoreSupport/WebEditorClient.h: Removed documentFragmentFromAttributedString.
+
+ * WebCoreSupport/WebEditorClient.mm:
+ (attributesForAttributedStringConversion): Replaced the
+ createExcludedElementsForAttributedStringConversion function with this one.
+ No good reason to keep the array around instead of the dictionary.
+ (_WebCreateFragment): Renamed from documentFragmentFromAttributedString.
+ This is now a global function exported so it can be called by WebCore with
+ a different way of returning its value.
+
+ * WebKit.exp: Added _WebCreateFragment.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources:]):
+ Removed long-ago-obsolete workaround for Radar bug 5052369.
+
</ins><span class="cx"> 2016-08-15 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Another build fix.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2014 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">@@ -43,7 +43,7 @@
</span><span class="cx"> @class WebView;
</span><span class="cx"> @class WebEditorUndoTarget;
</span><span class="cx">
</span><del>-class WebEditorClient : public WebCore::EditorClient, public WebCore::TextCheckerClient {
</del><ins>+class WebEditorClient final : public WebCore::EditorClient, public WebCore::TextCheckerClient {
</ins><span class="cx"> public:
</span><span class="cx"> WebEditorClient(WebView *);
</span><span class="cx"> virtual ~WebEditorClient();
</span><span class="lines">@@ -51,126 +51,125 @@
</span><span class="cx"> void didCheckSucceed(int sequence, NSArray *results);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- bool isGrammarCheckingEnabled() override;
- void toggleGrammarChecking() override;
- bool isContinuousSpellCheckingEnabled() override;
- void toggleContinuousSpellChecking() override;
- int spellCheckerDocumentTag() override;
</del><ins>+ bool isGrammarCheckingEnabled() final;
+ void toggleGrammarChecking() final;
+ bool isContinuousSpellCheckingEnabled() final;
+ void toggleContinuousSpellChecking() final;
+ int spellCheckerDocumentTag() final;
</ins><span class="cx">
</span><del>- bool smartInsertDeleteEnabled() override;
- bool isSelectTrailingWhitespaceEnabled() override;
</del><ins>+ bool smartInsertDeleteEnabled() final;
+ bool isSelectTrailingWhitespaceEnabled() final;
</ins><span class="cx">
</span><del>- bool shouldDeleteRange(WebCore::Range*) override;
</del><ins>+ bool shouldDeleteRange(WebCore::Range*) final;
</ins><span class="cx">
</span><del>- bool shouldBeginEditing(WebCore::Range*) override;
- bool shouldEndEditing(WebCore::Range*) override;
- bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction) override;
- bool shouldInsertText(const String&, WebCore::Range*, WebCore::EditorInsertAction) override;
- bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) override;
</del><ins>+ bool shouldBeginEditing(WebCore::Range*) final;
+ bool shouldEndEditing(WebCore::Range*) final;
+ bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction) final;
+ bool shouldInsertText(const String&, WebCore::Range*, WebCore::EditorInsertAction) final;
+ bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) final;
</ins><span class="cx">
</span><del>- bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*) override;
- void didApplyStyle() override;
</del><ins>+ bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*) final;
+ void didApplyStyle() final;
</ins><span class="cx">
</span><del>- bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range* rangeToBeReplaced) override;
</del><ins>+ bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range* rangeToBeReplaced) final;
</ins><span class="cx">
</span><del>- void didBeginEditing() override;
- void didEndEditing() override;
- void willWriteSelectionToPasteboard(WebCore::Range*) override;
- void didWriteSelectionToPasteboard() override;
- void getClientPasteboardDataForRange(WebCore::Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) override;
</del><ins>+ void didBeginEditing() final;
+ void didEndEditing() final;
+ void willWriteSelectionToPasteboard(WebCore::Range*) final;
+ void didWriteSelectionToPasteboard() final;
+ void getClientPasteboardDataForRange(WebCore::Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) final;
</ins><span class="cx">
</span><del>- NSString *userVisibleString(NSURL *) override;
- WebCore::DocumentFragment* documentFragmentFromAttributedString(NSAttributedString *, Vector< RefPtr<WebCore::ArchiveResource>>&) override;
- void setInsertionPasteboard(const String&) override;
- NSURL *canonicalizeURL(NSURL *) override;
- NSURL *canonicalizeURLString(NSString *) override;
</del><ins>+ NSString *userVisibleString(NSURL *) final;
+ void setInsertionPasteboard(const String&) final;
+ NSURL *canonicalizeURL(NSURL *) final;
+ NSURL *canonicalizeURLString(NSString *) final;
</ins><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><del>- void uppercaseWord() override;
- void lowercaseWord() override;
- void capitalizeWord() override;
</del><ins>+ void uppercaseWord() final;
+ void lowercaseWord() final;
+ void capitalizeWord() final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><del>- void showSubstitutionsPanel(bool show) override;
- bool substitutionsPanelIsShowing() override;
- void toggleSmartInsertDelete() override;
- bool isAutomaticQuoteSubstitutionEnabled() override;
- void toggleAutomaticQuoteSubstitution() override;
- bool isAutomaticLinkDetectionEnabled() override;
- void toggleAutomaticLinkDetection() override;
- bool isAutomaticDashSubstitutionEnabled() override;
- void toggleAutomaticDashSubstitution() override;
- bool isAutomaticTextReplacementEnabled() override;
- void toggleAutomaticTextReplacement() override;
- bool isAutomaticSpellingCorrectionEnabled() override;
- void toggleAutomaticSpellingCorrection() override;
</del><ins>+ void showSubstitutionsPanel(bool show) final;
+ bool substitutionsPanelIsShowing() final;
+ void toggleSmartInsertDelete() final;
+ bool isAutomaticQuoteSubstitutionEnabled() final;
+ void toggleAutomaticQuoteSubstitution() final;
+ bool isAutomaticLinkDetectionEnabled() final;
+ void toggleAutomaticLinkDetection() final;
+ bool isAutomaticDashSubstitutionEnabled() final;
+ void toggleAutomaticDashSubstitution() final;
+ bool isAutomaticTextReplacementEnabled() final;
+ void toggleAutomaticTextReplacement() final;
+ bool isAutomaticSpellingCorrectionEnabled() final;
+ void toggleAutomaticSpellingCorrection() final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- TextCheckerClient* textChecker() override { return this; }
</del><ins>+ TextCheckerClient* textChecker() final { return this; }
</ins><span class="cx">
</span><del>- void respondToChangedContents() override;
- void respondToChangedSelection(WebCore::Frame*) override;
- void didChangeSelectionAndUpdateLayout() override { }
- void discardedComposition(WebCore::Frame*) override;
</del><ins>+ void respondToChangedContents() final;
+ void respondToChangedSelection(WebCore::Frame*) final;
+ void didChangeSelectionAndUpdateLayout() final { }
+ void discardedComposition(WebCore::Frame*) final;
</ins><span class="cx">
</span><del>- void registerUndoStep(PassRefPtr<WebCore::UndoStep>) override;
- void registerRedoStep(PassRefPtr<WebCore::UndoStep>) override;
- void clearUndoRedoOperations() override;
</del><ins>+ void registerUndoStep(PassRefPtr<WebCore::UndoStep>) final;
+ void registerRedoStep(PassRefPtr<WebCore::UndoStep>) final;
+ void clearUndoRedoOperations() final;
</ins><span class="cx">
</span><del>- bool canCopyCut(WebCore::Frame*, bool defaultValue) const override;
- bool canPaste(WebCore::Frame*, bool defaultValue) const override;
- bool canUndo() const override;
- bool canRedo() const override;
</del><ins>+ bool canCopyCut(WebCore::Frame*, bool defaultValue) const final;
+ bool canPaste(WebCore::Frame*, bool defaultValue) const final;
+ bool canUndo() const final;
+ bool canRedo() const final;
</ins><span class="cx">
</span><del>- void undo() override;
- void redo() override;
</del><ins>+ void undo() final;
+ void redo() final;
</ins><span class="cx">
</span><del>- void handleKeyboardEvent(WebCore::KeyboardEvent*) override;
- void handleInputMethodKeydown(WebCore::KeyboardEvent*) override;
</del><ins>+ void handleKeyboardEvent(WebCore::KeyboardEvent*) final;
+ void handleInputMethodKeydown(WebCore::KeyboardEvent*) final;
</ins><span class="cx">
</span><del>- void textFieldDidBeginEditing(WebCore::Element*) override;
- void textFieldDidEndEditing(WebCore::Element*) override;
- void textDidChangeInTextField(WebCore::Element*) override;
- bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*) override;
- void textWillBeDeletedInTextField(WebCore::Element*) override;
- void textDidChangeInTextArea(WebCore::Element*) override;
- void overflowScrollPositionChanged() override { };
</del><ins>+ void textFieldDidBeginEditing(WebCore::Element*) final;
+ void textFieldDidEndEditing(WebCore::Element*) final;
+ void textDidChangeInTextField(WebCore::Element*) final;
+ bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*) final;
+ void textWillBeDeletedInTextField(WebCore::Element*) final;
+ void textDidChangeInTextArea(WebCore::Element*) final;
+ void overflowScrollPositionChanged() final { };
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>- void startDelayingAndCoalescingContentChangeNotifications() override;
- void stopDelayingAndCoalescingContentChangeNotifications() override;
- void writeDataToPasteboard(NSDictionary*) override;
- NSArray* supportedPasteboardTypesForCurrentSelection() override;
- NSArray* readDataFromPasteboard(NSString* type, int index) override;
- bool hasRichlyEditableSelection() override;
- int getPasteboardItemsCount() override;
- WebCore::DocumentFragment* documentFragmentFromDelegate(int index) override;
- bool performsTwoStepPaste(WebCore::DocumentFragment*) override;
- int pasteboardChangeCount() override;
</del><ins>+ void startDelayingAndCoalescingContentChangeNotifications() final;
+ void stopDelayingAndCoalescingContentChangeNotifications() final;
+ void writeDataToPasteboard(NSDictionary*) final;
+ NSArray* supportedPasteboardTypesForCurrentSelection() final;
+ NSArray* readDataFromPasteboard(NSString* type, int index) final;
+ bool hasRichlyEditableSelection() final;
+ int getPasteboardItemsCount() final;
+ WebCore::DocumentFragment* documentFragmentFromDelegate(int index) final;
+ bool performsTwoStepPaste(WebCore::DocumentFragment*) final;
+ int pasteboardChangeCount() final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- bool shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType) const override;
- void ignoreWordInSpellDocument(const String&) override;
- void learnWord(const String&) override;
- void checkSpellingOfString(StringView, int* misspellingLocation, int* misspellingLength) override;
- String getAutoCorrectSuggestionForMisspelledWord(const String&) override;
- void checkGrammarOfString(StringView, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) override;
- Vector<WebCore::TextCheckingResult> checkTextOfParagraph(StringView, WebCore::TextCheckingTypeMask checkingTypes, const WebCore::VisibleSelection& currentSelection) override;
- void updateSpellingUIWithGrammarString(const String&, const WebCore::GrammarDetail&) override;
- void updateSpellingUIWithMisspelledWord(const String&) override;
- void showSpellingUI(bool show) override;
- bool spellingUIIsShowing() override;
- void getGuessesForWord(const String& word, const String& context, const WebCore::VisibleSelection& currentSelection, Vector<String>& guesses) override;
</del><ins>+ bool shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType) const final;
+ void ignoreWordInSpellDocument(const String&) final;
+ void learnWord(const String&) final;
+ void checkSpellingOfString(StringView, int* misspellingLocation, int* misspellingLength) final;
+ String getAutoCorrectSuggestionForMisspelledWord(const String&) final;
+ void checkGrammarOfString(StringView, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) final;
+ Vector<WebCore::TextCheckingResult> checkTextOfParagraph(StringView, WebCore::TextCheckingTypeMask checkingTypes, const WebCore::VisibleSelection& currentSelection) final;
+ void updateSpellingUIWithGrammarString(const String&, const WebCore::GrammarDetail&) final;
+ void updateSpellingUIWithMisspelledWord(const String&) final;
+ void showSpellingUI(bool show) final;
+ bool spellingUIIsShowing() final;
+ void getGuessesForWord(const String& word, const String& context, const WebCore::VisibleSelection& currentSelection, Vector<String>& guesses) final;
</ins><span class="cx">
</span><del>- void willSetInputMethodState() override;
- void setInputMethodState(bool enabled) override;
- void requestCheckingOfString(PassRefPtr<WebCore::TextCheckingRequest>, const WebCore::VisibleSelection& currentSelection) override;
</del><ins>+ void willSetInputMethodState() final;
+ void setInputMethodState(bool enabled) final;
+ void requestCheckingOfString(PassRefPtr<WebCore::TextCheckingRequest>, const WebCore::VisibleSelection& currentSelection) final;
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</span><del>- void requestCandidatesForSelection(const WebCore::VisibleSelection&) override;
</del><ins>+ void requestCandidatesForSelection(const WebCore::VisibleSelection&) final;
</ins><span class="cx"> void handleRequestedCandidates(NSInteger, NSArray<NSTextCheckingResult *> *);
</span><del>- void handleAcceptedCandidateWithSoftSpaces(WebCore::TextCheckingResult) override;
</del><ins>+ void handleAcceptedCandidateWithSoftSpaces(WebCore::TextCheckingResult) final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void registerUndoOrRedoStep(PassRefPtr<WebCore::UndoStep>, bool isRedo);
</span><span class="lines">@@ -177,14 +176,16 @@
</span><span class="cx">
</span><span class="cx"> WebView *m_webView;
</span><span class="cx"> RetainPtr<WebEditorUndoTarget> m_undoTarget;
</span><del>- bool m_haveUndoRedoOperations;
</del><ins>+ bool m_haveUndoRedoOperations { false };
</ins><span class="cx"> RefPtr<WebCore::TextCheckingRequest> m_textCheckingRequest;
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>- bool m_delayingContentChangeNotifications;
- bool m_hasDelayedContentChangeNotification;
</del><ins>+ bool m_delayingContentChangeNotifications { false };
+ bool m_hasDelayedContentChangeNotification { false };
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> WebCore::VisibleSelection m_lastSelectionForRequestedCandidates;
</span><ins>+
</ins><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</span><span class="cx"> RetainPtr<NSString> m_paragraphContextForCandidateRequest;
</span><span class="cx"> NSRange m_rangeForCandidates;
</span><span class="lines">@@ -194,7 +195,6 @@
</span><span class="cx"> WeakPtrFactory<WebEditorClient> m_weakPtrFactory;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-#if PLATFORM(COCOA)
</del><span class="cx"> inline NSSelectionAffinity kit(WebCore::EAffinity affinity)
</span><span class="cx"> {
</span><span class="cx"> switch (affinity) {
</span><span class="lines">@@ -218,7 +218,6 @@
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return WebCore::EAffinity::UPSTREAM;
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebEditorClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm        2016-08-16 16:56:07 UTC (rev 204508)
</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"> * 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">@@ -31,6 +31,7 @@
</span><span class="cx">
</span><span class="cx"> #import "DOMCSSStyleDeclarationInternal.h"
</span><span class="cx"> #import "DOMDocumentFragmentInternal.h"
</span><ins>+#import "DOMDocumentInternal.h"
</ins><span class="cx"> #import "DOMHTMLElementInternal.h"
</span><span class="cx"> #import "DOMHTMLInputElementInternal.h"
</span><span class="cx"> #import "DOMHTMLTextAreaElementInternal.h"
</span><span class="lines">@@ -98,8 +99,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> @interface NSAttributedString (WebNSAttributedStringDetails)
</span><del>-- (id)_initWithDOMRange:(DOMRange*)range;
-- (DOMDocumentFragment*)_documentFromRange:(NSRange)range document:(DOMDocument*)document documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources;
</del><ins>+- (DOMDocumentFragment *)_documentFromRange:(NSRange)range document:(DOMDocument *)document documentAttributes:(NSDictionary *)attributes subresources:(NSArray **)subresources;
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> static WebViewInsertAction kit(EditorInsertAction coreAction)
</span><span class="lines">@@ -159,8 +159,6 @@
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @interface WebEditorUndoTarget : NSObject
</span><del>-{
-}
</del><span class="cx">
</span><span class="cx"> - (void)undoEditing:(id)arg;
</span><span class="cx"> - (void)redoEditing:(id)arg;
</span><span class="lines">@@ -186,11 +184,6 @@
</span><span class="cx"> WebEditorClient::WebEditorClient(WebView *webView)
</span><span class="cx"> : m_webView(webView)
</span><span class="cx"> , m_undoTarget(adoptNS([[WebEditorUndoTarget alloc] init]))
</span><del>- , m_haveUndoRedoOperations(false)
-#if PLATFORM(IOS)
- , m_delayingContentChangeNotifications(0)
- , m_hasDelayedContentChangeNotification(0)
-#endif
</del><span class="cx"> , m_weakPtrFactory(this)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -205,6 +198,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> void WebEditorClient::toggleContinuousSpellChecking()
</span><span class="cx"> {
</span><span class="cx"> [m_webView toggleContinuousSpellChecking:nil];
</span><span class="lines">@@ -224,6 +218,7 @@
</span><span class="cx"> {
</span><span class="cx"> return [m_webView spellCheckerDocumentTag];
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool WebEditorClient::shouldDeleteRange(Range* range)
</span><span class="lines">@@ -312,6 +307,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> void WebEditorClient::startDelayingAndCoalescingContentChangeNotifications()
</span><span class="cx"> {
</span><span class="cx"> m_delayingContentChangeNotifications = true;
</span><span class="lines">@@ -326,6 +322,7 @@
</span><span class="cx">
</span><span class="cx"> m_hasDelayedContentChangeNotification = false;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void WebEditorClient::respondToChangedContents()
</span><span class="lines">@@ -418,13 +415,13 @@
</span><span class="cx"> return URL;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static NSArray *createExcludedElementsForAttributedStringConversion()
</del><ins>+static NSDictionary *attributesForAttributedStringConversion()
</ins><span class="cx"> {
</span><del>- NSArray *elements = [[NSArray alloc] initWithObjects:
</del><ins>+ NSArray *excludedElements = [[NSArray alloc] initWithObjects:
</ins><span class="cx"> // Omit style since we want style to be inline so the fragment can be easily inserted.
</span><del>- @"style",
</del><ins>+ @"style",
</ins><span class="cx"> // Omit xml so the result is not XHTML.
</span><del>- @"xml",
</del><ins>+ @"xml",
</ins><span class="cx"> // Omit tags that will get stripped when converted to a fragment anyway.
</span><span class="cx"> @"doctype", @"html", @"head", @"body",
</span><span class="cx"> // Omit deprecated tags.
</span><span class="lines">@@ -431,31 +428,29 @@
</span><span class="cx"> @"applet", @"basefont", @"center", @"dir", @"font", @"isindex", @"menu", @"s", @"strike", @"u",
</span><span class="cx"> // Omit object so no file attachments are part of the fragment.
</span><span class="cx"> @"object", nil];
</span><del>- CFRetain(elements);
- return elements;
-}
</del><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-static NSString *NSExcludedElementsDocumentAttribute = @"ExcludedElements";
</del><ins>+ static NSString * const NSExcludedElementsDocumentAttribute = @"ExcludedElements";
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>-DocumentFragment* WebEditorClient::documentFragmentFromAttributedString(NSAttributedString *string, Vector<RefPtr<ArchiveResource>>& resources)
-{
- static NSArray *excludedElements = createExcludedElementsForAttributedStringConversion();
-
</del><span class="cx"> NSDictionary *dictionary = [NSDictionary dictionaryWithObject:excludedElements forKey:NSExcludedElementsDocumentAttribute];
</span><span class="cx">
</span><del>- NSArray *subResources;
- DOMDocumentFragment* fragment = [string _documentFromRange:NSMakeRange(0, [string length])
- document:[[m_webView mainFrame] DOMDocument]
- documentAttributes:dictionary
- subresources:&subResources];
- for (WebResource* resource in subResources)
- resources.append([resource _coreResource]);
</del><ins>+ [excludedElements release];
</ins><span class="cx">
</span><del>- return core(fragment);
</del><ins>+ return dictionary;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void _WebCreateFragment(Document& document, NSAttributedString *string, FragmentAndResources& result)
+{
+ static NSDictionary *documentAttributes = [attributesForAttributedStringConversion() retain];
+ NSArray *subresources;
+ DOMDocumentFragment* fragment = [string _documentFromRange:NSMakeRange(0, [string length])
+ document:kit(&document) documentAttributes:documentAttributes subresources:&subresources];
+ result.fragment = core(fragment);
+ for (WebResource* resource in subresources)
+ result.resources.append([resource _coreResource]);
+}
+
</ins><span class="cx"> void WebEditorClient::setInsertionPasteboard(const String& pasteboardName)
</span><span class="cx"> {
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -465,6 +460,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><ins>+
</ins><span class="cx"> void WebEditorClient::uppercaseWord()
</span><span class="cx"> {
</span><span class="cx"> [m_webView uppercaseWord:nil];
</span><span class="lines">@@ -479,9 +475,11 @@
</span><span class="cx"> {
</span><span class="cx"> [m_webView capitalizeWord:nil];
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><ins>+
</ins><span class="cx"> void WebEditorClient::showSubstitutionsPanel(bool show)
</span><span class="cx"> {
</span><span class="cx"> NSPanel *spellingPanel = [[NSSpellChecker sharedSpellChecker] substitutionsPanel];
</span><span class="lines">@@ -550,6 +548,7 @@
</span><span class="cx"> {
</span><span class="cx"> [m_webView toggleAutomaticSpellingCorrection:nil];
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><span class="cx">
</span><span class="cx"> bool WebEditorClient::shouldInsertNode(Node *node, Range* replacingRange, EditorInsertAction givenAction)
</span><span class="lines">@@ -612,13 +611,15 @@
</span><span class="cx"> ASSERT(step);
</span><span class="cx">
</span><span class="cx"> NSUndoManager *undoManager = [m_webView undoManager];
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>- // While we are undoing, we shouldn't be asked to register another Undo operation, we shouldn't even be touching the DOM. But
- // just in case this happens, return to avoid putting the undo manager into an inconsistent state. Same for being
- // asked to register a Redo operation in the midst of another Redo.
</del><ins>+ // While we are undoing, we shouldn't be asked to register another Undo operation, we shouldn't even be touching the DOM.
+ // But just in case this happens, return to avoid putting the undo manager into an inconsistent state.
+ // Same for being asked to register a Redo operation in the midst of another Redo.
</ins><span class="cx"> if (([undoManager isUndoing] && !isRedo) || ([undoManager isRedoing] && isRedo))
</span><span class="cx"> return;
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> NSString *actionName = undoNameForEditAction(step->editingAction());
</span><span class="cx"> WebUndoStep *webEntry = [WebUndoStep stepWithUndoStep:step];
</span><span class="cx"> [undoManager registerUndoWithTarget:m_undoTarget.get() selector:(isRedo ? @selector(redoEditing:) : @selector(undoEditing:)) object:webEntry];
</span><span class="lines">@@ -817,7 +818,7 @@
</span><span class="cx"> [[m_webView _UIKitDelegateForwarder] writeDataToPasteboard:representation];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NSArray* WebEditorClient::supportedPasteboardTypesForCurrentSelection()
</del><ins>+NSArray *WebEditorClient::supportedPasteboardTypesForCurrentSelection()
</ins><span class="cx"> {
</span><span class="cx"> if ([[m_webView _UIKitDelegateForwarder] respondsToSelector:@selector(supportedPasteboardTypesForCurrentSelection)])
</span><span class="cx"> return [[m_webView _UIKitDelegateForwarder] supportedPasteboardTypesForCurrentSelection];
</span><span class="lines">@@ -825,7 +826,7 @@
</span><span class="cx"> return nil;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NSArray* WebEditorClient::readDataFromPasteboard(NSString* type, int index)
</del><ins>+NSArray *WebEditorClient::readDataFromPasteboard(NSString* type, int index)
</ins><span class="cx"> {
</span><span class="cx"> if ([[m_webView _UIKitDelegateForwarder] respondsToSelector:@selector(readDataFromPasteboard:withIndex:)])
</span><span class="cx"> return [[m_webView _UIKitDelegateForwarder] readDataFromPasteboard:type withIndex:index];
</span><span class="lines">@@ -857,7 +858,7 @@
</span><span class="cx"> return core(fragmentFromDelegate);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool WebEditorClient::performsTwoStepPaste(WebCore::DocumentFragment* fragment)
</span><span class="lines">@@ -1132,6 +1133,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</span><ins>+
</ins><span class="cx"> void WebEditorClient::requestCandidatesForSelection(const VisibleSelection& selection)
</span><span class="cx"> {
</span><span class="cx"> if (![m_webView shouldRequestCandidates])
</span><span class="lines">@@ -1219,9 +1221,11 @@
</span><span class="cx">
</span><span class="cx"> frame->editor().handleAcceptedCandidate(acceptedCandidate);
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><ins>+
</ins><span class="cx"> @interface WebEditorSpellCheckResponder : NSObject
</span><span class="cx"> {
</span><span class="cx"> WebEditorClient* _client;
</span><span class="lines">@@ -1257,6 +1261,7 @@
</span><span class="cx"> m_textCheckingRequest->didSucceed(core(results, m_textCheckingRequest->data().mask()));
</span><span class="cx"> m_textCheckingRequest = nullptr;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void WebEditorClient::requestCheckingOfString(PassRefPtr<WebCore::TextCheckingRequest> request, const VisibleSelection& currentSelection)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebKitexp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebKit.exp (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebKit.exp        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit/mac/WebKit.exp        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx"> _WebViewProgressEstimateChangedNotification
</span><span class="cx"> _WebViewProgressStartedNotification
</span><span class="cx"> _WebViewWillCloseNotification
</span><ins>+__WebCreateFragment
</ins><span class="cx"> __WebHTMLViewPrintingMaximumShrinkFactor
</span><span class="cx"> __WebHTMLViewPrintingMinimumShrinkFactor
</span><span class="cx"> __WebViewDidStartAcceleratedCompositingNotification
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -2557,10 +2557,7 @@
</span><span class="cx"> return [[self _frame] _documentFragmentWithMarkupString:HTMLString baseURLString:nil];
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // The _hasHTMLDocument clause here is a workaround for a bug in NSAttributedString: Radar 5052369.
- // If we call _documentFromRange on an XML document we'll get "setInnerHTML: method not found".
- // FIXME: Remove this once bug 5052369 is fixed.
- if ([self _hasHTMLDocument] && (pboardType == NSRTFPboardType || pboardType == NSRTFDPboardType)) {
</del><ins>+ if (pboardType == NSRTFPboardType || pboardType == NSRTFDPboardType) {
</ins><span class="cx"> NSAttributedString *string = nil;
</span><span class="cx"> if (pboardType == NSRTFDPboardType)
</span><span class="cx"> string = [[NSAttributedString alloc] initWithRTFD:[pasteboard dataForType:NSRTFDPboardType] documentAttributes:NULL];
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit2/ChangeLog        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-08-16 Darin Adler <darin@apple.com>
+
+ [Cocoa] Remove dependency on Objective-C bindings in WebKit2 editing code
+ https://bugs.webkit.org/show_bug.cgi?id=160891
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.h: Removed documentFragmentFromAttributedString.
+ * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
+ (WebKit::WebEditorClient::documentFragmentFromAttributedString): Deleted.
+ * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
+ (WebKit::createExcludedElementsForAttributedStringConversion): Deleted.
+ (WebKit::WebEditorClient::documentFragmentFromAttributedString): Deleted.
+
</ins><span class="cx"> 2016-08-16 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Cleanup WK2 platform gamepad handling.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebEditorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h        2016-08-16 16:56:07 UTC (rev 204508)
</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 WebEditorClient_h
-#define WebEditorClient_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #include <WebCore/EditorClient.h>
</span><span class="cx"> #include <WebCore/TextCheckerClient.h>
</span><span class="lines">@@ -33,7 +32,7 @@
</span><span class="cx">
</span><span class="cx"> class WebPage;
</span><span class="cx">
</span><del>-class WebEditorClient : public WebCore::EditorClient, public WebCore::TextCheckerClient {
</del><ins>+class WebEditorClient final : public WebCore::EditorClient, public WebCore::TextCheckerClient {
</ins><span class="cx"> public:
</span><span class="cx"> WebEditorClient(WebPage* page)
</span><span class="cx"> : m_page(page)
</span><span class="lines">@@ -41,85 +40,85 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- bool shouldDeleteRange(WebCore::Range*) override;
- bool smartInsertDeleteEnabled() override;
- bool isSelectTrailingWhitespaceEnabled() override;
- bool isContinuousSpellCheckingEnabled() override;
- void toggleContinuousSpellChecking() override;
- bool isGrammarCheckingEnabled() override;
- void toggleGrammarChecking() override;
- int spellCheckerDocumentTag() override;
</del><ins>+ bool shouldDeleteRange(WebCore::Range*) final;
+ bool smartInsertDeleteEnabled() final;
+ bool isSelectTrailingWhitespaceEnabled() final;
+ bool isContinuousSpellCheckingEnabled() final;
+ void toggleContinuousSpellChecking() final;
+ bool isGrammarCheckingEnabled() final;
+ void toggleGrammarChecking() final;
+ int spellCheckerDocumentTag() final;
</ins><span class="cx">
</span><del>- bool shouldBeginEditing(WebCore::Range*) override;
- bool shouldEndEditing(WebCore::Range*) override;
- bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction) override;
- bool shouldInsertText(const String&, WebCore::Range*, WebCore::EditorInsertAction) override;
- bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) override;
</del><ins>+ bool shouldBeginEditing(WebCore::Range*) final;
+ bool shouldEndEditing(WebCore::Range*) final;
+ bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction) final;
+ bool shouldInsertText(const String&, WebCore::Range*, WebCore::EditorInsertAction) final;
+ bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting) final;
</ins><span class="cx">
</span><del>- bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*) override;
- void didApplyStyle() override;
- bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) override;
</del><ins>+ bool shouldApplyStyle(WebCore::StyleProperties*, WebCore::Range*) final;
+ void didApplyStyle() final;
+ bool shouldMoveRangeAfterDelete(WebCore::Range*, WebCore::Range*) final;
</ins><span class="cx">
</span><del>- void didBeginEditing() override;
- void respondToChangedContents() override;
- void respondToChangedSelection(WebCore::Frame*) override;
- void didChangeSelectionAndUpdateLayout() override;
- void discardedComposition(WebCore::Frame*) override;
- void didEndEditing() override;
- void willWriteSelectionToPasteboard(WebCore::Range*) override;
- void didWriteSelectionToPasteboard() override;
- void getClientPasteboardDataForRange(WebCore::Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) override;
</del><ins>+ void didBeginEditing() final;
+ void respondToChangedContents() final;
+ void respondToChangedSelection(WebCore::Frame*) final;
+ void didChangeSelectionAndUpdateLayout() final;
+ void discardedComposition(WebCore::Frame*) final;
+ void didEndEditing() final;
+ void willWriteSelectionToPasteboard(WebCore::Range*) final;
+ void didWriteSelectionToPasteboard() final;
+ void getClientPasteboardDataForRange(WebCore::Range*, Vector<String>& pasteboardTypes, Vector<RefPtr<WebCore::SharedBuffer>>& pasteboardData) final;
</ins><span class="cx">
</span><del>- void registerUndoStep(PassRefPtr<WebCore::UndoStep>) override;
- void registerRedoStep(PassRefPtr<WebCore::UndoStep>) override;
- void clearUndoRedoOperations() override;
</del><ins>+ void registerUndoStep(PassRefPtr<WebCore::UndoStep>) final;
+ void registerRedoStep(PassRefPtr<WebCore::UndoStep>) final;
+ void clearUndoRedoOperations() final;
</ins><span class="cx">
</span><del>- bool canCopyCut(WebCore::Frame*, bool defaultValue) const override;
- bool canPaste(WebCore::Frame*, bool defaultValue) const override;
- bool canUndo() const override;
- bool canRedo() const override;
</del><ins>+ bool canCopyCut(WebCore::Frame*, bool defaultValue) const final;
+ bool canPaste(WebCore::Frame*, bool defaultValue) const final;
+ bool canUndo() const final;
+ bool canRedo() const final;
</ins><span class="cx">
</span><del>- void undo() override;
- void redo() override;
</del><ins>+ void undo() final;
+ void redo() final;
</ins><span class="cx">
</span><del>- void handleKeyboardEvent(WebCore::KeyboardEvent*) override;
- void handleInputMethodKeydown(WebCore::KeyboardEvent*) override;
</del><ins>+ void handleKeyboardEvent(WebCore::KeyboardEvent*) final;
+ void handleInputMethodKeydown(WebCore::KeyboardEvent*) final;
</ins><span class="cx">
</span><del>- void textFieldDidBeginEditing(WebCore::Element*) override;
- void textFieldDidEndEditing(WebCore::Element*) override;
- void textDidChangeInTextField(WebCore::Element*) override;
- bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*) override;
- void textWillBeDeletedInTextField(WebCore::Element*) override;
- void textDidChangeInTextArea(WebCore::Element*) override;
- void overflowScrollPositionChanged() override;
</del><ins>+ void textFieldDidBeginEditing(WebCore::Element*) final;
+ void textFieldDidEndEditing(WebCore::Element*) final;
+ void textDidChangeInTextField(WebCore::Element*) final;
+ bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*) final;
+ void textWillBeDeletedInTextField(WebCore::Element*) final;
+ void textDidChangeInTextArea(WebCore::Element*) final;
+ void overflowScrollPositionChanged() final;
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>- NSString *userVisibleString(NSURL *) override;
- WebCore::DocumentFragment* documentFragmentFromAttributedString(NSAttributedString *, Vector< RefPtr<WebCore::ArchiveResource>>&) override;
- void setInsertionPasteboard(const String& pasteboardName) override;
- NSURL* canonicalizeURL(NSURL*) override;
- NSURL* canonicalizeURLString(NSString*) override;
</del><ins>+ NSString *userVisibleString(NSURL *) final;
+ void setInsertionPasteboard(const String& pasteboardName) final;
+ NSURL *canonicalizeURL(NSURL *) final;
+ NSURL *canonicalizeURLString(NSString *) final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><del>- void uppercaseWord() override;
- void lowercaseWord() override;
- void capitalizeWord() override;
</del><ins>+ void uppercaseWord() final;
+ void lowercaseWord() final;
+ void capitalizeWord() final;
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><del>- void showSubstitutionsPanel(bool show) override;
- bool substitutionsPanelIsShowing() override;
- void toggleSmartInsertDelete() override;
- bool isAutomaticQuoteSubstitutionEnabled() override;
- void toggleAutomaticQuoteSubstitution() override;
- bool isAutomaticLinkDetectionEnabled() override;
- void toggleAutomaticLinkDetection() override;
- bool isAutomaticDashSubstitutionEnabled() override;
- void toggleAutomaticDashSubstitution() override;
- bool isAutomaticTextReplacementEnabled() override;
- void toggleAutomaticTextReplacement() override;
- bool isAutomaticSpellingCorrectionEnabled() override;
- void toggleAutomaticSpellingCorrection() override;
</del><ins>+ void showSubstitutionsPanel(bool show) final;
+ bool substitutionsPanelIsShowing() final;
+ void toggleSmartInsertDelete() final;
+ bool isAutomaticQuoteSubstitutionEnabled() final;
+ void toggleAutomaticQuoteSubstitution() final;
+ bool isAutomaticLinkDetectionEnabled() final;
+ void toggleAutomaticLinkDetection() final;
+ bool isAutomaticDashSubstitutionEnabled() final;
+ void toggleAutomaticDashSubstitution() final;
+ bool isAutomaticTextReplacementEnabled() final;
+ void toggleAutomaticTextReplacement() final;
+ bool isAutomaticSpellingCorrectionEnabled() final;
+ void toggleAutomaticSpellingCorrection() final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="lines">@@ -128,47 +127,48 @@
</span><span class="cx"> void updateGlobalSelection(WebCore::Frame*);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- TextCheckerClient* textChecker() override { return this; }
</del><ins>+ TextCheckerClient* textChecker() final { return this; }
</ins><span class="cx">
</span><del>- bool shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType) const override;
- void ignoreWordInSpellDocument(const String&) override;
- void learnWord(const String&) override;
- void checkSpellingOfString(StringView, int* misspellingLocation, int* misspellingLength) override;
- String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) override;
- void checkGrammarOfString(StringView, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) override;
</del><ins>+ bool shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType) const final;
+ void ignoreWordInSpellDocument(const String&) final;
+ void learnWord(const String&) final;
+ void checkSpellingOfString(StringView, int* misspellingLocation, int* misspellingLength) final;
+ String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) final;
+ void checkGrammarOfString(StringView, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength) final;
+
</ins><span class="cx"> #if USE(UNIFIED_TEXT_CHECKING)
</span><del>- Vector<WebCore::TextCheckingResult> checkTextOfParagraph(StringView, WebCore::TextCheckingTypeMask checkingTypes, const WebCore::VisibleSelection& currentSelection) override;
</del><ins>+ Vector<WebCore::TextCheckingResult> checkTextOfParagraph(StringView, WebCore::TextCheckingTypeMask checkingTypes, const WebCore::VisibleSelection& currentSelection) final;
</ins><span class="cx"> #endif
</span><del>- void updateSpellingUIWithGrammarString(const String&, const WebCore::GrammarDetail&) override;
- void updateSpellingUIWithMisspelledWord(const String&) override;
- void showSpellingUI(bool show) override;
- bool spellingUIIsShowing() override;
- void getGuessesForWord(const String& word, const String& context, const WebCore::VisibleSelection& currentSelection, Vector<String>& guesses) override;
- void willSetInputMethodState() override;
- void setInputMethodState(bool enabled) override;
- void requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest>, const WebCore::VisibleSelection& currentSelection) override;
</del><span class="cx">
</span><ins>+ void updateSpellingUIWithGrammarString(const String&, const WebCore::GrammarDetail&) final;
+ void updateSpellingUIWithMisspelledWord(const String&) final;
+ void showSpellingUI(bool show) final;
+ bool spellingUIIsShowing() final;
+ void getGuessesForWord(const String& word, const String& context, const WebCore::VisibleSelection& currentSelection, Vector<String>& guesses) final;
+ void willSetInputMethodState() final;
+ void setInputMethodState(bool enabled) final;
+ void requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest>, const WebCore::VisibleSelection& currentSelection) final;
+
</ins><span class="cx"> #if PLATFORM(GTK)
</span><del>- bool shouldShowUnicodeMenu() override;
</del><ins>+ bool shouldShowUnicodeMenu() final;
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>- void startDelayingAndCoalescingContentChangeNotifications() override;
- void stopDelayingAndCoalescingContentChangeNotifications() override;
- void writeDataToPasteboard(NSDictionary*) override;
- NSArray *supportedPasteboardTypesForCurrentSelection() override;
- NSArray *readDataFromPasteboard(NSString* type, int index) override;
- bool hasRichlyEditableSelection() override;
- int getPasteboardItemsCount() override;
- WebCore::DocumentFragment* documentFragmentFromDelegate(int index) override;
- bool performsTwoStepPaste(WebCore::DocumentFragment*) override;
- int pasteboardChangeCount() override;
</del><ins>+ void startDelayingAndCoalescingContentChangeNotifications() final;
+ void stopDelayingAndCoalescingContentChangeNotifications() final;
+ void writeDataToPasteboard(NSDictionary*) final;
+ NSArray *supportedPasteboardTypesForCurrentSelection() final;
+ NSArray *readDataFromPasteboard(NSString* type, int index) final;
+ bool hasRichlyEditableSelection() final;
+ int getPasteboardItemsCount() final;
+ WebCore::DocumentFragment* documentFragmentFromDelegate(int index) final;
+ bool performsTwoStepPaste(WebCore::DocumentFragment*) final;
+ int pasteboardChangeCount() final;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- bool supportsGlobalSelection() override;
</del><ins>+ bool supportsGlobalSelection() final;
</ins><span class="cx">
</span><span class="cx"> WebPage* m_page;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span><del>-
-#endif // WebEditorClient_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportiosWebEditorClientIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -65,12 +65,6 @@
</span><span class="cx"> return nil;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-DocumentFragment* WebEditorClient::documentFragmentFromAttributedString(NSAttributedString *, Vector<RefPtr<ArchiveResource> >&)
-{
- notImplemented();
- return nullptr;
-}
-
</del><span class="cx"> void WebEditorClient::setInsertionPasteboard(const String&)
</span><span class="cx"> {
</span><span class="cx"> // This is used only by Mail, no need to implement it now.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebEditorClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm (204507 => 204508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm        2016-08-16 16:52:45 UTC (rev 204507)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm        2016-08-16 16:56:07 UTC (rev 204508)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2010, 2011 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2010-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">@@ -32,33 +32,17 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">
</span><del>-#import "WebCoreArgumentCoders.h"
</del><span class="cx"> #import "WebPage.h"
</span><del>-#import "WebFrame.h"
</del><span class="cx"> #import "WebPageProxyMessages.h"
</span><span class="cx"> #import "WebProcess.h"
</span><del>-#import <WebCore/ArchiveResource.h>
-#import <WebCore/DocumentFragment.h>
-#import <WebCore/DOMDocumentFragmentInternal.h>
-#import <WebCore/DOMDocumentInternal.h>
</del><span class="cx"> #import <WebCore/FocusController.h>
</span><span class="cx"> #import <WebCore/Frame.h>
</span><span class="cx"> #import <WebCore/KeyboardEvent.h>
</span><del>-#import <WebCore/MainFrame.h>
</del><span class="cx"> #import <WebCore/NotImplemented.h>
</span><del>-#import <WebCore/Page.h>
</del><span class="cx"> #import <WebCore/WebCoreNSURLExtras.h>
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><del>-@interface NSAttributedString (WebNSAttributedStringDetails)
-- (DOMDocumentFragment*)_documentFromRange:(NSRange)range document:(DOMDocument*)document documentAttributes:(NSDictionary *)dict subresources:(NSArray **)subresources;
-@end
-
-@interface NSObject (WebResourceInternal)
-- (WebCore::ArchiveResource*)_coreResource;
-@end
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event)
</span><span class="lines">@@ -90,44 +74,7 @@
</span><span class="cx"> URL = URLByCanonicalizingURL(URLWithUserTypedString(URLString, nil));
</span><span class="cx"> return URL;
</span><span class="cx"> }
</span><del>-
-static NSArray *createExcludedElementsForAttributedStringConversion()
-{
- NSArray *elements = [[NSArray alloc] initWithObjects:
- // Omit style since we want style to be inline so the fragment can be easily inserted.
- @"style",
- // Omit xml so the result is not XHTML.
- @"xml",
- // Omit tags that will get stripped when converted to a fragment anyway.
- @"doctype", @"html", @"head", @"body",
- // Omit deprecated tags.
- @"applet", @"basefont", @"center", @"dir", @"font", @"isindex", @"menu", @"s", @"strike", @"u",
- // Omit object so no file attachments are part of the fragment.
- @"object", nil];
- CFRetain(elements);
- return elements;
-}
</del><span class="cx">
</span><del>-DocumentFragment* WebEditorClient::documentFragmentFromAttributedString(NSAttributedString *string, Vector<RefPtr<ArchiveResource>>& resources)
-{
- static NSArray *excludedElements = createExcludedElementsForAttributedStringConversion();
-
- NSDictionary *dictionary = [NSDictionary dictionaryWithObject:excludedElements forKey:NSExcludedElementsDocumentAttribute];
-
- NSArray *subResources;
- Document* document = m_page->mainFrame()->document();
-
- // FIXME: Isntead of calling this WebKit1 method, the code should be factored out and moved into WebCore.
- DOMDocumentFragment* fragment = [string _documentFromRange:NSMakeRange(0, [string length])
- document:kit(document)
- documentAttributes:dictionary
- subresources:&subResources];
- for (id resource in subResources)
- resources.append([resource _coreResource]);
-
- return core(fragment);
-}
-
</del><span class="cx"> void WebEditorClient::setInsertionPasteboard(const String&)
</span><span class="cx"> {
</span><span class="cx"> // This is used only by Mail, no need to implement it now.
</span><span class="lines">@@ -134,7 +81,6 @@
</span><span class="cx"> notImplemented();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> static void changeWordCase(WebPage* page, SEL selector)
</span><span class="cx"> {
</span><span class="cx"> Frame& frame = page->corePage()->focusController().focusedOrMainFrame();
</span><span class="lines">@@ -147,7 +93,6 @@
</span><span class="cx"> page->replaceSelectionWithText(&frame, [selectedString performSelector:selector]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if USE(APPKIT)
</del><span class="cx"> void WebEditorClient::uppercaseWord()
</span><span class="cx"> {
</span><span class="cx"> changeWordCase(m_page, @selector(uppercaseString));
</span><span class="lines">@@ -162,9 +107,9 @@
</span><span class="cx"> {
</span><span class="cx"> changeWordCase(m_page, @selector(capitalizedString));
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx">
</span><span class="cx"> #if USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><ins>+
</ins><span class="cx"> void WebEditorClient::showSubstitutionsPanel(bool)
</span><span class="cx"> {
</span><span class="cx"> notImplemented();
</span><span class="lines">@@ -248,6 +193,7 @@
</span><span class="cx"> {
</span><span class="cx"> notImplemented();
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif // USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>
</body>
</html>