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

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

Issue 2267383003: [LayoutNG] Introduces NGPhysicalConstraintSpace and makes NGConstraintSpace a "view". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win compile? Created 4 years, 4 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.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index ee422e03fbca02f669de497b148f67e80cd89f97..5e3fbe4ea3f4c0ceeab9f5c6990403c3fa625b02 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -20,14 +20,14 @@ NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(
: m_style(style), m_boxIterator(box_iterator) {}
NGFragment* NGBlockLayoutAlgorithm::layout(
- const NGConstraintSpace& constraint_space) {
+ const NGConstraintSpace* constraint_space) {
LayoutUnit inline_size =
- computeInlineSizeForFragment(constraint_space, *m_style);
+ computeInlineSizeForFragment(*constraint_space, *m_style);
// TODO(layout-ng): For quirks mode, should we pass blockSize instead of -1?
LayoutUnit block_size =
- computeBlockSizeForFragment(constraint_space, *m_style, LayoutUnit(-1));
- NGConstraintSpace constraint_space_for_children(
- constraint_space, NGLogicalSize(inline_size, block_size));
+ computeBlockSizeForFragment(*constraint_space, *m_style, LayoutUnit(-1));
+ NGConstraintSpace* constraint_space_for_children = new NGConstraintSpace(
+ *constraint_space, NGLogicalSize(inline_size, block_size));
NGFragmentBuilder builder(NGFragmentBase::FragmentBox);
builder.SetInlineSize(inline_size).SetBlockSize(block_size);
@@ -35,7 +35,7 @@ NGFragment* NGBlockLayoutAlgorithm::layout(
LayoutUnit content_size;
for (NGBox box : m_boxIterator) {
NGBoxStrut child_margins =
- computeMargins(constraint_space_for_children, *box.style());
+ computeMargins(*constraint_space_for_children, *box.style());
NGFragment* fragment = box.layout(constraint_space_for_children);
// TODO(layout-ng): Support auto margins
fragment->SetOffset(child_margins.inline_start,
@@ -47,7 +47,8 @@ NGFragment* NGBlockLayoutAlgorithm::layout(
// Recompute the block-axis size now that we know our content size.
block_size =
- computeBlockSizeForFragment(constraint_space, *m_style, content_size);
+ computeBlockSizeForFragment(*constraint_space, *m_style, content_size);
+
// TODO(layout-ng): Compute correct inline overflow (block overflow should be
// correct)
builder.SetBlockSize(block_size)

Powered by Google App Engine
This is Rietveld 408576698