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

Side by Side Diff: third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.cpp

Issue 1420713003: Deduct pagination struts when calculating initial column height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 5 years, 1 month 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/Source/core/layout/MultiColumnFragmentainerGroup.h ('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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "core/layout/MultiColumnFragmentainerGroup.h" 7 #include "core/layout/MultiColumnFragmentainerGroup.h"
8 8
9 #include "core/layout/ColumnBalancer.h" 9 #include "core/layout/ColumnBalancer.h"
10 #include "core/layout/LayoutMultiColumnSet.h" 10 #include "core/layout/LayoutMultiColumnSet.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 void MultiColumnFragmentainerGroup::resetColumnHeight() 50 void MultiColumnFragmentainerGroup::resetColumnHeight()
51 { 51 {
52 // Nuke previously stored minimum column height. Contents may have changed f or all we know. 52 // Nuke previously stored minimum column height. Contents may have changed f or all we know.
53 m_minimumColumnHeight = 0; 53 m_minimumColumnHeight = 0;
54 54
55 m_maxColumnHeight = calculateMaxColumnHeight(); 55 m_maxColumnHeight = calculateMaxColumnHeight();
56 56
57 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread( ); 57 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread( );
58 LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlow Thread(); 58 if (heightIsAuto()) {
59 if (enclosingFlowThread && enclosingFlowThread->isPageLogicalHeightKnown()) { 59 LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosing FlowThread();
60 // TODO(mstensho): Do this better. If height is auto here, we shouldn't set a 60 if (enclosingFlowThread && enclosingFlowThread->isPageLogicalHeightKnown ()) {
61 // height, or forced breaks and pagination struts might mess up column b alancing. 61 // Even if height is auto, we set an initial height, in order to tel l how much content
62 LayoutUnit columnHeight = heightIsAuto() ? m_maxColumnHeight : heightAdj ustedForRowOffset(flowThread->columnHeightAvailable()); 62 // this MultiColumnFragmentainerGroup can hold, and when we need to append a new one.
63 setAndConstrainColumnHeight(columnHeight); 63 m_columnHeight = m_maxColumnHeight;
64 } else if (heightIsAuto()) { 64 } else {
65 m_columnHeight = LayoutUnit(); 65 m_columnHeight = LayoutUnit();
66 }
66 } else { 67 } else {
67 setAndConstrainColumnHeight(heightAdjustedForRowOffset(flowThread->colum nHeightAvailable())); 68 setAndConstrainColumnHeight(heightAdjustedForRowOffset(flowThread->colum nHeightAvailable()));
68 } 69 }
69 } 70 }
70 71
71 bool MultiColumnFragmentainerGroup::recalculateColumnHeight(BalancedColumnHeight Calculation calculationMode) 72 bool MultiColumnFragmentainerGroup::recalculateColumnHeight(BalancedColumnHeight Calculation calculationMode)
72 { 73 {
73 LayoutUnit oldColumnHeight = m_columnHeight; 74 LayoutUnit oldColumnHeight = m_columnHeight;
74 75
75 m_maxColumnHeight = calculateMaxColumnHeight(); 76 m_maxColumnHeight = calculateMaxColumnHeight();
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 append(MultiColumnFragmentainerGroup(m_columnSet)); 557 append(MultiColumnFragmentainerGroup(m_columnSet));
557 return last(); 558 return last();
558 } 559 }
559 560
560 void MultiColumnFragmentainerGroupList::deleteExtraGroups() 561 void MultiColumnFragmentainerGroupList::deleteExtraGroups()
561 { 562 {
562 shrink(1); 563 shrink(1);
563 } 564 }
564 565
565 } // namespace blink 566 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698