Bug 399532 - "nsDisplayBackground::GetBounds() should take nsITheme overflow into account" [p=frnchfrgg-mozbugs@altern.org (_FrnchFrgg_) r+sr=roc a1.9=beltzner]

This commit is contained in:
reed%reedloden.com 2007-12-18 05:26:38 +00:00
Родитель 761871eb2a
Коммит a371319e99
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@ -461,7 +461,7 @@ void nsDisplayList::Sort(nsDisplayListBuilder* aBuilder,
PRBool
nsDisplayBackground::IsOpaque(nsDisplayListBuilder* aBuilder) {
// theme background overrides any other background
if (mFrame->IsThemed())
if (mIsThemed)
return PR_FALSE;
PRBool isCanvas;
@ -479,7 +479,7 @@ nsDisplayBackground::IsOpaque(nsDisplayListBuilder* aBuilder) {
PRBool
nsDisplayBackground::IsUniform(nsDisplayListBuilder* aBuilder) {
// theme background overrides any other background
if (mFrame->IsThemed())
if (mIsThemed)
return PR_FALSE;
PRBool isCanvas;
@ -532,6 +532,14 @@ nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder,
mFrame->HonorPrintBackgroundSettings());
}
nsRect
nsDisplayBackground::GetBounds(nsDisplayListBuilder* aBuilder) {
if (mIsThemed)
return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame);
return nsRect(aBuilder->ToReferenceFrame(mFrame), mFrame->GetSize());
}
nsRect
nsDisplayOutline::GetBounds(nsDisplayListBuilder* aBuilder) {
return mFrame->GetOverflowRect() + aBuilder->ToReferenceFrame(mFrame);

Просмотреть файл

@ -958,6 +958,7 @@ public:
class nsDisplayBackground : public nsDisplayItem {
public:
nsDisplayBackground(nsIFrame* aFrame) : nsDisplayItem(aFrame) {
mIsThemed = mFrame->IsThemed();
MOZ_COUNT_CTOR(nsDisplayBackground);
}
#ifdef NS_BUILD_REFCNT_LOGGING
@ -971,9 +972,13 @@ public:
virtual PRBool IsVaryingRelativeToFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aAncestorFrame);
virtual PRBool IsUniform(nsDisplayListBuilder* aBuilder);
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder);
virtual void Paint(nsDisplayListBuilder* aBuilder, nsIRenderingContext* aCtx,
const nsRect& aDirtyRect);
NS_DISPLAY_DECL_NAME("Background")
private:
/* Used to cache mFrame->IsThemed() since it isn't a cheap call */
PRPackedBool mIsThemed;
};
/**