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 e7dde710055129368066dc36d0f2f12cd54851cf..425b13dc5ca118cd828060ecf37201d3a852c8a7 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -120,12 +120,30 @@ void LayoutBox::willBeDestroyed() |
clearExtraInlineAndBlockOffests(); |
LayoutBlock::removePercentHeightDescendantIfNeeded(this); |
+ if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot()) |
+ unmarkOrthogonalWritingModeRoot(); |
ShapeOutsideInfo::removeInfo(*this); |
LayoutBoxModelObject::willBeDestroyed(); |
} |
+void LayoutBox::insertedIntoTree() |
+{ |
+ LayoutBoxModelObject::insertedIntoTree(); |
+ |
+ if (isOrthogonalWritingModeRoot()) |
+ markOrthogonalWritingModeRoot(); |
+} |
+ |
+void LayoutBox::willBeRemovedFromTree() |
+{ |
+ if (!documentBeingDestroyed() && isOrthogonalWritingModeRoot()) |
+ unmarkOrthogonalWritingModeRoot(); |
+ |
+ LayoutBoxModelObject::willBeRemovedFromTree(); |
+} |
+ |
void LayoutBox::removeFloatingOrPositionedChildFromBlockLists() |
{ |
ASSERT(isFloatingOrOutOfFlowPositioned()); |
@@ -210,9 +228,17 @@ void LayoutBox::styleDidChange(StyleDifference diff, const ComputedStyle* oldSty |
if (needsLayout() && oldStyle) |
LayoutBlock::removePercentHeightDescendantIfNeeded(this); |
- if (LayoutBlock::hasPercentHeightContainerMap() && slowFirstChild() |
- && oldHorizontalWritingMode != isHorizontalWritingMode()) |
- LayoutBlock::clearPercentHeightDescendantsFrom(this); |
+ if (oldHorizontalWritingMode != isHorizontalWritingMode()) { |
+ if (parent()) { |
+ if (isOrthogonalWritingModeRoot()) |
+ markOrthogonalWritingModeRoot(); |
+ else |
+ unmarkOrthogonalWritingModeRoot(); |
+ } |
+ |
+ if (LayoutBlock::hasPercentHeightContainerMap() && slowFirstChild()) |
+ LayoutBlock::clearPercentHeightDescendantsFrom(this); |
+ } |
// If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the |
// new zoomed coordinate space. |
@@ -4214,6 +4240,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()) |