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

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

Issue 2714803002: [LayoutNG] Allow block-flow layout to be fragmented using new approach. (Closed)
Patch Set: rebase. 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 7e9338c0661019446a9730c120e9c23869808a54..3a82c44d014f0d6b6f2fc774586c3b93dbe407a0 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
@@ -35,6 +35,7 @@ class CORE_EXPORT NGFragmentBuilder final {
NGFragmentBuilder& AddChild(RefPtr<NGLayoutResult>, const NGLogicalOffset&);
NGFragmentBuilder& AddChild(RefPtr<NGPhysicalFragment>,
const NGLogicalOffset&);
+
NGFragmentBuilder& AddFloatingObject(NGFloatingObject*,
const NGLogicalOffset&);
@@ -75,11 +76,15 @@ class CORE_EXPORT NGFragmentBuilder final {
NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*,
const NGStaticPosition&);
- void SetBreakToken(NGBreakToken* token) {
- DCHECK(!break_token_);
- break_token_ = token;
+ // Sets how much of the block size we've used so far for this box.
+ //
+ // This will result in a fragment which has an unfinished break token, which
+ // contains this information.
+ 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;
@@ -109,6 +114,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
@@ -140,6 +147,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_;
@@ -153,8 +165,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