Backed out changeset 8b51998bca5b (bug 938772) for mochitest-8 bustage on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 04 Dec 2013 09:22:59 +0100
changeset 174438 65bdf48eb148cadb797dc51a8baa5227352a887c
parent 174437 ba41e330fc7a6cbc74278e0b9c7ab53caab7be9a
child 174439 89409f6726e6e50137cd72c8081b0a0c99187873
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs938772
milestone28.0a1
backs out8b51998bca5bca1e5b413ae27407562cd9e583ac
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 8b51998bca5b (bug 938772) for mochitest-8 bustage on a CLOSED TREE
layout/generic/nsVideoFrame.cpp
layout/generic/nsVideoFrame.h
layout/generic/test/mochitest.ini
layout/generic/test/test_bug938772.html
--- a/layout/generic/nsVideoFrame.cpp
+++ b/layout/generic/nsVideoFrame.cpp
@@ -87,17 +87,18 @@ nsVideoFrame::CreateAnonymousContent(nsT
     // as the image is native anonymous, and so can't be reframed (currently).
     nsCOMPtr<nsIImageLoadingContent> imgContent = do_QueryInterface(mPosterImage);
     NS_ENSURE_TRUE(imgContent, NS_ERROR_FAILURE);
 
     imgContent->ForceImageState(true, 0);
     // And now have it update its internal state
     element->UpdateState(false);
 
-    UpdatePosterSource(false);
+    nsresult res = UpdatePosterSource(false);
+    NS_ENSURE_SUCCESS(res,res);
 
     if (!aElements.AppendElement(mPosterImage))
       return NS_ERROR_OUT_OF_MEMORY;
 
     // Set up the caption overlay div for showing any TextTrack data
     nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::div,
                                             nullptr,
                                             kNameSpaceID_XHTML,
@@ -586,41 +587,40 @@ nsVideoFrame::GetVideoIntrinsicSize(nsRe
       return imgsize;
     }
   }
 
   return nsSize(nsPresContext::CSSPixelsToAppUnits(size.width),
                 nsPresContext::CSSPixelsToAppUnits(size.height));
 }
 
-void
+nsresult
 nsVideoFrame::UpdatePosterSource(bool aNotify)
 {
   NS_ASSERTION(HasVideoElement(), "Only call this on <video> elements.");
   HTMLVideoElement* element = static_cast<HTMLVideoElement*>(GetContent());
 
-  if (element->HasAttr(kNameSpaceID_None, nsGkAtoms::poster)) {
-    nsAutoString posterStr;
-    element->GetPoster(posterStr);
-    mPosterImage->SetAttr(kNameSpaceID_None,
-                          nsGkAtoms::src,
-                          posterStr,
-                          aNotify);
-  } else {
-    mPosterImage->UnsetAttr(kNameSpaceID_None, nsGkAtoms::poster, aNotify);
-  }
+  nsAutoString posterStr;
+  element->GetPoster(posterStr);
+  nsresult res = mPosterImage->SetAttr(kNameSpaceID_None,
+                                       nsGkAtoms::src,
+                                       posterStr,
+                                       aNotify);
+  NS_ENSURE_SUCCESS(res,res);
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsVideoFrame::AttributeChanged(int32_t aNameSpaceID,
                                nsIAtom* aAttribute,
                                int32_t aModType)
 {
   if (aAttribute == nsGkAtoms::poster && HasVideoElement()) {
-    UpdatePosterSource(true);
+    nsresult res = UpdatePosterSource(true);
+    NS_ENSURE_SUCCESS(res,res);
   }
   return nsContainerFrame::AttributeChanged(aNameSpaceID,
                                             aAttribute,
                                             aModType);
 }
 
 bool nsVideoFrame::HasVideoElement() {
   nsCOMPtr<nsIDOMHTMLVideoElement> videoDomElement = do_QueryInterface(mContent);
--- a/layout/generic/nsVideoFrame.h
+++ b/layout/generic/nsVideoFrame.h
@@ -107,17 +107,17 @@ protected:
   // Returns true if there is video data to render. Can return false
   // when we're the frame for an audio element, or we've created a video
   // element for a media which is audio-only.
   bool HasVideoData();
 
   // Sets the mPosterImage's src attribute to be the video's poster attribute,
   // if we're the frame for a video element. Only call on frames for video
   // elements, not for frames for audio elements.
-  void UpdatePosterSource(bool aNotify);
+  nsresult UpdatePosterSource(bool aNotify);
 
   virtual ~nsVideoFrame();
 
   nsMargin mBorderPadding;
 
   // Anonymous child which is bound via XBL to the video controls.
   nsCOMPtr<nsIContent> mVideoControls;
 
--- a/layout/generic/test/mochitest.ini
+++ b/layout/generic/test/mochitest.ini
@@ -74,17 +74,16 @@ support-files = bug633762_iframe.html
 [test_bug735641.html]
 [test_bug748961.html]
 [test_bug784410.html]
 [test_bug785324.html]
 [test_bug791616.html]
 [test_bug831780.html]
 [test_bug841361.html]
 [test_bug904810.html]
-[test_bug938772.html]
 [test_contained_plugin_transplant.html]
 [test_image_selection.html]
 [test_image_selection_2.html]
 [test_invalidate_during_plugin_paint.html]
 [test_movement_by_characters.html]
 [test_movement_by_words.html]
 # Disable the caret movement by word test on Linux because the shortcut keys
 # are defined in system level.  So, it depends on the environment.
deleted file mode 100644
--- a/layout/generic/test/test_bug938772.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!doctype html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=938772
--->
-<title>Test for Bug 938772</title>
-<script src="/tests/SimpleTest/SimpleTest.js"></script>
-<link rel="stylesheet" href="/tests/SimpleTest/test.css">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=938772">Mozilla Bug 938772</a>
-<p id="display"></p>
-<iframe id="i"
-        src="data:text/html,<base href='http://basetag/basetag'><video id='v' onerror='v.failed=true'></video>"></iframe>
-<pre id="test">
-<script>
-SimpleTest.waitForExplicitFinish();
-
-i.onload = function() {
-  ok(!i.contentDocument.getElementById("v").failed,
-     "Check whether an error was reported");
-  SimpleTest.finish();
-};
-</script>
-