Use enum class in createMarkup arguments
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2018 04:22:50 +0000 (04:22 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Sep 2018 04:22:50 +0000 (04:22 +0000)
commit288e913b850110896224dd6184b182dfdbee60ea
tree32422e1b1302d1385cd5d51037c95791af68e2d0
parent2cc562fabd39726e0570a943fbeb66f54b2fa063
Use enum class in createMarkup arguments
https://bugs.webkit.org/show_bug.cgi?id=190028

Reviewed by Wenson Hsieh.

Source/WebCore:

Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes,
EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax.

Also replaced the boolean convertBlocksToInlines with an enum class of the same name.

Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer
to serializeFragment.

* dom/Element.cpp:
(WebCore::Element::innerHTML const):
(WebCore::Element::outerHTML const):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::innerHTML const):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/HTMLInterchange.h:
(WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::MarkupAccumulator):
(WebCore::MarkupAccumulator::serializeNodes):
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::resolveURLIfNeeded const):
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::inXMLFragmentSerialization const):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::willApplyCommand):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentMarkupReader::readRTFD):
(WebCore::WebContentMarkupReader::readRTF):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeImageToPasteboard):
(WebCore::Editor::writeSelectionToPasteboard):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::serializeNodes):
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::highestAncestorToWrapMarkup):
(WebCore::createMarkupInternal):
(WebCore::createMarkup):
(WebCore::sanitizedMarkupForFragmentInDocument):
(WebCore::serializeFragment): Renamed from createMarkup. This is used for innerHTML and XMLSerializer,
which faithfully serializes the fragment without any computed style as inline styles.
(WebCore::documentTypeString):
(WebCore::createFullMarkup): Deleted two varinats used in WebKitLegacy.
* editing/markup.h:
(WebCore::ResolveURLs): Renamed from EAbsoluteURLs.
(WebCore::ConvertBlocksToInlines): Added.
(WebCore::SerializedNodes): Renamed from EChildrenOnly.
(WebCore::SerializationSyntax): Renamed from EFragmentSerialization.
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* inspector/DOMEditor.cpp:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getOuterHTML):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
(WebCore::PageSerializer::serializeFrame):
* page/win/DragControllerWin.cpp:
(WebCore::DragController::declareAndWriteDragImage):
* Source/WebCore/platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeRangeToDataObject):
(WebCore::Pasteboard::writeSelection):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLSerializer.cpp:
(WebCore::XMLSerializer::serializeToString):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::xsltStylesheetPointer):
(WebCore::xmlDocPtrFromNode):

Source/WebKit:

* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection):

Source/WebKitLegacy/mac:

* DOM/WebDOMOperations.mm:
(-[DOMNode markupString]): Moved the code from WebCore/editing/markup.cpp
(-[DOMRange markupString]): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/editing/CompositeEditCommand.cpp
Source/WebCore/editing/HTMLInterchange.h
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/editing/MarkupAccumulator.h
Source/WebCore/editing/ReplaceRangeWithTextCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/SpellingCorrectionCommand.cpp
Source/WebCore/editing/cocoa/EditorCocoa.mm
Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm
Source/WebCore/editing/gtk/EditorGtk.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/editing/markup.h
Source/WebCore/editing/wpe/EditorWPE.cpp
Source/WebCore/inspector/DOMEditor.cpp
Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/page/win/DragControllerWin.cpp
Source/WebCore/platform/win/PasteboardWin.cpp
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLSerializer.cpp
Source/WebCore/xml/XSLTProcessorLibxslt.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/WebDOMOperations.mm