Bug 1242256 - ensure images in patterns and masks animate properly. r=jwatt,seth

This commit is contained in:
Robert Longson 2016-03-26 16:07:03 +00:00
parent e11d308ed2
commit 968a509251

View File

@ -157,6 +157,12 @@ nsSVGImageFrame::Init(nsIContent* aContent,
nsSVGImageFrameBase::Init(aContent, aParent, aPrevInFlow);
if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
// Non-display frames are likely to be patterns, masks or the like.
// Treat them as always visible.
IncApproximateVisibleCount();
}
mListener = new nsSVGImageListener(this);
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
if (!imageLoader) {
@ -173,6 +179,10 @@ nsSVGImageFrame::Init(nsIContent* aContent,
/* virtual */ void
nsSVGImageFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
DecApproximateVisibleCount();
}
if (mReflowCallbackPosted) {
PresContext()->PresShell()->CancelReflowCallback(this);
mReflowCallbackPosted = false;