Backed out changeset 8b51998bca5b (bug 938772) for mochitest-8 bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2013-12-04 09:22:59 +01:00
parent 3c8d5360e3
commit dd25eec096
4 changed files with 14 additions and 38 deletions

View File

@ -92,7 +92,8 @@ nsVideoFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
// 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;
@ -591,22 +592,20 @@ nsVideoFrame::GetVideoIntrinsicSize(nsRenderingContext *aRenderingContext)
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
@ -615,7 +614,8 @@ nsVideoFrame::AttributeChanged(int32_t aNameSpaceID,
int32_t aModType)
{
if (aAttribute == nsGkAtoms::poster && HasVideoElement()) {
UpdatePosterSource(true);
nsresult res = UpdatePosterSource(true);
NS_ENSURE_SUCCESS(res,res);
}
return nsContainerFrame::AttributeChanged(aNameSpaceID,
aAttribute,

View File

@ -112,7 +112,7 @@ protected:
// 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();

View File

@ -79,7 +79,6 @@ support-files = bug633762_iframe.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]

View File

@ -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>