Changeset 236612 in webkit
- Timestamp:
- Sep 28, 2018 2:08:54 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r236611 r236612 1 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Rename createMarkup to serializePreservingVisualAppearance 4 https://bugs.webkit.org/show_bug.cgi?id=190086 5 6 Reviewed by Wenson Hsieh. 7 8 Renamed the function to clarify what it does. Also removed the unused Range::toHTML. 9 10 * dom/Range.cpp: 11 (WebCore::Range::toHTML const): Deleted. 12 * dom/Range.h: 13 * editing/CompositeEditCommand.cpp: 14 (WebCore::CompositeEditCommand::moveParagraphs): 15 * editing/cocoa/EditorCocoa.mm: 16 (WebCore::Editor::selectionInHTMLFormat): 17 * editing/gtk/EditorGtk.cpp: 18 (WebCore::Editor::writeSelectionToPasteboard): 19 * editing/markup.cpp: 20 (WebCore::serializePreservingVisualAppearance): 21 (WebCore::createMarkup): Deleted. 22 * editing/markup.h: 23 * editing/wpe/EditorWPE.cpp: 24 (WebCore::Editor::writeSelectionToPasteboard): 25 * loader/archive/cf/LegacyWebArchive.cpp: 26 (WebCore::LegacyWebArchive::create): 27 (WebCore::LegacyWebArchive::createFromSelection): 28 * platform/win/PasteboardWin.cpp: 29 (WebCore::Pasteboard::writeRangeToDataObject): 30 1 31 2018-09-28 Simon Fraser <simon.fraser@apple.com> 2 32 -
trunk/Source/WebCore/dom/Range.cpp
r236607 r236612 951 951 952 952 return builder.toString(); 953 }954 955 String Range::toHTML() const956 {957 return createMarkup(*this);958 953 } 959 954 -
trunk/Source/WebCore/dom/Range.h
r220503 r236612 85 85 WEBCORE_EXPORT String toString() const; 86 86 87 String toHTML() const;88 87 WEBCORE_EXPORT String text() const; 89 88 -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r236583 r236612 1445 1445 // This used to use a ternary for initialization, but that confused some versions of GCC, see bug 37912 1446 1446 if (startOfParagraphToMove != endOfParagraphToMove) 1447 fragment = createFragmentFromMarkup(document(), createMarkup(*range, nullptr, AnnotateForInterchange::No, ConvertBlocksToInlines::Yes), emptyString());1447 fragment = createFragmentFromMarkup(document(), serializePreservingVisualAppearance(*range, nullptr, AnnotateForInterchange::No, ConvertBlocksToInlines::Yes), emptyString()); 1448 1448 1449 1449 // A non-empty paragraph's style is moved when we copy and move it. We don't move -
trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm
r236583 r236612 77 77 { 78 78 if (auto range = selectedRange()) 79 return createMarkup(*range, nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy);79 return serializePreservingVisualAppearance(*range, nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy); 80 80 return { }; 81 81 } -
trunk/Source/WebCore/editing/gtk/EditorGtk.cpp
r236583 r236612 147 147 pasteboardContent.canSmartCopyOrDelete = canSmartCopyOrDelete(); 148 148 pasteboardContent.text = selectedTextForDataTransfer(); 149 pasteboardContent.markup = createMarkup(*selectedRange(), nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy);149 pasteboardContent.markup = serializePreservingVisualAppearance(*selectedRange(), nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy); 150 150 pasteboard.write(pasteboardContent); 151 151 } -
trunk/Source/WebCore/editing/markup.cpp
r236609 r236612 845 845 } 846 846 847 String createMarkup(const Range& range, Vector<Node*>* nodes, AnnotateForInterchange annotate, ConvertBlocksToInlines convertBlocksToInlines, ResolveURLs urlsToReslve)847 String serializePreservingVisualAppearance(const Range& range, Vector<Node*>* nodes, AnnotateForInterchange annotate, ConvertBlocksToInlines convertBlocksToInlines, ResolveURLs urlsToReslve) 848 848 { 849 849 return createMarkupInternal(range.ownerDocument(), range, nodes, annotate, convertBlocksToInlines, urlsToReslve, MSOListMode::DoNotPreserve); -
trunk/Source/WebCore/editing/markup.h
r236583 r236612 70 70 enum class ResolveURLs : uint8_t { No, Yes, YesExcludingLocalFileURLsForPrivacy }; 71 71 enum class ConvertBlocksToInlines : uint8_t { No, Yes }; 72 WEBCORE_EXPORT String createMarkup(const Range&, Vector<Node*>* = nullptr, AnnotateForInterchange = AnnotateForInterchange::No, ConvertBlocksToInlines = ConvertBlocksToInlines::No, ResolveURLs = ResolveURLs::No);72 WEBCORE_EXPORT String serializePreservingVisualAppearance(const Range&, Vector<Node*>* = nullptr, AnnotateForInterchange = AnnotateForInterchange::No, ConvertBlocksToInlines = ConvertBlocksToInlines::No, ResolveURLs = ResolveURLs::No); 73 73 74 74 enum class SerializedNodes : uint8_t { SubtreeIncludingNode, SubtreesOfChildren }; 75 75 enum class SerializationSyntax : uint8_t { HTML, XML }; 76 76 WEBCORE_EXPORT String serializeFragment(const Node&, SerializedNodes, Vector<Node*>* = nullptr, ResolveURLs = ResolveURLs::No, Vector<QualifiedName>* tagNamesToSkip = nullptr, SerializationSyntax = SerializationSyntax::HTML); 77 WEBCORE_EXPORT String serializeFragmentWithDocType(const Node&);78 77 79 78 String urlToMarkup(const URL&, const String& title); -
trunk/Source/WebCore/editing/wpe/EditorWPE.cpp
r236583 r236612 65 65 PasteboardWebContent pasteboardContent; 66 66 pasteboardContent.text = selectedTextForDataTransfer(); 67 pasteboardContent.markup = createMarkup(*selectedRange(), nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy);67 pasteboardContent.markup = serializePreservingVisualAppearance(*selectedRange(), nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy); 68 68 pasteboard.write(pasteboardContent); 69 69 } -
trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
r236583 r236612 461 461 // FIXME: This is always "for interchange". Is that right? 462 462 Vector<Node*> nodeList; 463 String markupString = documentTypeString(document) + createMarkup(*range, &nodeList, AnnotateForInterchange::Yes);463 String markupString = documentTypeString(document) + serializePreservingVisualAppearance(*range, &nodeList, AnnotateForInterchange::Yes); 464 464 return create(markupString, *frame, nodeList, nullptr); 465 465 } … … 556 556 Vector<Node*> nodeList; 557 557 if (auto selectionRange = frame->selection().toNormalizedRange()) 558 builder.append( createMarkup(*selectionRange, &nodeList, AnnotateForInterchange::Yes));558 builder.append(serializePreservingVisualAppearance(*selectionRange, &nodeList, AnnotateForInterchange::Yes)); 559 559 560 560 auto archive = create(builder.toString(), *frame, nodeList, nullptr); -
trunk/Source/WebCore/platform/win/PasteboardWin.cpp
r236583 r236612 445 445 446 446 Vector<char> data; 447 markupToCFHTML( createMarkup(selectedRange, nullptr, AnnotateForInterchange::Yes),447 markupToCFHTML(serializePreservingVisualAppearance(selectedRange, nullptr, AnnotateForInterchange::Yes), 448 448 selectedRange.startContainer().document().url().string(), data); 449 449 medium.hGlobal = createGlobalData(data); -
trunk/Source/WebKit/ChangeLog
r236610 r236612 1 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Rename createMarkup to serializePreservingVisualAppearance 4 https://bugs.webkit.org/show_bug.cgi?id=190086 5 6 Reviewed by Wenson Hsieh. 7 8 * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: 9 (WebKit::WebEditorClient::updateGlobalSelection): 10 1 11 2018-09-28 Commit Queue <commit-queue@webkit.org> 2 12 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
r236583 r236612 127 127 pasteboardContent.canSmartCopyOrDelete = false; 128 128 pasteboardContent.text = range->text(); 129 pasteboardContent.markup = createMarkup(*range, nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy);129 pasteboardContent.markup = serializePreservingVisualAppearance(*range, nullptr, AnnotateForInterchange::Yes, ConvertBlocksToInlines::No, ResolveURLs::YesExcludingLocalFileURLsForPrivacy); 130 130 Pasteboard::createForGlobalSelection()->write(pasteboardContent); 131 131 } -
trunk/Source/WebKitLegacy/mac/ChangeLog
r236610 r236612 1 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> 2 3 Rename createMarkup to serializePreservingVisualAppearance 4 https://bugs.webkit.org/show_bug.cgi?id=190086 5 6 Reviewed by Wenson Hsieh. 7 8 * DOM/WebDOMOperations.mm: 9 (-[DOMRange markupString]): 10 1 11 2018-09-28 Commit Queue <commit-queue@webkit.org> 2 12 -
trunk/Source/WebKitLegacy/mac/DOM/WebDOMOperations.mm
r236583 r236612 196 196 { 197 197 auto& range = *core(self); 198 return String { documentTypeString(range.startContainer().document()) + createMarkup(range, nullptr, AnnotateForInterchange::Yes) };198 return String { documentTypeString(range.startContainer().document()) + serializePreservingVisualAppearance(range, nullptr, AnnotateForInterchange::Yes) }; 199 199 } 200 200
Note: See TracChangeset
for help on using the changeset viewer.