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

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

Issue 2025543002: Fix when orthogonal writing mode roots have floating siblings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments as per robhogan review Created 4 years, 3 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/LayoutTests/fast/writing-mode/orthogonal-writing-modes-floats-crash-expected.txt ('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 e106030ac6c138d8d707a6158cfcc99057eddaee..e79f1b3a3a9c57282638f5b2bf3e3eb069b18707 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1857,6 +1857,24 @@ bool FrameView::hasOrthogonalWritingModeRoots() const
return !m_orthogonalWritingModeRootList.isEmpty();
}
+static inline void removeFloatingObjectsForSubtreeRoot(LayoutObject& root)
+{
+ // TODO(kojii): Under certain conditions, moveChildTo() defers
+ // removeFloatingObjects() until the containing block layouts. For
+ // instance, when descendants of the moving child is floating,
+ // removeChildNode() does not clear them. In such cases, at this
+ // point, FloatingObjects may contain old or even deleted objects.
+ // Dealing this in markAllDescendantsWithFloatsForLayout() could
+ // solve, but since that is likely to suffer the performance and
+ // since the containing block of orthogonal writing mode roots
+ // having floats is very rare, prefer to re-create
+ // FloatingObjects.
+ if (LayoutBlock* cb = root.containingBlock()) {
+ if (cb->needsLayout() && cb->isLayoutBlockFlow())
+ toLayoutBlockFlow(cb)->removeFloatingObjects();
+ }
+}
+
void FrameView::layoutOrthogonalWritingModeRoots()
{
for (auto& root : m_orthogonalWritingModeRootList.ordered()) {
@@ -1867,8 +1885,9 @@ void FrameView::layoutOrthogonalWritingModeRoots()
|| !root->styleRef().logicalHeight().isIntrinsicOrAuto()) {
continue;
}
- LayoutState layoutState(*root);
- root->layout();
+
+ removeFloatingObjectsForSubtreeRoot(*root);
+ layoutFromRootObject(*root);
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/writing-mode/orthogonal-writing-modes-floats-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698