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

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

Issue 2679343002: Fragment that establishes new BFC knows it's BFC offset in parent space (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
index 141a3d5da6ec335c285ef58a3e7ed52f6105582a..949178e1af96c65a9aee083be486ab5fb6e4f695 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space_builder.cc
@@ -117,11 +117,18 @@ NGConstraintSpaceBuilder& NGConstraintSpaceBuilder::SetWritingMode(
}
NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
+ // Exclusions do not pass the formatting context boundary.
+ std::shared_ptr<NGExclusions> exclusions(
+ is_new_fc_ ? std::make_shared<NGExclusions>() : exclusions_);
+
// Whether the child and the containing block are parallel to each other.
// Example: vertical-rl and vertical-lr
bool is_in_parallel_flow = (parent_writing_mode_ == kHorizontalTopBottom) ==
(writing_mode_ == kHorizontalTopBottom);
+ NGLogicalOffset bfc_offset = is_new_fc_ ? NGLogicalOffset() : bfc_offset_;
+ NGMarginStrut margin_strut = is_new_fc_ ? NGMarginStrut() : margin_strut_;
+
if (is_in_parallel_flow) {
return new NGConstraintSpace(
static_cast<NGWritingMode>(writing_mode_),
@@ -134,7 +141,7 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
is_inline_direction_triggers_scrollbar_,
is_block_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_,
- margin_strut_, bfc_offset_, exclusions_);
+ margin_strut, bfc_offset, exclusions);
}
return new NGConstraintSpace(
@@ -148,7 +155,7 @@ NGConstraintSpace* NGConstraintSpaceBuilder::ToConstraintSpace() {
is_block_direction_triggers_scrollbar_,
is_inline_direction_triggers_scrollbar_,
static_cast<NGFragmentationType>(fragmentation_type_), is_new_fc_,
- margin_strut_, bfc_offset_, exclusions_);
+ margin_strut, bfc_offset, exclusions);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698