Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index e66941752fb87c3f9fc358e72a487e07dfa68d58..8a7e66da1f8c9261d95d012900c602aefd589e50 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -224,6 +224,7 @@ void FrameView::reset() |
clearFragmentAnchor(); |
m_viewportConstrainedObjects.clear(); |
m_layoutSubtreeRootList.clear(); |
+ m_orthogonalWritingModeRootList.clear(); |
} |
// Call function for each non-throttled frame view in pre tree order. |
@@ -844,10 +845,13 @@ void FrameView::performLayout(bool inSubtreeLayout) |
forceLayoutParentViewIfNeeded(); |
+ if (hasOrthogonalWritingModeRoots()) |
+ layoutOrthogonalWritingModeRoots(); |
+ |
if (inSubtreeLayout) { |
if (m_analyzer) |
m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects, m_layoutSubtreeRootList.size()); |
- while (LayoutObject* root = m_layoutSubtreeRootList.takeDeepestRoot()) { |
+ for (auto& root : m_layoutSubtreeRootList.ordered()) { |
if (!root->needsLayout()) |
continue; |
layoutFromRootObject(*root); |
@@ -858,6 +862,7 @@ void FrameView::performLayout(bool inSubtreeLayout) |
if (LayoutObject* container = root->container()) |
container->setMayNeedPaintInvalidation(); |
} |
+ m_layoutSubtreeRootList.clear(); |
} else { |
layoutFromRootObject(*layoutView()); |
} |
@@ -1728,7 +1733,7 @@ void FrameView::handleLoadCompleted() |
void FrameView::clearLayoutSubtreeRoot(const LayoutObject& root) |
{ |
- m_layoutSubtreeRootList.removeRoot(const_cast<LayoutObject&>(root)); |
+ m_layoutSubtreeRootList.remove(const_cast<LayoutObject&>(root)); |
} |
void FrameView::clearLayoutSubtreeRootsAndMarkContainingBlocks() |
@@ -1736,6 +1741,36 @@ void FrameView::clearLayoutSubtreeRootsAndMarkContainingBlocks() |
m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout(); |
} |
+void FrameView::addOrthogonalWritingModeRoot(LayoutBox& root) |
+{ |
+ m_orthogonalWritingModeRootList.add(root); |
+} |
+ |
+void FrameView::removeOrthogonalWritingModeRoot(LayoutBox& root) |
+{ |
+ m_orthogonalWritingModeRootList.remove(root); |
+} |
+ |
+bool FrameView::hasOrthogonalWritingModeRoots() const |
+{ |
+ return !m_orthogonalWritingModeRootList.isEmpty(); |
+} |
+ |
+void FrameView::layoutOrthogonalWritingModeRoots() |
+{ |
+ for (auto& root : m_orthogonalWritingModeRootList.ordered()) { |
+ ASSERT(root->isBox() && toLayoutBox(*root).isOrthogonalWritingModeRoot()); |
+ if (!root->needsLayout() |
+ || root->isOutOfFlowPositioned() |
+ || root->isColumnSpanAll() |
+ || !root->styleRef().logicalHeight().isIntrinsicOrAuto()) { |
+ continue; |
+ } |
+ LayoutState layoutState(*root); |
+ root->layout(); |
+ } |
+} |
+ |
void FrameView::scheduleRelayout() |
{ |
ASSERT(m_frame->view() == this); |
@@ -1777,7 +1812,7 @@ void FrameView::scheduleRelayoutOfSubtree(LayoutObject* relayoutRoot) |
if (relayoutRoot == layoutView) |
m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout(); |
else |
- m_layoutSubtreeRootList.addRoot(*relayoutRoot); |
+ m_layoutSubtreeRootList.add(*relayoutRoot); |
if (m_layoutSchedulingEnabled) { |
m_hasPendingLayout = true; |