From 3e757b536e5d71578b4cfa64d0bf20a1c5e356d8 Mon Sep 17 00:00:00 2001 From: Xiaocheng Hu Date: Fri, 22 Nov 2019 03:02:42 +0000 Subject: [Backport] Dependency for CVE-2020-6391 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manual backport of patch originally reviewed on https://chromium-review.googlesource.com/c/chromium/src/+/1927207: Pack CreateMarkup() optional parameters into CreateMarkupOptions CreateMarkup() has too many option parameters. This patch packs them into a CreateMarkupOptions object, to improve code readability and make callers easier to call CreateMarkup() without the need to understand all different parameters. This is also a preparation for crrev.com/c/1922919 where we need to add another parameter to CreateMarkup(). Change-Id: Ia97490279ec027b88c61fbc6de482b1310cabcf6 Reviewed-by: Jüri Valdmann --- .../blink/renderer/core/editing/BUILD.gn | 2 + .../editing/commands/composite_edit_command.cc | 7 +-- .../blink/renderer/core/editing/frame_selection.cc | 8 +-- .../editing/serializers/create_markup_options.cc | 36 +++++++++++++ .../editing/serializers/create_markup_options.h | 63 ++++++++++++++++++++++ .../core/editing/serializers/html_interchange.h | 5 -- .../core/editing/serializers/serialization.cc | 47 ++++++---------- .../core/editing/serializers/serialization.h | 13 ++--- .../serializers/styled_markup_accumulator.cc | 11 ++-- .../serializers/styled_markup_accumulator.h | 12 ++--- .../serializers/styled_markup_serializer.cc | 12 ++--- .../editing/serializers/styled_markup_serializer.h | 13 ++--- .../renderer/core/frame/web_local_frame_impl.cc | 14 ++--- 13 files changed, 156 insertions(+), 87 deletions(-) create mode 100644 chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.cc create mode 100644 chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.h diff --git a/chromium/third_party/blink/renderer/core/editing/BUILD.gn b/chromium/third_party/blink/renderer/core/editing/BUILD.gn index b9cd43556be..2333ee4509d 100644 --- a/chromium/third_party/blink/renderer/core/editing/BUILD.gn +++ b/chromium/third_party/blink/renderer/core/editing/BUILD.gn @@ -251,6 +251,8 @@ blink_core_sources("editing") { "selection_template.cc", "selection_template.h", "selection_type.h", + "serializers/create_markup_options.cc", + "serializers/create_markup_options.h", "serializers/html_interchange.cc", "serializers/html_interchange.h", "serializers/markup_accumulator.cc", diff --git a/chromium/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc b/chromium/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc index 9a51fcdf019..6445d99978b 100644 --- a/chromium/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc +++ b/chromium/third_party/blink/renderer/core/editing/commands/composite_edit_command.cc @@ -1500,9 +1500,10 @@ void CompositeEditCommand::MoveParagraphs( GetDocument(), CreateMarkup(start.ParentAnchoredEquivalent(), end.ParentAnchoredEquivalent(), - kDoNotAnnotateForInterchange, - ConvertBlocksToInlines::kConvert, - kDoNotResolveURLs, constraining_ancestor), + CreateMarkupOptions::Builder() + .SetShouldConvertBlocksToInlines(true) + .SetConstrainingAncestor(constraining_ancestor) + .Build()), "", kDisallowScriptingAndPluginContent) : nullptr; diff --git a/chromium/third_party/blink/renderer/core/editing/frame_selection.cc b/chromium/third_party/blink/renderer/core/editing/frame_selection.cc index 8567849e845..e9519303e62 100644 --- a/chromium/third_party/blink/renderer/core/editing/frame_selection.cc +++ b/chromium/third_party/blink/renderer/core/editing/frame_selection.cc @@ -944,9 +944,11 @@ static String ExtractSelectedText(const FrameSelection& selection, String FrameSelection::SelectedHTMLForClipboard() const { const EphemeralRangeInFlatTree& range = ComputeRangeForSerialization(GetSelectionInDOMTree()); - return CreateMarkup( - range.StartPosition(), range.EndPosition(), kAnnotateForInterchange, - ConvertBlocksToInlines::kNotConvert, kResolveNonLocalURLs); + return CreateMarkup(range.StartPosition(), range.EndPosition(), + CreateMarkupOptions::Builder() + .SetShouldAnnotateForInterchange(true) + .SetShouldResolveURLs(kResolveNonLocalURLs) + .Build()); } String FrameSelection::SelectedText( diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.cc b/chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.cc new file mode 100644 index 00000000000..d726657e2aa --- /dev/null +++ b/chromium/third_party/blink/renderer/core/editing/serializers/create_markup_options.cc @@ -0,0 +1,36 @@ +// 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. + +#include "third_party/blink/renderer/core/editing/serializers/create_markup_options.h" + +namespace blink { + +CreateMarkupOptions::Builder& +CreateMarkupOptions::Builder::SetConstrainingAncestor(const Node* node) { + data_.constraining_ancestor_ = node; + return *this; +} + +CreateMarkupOptions::Builder& +CreateMarkupOptions::Builder::SetShouldResolveURLs( + AbsoluteURLs should_resolve_urls) { + data_.should_resolve_urls_ = should_resolve_urls; + return *this; +} + +CreateMarkupOptions::Builder& +CreateMarkupOptions::Builder::SetShouldAnnotateForInterchange( + bool annotate_for_interchange) { + data_.should_annotate_for_interchange_ = annotate_for_interchange; + return *this; +} + +CreateMarkupOptions::Builder& +CreateMarkupOptions::Builder::SetShouldConvertBlocksToInlines( + bool convert_blocks_to_inlines) { + data_.should_convert_blocks_to_inlines_ = convert_blocks_to_inlines; + return *this; +} + +} // namespace blink 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 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_ + diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/html_interchange.h b/chromium/third_party/blink/renderer/core/editing/serializers/html_interchange.h index 706ea62320d..bdc114e8736 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/html_interchange.h +++ b/chromium/third_party/blink/renderer/core/editing/serializers/html_interchange.h @@ -34,11 +34,6 @@ class Text; #define AppleInterchangeNewline "Apple-interchange-newline" -enum AnnotateForInterchange { - kDoNotAnnotateForInterchange, - kAnnotateForInterchange -}; - String ConvertHTMLTextToInterchangeFormat(const String&, const Text&); } // namespace blink diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/serialization.cc b/chromium/third_party/blink/renderer/core/editing/serializers/serialization.cc index 7810ae7f6ac..19603ed22c5 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/serialization.cc +++ b/chromium/third_party/blink/renderer/core/editing/serializers/serialization.cc @@ -172,8 +172,7 @@ template static HTMLElement* HighestAncestorToWrapMarkup( const PositionTemplate& start_position, const PositionTemplate& end_position, - AnnotateForInterchange should_annotate, - Node* constraining_ancestor) { + const CreateMarkupOptions& options) { Node* first_node = start_position.NodeAsRangeFirstNode(); // For compatibility reason, we use container node of start and end // positions rather than first node and last node in selection. @@ -182,7 +181,7 @@ static HTMLElement* HighestAncestorToWrapMarkup( *end_position.ComputeContainerNode()); DCHECK(common_ancestor); HTMLElement* special_common_ancestor = nullptr; - if (should_annotate == kAnnotateForInterchange) { + if (options.ShouldAnnotateForInterchange()) { // Include ancestors that aren't completely inside the range but are // required to retain the structure and appearance of the copied markup. special_common_ancestor = @@ -223,9 +222,12 @@ static HTMLElement* HighestAncestorToWrapMarkup( // Ex:

