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

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

Issue 2435803005: Initial implementation of LayoutNG's block layout algorithm for floats. (Closed)
Patch Set: fix PositionFragment's doc, added TODO to fix floats with margins and add more test expectations. Created 4 years, 2 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 479ac4bbef9b4149a9c6499e1c9962553bf355a8..3f98bef5e96caef1e259ee6dc6d577f76b4b2ff6 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
@@ -58,6 +58,26 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
const NGBoxStrut& child_margins,
const NGFragment& fragment);
+ // Calculates position of the in-flow block-level fragment that needs to be
+ // positioned relative to the current fragment that is being built.
+ //
+ // @param fragment Fragment that needs to be placed.
+ // @param child_margins Margins information for the current child fragment.
+ // @param space Constraint space for the block.
+ // @return Position of the fragment in the parent's constraint space.
+ NGLogicalOffset PositionFragment(const NGFragment& fragment,
+ NGBoxStrut child_margins,
+ const NGConstraintSpace& space);
+
+ // Calculates position of the float fragment that needs to be
+ // positioned relative to the current fragment that is being built.
+ //
+ // @param fragment Fragment that needs to be placed.
+ // @param margins Margins information for the fragment.
+ // @return Position of the fragment in the parent's constraint space.
+ NGLogicalOffset PositionFloatFragment(const NGFragment& fragment,
+ NGBoxStrut margins);
+
// Updates block-{start|end} of the currently constructed fragment.
//
// This method is supposed to be called on every child but it only updates
@@ -65,6 +85,9 @@ class CORE_EXPORT NGBlockLayoutAlgorithm : public NGLayoutAlgorithm {
// keeps updating block-end (on every non-zero height child).
void UpdateMarginStrut(const NGMarginStrut& from);
+ // Read-only Getters.
+ const ComputedStyle& Style() const { return *style_; }
+
RefPtr<const ComputedStyle> style_;
Member<NGBox> first_child_;
« no previous file with comments | « third_party/WebKit/Source/core/layout/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698