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

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

Issue 2693193002: [LayoutNG] A different approach to multi-col. (Closed)
Patch Set: Created 3 years, 10 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_fragment_builder.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
index 5bffa4f0f5b99bb6dcf791bd159c3ce0821a4753..1e04915a210a8a9d09d599425cc17b6f3b772e2c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
@@ -19,7 +19,7 @@ class NGPhysicalTextFragment;
class CORE_EXPORT NGFragmentBuilder final {
public:
- NGFragmentBuilder(NGPhysicalFragment::NGFragmentType, LayoutObject*);
+ NGFragmentBuilder(NGPhysicalFragment::NGFragmentType, NGLayoutInputNode*);
using WeakBoxList = PersistentHeapLinkedHashSet<WeakMember<NGBlockNode>>;
@@ -35,6 +35,7 @@ class CORE_EXPORT NGFragmentBuilder final {
NGFragmentBuilder& AddChild(RefPtr<NGPhysicalFragment>,
const NGLogicalOffset&);
+
NGFragmentBuilder& AddFloatingObject(NGFloatingObject*,
const NGLogicalOffset&);
@@ -75,11 +76,11 @@ class CORE_EXPORT NGFragmentBuilder final {
NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*,
const NGStaticPosition&);
- void SetBreakToken(NGBreakToken* token) {
- DCHECK(!break_token_);
- break_token_ = token;
+ NGFragmentBuilder& SetUsedBlockSize(LayoutUnit used_block_size) {
+ used_block_size_ = used_block_size;
+ did_break_ = true;
+ return *this;
}
- bool HasBreakToken() const { return break_token_; }
NGFragmentBuilder& SetEndMarginStrut(const NGMarginStrut& from) {
end_margin_strut_ = from;
@@ -110,6 +111,8 @@ class CORE_EXPORT NGFragmentBuilder final {
return bfc_offset_;
}
+ bool DidBreak() const { return did_break_; }
+
private:
// Out-of-flow descendant placement information.
// The generated fragment must compute NGStaticPosition for all
@@ -133,7 +136,7 @@ class CORE_EXPORT NGFragmentBuilder final {
NGWritingMode writing_mode_;
TextDirection direction_;
- LayoutObject* layout_object_;
+ Persistent<NGLayoutInputNode> node_;
NGLogicalSize size_;
NGLogicalSize overflow_;
@@ -141,6 +144,11 @@ class CORE_EXPORT NGFragmentBuilder final {
Vector<RefPtr<NGPhysicalFragment>> children_;
Vector<NGLogicalOffset> offsets_;
+ bool did_break_;
+ LayoutUnit used_block_size_;
+
+ Persistent<HeapVector<Member<NGBreakToken>>> child_break_tokens_;
+
WeakBoxList out_of_flow_descendant_candidates_;
Vector<OutOfFlowPlacement> out_of_flow_candidate_placements_;
@@ -154,8 +162,6 @@ class CORE_EXPORT NGFragmentBuilder final {
Vector<NGLogicalOffset> floating_object_offsets_;
Vector<Persistent<NGFloatingObject>> positioned_floats_;
- Persistent<NGBreakToken> break_token_;
-
WTF::Optional<NGLogicalOffset> bfc_offset_;
NGMarginStrut end_margin_strut_;
};

Powered by Google App Engine
This is Rietveld 408576698