Bug 896261 - Remove aAppendedThemedBackground arguments from nsDisplayBackgroundImage::AppendBackgroundItemsToTop, nsFrame::DisplayBackgroundUnconditional; r=roc

This commit is contained in:
Ms2ger
2013-07-24 09:38:55 +02:00
parent bb5e5e2f9e
commit e26cec152b
4 changed files with 21 additions and 40 deletions

View File

@@ -1633,16 +1633,11 @@ static nsStyleContext* GetBackgroundStyleContext(nsIFrame* aFrame)
return sc;
}
/*static*/ nsresult
/*static*/ bool
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList,
bool* aAppendedThemedBackground)
nsDisplayList* aList)
{
if (aAppendedThemedBackground) {
*aAppendedThemedBackground = false;
}
nsStyleContext* bgSC = nullptr;
const nsStyleBackground* bg = nullptr;
nsPresContext* presContext = aFrame->PresContext();
@@ -1676,14 +1671,11 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
nsDisplayThemedBackground* bgItem =
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame);
aList->AppendNewToTop(bgItem);
if (aAppendedThemedBackground) {
*aAppendedThemedBackground = true;
}
return NS_OK;
return true;
}
if (!bg) {
return NS_OK;
return false;
}
// Passing bg == nullptr in this macro will result in one iteration with
@@ -1697,7 +1689,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
aList->AppendNewToTop(bgItem);
}
return NS_OK;
return false;
}
// Check that the rounded border of aFrame, added to aToReferenceFrame,

View File

@@ -1959,12 +1959,10 @@ public:
virtual ~nsDisplayBackgroundImage();
// This will create and append new items for all the layers of the
// background. If given, aBackground will be set with the address of the
// bottom-most background item.
static nsresult AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
// background. Returns whether we appended a themed background.
static bool AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
nsDisplayList* aList,
bool* aAppendedThemedBackground = nullptr);
nsDisplayList* aList);
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,

View File

@@ -1481,25 +1481,20 @@ nsIFrame::GetCaretColorAt(int32_t aOffset)
return StyleColor()->mColor;
}
void
bool
nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists,
bool aForceBackground,
bool* aAppendedThemedBackground)
bool aForceBackground)
{
if (aAppendedThemedBackground) {
*aAppendedThemedBackground = false;
}
// Here we don't try to detect background propagation. Frames that might
// receive a propagated background should just set aForceBackground to
// true.
if (aBuilder->IsForEventDelivery() || aForceBackground ||
!StyleBackground()->IsTransparent() || StyleDisplay()->mAppearance) {
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, this,
aLists.BorderBackground(),
aAppendedThemedBackground);
return nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, this, aLists.BorderBackground());
}
return false;
}
void
@@ -1519,9 +1514,8 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
nsDisplayBoxShadowOuter(aBuilder, this));
}
bool bgIsThemed;
DisplayBackgroundUnconditional(aBuilder, aLists, aForceBackground,
&bgIsThemed);
bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
aForceBackground);
if (shadows && shadows->HasShadowWithInset(true)) {
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)

View File

@@ -494,14 +494,11 @@ public:
* background style appears to have no background --- this is useful
* for frames that might receive a propagated background via
* nsCSSRendering::FindBackground
* @param aAppendedThemedBackground if non-null,
* *aAppendedThemedBackground will indicate whether a themed background
* item was created.
* @return whether a themed background item was created.
*/
void DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
bool DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists,
bool aForceBackground,
bool* aAppendedThemedBackground = nullptr);
bool aForceBackground);
/**
* Adds display items for standard CSS borders, background and outline for
* for this frame, as necessary. Checks IsVisibleForPainting and won't