зеркало из https://github.com/mozilla/pjs.git
Bug 462307 - 'Speed up columns case hit by HTML5 spec'. r+sr=dbaron
This commit is contained in:
Родитель
bdeeace995
Коммит
83a3ac2d87
|
@ -129,11 +129,17 @@ protected:
|
|||
* Some data that is better calculated during reflow
|
||||
*/
|
||||
struct ColumnBalanceData {
|
||||
// The maximum "content height" of any column
|
||||
nscoord mMaxHeight;
|
||||
// The sum of the "content heights" for all columns
|
||||
nscoord mSumHeight;
|
||||
// The "content height" of the last column
|
||||
nscoord mLastHeight;
|
||||
// The maximum "content height" of all columns that overflowed
|
||||
// their available height
|
||||
nscoord mMaxOverflowingHeight;
|
||||
void Reset() {
|
||||
mMaxHeight = mSumHeight = mLastHeight = 0;
|
||||
mMaxHeight = mSumHeight = mLastHeight = mMaxOverflowingHeight = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -669,6 +675,10 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
|
|||
if (childContentBottom > aConfig.mColMaxHeight) {
|
||||
allFit = PR_FALSE;
|
||||
}
|
||||
if (childContentBottom > availSize.height) {
|
||||
aColData.mMaxOverflowingHeight = PR_MAX(childContentBottom,
|
||||
aColData.mMaxOverflowingHeight);
|
||||
}
|
||||
}
|
||||
|
||||
contentRect.UnionRect(contentRect, child->GetRect());
|
||||
|
@ -908,6 +918,11 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
|
|||
}
|
||||
} else {
|
||||
knownInfeasibleHeight = PR_MAX(knownInfeasibleHeight, mLastBalanceHeight);
|
||||
// If a column didn't fit in its available height, then its current
|
||||
// height must be the minimum height for unbreakable content in
|
||||
// the column, and therefore no smaller height can be feasible.
|
||||
knownInfeasibleHeight = PR_MAX(knownInfeasibleHeight,
|
||||
colData.mMaxOverflowingHeight - 1);
|
||||
|
||||
if (unboundedLastColumn) {
|
||||
// The last column is unbounded, so all content got reflowed, so the
|
||||
|
|
Загрузка…
Ссылка в новой задаче