is an ill-formed html and we don't want to return // as the ancestor because paragraph element is the enclosing block of the // start and end positions provided to this API. - constraining_ancestor = constraining_ancestor - ? constraining_ancestor - : EnclosingBlock(check_ancestor); + // TODO(editing-dev): Make |HighestEnclosingNodeOfType| take const pointer + // to remove the |const_cast| below. + Node* constraining_ancestor = + options.ConstrainingAncestor() + ? const_cast(options.ConstrainingAncestor()) + : EnclosingBlock(check_ancestor); auto* new_special_common_ancestor = To(HighestEnclosingNodeOfType( Position::FirstPositionInNode(*check_ancestor), @@ -264,10 +266,7 @@ class CreateMarkupAlgorithm { static String CreateMarkup( const PositionTemplate& start_position, const PositionTemplate& end_position, - AnnotateForInterchange should_annotate = kDoNotAnnotateForInterchange, - ConvertBlocksToInlines = ConvertBlocksToInlines::kNotConvert, - AbsoluteURLs should_resolve_urls = kDoNotResolveURLs, - Node* constraining_ancestor = nullptr); + const CreateMarkupOptions& options = CreateMarkupOptions()); }; // FIXME: Shouldn't we omit style info when annotate == @@ -278,10 +277,7 @@ template String CreateMarkupAlgorithm::CreateMarkup( const PositionTemplate& start_position, const PositionTemplate& end_position, - AnnotateForInterchange should_annotate, - ConvertBlocksToInlines convert_blocks_to_inlines, - AbsoluteURLs should_resolve_urls, - Node* constraining_ancestor) { + const CreateMarkupOptions& options) { if (start_position.IsNull() || end_position.IsNull()) return g_empty_string; @@ -303,33 +299,24 @@ String CreateMarkupAlgorithm::CreateMarkup( document->Lifecycle()); HTMLElement* special_common_ancestor = HighestAncestorToWrapMarkup( - start_position, end_position, should_annotate, constraining_ancestor); - StyledMarkupSerializer serializer( - should_resolve_urls, should_annotate, start_position, end_position, - special_common_ancestor, convert_blocks_to_inlines); + start_position, end_position, options); + StyledMarkupSerializer serializer(start_position, end_position, + special_common_ancestor, options); return serializer.CreateMarkup(); } String CreateMarkup(const Position& start_position, const Position& end_position, - AnnotateForInterchange should_annotate, - ConvertBlocksToInlines convert_blocks_to_inlines, - AbsoluteURLs should_resolve_urls, - Node* constraining_ancestor) { + const CreateMarkupOptions& options) { return CreateMarkupAlgorithm::CreateMarkup( - start_position, end_position, should_annotate, convert_blocks_to_inlines, - should_resolve_urls, constraining_ancestor); + start_position, end_position, options); } String CreateMarkup(const PositionInFlatTree& start_position, const PositionInFlatTree& end_position, - AnnotateForInterchange should_annotate, - ConvertBlocksToInlines convert_blocks_to_inlines, - AbsoluteURLs should_resolve_urls, - Node* constraining_ancestor) { + const CreateMarkupOptions& options) { return CreateMarkupAlgorithm::CreateMarkup( - start_position, end_position, should_annotate, convert_blocks_to_inlines, - should_resolve_urls, constraining_ancestor); + start_position, end_position, options); } DocumentFragment* CreateFragmentFromMarkup( diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/serialization.h b/chromium/third_party/blink/renderer/core/editing/serializers/serialization.h index 91ca65e0ac3..17d89c57aec 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/serialization.h +++ b/chromium/third_party/blink/renderer/core/editing/serializers/serialization.h @@ -30,6 +30,7 @@ #include "third_party/blink/renderer/core/css/css_property_names.h" #include "third_party/blink/renderer/core/dom/parser_content_policy.h" #include "third_party/blink/renderer/core/editing/forward.h" +#include "third_party/blink/renderer/core/editing/serializers/create_markup_options.h" #include "third_party/blink/renderer/core/editing/serializers/html_interchange.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/wtf/forward.h" @@ -45,8 +46,6 @@ class Node; class CSSPropertyValueSet; enum ChildrenOnly { kIncludeNode, kChildrenOnly }; -enum AbsoluteURLs { kDoNotResolveURLs, kResolveAllURLs, kResolveNonLocalURLs }; -enum class ConvertBlocksToInlines { kNotConvert, kConvert }; DocumentFragment* CreateFragmentFromText(const EphemeralRange& context, const String& text); @@ -91,17 +90,11 @@ CORE_EXPORT String CreateMarkup(const Node*, CORE_EXPORT String CreateMarkup(const Position& start, const Position& end, - AnnotateForInterchange = kDoNotAnnotateForInterchange, - ConvertBlocksToInlines = ConvertBlocksToInlines::kNotConvert, - AbsoluteURLs = kDoNotResolveURLs, - Node* constraining_ancestor = nullptr); + const CreateMarkupOptions& options = CreateMarkupOptions()); CORE_EXPORT String CreateMarkup(const PositionInFlatTree& start, const PositionInFlatTree& end, - AnnotateForInterchange = kDoNotAnnotateForInterchange, - ConvertBlocksToInlines = ConvertBlocksToInlines::kNotConvert, - AbsoluteURLs = kDoNotResolveURLs, - Node* constraining_ancestor = nullptr); + const CreateMarkupOptions& options = CreateMarkupOptions()); void MergeWithNextTextNode(Text*, ExceptionState&); diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.cc b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.cc index 14b776f23b1..f4ae1049bf1 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.cc +++ b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.cc @@ -52,20 +52,17 @@ wtf_size_t TotalLength(const Vector& strings) { using namespace html_names; StyledMarkupAccumulator::StyledMarkupAccumulator( - AbsoluteURLs should_resolve_urls, const TextOffset& start, const TextOffset& end, Document* document, - AnnotateForInterchange should_annotate, - ConvertBlocksToInlines convert_blocks_to_inlines) - : formatter_(should_resolve_urls, + const CreateMarkupOptions& options) + : formatter_(options.ShouldResolveURLs(), document->IsHTMLDocument() ? SerializationType::kHTML : SerializationType::kXML), start_(start), end_(end), document_(document), - should_annotate_(should_annotate), - convert_blocks_to_inlines_(convert_blocks_to_inlines) {} + options_(options) {} void StyledMarkupAccumulator::AppendEndTag(const Element& element) { AppendEndMarkup(result_, element); @@ -240,7 +237,7 @@ String StyledMarkupAccumulator::StringValueForRange(const Text& node) { } bool StyledMarkupAccumulator::ShouldAnnotate() const { - return should_annotate_ == kAnnotateForInterchange; + return options_.ShouldAnnotateForInterchange(); } void StyledMarkupAccumulator::PushMarkup(const String& str) { diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.h b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.h index d439673fa74..3632bcfbe28 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.h +++ b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.h @@ -32,6 +32,7 @@ #include "base/macros.h" #include "third_party/blink/renderer/core/editing/editing_style.h" +#include "third_party/blink/renderer/core/editing/serializers/create_markup_options.h" #include "third_party/blink/renderer/core/editing/serializers/markup_formatter.h" #include "third_party/blink/renderer/core/editing/serializers/text_offset.h" #include "third_party/blink/renderer/platform/wtf/forward.h" @@ -46,12 +47,10 @@ class StyledMarkupAccumulator final { STACK_ALLOCATED(); public: - StyledMarkupAccumulator(AbsoluteURLs, - const TextOffset& start, + StyledMarkupAccumulator(const TextOffset& start, const TextOffset& end, Document*, - AnnotateForInterchange, - ConvertBlocksToInlines); + const CreateMarkupOptions& options); void AppendEndTag(const Element&); void AppendInterchangeNewline(); @@ -75,7 +74,7 @@ class StyledMarkupAccumulator final { bool ShouldAnnotate() const; bool ShouldConvertBlocksToInlines() const { - return convert_blocks_to_inlines_ == ConvertBlocksToInlines::kConvert; + return options_.ShouldConvertBlocksToInlines(); } private: @@ -91,10 +90,9 @@ class StyledMarkupAccumulator final { const TextOffset start_; const TextOffset end_; const Member document_; - const AnnotateForInterchange should_annotate_; + const CreateMarkupOptions options_; StringBuilder result_; Vector reversed_preceding_markup_; - const ConvertBlocksToInlines convert_blocks_to_inlines_; DISALLOW_COPY_AND_ASSIGN(StyledMarkupAccumulator); }; diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc index 43c63a99348..f7106a6a7c8 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc +++ b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.cc @@ -121,18 +121,14 @@ bool StyledMarkupTraverser::ShouldConvertBlocksToInlines() const { template StyledMarkupSerializer::StyledMarkupSerializer( - AbsoluteURLs should_resolve_urls, - AnnotateForInterchange should_annotate, const PositionTemplate& start, const PositionTemplate& end, Node* highest_node_to_be_serialized, - ConvertBlocksToInlines convert_blocks_to_inlines) + const CreateMarkupOptions& options) : start_(start), end_(end), - should_resolve_urls_(should_resolve_urls), - should_annotate_(should_annotate), highest_node_to_be_serialized_(highest_node_to_be_serialized), - convert_blocks_to_inlines_(convert_blocks_to_inlines), + options_(options), last_closed_(highest_node_to_be_serialized) {} template @@ -181,9 +177,9 @@ static EditingStyle* StyleFromMatchedRulesAndInlineDecl( template String StyledMarkupSerializer::CreateMarkup() { StyledMarkupAccumulator markup_accumulator( - should_resolve_urls_, ToTextOffset(start_.ParentAnchoredEquivalent()), + ToTextOffset(start_.ParentAnchoredEquivalent()), ToTextOffset(end_.ParentAnchoredEquivalent()), start_.GetDocument(), - should_annotate_, convert_blocks_to_inlines_); + options_); Node* past_end = end_.NodeAsRangePastLastNode(); diff --git a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.h b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.h index 65ff4e9a85b..3021ab7160b 100644 --- a/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.h +++ b/chromium/third_party/blink/renderer/core/editing/serializers/styled_markup_serializer.h @@ -33,6 +33,7 @@ #include "third_party/blink/renderer/core/dom/node_traversal.h" #include "third_party/blink/renderer/core/editing/editing_strategy.h" #include "third_party/blink/renderer/core/editing/editing_style.h" +#include "third_party/blink/renderer/core/editing/serializers/create_markup_options.h" #include "third_party/blink/renderer/core/editing/position.h" #include "third_party/blink/renderer/core/editing/serializers/styled_markup_accumulator.h" #include "third_party/blink/renderer/platform/wtf/forward.h" @@ -44,26 +45,22 @@ class StyledMarkupSerializer final { STACK_ALLOCATED(); public: - StyledMarkupSerializer(AbsoluteURLs, - AnnotateForInterchange, - const PositionTemplate& start, + StyledMarkupSerializer(const PositionTemplate& start, const PositionTemplate& end, Node* highest_node_to_be_serialized, - ConvertBlocksToInlines); + const CreateMarkupOptions& options); String CreateMarkup(); private: bool ShouldAnnotate() const { - return should_annotate_ == kAnnotateForInterchange; + return options_.ShouldAnnotateForInterchange(); } const PositionTemplate start_; const PositionTemplate end_; - const AbsoluteURLs should_resolve_urls_; - const AnnotateForInterchange should_annotate_; const Member highest_node_to_be_serialized_; - const ConvertBlocksToInlines convert_blocks_to_inlines_; + const CreateMarkupOptions options_; Member last_closed_; Member wrapping_style_; }; diff --git a/chromium/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/chromium/third_party/blink/renderer/core/frame/web_local_frame_impl.cc index befb059483c..be174d24a7b 100644 --- a/chromium/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/chromium/third_party/blink/renderer/core/frame/web_local_frame_impl.cc @@ -2486,14 +2486,16 @@ static String CreateMarkupInRect(LocalFrame* frame, if (!start_position.GetDocument() || !end_position.GetDocument()) return String(); + const CreateMarkupOptions create_markup_options = + CreateMarkupOptions::Builder() + .SetShouldAnnotateForInterchange(true) + .SetShouldResolveURLs(kResolveNonLocalURLs) + .Build(); + if (start_position.CompareTo(end_position) <= 0) { - return CreateMarkup(start_position, end_position, kAnnotateForInterchange, - ConvertBlocksToInlines::kNotConvert, - kResolveNonLocalURLs); + return CreateMarkup(start_position, end_position, create_markup_options); } - return CreateMarkup(end_position, start_position, kAnnotateForInterchange, - ConvertBlocksToInlines::kNotConvert, - kResolveNonLocalURLs); + return CreateMarkup(end_position, start_position, create_markup_options); } void WebLocalFrameImpl::AdvanceFocusInForm(WebFocusType focus_type) { -- cgit v1.2.1