diff --git a/mozilla/view/public/nsIView.h b/mozilla/view/public/nsIView.h index 86545a25b74..99aac79ec92 100644 --- a/mozilla/view/public/nsIView.h +++ b/mozilla/view/public/nsIView.h @@ -278,9 +278,13 @@ public: PRBool IsTransparent() const { return (mVFlags & NS_VIEW_FLAG_TRANSPARENT) != 0; } /** - * Indicate that this view is always painted onto a uniform field of pixels. Thus, - * even if the view is transparent, it may still be bitblit scrollable because - * the background that shines through does not vary with position. + * Indicate that this view is always painted onto a uniform field of + * pixels. Thus, even if the view is transparent, it may still be + * bitblit scrollable because the background that shines through + * does not vary with position. Caller must ensure that the pixel + * field belongs to the same element as this view or some ancestor + * element, so that if the pixel field is in some opacity group, then + * this view is also in the opacity group (or some subgroup). */ void SetHasUniformBackground(PRBool aUniform) { if (aUniform) { diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 1c93c6db725..9415fa93f2f 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -3653,7 +3653,17 @@ void nsViewManager::OptimizeDisplayList(const nsVoidArray* aDisplayList, const n // a view is opaque if it is neither transparent nor transluscent if (!(element->mFlags & (VIEW_TRANSPARENT | VIEW_TRANSLUCENT)) - || (element->mView->HasUniformBackground() && aTreatUniformAsOpaque)) { + // also, treat it as opaque if it's drawn onto a uniform background + // and we're doing scrolling analysis; if the background is uniform, + // we don't care what's under it. But the background might be translucent + // because of some enclosing opacity group, in which case we do care + // what's under it. Unfortunately we don't know exactly where the + // background comes from ... it may not even have a view ... but + // the side condition on SetHasUniformBackground ensures that + // if the background is translucent, then this view is also marked + // translucent. + || (element->mView->HasUniformBackground() && aTreatUniformAsOpaque + && !(element->mFlags & VIEW_TRANSLUCENT))) { aOpaqueRegion.Or(aOpaqueRegion, element->mBounds); } }