зеркало из https://github.com/mozilla/gecko-dev.git
Bug 505184. Expose nsFrame::DisplayBackgroundUnconditional so we can easily create an nsDisplayBackground elsewhere. r=dbaron
This commit is contained in:
Родитель
4f7139b194
Коммит
53a0bb6bba
|
@ -960,6 +960,22 @@ nsFrame::HasBorder() const
|
|||
GetStyleBorder()->IsBorderImageLoaded());
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrame::DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists,
|
||||
PRBool aForceBackground)
|
||||
{
|
||||
// Here we don't try to detect background propagation. Frames that might
|
||||
// receive a propagated background should just set aForceBackground to
|
||||
// PR_TRUE.
|
||||
if (aBuilder->IsForEventDelivery() || aForceBackground ||
|
||||
!GetStyleBackground()->IsTransparent() || GetStyleDisplay()->mAppearance) {
|
||||
return aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayBackground(this));
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists,
|
||||
|
@ -978,24 +994,18 @@ nsFrame::DisplayBorderBackgroundOutline(nsDisplayListBuilder* aBuilder,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// Here we don't try to detect background propagation. Frames that might
|
||||
// receive a propagated background should just set aForceBackground to
|
||||
// PR_TRUE.
|
||||
if (aBuilder->IsForEventDelivery() || aForceBackground ||
|
||||
!GetStyleBackground()->IsTransparent() || GetStyleDisplay()->mAppearance) {
|
||||
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayBackground(this));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
nsresult rv =
|
||||
DisplayBackgroundUnconditional(aBuilder, aLists, aForceBackground);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (hasBoxShadow) {
|
||||
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayBoxShadowInner(this));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
if (HasBorder()) {
|
||||
nsresult rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||
rv = aLists.BorderBackground()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayBorder(this));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
|
|
@ -497,6 +497,17 @@ public:
|
|||
static void DisplayReflowShutdown();
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Adds display item for standard CSS background if necessary.
|
||||
* Does not check IsVisibleForPainting.
|
||||
* @param aForceBackground draw the background even if the frame
|
||||
* background style appears to have no background --- this is useful
|
||||
* for frames that might receive a propagated background via
|
||||
* nsCSSRendering::FindBackground
|
||||
*/
|
||||
nsresult DisplayBackgroundUnconditional(nsDisplayListBuilder* aBuilder,
|
||||
const nsDisplayListSet& aLists,
|
||||
PRBool aForceBackground = PR_FALSE);
|
||||
/**
|
||||
* Adds display items for standard CSS borders, background and outline for
|
||||
* for this frame, as necessary. Checks IsVisibleForPainting and won't
|
||||
|
|
Загрузка…
Ссылка в новой задаче