mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 855464: Optimize nsBlockReflowState::ClearFloats better, given that nsBlockFrame::WidthToClearPastFloats is somewhat expensive. r=dholbert
This fixes a performance issue that showed up in a profile of the b2g contacts app (though it's not clear what percentage of the time it was given the difficulty of understanding output of 'perf').
This commit is contained in:
parent
ab382b9891
commit
8c6ca20f7d
@ -945,7 +945,11 @@ nsBlockReflowState::ClearFloats(nscoord aY, uint8_t aBreakType,
|
||||
aY, aBreakType);
|
||||
mFloatManager->List(stdout);
|
||||
#endif
|
||||
|
||||
|
||||
if (!mFloatManager->HasAnyFloats()) {
|
||||
return aY;
|
||||
}
|
||||
|
||||
nscoord newY = aY;
|
||||
|
||||
if (aBreakType != NS_STYLE_CLEAR_NONE) {
|
||||
@ -955,11 +959,16 @@ nsBlockReflowState::ClearFloats(nscoord aY, uint8_t aBreakType,
|
||||
if (aReplacedBlock) {
|
||||
for (;;) {
|
||||
nsFlowAreaRect floatAvailableSpace = GetFloatAvailableSpace(newY);
|
||||
if (!floatAvailableSpace.mHasFloats) {
|
||||
// If there aren't any floats here, then we always fit.
|
||||
// We check this before calling WidthToClearPastFloats, which is
|
||||
// somewhat expensive.
|
||||
break;
|
||||
}
|
||||
nsBlockFrame::ReplacedElementWidthToClear replacedWidth =
|
||||
nsBlockFrame::WidthToClearPastFloats(*this, floatAvailableSpace.mRect,
|
||||
aReplacedBlock);
|
||||
if (!floatAvailableSpace.mHasFloats ||
|
||||
std::max(floatAvailableSpace.mRect.x - mContentArea.x,
|
||||
if (std::max(floatAvailableSpace.mRect.x - mContentArea.x,
|
||||
replacedWidth.marginLeft) +
|
||||
replacedWidth.borderBoxWidth +
|
||||
std::max(mContentArea.XMost() - floatAvailableSpace.mRect.XMost(),
|
||||
|
Loading…
Reference in New Issue
Block a user