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

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

Issue 2230683003: [LayoutNG] Initial implementation of NGBoxIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: synced to the head 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 56d0fad1e665d019a98e43b8fa0610599e88193c..0579f117a4fef2ab0c5681d0ce6bb25e805189b8 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
@@ -15,8 +15,8 @@ namespace blink {
NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(
PassRefPtr<const ComputedStyle> style,
- NGBox firstChild)
- : m_style(style), m_firstChild(firstChild) {}
+ NGBoxIterator boxIterator)
+ : m_style(style), m_boxIterator(boxIterator) {}
NGFragment* NGBlockLayoutAlgorithm::layout(
const NGConstraintSpace& constraintSpace) {
@@ -24,9 +24,8 @@ NGFragment* NGBlockLayoutAlgorithm::layout(
computeInlineSizeForFragment(constraintSpace, *m_style);
HeapVector<Member<const NGFragmentBase>> childFragments;
-
LayoutUnit contentSize;
- for (NGBox curr = m_firstChild; curr; curr.nextSibling()) {
+ for (NGBox curr = m_boxIterator.first(); curr; m_boxIterator.next()) {
NGFragment* fragment = curr.layout(constraintSpace);
// TODO(layout-ng): Take margins into account
fragment->setOffset(LayoutUnit(), contentSize);

Powered by Google App Engine
This is Rietveld 408576698