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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1549153002: Fix preferred logical widths of orthogonal writing modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations Created 4 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 unified diff | Download patch
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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout); 827 lifecycle().advanceTo(DocumentLifecycle::InPerformLayout);
828 828
829 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true); 829 TemporaryChange<bool> changeInPerformLayout(m_inPerformLayout, true);
830 830
831 // performLayout is the actual guts of layout(). 831 // performLayout is the actual guts of layout().
832 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions 832 // FIXME: The 300 other lines in layout() probably belong in other helper fu nctions
833 // so that a single human could understand what layout() is actually doing. 833 // so that a single human could understand what layout() is actually doing.
834 834
835 forceLayoutParentViewIfNeeded(); 835 forceLayoutParentViewIfNeeded();
836 836
837 if (hasOrthogonalWritingModeRoots())
838 layoutOrthogonalWritingModeRoots();
839
837 if (inSubtreeLayout) { 840 if (inSubtreeLayout) {
838 if (m_analyzer) 841 if (m_analyzer)
839 m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects , m_layoutSubtreeRootList.size()); 842 m_analyzer->increment(LayoutAnalyzer::PerformLayoutRootLayoutObjects , m_layoutSubtreeRootList.size());
840 while (LayoutObject* root = m_layoutSubtreeRootList.takeDeepestRoot()) { 843 while (LayoutObject* root = m_layoutSubtreeRootList.takeDeepestRoot()) {
841 if (!root->needsLayout()) 844 if (!root->needsLayout())
842 continue; 845 continue;
843 layoutFromRootObject(*root); 846 layoutFromRootObject(*root);
844 847
845 // We need to ensure that we mark up all layoutObjects up to the Lay outView 848 // We need to ensure that we mark up all layoutObjects up to the Lay outView
846 // for paint invalidation. This simplifies our code as we just alway s 849 // for paint invalidation. This simplifies our code as we just alway s
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 void FrameView::clearLayoutSubtreeRoot(const LayoutObject& root) 1692 void FrameView::clearLayoutSubtreeRoot(const LayoutObject& root)
1690 { 1693 {
1691 m_layoutSubtreeRootList.removeRoot(const_cast<LayoutObject&>(root)); 1694 m_layoutSubtreeRootList.removeRoot(const_cast<LayoutObject&>(root));
1692 } 1695 }
1693 1696
1694 void FrameView::clearLayoutSubtreeRootsAndMarkContainingBlocks() 1697 void FrameView::clearLayoutSubtreeRootsAndMarkContainingBlocks()
1695 { 1698 {
1696 m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout(); 1699 m_layoutSubtreeRootList.clearAndMarkContainingBlocksForLayout();
1697 } 1700 }
1698 1701
1702 void FrameView::addOrthogonalWritingModeRoot(LayoutBox& root)
1703 {
1704 m_orthogonalWritingModeRootList.addRoot(root);
1705 }
1706
1707 void FrameView::removeOrthogonalWritingModeRoot(LayoutBox& root)
1708 {
1709 m_orthogonalWritingModeRootList.removeRoot(root);
1710 }
1711
1712 bool FrameView::hasOrthogonalWritingModeRoots() const
1713 {
1714 return !m_orthogonalWritingModeRootList.isEmpty();
1715 }
1716
1717 void FrameView::layoutOrthogonalWritingModeRoots()
1718 {
1719 while (LayoutObject* root = m_orthogonalWritingModeRootList.takeDeepestRoot( )) {
1720 ASSERT(root->isBox() && toLayoutBox(*root).isOrthogonalWritingModeRoot() );
1721 if (!root->needsLayout()
1722 || root->isOutOfFlowPositioned()
1723 || root->isColumnSpanAll()
1724 || !root->styleRef().logicalHeight().isIntrinsicOrAuto()) {
ojan 2016/01/22 02:22:35 If it's any of these last three, maybe we just sho
kojii 2016/01/22 02:33:51 Yeah, thought about it. But then we'll need to che
1725 continue;
1726 }
1727 LayoutState layoutState(*root);
ojan 2016/01/22 02:22:35 I'm not 100% sure creating a LayoutState without d
kojii 2016/01/22 02:33:51 Yeah, wasn't sure either, but reading around and t
1728 root->layout();
1729 }
1730 }
1731
1699 void FrameView::scheduleRelayout() 1732 void FrameView::scheduleRelayout()
1700 { 1733 {
1701 ASSERT(m_frame->view() == this); 1734 ASSERT(m_frame->view() == this);
1702 1735
1703 if (!m_layoutSchedulingEnabled) 1736 if (!m_layoutSchedulingEnabled)
1704 return; 1737 return;
1705 if (!needsLayout()) 1738 if (!needsLayout())
1706 return; 1739 return;
1707 if (!m_frame->document()->shouldScheduleLayout()) 1740 if (!m_frame->document()->shouldScheduleLayout())
1708 return; 1741 return;
(...skipping 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after
4008 return m_hiddenForThrottling && m_crossOriginForThrottling; 4041 return m_hiddenForThrottling && m_crossOriginForThrottling;
4009 } 4042 }
4010 4043
4011 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4044 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4012 { 4045 {
4013 ASSERT(layoutView()); 4046 ASSERT(layoutView());
4014 return *layoutView(); 4047 return *layoutView();
4015 } 4048 }
4016 4049
4017 } // namespace blink 4050 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698