зеркало из https://github.com/mozilla/pjs.git
Fix assertion about float manager state by restoring old float manager state when we place a float and then cancel that placement. (Bug 563584, patch 1) r=roc
This commit is contained in:
Родитель
611a21f7ad
Коммит
183b5fe161
|
@ -574,6 +574,9 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
|
||||||
(aLineLayout->LineIsEmpty() ||
|
(aLineLayout->LineIsEmpty() ||
|
||||||
mBlock->ComputeFloatWidth(*this, floatAvailableSpace, aFloat)
|
mBlock->ComputeFloatWidth(*this, floatAvailableSpace, aFloat)
|
||||||
<= aAvailableWidth))) {
|
<= aAvailableWidth))) {
|
||||||
|
nsFloatManager::SavedState floatManagerState;
|
||||||
|
mFloatManager->PushState(&floatManagerState);
|
||||||
|
|
||||||
// And then place it
|
// And then place it
|
||||||
// force it to fit if we're at the top of the block and we can't
|
// force it to fit if we're at the top of the block and we can't
|
||||||
// break before this
|
// break before this
|
||||||
|
@ -599,6 +602,11 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
|
||||||
aReflowStatus &= ~NS_FRAME_TRUNCATED;
|
aReflowStatus &= ~NS_FRAME_TRUNCATED;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (placed) {
|
||||||
|
mFloatManager->PopState(&floatManagerState);
|
||||||
|
} else {
|
||||||
|
mFloatManager->AssertStateMatches(&floatManagerState);
|
||||||
|
}
|
||||||
if (IsAdjacentWithTop()) {
|
if (IsAdjacentWithTop()) {
|
||||||
// Pushing the line to the next page won't give us any more space;
|
// Pushing the line to the next page won't give us any more space;
|
||||||
// therefore, we break.
|
// therefore, we break.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче