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..c843ba12ad1abcfa39198d598d9a4629824422b8 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_isNewBfc flag to ComputedStyle and set it from |
+// StyleResolver instead of getting it calculated by createsNewFormattingContext |
+bool isNewBlockFormattingContext(const LayoutBox* layout_box) { |
ikilpatrick
2016/09/29 00:18:11
I went and read through some of the specs, the bes
cbiesinger
2016/09/29 00:41:28
nit: Shouldn't this function start with an upperca
Gleb Lanbin
2016/09/29 17:11:15
Done.
Gleb Lanbin
2016/09/29 17:11:15
Done.
|
+ 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->SetIsNewBfc( |
+ isNewBlockFormattingContext(layout_box_)); |
NGPhysicalFragment* fragment = nullptr; |
if (!algorithm_->Layout(child_constraint_space, &fragment)) |