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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.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_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 36fa8435a00b7e9323dd80d6c0fe482687c21cc2..f0d9377e4b8e54835bcb130907b068fa7a3e4c7f 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
@@ -8,7 +8,6 @@
#include "core/CoreExport.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"
#include "core/layout/ng/ng_fragment_builder.h"
#include "core/layout/ng/ng_layout_algorithm.h"
#include "core/layout/ng/ng_units.h"
@@ -22,7 +21,6 @@ class NGConstraintSpace;
class NGConstraintSpaceBuilder;
class NGInlineNode;
class NGLayoutResult;
-class NGPhysicalFragment;
// A class for general block layout (e.g. a <div> with no special style).
// Lays out the children in sequence.
@@ -35,7 +33,7 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
// @param break_token The break token from which the layout should start.
NGBlockLayoutAlgorithm(NGBlockNode* node,
NGConstraintSpace* space,
- NGBreakToken* break_token = nullptr);
+ NGBlockBreakToken* break_token = nullptr);
Optional<MinAndMaxContentSizes> ComputeMinAndMaxContentSizes() const override;
RefPtr<NGLayoutResult> Layout() override;
@@ -51,49 +49,11 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
// Layout inline children.
void LayoutInlineChildren(NGInlineNode*);
- // Proceed to the next sibling that still needs layout.
- //
- // @param child_fragment The newly created fragment for the current child.
- // @return true if we can continue to lay out, or false if we need to abort
- // 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
+ // Final adjustments 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
@@ -128,18 +88,13 @@ 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_;
- // 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_;
-
NGBoxStrut border_and_padding_;
LayoutUnit content_size_;
LayoutUnit max_inline_size_;

Powered by Google App Engine
This is Rietveld 408576698