Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h

Issue 2739683006: Use Opportunity Iterator to position text fragments in NGLineBuilder (Closed)
Patch Set: add font-family Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
index 9ecf8bd40681e00ec62e8ffdcd4452301ce44125..dc06eca28c9205e637f1135349467647eba88349 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
@@ -10,6 +10,7 @@
#include "platform/heap/Handle.h"
#include "wtf/Optional.h"
#include "wtf/Vector.h"
+#include "wtf/text/StringBuilder.h"
namespace blink {
@@ -23,21 +24,25 @@ class CORE_EXPORT NGLayoutOpportunityIterator final {
//
// @param space Constraint space with exclusions for which this iterator needs
// to generate layout opportunities.
- // @param opt_origin_point Optional origin_point parameter that is used as a
- // default start point for layout opportunities.
+ // @param opt_offset Optional offset parameter that is used as a
+ // default start point for layout opportunities.
// @param opt_leader_point Optional 'leader' parameter that is used to specify
// the ending point of temporary excluded rectangle
// which starts from 'origin'. This rectangle may
// represent a text fragment for example.
NGLayoutOpportunityIterator(
const NGConstraintSpace* space,
- const WTF::Optional<NGLogicalOffset>& opt_origin_point = WTF::nullopt,
+ const WTF::Optional<NGLogicalOffset>& opt_offset = WTF::nullopt,
const WTF::Optional<NGLogicalOffset>& opt_leader_point = WTF::nullopt);
// Gets the next Layout Opportunity or nullptr if the search is exhausted.
// TODO(chrome-layout-team): Refactor with using C++ <iterator> library.
const NGLayoutOpportunity Next();
+ // Offset that specifies the starting point to search layout opportunities.
+ // It's either {@code opt_offset} or space->BfcOffset().
+ NGLogicalOffset Offset() const { return offset_; }
+
#ifndef NDEBUG
// Prints Layout Opportunity tree for debug purposes.
void ShowLayoutOpportunityTree() const;
@@ -59,6 +64,7 @@ class CORE_EXPORT NGLayoutOpportunityIterator final {
NGLayoutOpportunities opportunities_;
NGLayoutOpportunities::const_iterator opportunity_iter_;
Persistent<NGLayoutOpportunityTreeNode> opportunity_tree_root_;
+ NGLogicalOffset offset_;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698