Bug 871747 - Load the TrackElement outside the document. r=rillian

MozReview-Commit-ID: Cql1YAZnnnL
This commit is contained in:
bechen
2016-07-11 15:03:53 +08:00
parent bd35abcce9
commit c74b8e596a

View File

@@ -239,10 +239,6 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument,
aCompileEventHandlers);
NS_ENSURE_SUCCESS(rv, rv);
if (!aDocument) {
return NS_OK;
}
LOG(LogLevel::Debug, ("Track Element bound to tree."));
if (!aParent || !aParent->IsNodeOfType(nsINode::eMEDIA)) {
return NS_OK;
@@ -263,7 +259,7 @@ HTMLTrackElement::BindToTree(nsIDocument* aDocument,
CreateTextTrack();
}
RefPtr<Runnable> r = NewRunnableMethod(this, &HTMLTrackElement::LoadResource);
mMediaParent->RunInStableState(r);
nsContentUtils::RunInStableState(r.forget());
}
return NS_OK;