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

Side by Side Diff: Source/core/rendering/RenderMultiColumnSet.cpp

Issue 223743002: [New Multicolumn] Avoid freeze if column count is 1 and there's a forced break. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 | « LayoutTests/fast/multicol/one-column-with-break-expected.html ('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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 unsigned index = findRunWithTallestColumns(); 130 unsigned index = findRunWithTallestColumns();
131 LayoutUnit startOffset = index > 0 ? m_contentRuns[index - 1].breakOffse t() : LayoutUnit(); 131 LayoutUnit startOffset = index > 0 ? m_contentRuns[index - 1].breakOffse t() : LayoutUnit();
132 return std::max<LayoutUnit>(m_contentRuns[index].columnLogicalHeight(sta rtOffset), m_minimumColumnHeight); 132 return std::max<LayoutUnit>(m_contentRuns[index].columnLogicalHeight(sta rtOffset), m_minimumColumnHeight);
133 } 133 }
134 134
135 if (columnCount() <= computedColumnCount()) { 135 if (columnCount() <= computedColumnCount()) {
136 // With the current column height, the content fits without creating ove rflowing columns. We're done. 136 // With the current column height, the content fits without creating ove rflowing columns. We're done.
137 return m_computedColumnHeight; 137 return m_computedColumnHeight;
138 } 138 }
139 139
140 if (forcedBreaksCount() > 1 && forcedBreaksCount() >= computedColumnCount()) { 140 if (forcedBreaksCount() >= computedColumnCount()) {
141 // Too many forced breaks to allow any implicit breaks. Initial balancin g should already 141 // Too many forced breaks to allow any implicit breaks. Initial balancin g should already
142 // have set a good height. There's nothing more we should do. 142 // have set a good height. There's nothing more we should do.
143 return m_computedColumnHeight; 143 return m_computedColumnHeight;
144 } 144 }
145 145
146 // If the initial guessed column height wasn't enough, stretch it now. Stret ch by the lowest 146 // If the initial guessed column height wasn't enough, stretch it now. Stret ch by the lowest
147 // amount of space shortage found during layout. 147 // amount of space shortage found during layout.
148 148
149 ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height! 149 ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height!
150 ASSERT(m_minSpaceShortage != RenderFlowThread::maxLogicalHeight()); // If th is happens, we probably have a bug. 150 ASSERT(m_minSpaceShortage != RenderFlowThread::maxLogicalHeight()); // If th is happens, we probably have a bug.
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 fragments.append(fragment); 584 fragments.append(fragment);
585 } 585 }
586 } 586 }
587 587
588 const char* RenderMultiColumnSet::renderName() const 588 const char* RenderMultiColumnSet::renderName() const
589 { 589 {
590 return "RenderMultiColumnSet"; 590 return "RenderMultiColumnSet";
591 } 591 }
592 592
593 } 593 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/one-column-with-break-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698