Bug 896261 - Remove aAppendedThemedBackground arguments from nsDisplayBackgroundImage::AppendBackgroundItemsToTop, nsFrame::DisplayBackgroundUnconditional; r=roc
This commit is contained in:
@@ -1633,16 +1633,11 @@ static nsStyleContext* GetBackgroundStyleContext(nsIFrame* aFrame)
|
|||||||
return sc;
|
return sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/ nsresult
|
/*static*/ bool
|
||||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
||||||
nsIFrame* aFrame,
|
nsIFrame* aFrame,
|
||||||
nsDisplayList* aList,
|
nsDisplayList* aList)
|
||||||
bool* aAppendedThemedBackground)
|
|
||||||
{
|
{
|
||||||
if (aAppendedThemedBackground) {
|
|
||||||
*aAppendedThemedBackground = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsStyleContext* bgSC = nullptr;
|
nsStyleContext* bgSC = nullptr;
|
||||||
const nsStyleBackground* bg = nullptr;
|
const nsStyleBackground* bg = nullptr;
|
||||||
nsPresContext* presContext = aFrame->PresContext();
|
nsPresContext* presContext = aFrame->PresContext();
|
||||||
@@ -1676,14 +1671,11 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||||||
nsDisplayThemedBackground* bgItem =
|
nsDisplayThemedBackground* bgItem =
|
||||||
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame);
|
new (aBuilder) nsDisplayThemedBackground(aBuilder, aFrame);
|
||||||
aList->AppendNewToTop(bgItem);
|
aList->AppendNewToTop(bgItem);
|
||||||
if (aAppendedThemedBackground) {
|
return true;
|
||||||
*aAppendedThemedBackground = true;
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bg) {
|
if (!bg) {
|
||||||
return NS_OK;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Passing bg == nullptr in this macro will result in one iteration with
|
// Passing bg == nullptr in this macro will result in one iteration with
|
||||||
@@ -1697,7 +1689,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
|
|||||||
aList->AppendNewToTop(bgItem);
|
aList->AppendNewToTop(bgItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the rounded border of aFrame, added to aToReferenceFrame,
|
// Check that the rounded border of aFrame, added to aToReferenceFrame,
|
||||||
|
|||||||
@@ -1959,12 +1959,10 @@ public:
|
|||||||
virtual ~nsDisplayBackgroundImage();
|
virtual ~nsDisplayBackgroundImage();
|
||||||
|
|
||||||
// This will create and append new items for all the layers of the
|
// 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
|
// background. Returns whether we appended a themed background.
|
||||||
// bottom-most background item.
|
static bool AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
||||||
static nsresult AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuilder,
|
nsIFrame* aFrame,
|
||||||
nsIFrame* aFrame,
|
nsDisplayList* aList);
|
||||||
nsDisplayList* aList,
|
|
||||||
bool* aAppendedThemedBackground = nullptr);
|
|
||||||
|
|
||||||
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||||
LayerManager* aManager,
|
LayerManager* aManager,
|
||||||
|
|||||||
@@ -1481,25 +1481,20 @@ nsIFrame::GetCaretColorAt(int32_t aOffset)
|
|||||||
return StyleColor()->mColor;
|
return StyleColor()->mColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists,
|
const nsDisplayListSet& aLists,
|
||||||
bool aForceBackground,
|
bool aForceBackground)
|
||||||
bool* aAppendedThemedBackground)
|
|
||||||
{
|
{
|
||||||
if (aAppendedThemedBackground) {
|
|
||||||
*aAppendedThemedBackground = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Here we don't try to detect background propagation. Frames that might
|
// Here we don't try to detect background propagation. Frames that might
|
||||||
// receive a propagated background should just set aForceBackground to
|
// receive a propagated background should just set aForceBackground to
|
||||||
// true.
|
// true.
|
||||||
if (aBuilder->IsForEventDelivery() || aForceBackground ||
|
if (aBuilder->IsForEventDelivery() || aForceBackground ||
|
||||||
!StyleBackground()->IsTransparent() || StyleDisplay()->mAppearance) {
|
!StyleBackground()->IsTransparent() || StyleDisplay()->mAppearance) {
|
||||||
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, this,
|
return nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
|
||||||
aLists.BorderBackground(),
|
aBuilder, this, aLists.BorderBackground());
|
||||||
aAppendedThemedBackground);
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -1519,9 +1514,8 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
|
|||||||
nsDisplayBoxShadowOuter(aBuilder, this));
|
nsDisplayBoxShadowOuter(aBuilder, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bgIsThemed;
|
bool bgIsThemed = DisplayBackgroundUnconditional(aBuilder, aLists,
|
||||||
DisplayBackgroundUnconditional(aBuilder, aLists, aForceBackground,
|
aForceBackground);
|
||||||
&bgIsThemed);
|
|
||||||
|
|
||||||
if (shadows && shadows->HasShadowWithInset(true)) {
|
if (shadows && shadows->HasShadowWithInset(true)) {
|
||||||
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||||
|
|||||||
@@ -494,14 +494,11 @@ public:
|
|||||||
* background style appears to have no background --- this is useful
|
* background style appears to have no background --- this is useful
|
||||||
* for frames that might receive a propagated background via
|
* for frames that might receive a propagated background via
|
||||||
* nsCSSRendering::FindBackground
|
* nsCSSRendering::FindBackground
|
||||||
* @param aAppendedThemedBackground if non-null,
|
* @return whether a themed background item was created.
|
||||||
* *aAppendedThemedBackground will indicate whether a themed background
|
|
||||||
* item was created.
|
|
||||||
*/
|
*/
|
||||||
void DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
bool DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
||||||
const nsDisplayListSet& aLists,
|
const nsDisplayListSet& aLists,
|
||||||
bool aForceBackground,
|
bool aForceBackground);
|
||||||
bool* aAppendedThemedBackground = nullptr);
|
|
||||||
/**
|
/**
|
||||||
* Adds display items for standard CSS borders, background and outline for
|
* Adds display items for standard CSS borders, background and outline for
|
||||||
* for this frame, as necessary. Checks IsVisibleForPainting and won't
|
* for this frame, as necessary. Checks IsVisibleForPainting and won't
|
||||||
|
|||||||
Reference in New Issue
Block a user