#include "third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.h"
#include "third_party/blink/renderer/core/css/css_property_value_set.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/editing/editing_style.h"
#include "third_party/blink/renderer/core/editing/editing_style_utilities.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/serializers/serialization.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/editing/visible_selection.h"
#include "third_party/blink/renderer/core/editing/visible_units.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_iframe_element.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
namespace blink {
namespace {
template <typename Strategy>
TextOffset ToTextOffset(const PositionTemplate<Strategy>& position) { … }
template <typename EditingStrategy>
static bool HandleSelectionBoundary(const Node&);
template <>
bool HandleSelectionBoundary<EditingStrategy>(const Node&) { … }
template <>
bool HandleSelectionBoundary<EditingInFlatTreeStrategy>(const Node& node) { … }
}
template <typename Strategy>
class StyledMarkupTraverser { … };
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::ShouldAnnotate() const { … }
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::IsForMarkupSanitization() const { … }
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::ShouldConvertBlocksToInlines() const { … }
template <typename Strategy>
StyledMarkupSerializer<Strategy>::StyledMarkupSerializer(
const PositionTemplate<Strategy>& start,
const PositionTemplate<Strategy>& end,
Node* highest_node_to_be_serialized,
const CreateMarkupOptions& options)
: … { … }
template <typename Strategy>
static bool NeedInterchangeNewlineAfter(
const VisiblePositionTemplate<Strategy>& v) { … }
template <typename Strategy>
static bool NeedInterchangeNewlineAt(
const VisiblePositionTemplate<Strategy>& v) { … }
static EditingStyle* StyleFromMatchedRulesAndInlineDecl(
const HTMLElement* element) { … }
template <typename Strategy>
String StyledMarkupSerializer<Strategy>::CreateMarkup() { … }
template <typename Strategy>
StyledMarkupTraverser<Strategy>::StyledMarkupTraverser()
: … { … }
template <typename Strategy>
StyledMarkupTraverser<Strategy>::StyledMarkupTraverser(
StyledMarkupAccumulator* accumulator,
Node* last_closed)
: … { … }
template <typename Strategy>
Node* StyledMarkupTraverser<Strategy>::Traverse(Node* start_node,
Node* past_end) { … }
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::NeedsInlineStyle(const Element& element) { … }
template <typename Strategy>
void StyledMarkupTraverser<Strategy>::WrapWithNode(ContainerNode& node,
EditingStyle* style) { … }
template <typename Strategy>
EditingStyle* StyledMarkupTraverser<Strategy>::CreateInlineStyleIfNeeded(
Node& node) { … }
template <typename Strategy>
void StyledMarkupTraverser<Strategy>::AppendStartMarkup(Node& node) { … }
template <typename Strategy>
void StyledMarkupTraverser<Strategy>::AppendEndMarkup(Node& node) { … }
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::ShouldApplyWrappingStyle(
const Node& node) const { … }
template <typename Strategy>
EditingStyle* StyledMarkupTraverser<Strategy>::CreateInlineStyle(
Element& element) { … }
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::ContainsOnlyBRElement(
const Element& element) const { … }
template <typename Strategy>
bool StyledMarkupTraverser<Strategy>::ShouldSerializeUnrenderedElement(
const Node& node) const { … }
template class StyledMarkupSerializer<EditingStrategy>;
template class StyledMarkupSerializer<EditingInFlatTreeStrategy>;
}