Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2696713002: Merge list of orthogonal writing mode roots into depth-ordered layout list. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698