Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| index d0c904e9c63fda921f0c2b284ff6d27d49e23845..7e972405786ba049268e822d5bf98dad21d6c168 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
| @@ -133,12 +133,30 @@ void LayoutBox::willBeDestroyed() |
| if (isOutOfFlowPositioned()) |
| LayoutBlock::removePositionedObject(this); |
| removeFromPercentHeightContainer(); |
| + if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot()) |
| + unmarkOrthogonalWritingModeRoot(); |
| ShapeOutsideInfo::removeInfo(*this); |
| LayoutBoxModelObject::willBeDestroyed(); |
| } |
| +void LayoutBox::insertedIntoTree() |
| +{ |
| + LayoutBoxModelObject::insertedIntoTree(); |
| + |
| + if (isOrthogonalWritingModeRoot()) |
| + markOrthogonalWritingModeRoot(); |
| +} |
| + |
| +void LayoutBox::willBeRemovedFromTree() |
| +{ |
| + if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot()) |
|
leviw_travelin_and_unemployed
2016/02/02 05:03:40
May be worth switching this ordering? I think it's
kojii
2016/02/02 23:32:50
Done.
|
| + unmarkOrthogonalWritingModeRoot(); |
| + |
| + LayoutBoxModelObject::willBeRemovedFromTree(); |
| +} |
| + |
| void LayoutBox::removeFloatingOrPositionedChildFromBlockLists() |
| { |
| ASSERT(isFloatingOrOutOfFlowPositioned()); |
| @@ -223,8 +241,16 @@ void LayoutBox::styleDidChange(StyleDifference diff, const ComputedStyle* oldSty |
| if (needsLayout() && oldStyle) |
| removeFromPercentHeightContainer(); |
| - if (oldHorizontalWritingMode != isHorizontalWritingMode()) |
| + if (oldHorizontalWritingMode != isHorizontalWritingMode()) { |
| + if (parent()) { |
| + if (isOrthogonalWritingModeRoot()) |
| + markOrthogonalWritingModeRoot(); |
| + else |
| + unmarkOrthogonalWritingModeRoot(); |
| + } |
| + |
| clearPercentHeightDescendants(); |
| + } |
| // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the |
| // new zoomed coordinate space. |
| @@ -3934,6 +3960,18 @@ void LayoutBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop |
| layoutScope.setChildNeedsLayout(this); |
| } |
| +void LayoutBox::markOrthogonalWritingModeRoot() |
| +{ |
| + ASSERT(frameView()); |
| + frameView()->addOrthogonalWritingModeRoot(*this); |
| +} |
| + |
| +void LayoutBox::unmarkOrthogonalWritingModeRoot() |
| +{ |
| + ASSERT(frameView()); |
| + frameView()->removeOrthogonalWritingModeRoot(*this); |
| +} |
| + |
| void LayoutBox::addVisualEffectOverflow() |
| { |
| if (!style()->hasVisualOverflowingEffect()) |