Clean up how WebKit exports _WebCreateFragment
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2017 17:22:56 +0000 (17:22 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Feb 2017 17:22:56 +0000 (17:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168579

Reviewed by Dan Bernstein.

Source/WebCore:

* editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
* editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj: Added WebCreateFragmentInternal.h.

Source/WebKit/mac:

* WebCoreSupport/WebCreateFragmentInternal.h: Added a private header.
* WebCoreSupport/WebEditorClient.mm: Include the new header that declares _WebCreateFragment.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@212642 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.h
Source/WebCore/editing/cocoa/EditorCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebCreateFragmentInternal.h [new file with mode: 0644]
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm

index 3b7be25..18a9aa4 100644 (file)
@@ -1,3 +1,13 @@
+2017-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up how WebKit exports _WebCreateFragment
+        https://bugs.webkit.org/show_bug.cgi?id=168579
+
+        Reviewed by Dan Bernstein.
+
+        * editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
+        * editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.
+
 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r212637.
index f9b2ce4..7e512dd 100644 (file)
@@ -589,9 +589,3 @@ inline bool Editor::markedTextMatchesAreHighlighted() const
 }
 
 } // namespace WebCore
-
-#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
index 4754e77..71945bf 100644 (file)
@@ -58,6 +58,7 @@ SOFT_LINK_PRIVATE_FRAMEWORK(WebKitLegacy)
 SOFT_LINK_FRAMEWORK_IN_UMBRELLA(WebKit, WebKitLegacy)
 #endif
 
+// FIXME: Get rid of this and change NSAttributedString conversion so it doesn't use WebKitLegacy (cf. rdar://problem/30597352).
 SOFT_LINK(WebKitLegacy, _WebCreateFragment, void, (WebCore::Document& document, NSAttributedString *string, WebCore::FragmentAndResources& result), (document, string, result))
 
 namespace WebCore {
index c498f25..f377015 100644 (file)
@@ -1,3 +1,12 @@
+2017-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up how WebKit exports _WebCreateFragment
+        https://bugs.webkit.org/show_bug.cgi?id=168579
+
+        Reviewed by Dan Bernstein.
+
+        * WebKit.xcodeproj/project.pbxproj: Added WebCreateFragmentInternal.h.
+
 2017-02-15  Brady Eidson  <beidson@apple.com>
 
         Stop backing up localStorage databases to iCloud by default.
index d76f0e0..04bf726 100644 (file)
                DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
                DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
                DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; };
+               E13E782C1E5A7365001849D1 /* WebCreateFragmentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = E13E782B1E5A7365001849D1 /* WebCreateFragmentInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E15663190FB61C1F00C199CA /* WebDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = E15663180FB61C1F00C199CA /* WebDownload.mm */; };
                E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169836111346D1B00894115 /* ProxyRuntimeObject.h */; };
                E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = E169836B11346D5600894115 /* ProxyRuntimeObject.mm */; };
                DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; };
                DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               E13E782B1E5A7365001849D1 /* WebCreateFragmentInternal.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = WebCreateFragmentInternal.h; sourceTree = "<group>"; };
                E15663180FB61C1F00C199CA /* WebDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDownload.mm; sourceTree = "<group>"; };
                E169836111346D1B00894115 /* ProxyRuntimeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyRuntimeObject.h; sourceTree = "<group>"; };
                E169836B11346D5600894115 /* ProxyRuntimeObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProxyRuntimeObject.mm; sourceTree = "<group>"; };
                                14D8252E0AF955090004F057 /* WebChromeClient.mm */,
                                065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */,
                                065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */,
+                               E13E782B1E5A7365001849D1 /* WebCreateFragmentInternal.h */,
                                598AD9191201CEC900ABAE4E /* WebDeviceOrientationClient.h */,
                                598AD91D1201CECF00ABAE4E /* WebDeviceOrientationClient.mm */,
                                A70936AD0B5608DC00CDB48E /* WebDragClient.h */,
                                93D437701D57ABEF00AB85EA /* DOMRGBColor.h in Headers */,
                                93D437721D57ABEF00AB85EA /* DOMRGBColorInternal.h in Headers */,
                                93D437731D57ABEF00AB85EA /* DOMStyleSheet.h in Headers */,
+                               E13E782C1E5A7365001849D1 /* WebCreateFragmentInternal.h in Headers */,
                                93D437751D57ABEF00AB85EA /* DOMStyleSheetInternal.h in Headers */,
                                93D437761D57ABEF00AB85EA /* DOMStyleSheetList.h in Headers */,
                                93D437781D57ABEF00AB85EA /* DOMStyleSheetListInternal.h in Headers */,
index 632fbcd..d0c310f 100644 (file)
@@ -1,3 +1,13 @@
+2017-02-20  Alexey Proskuryakov  <ap@apple.com>
+
+        Clean up how WebKit exports _WebCreateFragment
+        https://bugs.webkit.org/show_bug.cgi?id=168579
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/WebCreateFragmentInternal.h: Added a private header.
+        * WebCoreSupport/WebEditorClient.mm: Include the new header that declares _WebCreateFragment.
+
 2017-02-20  Aakash Jain  <aakash_jain@apple.com>
 
         Stop exporting DOMNodeFilter
diff --git a/Source/WebKit/mac/WebCoreSupport/WebCreateFragmentInternal.h b/Source/WebKit/mac/WebCoreSupport/WebCreateFragmentInternal.h
new file mode 100644 (file)
index 0000000..c34075a
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#pragma once
+
+namespace WebCore {
+class Document;
+struct FragmentAndResources;
+}
+
+extern "C" void _WebCreateFragment(WebCore::Document&, NSAttributedString *, WebCore::FragmentAndResources&);
index f38a9f0..823f16e 100644 (file)
@@ -38,6 +38,7 @@
 #import "DOMNodeInternal.h"
 #import "DOMRangeInternal.h"
 #import "WebArchive.h"
+#import "WebCreateFragmentInternal.h"
 #import "WebDataSourceInternal.h"
 #import "WebDelegateImplementationCaching.h"
 #import "WebDocument.h"