From ae902d5599a99771ea4f2dfa8ed7313beadc2b6f Mon Sep 17 00:00:00 2001 From: bechen Date: Mon, 11 Jul 2016 15:03:53 +0800 Subject: [PATCH] Bug 871747 - Load the TrackElement outside the document. r=rillian MozReview-Commit-ID: Cql1YAZnnnL --HG-- extra : transplant_source : %FA%21%D1%8A%14%E6%BA%8A%91H%F0%EE%CB%7B%AB9%19%20%2A%C2 --- dom/html/HTMLTrackElement.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dom/html/HTMLTrackElement.cpp b/dom/html/HTMLTrackElement.cpp index 1ad91700ab97..aa201f4cccd7 100644 --- a/dom/html/HTMLTrackElement.cpp +++ b/dom/html/HTMLTrackElement.cpp @@ -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 r = NewRunnableMethod(this, &HTMLTrackElement::LoadResource); - mMediaParent->RunInStableState(r); + nsContentUtils::RunInStableState(r.forget()); } return NS_OK;