diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.h b/chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.h new file mode 100644 index 00000000000..63fae1e2957 --- /dev/null +++ b/chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.h @@ -0,0 +1,63 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SERIALIZERS_CREATE_MARKUP_OPTIONS_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SERIALIZERS_CREATE_MARKUP_OPTIONS_H_ + +#include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" + +namespace blink { + +class Node; + +enum AbsoluteURLs { kDoNotResolveURLs, kResolveAllURLs, kResolveNonLocalURLs }; + +class CORE_EXPORT CreateMarkupOptions final { + STACK_ALLOCATED(); + + public: + class CORE_EXPORT Builder; + + CreateMarkupOptions() = default; + + const Node* ConstrainingAncestor() const { return constraining_ancestor_; } + AbsoluteURLs ShouldResolveURLs() const { return should_resolve_urls_; } + bool ShouldAnnotateForInterchange() const { + return should_annotate_for_interchange_; + } + bool ShouldConvertBlocksToInlines() const { + return should_convert_blocks_to_inlines_; + } + + private: + Member<const Node> constraining_ancestor_; + AbsoluteURLs should_resolve_urls_ = kDoNotResolveURLs; + bool should_annotate_for_interchange_ = false; + bool should_convert_blocks_to_inlines_ = false; +}; + +class CORE_EXPORT CreateMarkupOptions::Builder final { + STACK_ALLOCATED(); + + public: + Builder() = default; + explicit Builder(const CreateMarkupOptions& options) : data_(options) {} + + CreateMarkupOptions Build() const { return data_; } + + Builder& SetConstrainingAncestor(const Node* node); + Builder& SetShouldResolveURLs(AbsoluteURLs absolute_urls); + Builder& SetShouldAnnotateForInterchange(bool annotate_for_interchange); + Builder& SetShouldConvertBlocksToInlines(bool convert_blocks_for_inlines); + + private: + CreateMarkupOptions data_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_SERIALIZERS_CREATE_MARKUP_OPTIONS_H_ + |