Bug 1261553 - Don't return from OnVisibilityChanged implementations without calling the superclass implementation. r=mstange
authorSeth Fowler <mark.seth.fowler@gmail.com>
Tue, 05 Apr 2016 01:11:14 -0700
changeset 347757 1d7ff58884f4f9937d92a08b0648be580d0066aa
parent 347756 b98bd60a5a876b55af6272c10fdd3b640a6dd9e8
child 347758 0847a24d311053f3b17f36b5680e208dd862857a
push id14653
push userolivier@olivieryiptong.com
push dateTue, 05 Apr 2016 19:21:01 +0000
reviewersmstange
bugs1261553
milestone48.0a1
Bug 1261553 - Don't return from OnVisibilityChanged implementations without calling the superclass implementation. r=mstange
layout/generic/nsImageFrame.cpp
layout/generic/nsVideoFrame.cpp
layout/svg/SVGFEImageFrame.cpp
layout/svg/nsSVGImageFrame.cpp
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -2146,16 +2146,17 @@ nsImageFrame::AttributeChanged(int32_t a
 
 void
 nsImageFrame::OnVisibilityChange(Visibility aNewVisibility,
                                  Maybe<OnNonvisible> aNonvisibleAction)
 {
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
   if (!imageLoader) {
     MOZ_ASSERT_UNREACHABLE("Should have an nsIImageLoadingContent");
+    ImageFrameSuper::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
     return;
   }
 
   imageLoader->OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 
   if (aNewVisibility == Visibility::APPROXIMATELY_VISIBLE) {
     MaybeDecodeForPredictedSize();
   }
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -618,16 +618,17 @@ nsVideoFrame::AttributeChanged(int32_t a
 }
 
 void
 nsVideoFrame::OnVisibilityChange(Visibility aNewVisibility,
                                  Maybe<OnNonvisible> aNonvisibleAction)
 {
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mPosterImage);
   if (!imageLoader) {
+    nsVideoFrameBase::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
     return;
   }
 
   imageLoader->OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 
   nsVideoFrameBase::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 }
 
--- a/layout/svg/SVGFEImageFrame.cpp
+++ b/layout/svg/SVGFEImageFrame.cpp
@@ -151,15 +151,16 @@ SVGFEImageFrame::AttributeChanged(int32_
 void
 SVGFEImageFrame::OnVisibilityChange(Visibility aNewVisibility,
                                     Maybe<OnNonvisible> aNonvisibleAction)
 {
   nsCOMPtr<nsIImageLoadingContent> imageLoader =
     do_QueryInterface(SVGFEImageFrameBase::mContent);
   if (!imageLoader) {
     MOZ_ASSERT_UNREACHABLE("Should have an nsIImageLoadingContent");
+    SVGFEImageFrameBase::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
     return;
   }
 
   imageLoader->OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 
   SVGFEImageFrameBase::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 }
--- a/layout/svg/nsSVGImageFrame.cpp
+++ b/layout/svg/nsSVGImageFrame.cpp
@@ -242,16 +242,17 @@ nsSVGImageFrame::AttributeChanged(int32_
 }
 
 void
 nsSVGImageFrame::OnVisibilityChange(Visibility aNewVisibility,
                                     Maybe<OnNonvisible> aNonvisibleAction)
 {
   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent);
   if (!imageLoader) {
+    nsSVGImageFrameBase::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
     return;
   }
 
   imageLoader->OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 
   nsSVGImageFrameBase::OnVisibilityChange(aNewVisibility, aNonvisibleAction);
 }