source: webkit/trunk/Source/WebCore/xml/XMLSerializer.cpp

Last change on this file was 236583, checked in by [email protected], 7 years ago

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.

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1/*
2 * Copyright (C) 2003, 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Samuel Weinig ([email protected])
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include "config.h"
21#include "XMLSerializer.h"
22
23#include "markup.h"
24
25namespace WebCore {
26
27String XMLSerializer::serializeToString(Node& node)
28{
29 return serializeFragment(node, SerializedNodes::SubtreeIncludingNode, nullptr, ResolveURLs::No, nullptr, SerializationSyntax::XML);
30}
31
32} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.