Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
index d2962edc0d73796563384574b7fe9ea6cdbc18ac..fcc1246a0b48a318a7352c8280609cdca0e19792 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
@@ -6,6 +6,7 @@ |
#define NGBlockLayoutAlgorithm_h |
#include "core/CoreExport.h" |
+#include "core/layout/ng/ng_block_layout_child_iterator.h" |
#include "core/layout/ng/ng_block_node.h" |
#include "core/layout/ng/ng_break_token.h" |
#include "core/layout/ng/ng_column_mapper.h" |
@@ -34,11 +35,9 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm { |
// method to access all the children. |
// @param space The constraint space which the algorithm should generate a |
// fragment within. |
- NGBlockLayoutAlgorithm(LayoutObject* layout_object, |
- PassRefPtr<const ComputedStyle> style, |
- NGLayoutInputNode* first_child, |
+ NGBlockLayoutAlgorithm(NGBlockNode* node, |
NGConstraintSpace* space, |
- NGBreakToken* break_token = nullptr); |
+ NGBlockBreakToken* break_token = nullptr); |
Optional<MinAndMaxContentSizes> ComputeMinAndMaxContentSizes() const override; |
RefPtr<NGPhysicalFragment> Layout() override; |
@@ -61,42 +60,11 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm { |
// due to a fragmentainer break. |
bool ProceedToNextUnfinishedSibling(NGPhysicalFragment* child_fragment); |
- // Set a break token which contains enough information to be able to resume |
- // layout in the next fragmentainer. |
- void SetPendingBreakToken(NGBlockBreakToken*); |
- |
- // Check if we have a pending break token set. Once we have set a pending |
- // break token, we cannot set another one. First we need to abort layout in |
- // the current fragmentainer and resume in the next one. |
- bool HasPendingBreakToken() const; |
- |
// Final adjusstments before fragment creation. We need to prevent the |
// fragment from crossing fragmentainer boundaries, and rather create a break |
// token if we're out of space. |
void FinalizeForFragmentation(); |
- // Return the break token, if any, at which we resumed layout after a |
- // previous break. |
- NGBlockBreakToken* CurrentBlockBreakToken() const; |
- |
- // Return the block offset of the previous break, in the fragmented flow |
- // coordinate space, relatively to the start edge of this block. |
- LayoutUnit PreviousBreakOffset() const; |
- |
- // Return the offset of the potential next break, in the fragmented flow |
- // coordinate space, relatively to the start edge of this block. |
- LayoutUnit NextBreakOffset() const; |
- |
- // Get the amount of block space left in the current fragmentainer for the |
- // child that is about to be laid out. |
- LayoutUnit SpaceAvailableForCurrentChild() const; |
- |
- LayoutUnit BorderEdgeForCurrentChild() const { |
- // TODO(mstensho): Need to take care of margin collapsing somehow. We |
- // should at least attempt to estimate what the top margin is going to be. |
- return content_size_; |
- } |
- |
// Calculates logical offset for the current fragment using either |
// {@code content_size_} when the fragment doesn't know it's offset |
// or {@code known_fragment_offset} if the fragment knows it's offset |
@@ -130,17 +98,15 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm { |
Persistent<NGConstraintSpace> constraint_space_; |
// The break token from which we are currently resuming layout. |
- Persistent<NGBreakToken> break_token_; |
+ Persistent<NGBlockBreakToken> break_token_; |
std::unique_ptr<NGFragmentBuilder> builder_; |
Persistent<NGConstraintSpaceBuilder> space_builder_; |
Persistent<NGConstraintSpace> space_for_current_child_; |
Persistent<NGLayoutInputNode> current_child_; |
+ Persistent<NGBreakToken> current_child_break_token_; |
- // Mapper from the fragmented flow coordinate space coordinates to visual |
- // coordinates. Only set on fragmentation context roots, such as multicol |
- // containers. Keeps track of the current fragmentainer. |
- Persistent<NGColumnMapper> fragmentainer_mapper_; |
+ std::unique_ptr<NGBlockLayoutChildIterator> child_iterator_; |
NGBoxStrut border_and_padding_; |
LayoutUnit content_size_; |