Commit 2eacf266 authored by cbiesinger's avatar cbiesinger Committed by Commit bot

[layoutng] Make sure to update m_isSelfCollapsing after ng layout

This will otherwise cause assertion failures on many pages.

We could also compute this in ng code during margin collapsing and just set it
on the old object, but I'm not sure that would be worth it.

This and https://codereview.chromium.org/2337763005/ fixes most (but not all)
of the assertion failures during legacy/ng interop.

R=ikilpatrick@chromium.org,eae@chromium.org,glebl@chromium.org
BUG=635619

Review-Url: https://codereview.chromium.org/2340113003
Cr-Commit-Position: refs/heads/master@{#418703}
parent aaf2accb
...@@ -412,7 +412,7 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren) ...@@ -412,7 +412,7 @@ void LayoutBlockFlow::layoutBlock(bool relayoutChildren)
positionDialog(); positionDialog();
clearNeedsLayout(); clearNeedsLayout();
m_isSelfCollapsing = checkIfIsSelfCollapsingBlock(); updateIsSelfCollapsing();
} }
DISABLE_CFI_PERF DISABLE_CFI_PERF
......
...@@ -301,6 +301,10 @@ public: ...@@ -301,6 +301,10 @@ public:
bool hasOverhangingFloats() const { return parent() && containsFloats() && lowestFloatLogicalBottom() > logicalHeight(); } bool hasOverhangingFloats() const { return parent() && containsFloats() && lowestFloatLogicalBottom() > logicalHeight(); }
bool isOverhangingFloat(const FloatingObject& floatObject) const { return logicalBottomForFloat(floatObject) > logicalHeight(); } bool isOverhangingFloat(const FloatingObject& floatObject) const { return logicalBottomForFloat(floatObject) > logicalHeight(); }
// This function is only public so we can call it from NGBox while we're
// still working on LayoutNG.
void updateIsSelfCollapsing() { m_isSelfCollapsing = checkIfIsSelfCollapsingBlock(); }
#ifndef NDEBUG #ifndef NDEBUG
void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr) const; void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr) const;
#endif #endif
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "core/layout/ng/ng_box.h" #include "core/layout/ng/ng_box.h"
#include "core/layout/LayoutBlockFlow.h"
#include "core/layout/ng/layout_ng_block_flow.h" #include "core/layout/ng/layout_ng_block_flow.h"
#include "core/layout/ng/ng_block_layout_algorithm.h" #include "core/layout/ng/ng_block_layout_algorithm.h"
#include "core/layout/ng/ng_constraint_space.h" #include "core/layout/ng/ng_constraint_space.h"
...@@ -63,6 +64,9 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space, ...@@ -63,6 +64,9 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space,
if (layout_box_->isLayoutBlock()) if (layout_box_->isLayoutBlock())
toLayoutBlock(layout_box_)->layoutPositionedObjects(true); toLayoutBlock(layout_box_)->layoutPositionedObjects(true);
layout_box_->clearNeedsLayout(); layout_box_->clearNeedsLayout();
if (layout_box_->isLayoutBlockFlow()) {
toLayoutBlockFlow(layout_box_)->updateIsSelfCollapsing();
}
} }
} else { } else {
DCHECK(layout_box_); DCHECK(layout_box_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment