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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 void FrameView::removeOrthogonalWritingModeRoot(LayoutBox& root) 1850 void FrameView::removeOrthogonalWritingModeRoot(LayoutBox& root)
1851 { 1851 {
1852 m_orthogonalWritingModeRootList.remove(root); 1852 m_orthogonalWritingModeRootList.remove(root);
1853 } 1853 }
1854 1854
1855 bool FrameView::hasOrthogonalWritingModeRoots() const 1855 bool FrameView::hasOrthogonalWritingModeRoots() const
1856 { 1856 {
1857 return !m_orthogonalWritingModeRootList.isEmpty(); 1857 return !m_orthogonalWritingModeRootList.isEmpty();
1858 } 1858 }
1859 1859
1860 static inline void removeFloatingObjectsForSubtreeRoot(LayoutObject& root)
1861 {
1862 // TODO(kojii): Under certain conditions, moveChildTo() defers
1863 // removeFloatingObjects() until the containing block layouts. For
1864 // instance, when descendants of the moving child is floating,
1865 // removeChildNode() does not clear them. In such cases, at this
1866 // point, FloatingObjects may contain old or even deleted objects.
1867 // Dealing this in markAllDescendantsWithFloatsForLayout() could
1868 // solve, but since that is likely to suffer the performance and
1869 // since the containing block of orthogonal writing mode roots
1870 // having floats is very rare, prefer to re-create
1871 // FloatingObjects.
1872 if (LayoutBlock* cb = root.containingBlock()) {
1873 if (cb->needsLayout() && cb->isLayoutBlockFlow())
1874 toLayoutBlockFlow(cb)->removeFloatingObjects();
1875 }
1876 }
1877
1860 void FrameView::layoutOrthogonalWritingModeRoots() 1878 void FrameView::layoutOrthogonalWritingModeRoots()
1861 { 1879 {
1862 for (auto& root : m_orthogonalWritingModeRootList.ordered()) { 1880 for (auto& root : m_orthogonalWritingModeRootList.ordered()) {
1863 ASSERT(root->isBox() && toLayoutBox(*root).isOrthogonalWritingModeRoot() ); 1881 ASSERT(root->isBox() && toLayoutBox(*root).isOrthogonalWritingModeRoot() );
1864 if (!root->needsLayout() 1882 if (!root->needsLayout()
1865 || root->isOutOfFlowPositioned() 1883 || root->isOutOfFlowPositioned()
1866 || root->isColumnSpanAll() 1884 || root->isColumnSpanAll()
1867 || !root->styleRef().logicalHeight().isIntrinsicOrAuto()) { 1885 || !root->styleRef().logicalHeight().isIntrinsicOrAuto()) {
1868 continue; 1886 continue;
1869 } 1887 }
1870 LayoutState layoutState(*root); 1888
1871 root->layout(); 1889 removeFloatingObjectsForSubtreeRoot(*root);
1890 layoutFromRootObject(*root);
1872 } 1891 }
1873 } 1892 }
1874 1893
1875 bool FrameView::checkLayoutInvalidationIsAllowed() const 1894 bool FrameView::checkLayoutInvalidationIsAllowed() const
1876 { 1895 {
1877 if (m_allowsLayoutInvalidationAfterLayoutClean) 1896 if (m_allowsLayoutInvalidationAfterLayoutClean)
1878 return true; 1897 return true;
1879 1898
1880 // If we are updating all lifecycle phases beyond LayoutClean, we don't expe ct dirty layout after LayoutClean. 1899 // If we are updating all lifecycle phases beyond LayoutClean, we don't expe ct dirty layout after LayoutClean.
1881 CHECK_FOR_DIRTY_LAYOUT(lifecycle().state() < DocumentLifecycle::LayoutClean) ; 1900 CHECK_FOR_DIRTY_LAYOUT(lifecycle().state() < DocumentLifecycle::LayoutClean) ;
(...skipping 2471 matching lines...) Expand 10 before | Expand all | Expand 10 after
4353 } 4372 }
4354 4373
4355 bool FrameView::canThrottleRendering() const 4374 bool FrameView::canThrottleRendering() const
4356 { 4375 {
4357 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4376 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4358 return false; 4377 return false;
4359 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4378 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4360 } 4379 }
4361 4380
4362 } // namespace blink 4381 } // namespace blink
OLDNEW
« 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