From 80ae2df9e62f94d94f4ee1bdfca89362194d02ca Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Tue, 28 Feb 2012 23:53:37 -0600 Subject: [PATCH] Bug 714346. Part 1. Make some code stop checking useless return values because it makes the control flow more complicated then needed. r=mats --- layout/generic/nsSubDocumentFrame.cpp | 61 +++++++++++++-------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 87acf1d051c..c8a4997e7c4 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -343,7 +343,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsRect subdocBoundsInParentUnits = mInnerView->GetBounds() + GetOffsetToCrossDoc(aBuilder->ReferenceFrame()); - if (subdocRootFrame && NS_SUCCEEDED(rv)) { + if (subdocRootFrame) { rv = subdocRootFrame-> 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) { - NS_WARN_IF_FALSE(!addedLayer, - "Two container layers have been added. " - "Performance may suffer."); - addedLayer = true; + nsDisplayZoom* zoomItem = + new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems, + subdocAPD, parentAPD); + childItems.AppendToTop(zoomItem); + } - nsDisplayZoom* zoomItem = - new (aBuilder) nsDisplayZoom(aBuilder, subdocRootFrame, &childItems, - subdocAPD, parentAPD); - childItems.AppendToTop(zoomItem); - } - - if (!addedLayer && presContext->IsRootContentDocument()) { - // We always want top level content documents to be in their own layer. - nsDisplayOwnLayer* layerItem = new (aBuilder) nsDisplayOwnLayer( - aBuilder, subdocRootFrame ? subdocRootFrame : this, &childItems); - childItems.AppendToTop(layerItem); - } + if (!addedLayer && presContext->IsRootContentDocument()) { + // We always want top level content documents to be in their own layer. + nsDisplayOwnLayer* layerItem = new (aBuilder) nsDisplayOwnLayer( + aBuilder, subdocRootFrame ? subdocRootFrame : this, &childItems); + childItems.AppendToTop(layerItem); + } - if (ShouldClipSubdocument()) { - nsDisplayClip* item = - new (aBuilder) nsDisplayClip(aBuilder, this, &childItems, - subdocBoundsInParentUnits); - // Clip children to the child root frame's rectangle - childItems.AppendToTop(item); - } + if (ShouldClipSubdocument()) { + nsDisplayClip* item = + new (aBuilder) nsDisplayClip(aBuilder, this, &childItems, + subdocBoundsInParentUnits); + // Clip children to the child root frame's rectangle + childItems.AppendToTop(item); + } - if (mIsInline) { - WrapReplacedContentForBorderRadius(aBuilder, &childItems, aLists); - } else { - aLists.Content()->AppendToTop(&childItems); - } + if (mIsInline) { + WrapReplacedContentForBorderRadius(aBuilder, &childItems, aLists); + } else { + aLists.Content()->AppendToTop(&childItems); } // delete childItems in case of OOM