Bug 714346. Part 1. Make some code stop checking useless return values because it makes the control flow more complicated then needed. r=mats

This commit is contained in:
Timothy Nikkel 2012-02-28 23:53:37 -06:00
parent 2cbb11efb8
commit 80ae2df9e6

View File

@ -343,7 +343,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsRect subdocBoundsInParentUnits = nsRect subdocBoundsInParentUnits =
mInnerView->GetBounds() + GetOffsetToCrossDoc(aBuilder->ReferenceFrame()); mInnerView->GetBounds() + GetOffsetToCrossDoc(aBuilder->ReferenceFrame());
if (subdocRootFrame && NS_SUCCEEDED(rv)) { if (subdocRootFrame) {
rv = subdocRootFrame-> rv = subdocRootFrame->
BuildDisplayListForStackingContext(aBuilder, dirty, &childItems); BuildDisplayListForStackingContext(aBuilder, dirty, &childItems);
} }
@ -378,42 +378,39 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
} }
} }
if (NS_SUCCEEDED(rv)) { bool addedLayer = false;
bool addedLayer = false; if (subdocRootFrame && parentAPD != subdocAPD) {
NS_WARN_IF_FALSE(!addedLayer,
"Two container layers have been added. "
"Performance may suffer.");
addedLayer = true;
if (subdocRootFrame && parentAPD != subdocAPD) { nsDisplayZoom* zoomItem =
NS_WARN_IF_FALSE(!addedLayer, new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems,
"Two container layers have been added. " subdocAPD, parentAPD);
"Performance may suffer."); childItems.AppendToTop(zoomItem);
addedLayer = true; }
nsDisplayZoom* zoomItem = if (!addedLayer && presContext->IsRootContentDocument()) {
new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems, // We always want top level content documents to be in their own layer.
subdocAPD, parentAPD); nsDisplayOwnLayer* layerItem = new (aBuilder) nsDisplayOwnLayer(
childItems.AppendToTop(zoomItem); aBuilder, subdocRootFrame ? subdocRootFrame : this, &childItems);
} childItems.AppendToTop(layerItem);
}
if (!addedLayer && presContext->IsRootContentDocument()) { if (ShouldClipSubdocument()) {
// We always want top level content documents to be in their own layer. nsDisplayClip* item =
nsDisplayOwnLayer* layerItem = new (aBuilder) nsDisplayOwnLayer( new (aBuilder) nsDisplayClip(aBuilder, this, &childItems,
aBuilder, subdocRootFrame ? subdocRootFrame : this, &childItems); subdocBoundsInParentUnits);
childItems.AppendToTop(layerItem); // Clip children to the child root frame's rectangle
} childItems.AppendToTop(item);
}
if (ShouldClipSubdocument()) { if (mIsInline) {
nsDisplayClip* item = WrapReplacedContentForBorderRadius(aBuilder, &childItems, aLists);
new (aBuilder) nsDisplayClip(aBuilder, this, &childItems, } else {
subdocBoundsInParentUnits); aLists.Content()->AppendToTop(&childItems);
// Clip children to the child root frame's rectangle
childItems.AppendToTop(item);
}
if (mIsInline) {
WrapReplacedContentForBorderRadius(aBuilder, &childItems, aLists);
} else {
aLists.Content()->AppendToTop(&childItems);
}
} }
// delete childItems in case of OOM // delete childItems in case of OOM