Bug 1284350. Backed out changeset 103dc4eddacf (Bug 1282710 - part 2 - Plumb the visibility event from nsIFrame to nsIDOMMediaElemnt; r=seth) a=ritu
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 26 Jul 2016 17:43:58 -0500
changeset 348162 523cdfce8a5c4acbbcdc3db0b9f6984613376d8f
parent 348161 10046a00f401008f625c4b9ff6f0ca96f03e97b5
child 348163 2d830254b5fd675087a83cd6ec4fa25bf1c0e1d7
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth, ritu
bugs1284350, 1282710
milestone50.0a2
Bug 1284350. Backed out changeset 103dc4eddacf (Bug 1282710 - part 2 - Plumb the visibility event from nsIFrame to nsIDOMMediaElemnt; r=seth) a=ritu
layout/generic/nsVideoFrame.cpp
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -664,26 +664,25 @@ nsVideoFrame::AttributeChanged(int32_t a
                                             aModType);
 }
 
 void
 nsVideoFrame::OnVisibilityChange(Visibility aOldVisibility,
                                  Visibility aNewVisibility,
                                  Maybe<OnNonvisible> aNonvisibleAction)
 {
-  if (HasVideoElement()) {
-    nsCOMPtr<nsIDOMHTMLMediaElement> mediaDomElement = do_QueryInterface(mContent);
-    mediaDomElement->OnVisibilityChange(aOldVisibility, aNewVisibility);
+  nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mPosterImage);
+  if (!imageLoader) {
+    nsContainerFrame::OnVisibilityChange(aOldVisibility, aNewVisibility,
+                                         aNonvisibleAction);
+    return;
   }
 
-  nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mPosterImage);
-  if (imageLoader) {
-    imageLoader->OnVisibilityChange(aOldVisibility, aNewVisibility,
-                                    aNonvisibleAction);
-  }
+  imageLoader->OnVisibilityChange(aOldVisibility, aNewVisibility,
+                                  aNonvisibleAction);
 
   nsContainerFrame::OnVisibilityChange(aOldVisibility, aNewVisibility,
                                        aNonvisibleAction);
 }
 
 bool nsVideoFrame::HasVideoElement() {
   nsCOMPtr<nsIDOMHTMLMediaElement> mediaDomElement = do_QueryInterface(mContent);
   return mediaDomElement->IsVideo();