#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/editing/serializers/markup_formatter.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h"
#include "third_party/blink/renderer/core/dom/cdata_section.h"
#include "third_party/blink/renderer/core/dom/comment.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/document_fragment.h"
#include "third_party/blink/renderer/core/dom/document_type.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/dom/processing_instruction.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_template_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/xlink_names.h"
#include "third_party/blink/renderer/core/xml_names.h"
#include "third_party/blink/renderer/core/xmlns_names.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/text/character_visitor.h"
namespace blink {
struct EntityDescription { … };
template <typename CharType>
static inline void AppendCharactersReplacingEntitiesInternal(
StringBuilder& result,
const StringView& source,
CharType* text,
unsigned length,
const EntityDescription entity_maps[],
unsigned entity_maps_count,
EntityMask entity_mask) { … }
void MarkupFormatter::AppendCharactersReplacingEntities(
StringBuilder& result,
const StringView& source,
EntityMask entity_mask) { … }
MarkupFormatter::MarkupFormatter(AbsoluteURLs resolve_urls_method,
SerializationType serialization_type)
: … { … }
String MarkupFormatter::ResolveURLIfNeeded(const Element& element,
const Attribute& attribute) const { … }
void MarkupFormatter::AppendStartMarkup(StringBuilder& result,
const Node& node) { … }
void MarkupFormatter::AppendEndMarkup(StringBuilder& result,
const Element& element) { … }
void MarkupFormatter::AppendEndMarkup(StringBuilder& result,
const Element& element,
const AtomicString& prefix,
const AtomicString& local_name) { … }
void MarkupFormatter::AppendAttributeValue(StringBuilder& result,
const String& attribute,
bool document_is_html,
const Document& document) { … }
void MarkupFormatter::AppendAttribute(StringBuilder& result,
const AtomicString& prefix,
const AtomicString& local_name,
const String& value,
bool document_is_html,
const Document& document) { … }
void MarkupFormatter::AppendText(StringBuilder& result, const Text& text) { … }
void MarkupFormatter::AppendComment(StringBuilder& result,
const String& comment) { … }
void MarkupFormatter::AppendXMLDeclaration(StringBuilder& result,
const Document& document) { … }
void MarkupFormatter::AppendDocumentType(StringBuilder& result,
const DocumentType& n) { … }
void MarkupFormatter::AppendProcessingInstruction(StringBuilder& result,
const String& target,
const String& data) { … }
void MarkupFormatter::AppendStartTagOpen(StringBuilder& result,
const Element& element) { … }
void MarkupFormatter::AppendStartTagOpen(StringBuilder& result,
const AtomicString& prefix,
const AtomicString& local_name) { … }
void MarkupFormatter::AppendStartTagClose(StringBuilder& result,
const Element& element) { … }
void MarkupFormatter::AppendAttributeAsHTML(StringBuilder& result,
const Attribute& attribute,
const String& value,
const Document& document) { … }
void MarkupFormatter::AppendAttributeAsXMLWithoutNamespace(
StringBuilder& result,
const Attribute& attribute,
const String& value,
const Document& document) { … }
void MarkupFormatter::AppendCDATASection(StringBuilder& result,
const String& section) { … }
EntityMask MarkupFormatter::EntityMaskForText(const Text& text) const { … }
bool MarkupFormatter::ShouldSelfClose(const Element& element) const { … }
bool MarkupFormatter::SerializeAsHTML() const { … }
}