| 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 66f01b8733e6e900ce04f19451113bda96fc6287..8d3fe4e336d60ff9f31969bcd56b465229755373 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -1051,6 +1051,16 @@ void FrameView::performLayout(bool inSubtreeLayout) {
|
|
|
| ScriptForbiddenScope forbidScript;
|
|
|
| + if (inSubtreeLayout && hasOrthogonalWritingModeRoots()) {
|
| + // If we're going to lay out from each subtree root, rather than once from
|
| + // LayoutView, we need to merge the depth-ordered orthogonal writing mode
|
| + // root list into the depth-ordered list of subtrees scheduled for
|
| + // layout. Otherwise, during layout of one such subtree, we'd risk skipping
|
| + // over a subtree of objects needing layout.
|
| + DCHECK(!m_layoutSubtreeRootList.isEmpty());
|
| + scheduleOrthogonalWritingModeRootsForLayout();
|
| + }
|
| +
|
| ASSERT(!isInPerformLayout());
|
| lifecycle().advanceTo(DocumentLifecycle::InPerformLayout);
|
|
|
| @@ -1061,9 +1071,6 @@ void FrameView::performLayout(bool inSubtreeLayout) {
|
|
|
| forceLayoutParentViewIfNeeded();
|
|
|
| - if (hasOrthogonalWritingModeRoots())
|
| - layoutOrthogonalWritingModeRoots();
|
| -
|
| if (inSubtreeLayout) {
|
| if (m_analyzer)
|
| m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects,
|
| @@ -1081,6 +1088,8 @@ void FrameView::performLayout(bool inSubtreeLayout) {
|
| }
|
| m_layoutSubtreeRootList.clear();
|
| } else {
|
| + if (hasOrthogonalWritingModeRoots())
|
| + layoutOrthogonalWritingModeRoots();
|
| layoutFromRootObject(*layoutView());
|
| }
|
|
|
| @@ -2134,17 +2143,28 @@ static inline void removeFloatingObjectsForSubtreeRoot(LayoutObject& root) {
|
| }
|
| }
|
|
|
| +static bool prepareOrthogonalWritingModeRootForLayout(LayoutObject& root) {
|
| + DCHECK(root.isBox() && toLayoutBox(root).isOrthogonalWritingModeRoot());
|
| + if (!root.needsLayout() || root.isOutOfFlowPositioned() ||
|
| + root.isColumnSpanAll() ||
|
| + !root.styleRef().logicalHeight().isIntrinsicOrAuto())
|
| + return false;
|
| +
|
| + removeFloatingObjectsForSubtreeRoot(root);
|
| + return true;
|
| +}
|
| +
|
| 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;
|
| - }
|
| + if (prepareOrthogonalWritingModeRootForLayout(*root))
|
| + layoutFromRootObject(*root);
|
| + }
|
| +}
|
|
|
| - removeFloatingObjectsForSubtreeRoot(*root);
|
| - layoutFromRootObject(*root);
|
| +void FrameView::scheduleOrthogonalWritingModeRootsForLayout() {
|
| + for (auto& root : m_orthogonalWritingModeRootList.ordered()) {
|
| + if (prepareOrthogonalWritingModeRootForLayout(*root))
|
| + m_layoutSubtreeRootList.add(*root);
|
| }
|
| }
|
|
|
|
|