Bug 797295 - Add support for the layer attribute to nsImageBoxFrame. r=roc

This commit is contained in:
Matt Woodrow 2012-10-11 18:44:59 +13:00
parent be98caba91
commit 479663fd71
3 changed files with 21 additions and 1 deletions

View File

@ -8166,6 +8166,16 @@ nsFrame::InitBoxMetrics(bool aClear)
metrics->mLastSize.SizeTo(0, 0);
}
void
nsIFrame::CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder,
nsDisplayList* aList)
{
if (GetContent()->HasAttr(kNameSpaceID_None, nsGkAtoms::layer)) {
aList->AppendNewToTop(new (aBuilder)
nsDisplayOwnLayer(aBuilder, this, aList));
}
}
// Box layout debugging
#ifdef DEBUG_REFLOW
int32_t gIndent2 = 0;

View File

@ -2907,6 +2907,8 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
bool IsSVGText() const { return mState & NS_FRAME_IS_SVG_TEXT; }
void CreateOwnLayerIfNeeded(nsDisplayListBuilder* aBuilder, nsDisplayList* aList);
protected:
// Members
nsRect mRect;

View File

@ -304,8 +304,16 @@ nsImageBoxFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!IsVisibleForPainting(aBuilder))
return NS_OK;
return aLists.Content()->AppendNewToTop(
nsDisplayList list;
rv = list.AppendNewToTop(
new (aBuilder) nsDisplayXULImage(aBuilder, this));
NS_ENSURE_SUCCESS(rv, rv);
CreateOwnLayerIfNeeded(aBuilder, &list);
aLists.Content()->AppendToTop(&list);
return NS_OK;
}
void