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

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

Issue 2368153003: Compute margin block start for 1st block in LayoutNG root constraint space (Closed)
Patch Set: rename IsNewBfc -> IsNewFormattingContext Created 4 years, 3 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_box.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.cc b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
index 3c9667beefb82b6b1d7eaa7eda8b6b979216f057..c5664492f8c7902d716e90967233c1b5a5c55ec8 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -15,6 +15,14 @@
#include "core/layout/ng/ng_writing_mode.h"
namespace blink {
+namespace {
+// TODO(layout-ng): Add m_isNewFc flag to ComputedStyle and set it from
+// StyleResolver instead of getting it calculated by createsNewFormattingContext
+bool IsNewFormattingContext(const LayoutBox* layout_box) {
+ return layout_box && toLayoutBlock(layout_box)->createsNewFormattingContext();
+}
+} // namespace
+
NGBox::NGBox(LayoutObject* layout_object)
: layout_box_(toLayoutBox(layout_object)) {
DCHECK(layout_box_);
@@ -38,6 +46,8 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space,
NGConstraintSpace* child_constraint_space = new NGConstraintSpace(
FromPlatformWritingMode(Style()->getWritingMode()),
FromPlatformDirection(Style()->direction()), constraint_space);
+ child_constraint_space->SetIsNewFormattingContext(
+ IsNewFormattingContext(layout_box_));
NGPhysicalFragment* fragment = nullptr;
if (!algorithm_->Layout(child_constraint_space, &fragment))

Powered by Google App Engine
This is Rietveld 408576698