| 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 f6d8df4957542e60f134642ad4869cb670e9d01f..655a73a0c0e94530aa7acdd99663e469b6a13f18 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -1846,6 +1846,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()) {
|
| @@ -1856,8 +1874,9 @@ void FrameView::layoutOrthogonalWritingModeRoots()
|
| || !root->styleRef().logicalHeight().isIntrinsicOrAuto()) {
|
| continue;
|
| }
|
| - LayoutState layoutState(*root);
|
| - root->layout();
|
| +
|
| + removeFloatingObjectsForSubtreeRoot(*root);
|
| + layoutFromRootObject(*root);
|
| }
|
| }
|
|
|
|
|