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

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

Issue 2655783006: Top down version of algorithm to position margins and floats in LayoutNG (Closed)
Patch Set: git rebase-update Created 3 years, 11 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_constraint_space.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
index 4ca9cf165a2e107f1e847f58231decc444f8561e..bcd642608ef7d6deea5d4833c20e350d942e7ab5 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc
@@ -24,6 +24,8 @@ NGConstraintSpace::NGConstraintSpace(
bool is_block_direction_triggers_scrollbar,
NGFragmentationType block_direction_fragmentation_type,
bool is_new_fc,
+ const NGMarginStrut& margin_strut,
+ const NGLogicalOffset& bfc_offset,
const std::shared_ptr<NGExclusions>& exclusions)
: available_size_(available_size),
percentage_resolution_size_(percentage_resolution_size),
@@ -39,6 +41,8 @@ NGConstraintSpace::NGConstraintSpace(
is_new_fc_(is_new_fc),
writing_mode_(writing_mode),
direction_(static_cast<unsigned>(direction)),
+ margin_strut_(margin_strut),
+ bfc_offset_(bfc_offset),
exclusions_(exclusions) {}
NGConstraintSpace* NGConstraintSpace::CreateFromLayoutObject(
@@ -104,18 +108,19 @@ void NGConstraintSpace::Subtract(const NGBoxFragment*) {
}
NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities(
- unsigned clear,
- bool for_inline_or_bfc) {
- NGLayoutOpportunityIterator* iterator = new NGLayoutOpportunityIterator(this);
+ const WTF::Optional<NGLogicalOffset>& opt_origin_point) {
+ NGLayoutOpportunityIterator* iterator =
+ new NGLayoutOpportunityIterator(this, opt_origin_point);
return iterator;
}
String NGConstraintSpace::ToString() const {
- return String::format("%s,%s %sx%s",
- offset_.inline_offset.toString().ascii().data(),
- offset_.block_offset.toString().ascii().data(),
+ return String::format("Offset: %s,%s Size: %sx%s MarginStrut: %s",
+ bfc_offset_.inline_offset.toString().ascii().data(),
+ bfc_offset_.block_offset.toString().ascii().data(),
AvailableSize().inline_size.toString().ascii().data(),
- AvailableSize().block_size.toString().ascii().data());
+ AvailableSize().block_size.toString().ascii().data(),
+ margin_strut_.ToString().ascii().data());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698