Index: third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h b/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h |
index 39e9f48b8789f14b0845a150edf281e8ea068fe3..64fac59bc5acdd4d314f5cf1f16bc74d1426e29b 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_break_token.h |
@@ -5,6 +5,7 @@ |
#ifndef NGBlockBreakToken_h |
#define NGBlockBreakToken_h |
+#include "core/CoreExport.h" |
#include "core/layout/ng/ng_break_token.h" |
#include "platform/LayoutUnit.h" |
@@ -13,27 +14,23 @@ namespace blink { |
class NGBlockNode; |
// Represents a break token for a block node. |
-class NGBlockBreakToken : public NGBreakToken { |
+class CORE_EXPORT NGBlockBreakToken : public NGBreakToken { |
public: |
// Creates a break token for a node which did fragment, and can potentially |
// produce more fragments. |
+ // |
+ // The NGBlockBreakToken takes ownership of child_break_tokens, leaving it |
+ // empty for the caller. |
NGBlockBreakToken(NGBlockNode* node, |
LayoutUnit used_block_size, |
- HeapVector<Member<NGBreakToken>>& child_break_tokens) |
- : NGBreakToken(kBlockBreakToken, /* is_finished */ false, node), |
- used_block_size_(used_block_size) { |
- child_break_tokens_.swap(child_break_tokens); |
- } |
+ HeapVector<Member<NGBreakToken>>& child_break_tokens); |
// Creates a break token for a node which cannot produce any more fragments. |
- explicit NGBlockBreakToken(NGBlockNode* node) |
- : NGBreakToken(kBlockBreakToken, /* is_finished */ true, node) {} |
+ explicit NGBlockBreakToken(NGBlockNode* node); |
// TODO(ikilpatrick): Remove this constructor and break_offset once we've |
// switched to new multi-col approach. |
- NGBlockBreakToken(NGBlockNode* node, LayoutUnit break_offset) |
- : NGBreakToken(kBlockBreakToken, false, node), |
- break_offset_(break_offset) {} |
+ NGBlockBreakToken(NGBlockNode* node, LayoutUnit break_offset); |
// Represents the amount of block size used in previous fragments. |
// |
@@ -44,9 +41,12 @@ class NGBlockBreakToken : public NGBreakToken { |
// The break tokens for children of the layout node. |
// |
- // This is used to resume layout of any children which fragmented, it may |
- // contain "finished" break tokens so we know which children to skip for the |
- // next fragment. |
+ // Each child we have visited previously in the block-flow layout algorithm |
+ // has an associated break token. This may be either finished (we should skip |
+ // this child) or unfinished (we should try and produce the next fragment for |
+ // this child). |
+ // |
+ // A child which we haven't visited yet doesn't have a break token here. |
const HeapVector<Member<NGBreakToken>>& ChildBreakTokens() const { |
return child_break_tokens_; |
} |