Bug 852501 part 11. Make FlushAccumulatedBlock infallible. r=dholbert

This commit is contained in:
Boris Zbarsky 2013-03-19 21:47:51 -04:00
parent d6f028e002
commit a75a81c666
2 changed files with 11 additions and 14 deletions

View File

@ -3715,10 +3715,8 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
while ((f = childItems.FirstChild()) != nullptr) {
bool wrapFrame = IsInlineFrame(f) || IsFrameSpecial(f);
if (!wrapFrame) {
rv = FlushAccumulatedBlock(aState, content, newFrame,
currentBlockItems, newItems);
if (NS_FAILED(rv))
break;
FlushAccumulatedBlock(aState, content, newFrame,
currentBlockItems, newItems);
}
childItems.RemoveFrame(f);
@ -3728,8 +3726,8 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
newItems.AddChild(f);
}
}
rv = FlushAccumulatedBlock(aState, content, newFrame,
currentBlockItems, newItems);
FlushAccumulatedBlock(aState, content, newFrame,
currentBlockItems, newItems);
if (childItems.NotEmpty()) {
// an error must have occurred, delete unprocessed frames
@ -4546,7 +4544,7 @@ nsCSSFrameConstructor::ResolveStyleContext(nsStyleContext* aParentStyleContext,
}
// MathML Mod - RBS
nsresult
void
nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
@ -4555,7 +4553,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
{
if (aBlockItems.IsEmpty()) {
// Nothing to do
return NS_OK;
return;
}
nsIAtom* anonPseudo = nsCSSAnonBoxes::mozMathMLAnonymousBlock;
@ -4584,7 +4582,6 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
NS_ASSERTION(aBlockItems.IsEmpty(), "What happened?");
aBlockItems.Clear();
aNewItems.AddChild(blockFrame);
return NS_OK;
}
// Only <math> elements can be floated or positioned. All other MathML

View File

@ -1323,11 +1323,11 @@ private:
* frame whose content is aContent and whose parent will be aParentFrame.
* The anonymous block is added to aNewItems and aBlockItems is cleared.
*/
nsresult FlushAccumulatedBlock(nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsFrameItems& aBlockItems,
nsFrameItems& aNewItems);
void FlushAccumulatedBlock(nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsFrameItems& aBlockItems,
nsFrameItems& aNewItems);
// Function to find FrameConstructionData for aContent. Will return
// null if aContent is not MathML.