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

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

Issue 1266553002: Include overflow when setting the logical flowthread bottom on the last column set. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « 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/LayoutMultiColumnSet.h" 9 #include "core/layout/LayoutMultiColumnSet.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // the next layout pass, since each pass will rebuild this. 110 // the next layout pass, since each pass will rebuild this.
111 m_contentRuns.clear(); 111 m_contentRuns.clear();
112 112
113 if (m_columnHeight == oldColumnHeight) 113 if (m_columnHeight == oldColumnHeight)
114 return false; // No change. We're done. 114 return false; // No change. We're done.
115 115
116 m_minSpaceShortage = LayoutUnit::max(); 116 m_minSpaceShortage = LayoutUnit::max();
117 return true; // Need another pass. 117 return true; // Need another pass.
118 } 118 }
119 119
120 void MultiColumnFragmentainerGroup::expandToEncompassFlowThreadOverflow()
121 {
122 ASSERT(isLastGroup());
123 // Get the offset within the flow thread in its block progression direction. Then get the
124 // flow thread's remaining logical height including its overflow and expand our rect
125 // to encompass that remaining height and overflow. The idea is that we will generate
126 // additional columns and pages to hold that overflow, since people do write bad
127 // content like <body style="height:0px"> in multi-column layouts.
128 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread( );
129 LayoutRect layoutRect = flowThread->layoutOverflowRect();
130 m_logicalBottomInFlowThread = flowThread->isHorizontalWritingMode() ? layout Rect.maxY() : layoutRect.maxX();
131 }
132
133 LayoutSize MultiColumnFragmentainerGroup::flowThreadTranslationAtOffset(LayoutUn it offsetInFlowThread) const 120 LayoutSize MultiColumnFragmentainerGroup::flowThreadTranslationAtOffset(LayoutUn it offsetInFlowThread) const
134 { 121 {
135 LayoutFlowThread* flowThread = m_columnSet.flowThread(); 122 LayoutFlowThread* flowThread = m_columnSet.flowThread();
136 unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread); 123 unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread);
137 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); 124 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex));
138 flowThread->flipForWritingMode(portionRect); 125 flowThread->flipForWritingMode(portionRect);
139 LayoutRect columnRect(columnRectAt(columnIndex)); 126 LayoutRect columnRect(columnRectAt(columnIndex));
140 m_columnSet.flipForWritingMode(columnRect); 127 m_columnSet.flipForWritingMode(columnRect);
141 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect. location(); 128 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect. location();
142 return translationRelativeToGroup + offsetFromColumnSet() + m_columnSet.topL eftLocationOffset() - flowThread->topLeftLocationOffset(); 129 return translationRelativeToGroup + offsetFromColumnSet() + m_columnSet.topL eftLocationOffset() - flowThread->topLeftLocationOffset();
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 append(MultiColumnFragmentainerGroup(m_columnSet)); 544 append(MultiColumnFragmentainerGroup(m_columnSet));
558 return last(); 545 return last();
559 } 546 }
560 547
561 void MultiColumnFragmentainerGroupList::deleteExtraGroups() 548 void MultiColumnFragmentainerGroupList::deleteExtraGroups()
562 { 549 {
563 shrink(1); 550 shrink(1);
564 } 551 }
565 552
566 } // namespace blink 553 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698