Bug 800198 - Make mContainerReferenceFrame the reference frame for the items inside the container, not the container itself. r=roc

This commit is contained in:
Matt Woodrow 2012-10-16 14:10:48 +13:00
parent 773891762c
commit 7c4e5b5701
2 changed files with 16 additions and 1 deletions

View File

@ -212,7 +212,7 @@ public:
{
nsPresContext* presContext = aContainerFrame->PresContext();
mAppUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
mContainerReferenceFrame = aContainerItem ? aContainerItem->ReferenceFrame() :
mContainerReferenceFrame = aContainerItem ? aContainerItem->ReferenceFrameForChildren() :
mBuilder->FindReferenceFrameFor(mContainerFrame);
// When AllowResidualTranslation is false, display items will be drawn
// scaled with a translation by integer pixels, so we know how the snapping

View File

@ -1050,6 +1050,11 @@ public:
*/
const nsIFrame* ReferenceFrame() const { return mReferenceFrame; }
/**
* Returns the reference frame for display item children of this item.
*/
virtual const nsIFrame* ReferenceFrameForChildren() const { return mReferenceFrame; }
/**
* Checks if this display item (or any children) contains content that might
* be rendered with component alpha (e.g. subpixel antialiasing). Returns the
@ -2589,6 +2594,16 @@ public:
virtual uint32_t GetPerFrameKey() MOZ_OVERRIDE { return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); }
virtual const nsIFrame* ReferenceFrameForChildren() const MOZ_OVERRIDE {
// If we were created using a transform-getter, then we don't
// belong to a transformed frame, and aren't a reference frame
// for our children.
if (!mTransformGetter) {
return mFrame;
}
return nsDisplayItem::ReferenceFrameForChildren();
}
enum {
INDEX_MAX = UINT32_MAX >> nsDisplayItem::TYPE_BITS
};