Backed out changeset c8013b27a0fa (bug 1239899) for failing W(2). r=backout
This commit is contained in:
@@ -2714,21 +2714,18 @@ HTMLMediaElement::ReportMSETelemetry()
|
||||
void HTMLMediaElement::UnbindFromTree(bool aDeep,
|
||||
bool aNullParent)
|
||||
{
|
||||
RefPtr<HTMLMediaElement> self(this);
|
||||
nsCOMPtr<nsIRunnable> task = NS_NewRunnableFunction([self]() {
|
||||
if (self->IsInDoc() || self->mNetworkState == nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
|
||||
return;
|
||||
}
|
||||
self->Pause();
|
||||
if (self->mDecoder) {
|
||||
self->mDecoder->NotifyOwnerActivityChanged();
|
||||
}
|
||||
});
|
||||
RunInStableState(task);
|
||||
if (!mPaused && mNetworkState != nsIDOMHTMLMediaElement::NETWORK_EMPTY) {
|
||||
Pause();
|
||||
}
|
||||
|
||||
mElementInTreeState = ELEMENT_NOT_INTREE_HAD_INTREE;
|
||||
|
||||
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
|
||||
|
||||
if (mDecoder) {
|
||||
MOZ_ASSERT(IsHidden());
|
||||
mDecoder->NotifyOwnerActivityChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
||||
Reference in New Issue
Block a user