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

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

Issue 1927283002: Improve multicol overflow rect calculation when column width is 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Explain what goes on in the test. Created 4 years, 7 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/multicol/overflowing-columns-large-gaps-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 // 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 "core/layout/MultiColumnFragmentainerGroup.h" 5 #include "core/layout/MultiColumnFragmentainerGroup.h"
6 6
7 #include "core/layout/ColumnBalancer.h" 7 #include "core/layout/ColumnBalancer.h"
8 #include "core/layout/FragmentationContext.h" 8 #include "core/layout/FragmentationContext.h"
9 #include "core/layout/LayoutMultiColumnSet.h" 9 #include "core/layout/LayoutMultiColumnSet.h"
10 10
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 fragment.paginationClip = flowThreadPortionOverflowRectAt(i); 260 fragment.paginationClip = flowThreadPortionOverflowRectAt(i);
261 // Flip it into more a physical (PaintLayer-style) rectangle. 261 // Flip it into more a physical (PaintLayer-style) rectangle.
262 flowThread->flipForWritingMode(fragment.paginationClip); 262 flowThread->flipForWritingMode(fragment.paginationClip);
263 263
264 fragments.append(fragment); 264 fragments.append(fragment);
265 } 265 }
266 } 266 }
267 267
268 LayoutRect MultiColumnFragmentainerGroup::calculateOverflow() const 268 LayoutRect MultiColumnFragmentainerGroup::calculateOverflow() const
269 { 269 {
270 unsigned columnCount = actualColumnCount(); 270 // Note that we just return the bounding rectangle of the column boxes here. We currently don't
271 if (!columnCount) 271 // examine overflow caused by the actual content that ends up in each column .
272 return LayoutRect(); 272 LayoutRect overflowRect;
273 return columnRectAt(columnCount - 1); 273 if (unsigned columnCount = actualColumnCount()) {
274 overflowRect = columnRectAt(0);
275 if (columnCount > 1)
276 overflowRect.uniteEvenIfEmpty(columnRectAt(columnCount - 1));
277 }
278 return overflowRect;
274 } 279 }
275 280
276 unsigned MultiColumnFragmentainerGroup::actualColumnCount() const 281 unsigned MultiColumnFragmentainerGroup::actualColumnCount() const
277 { 282 {
278 // We must always return a value of 1 or greater. Column count = 0 is a mean ingless situation, 283 // We must always return a value of 1 or greater. Column count = 0 is a mean ingless situation,
279 // and will confuse and cause problems in other parts of the code. 284 // and will confuse and cause problems in other parts of the code.
280 if (!m_columnHeight) 285 if (!m_columnHeight)
281 return 1; 286 return 1;
282 287
283 // Our flow thread portion determines our column count. We have as many colu mns as needed to fit 288 // Our flow thread portion determines our column count. We have as many colu mns as needed to fit
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 append(MultiColumnFragmentainerGroup(m_columnSet)); 540 append(MultiColumnFragmentainerGroup(m_columnSet));
536 return last(); 541 return last();
537 } 542 }
538 543
539 void MultiColumnFragmentainerGroupList::deleteExtraGroups() 544 void MultiColumnFragmentainerGroupList::deleteExtraGroups()
540 { 545 {
541 shrink(1); 546 shrink(1);
542 } 547 }
543 548
544 } // namespace blink 549 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/overflowing-columns-large-gaps-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698