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

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

Issue 2635143003: Merge list of orthogonal writing mode roots into depth-ordered layout list. (Closed)
Patch Set: Created 3 years, 11 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 9d353189efb8d043a67ef5c640bd8b363b04f933..28d4deb5bdb9f730452502c8e0fa40560ff7142a 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1035,6 +1035,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);
@@ -1045,9 +1055,6 @@ void FrameView::performLayout(bool inSubtreeLayout) {
forceLayoutParentViewIfNeeded();
- if (hasOrthogonalWritingModeRoots())
- layoutOrthogonalWritingModeRoots();
-
if (inSubtreeLayout) {
if (m_analyzer)
m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects,
@@ -1065,6 +1072,8 @@ void FrameView::performLayout(bool inSubtreeLayout) {
}
m_layoutSubtreeRootList.clear();
} else {
+ if (hasOrthogonalWritingModeRoots())
+ layoutOrthogonalWritingModeRoots();
layoutFromRootObject(*layoutView());
}
@@ -2124,17 +2133,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