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()) |
+ 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()) { |
esprehn
2016/01/31 00:44:56
The only times you go through here without a paren
kojii
2016/01/31 01:12:20
This "if" avoids:
* Mark/unmark twice for when fir
|
+ 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()) |