Bug 1193349 - Part 2: Force a reload only when a source/img is really removed from a picture; r=jdm

MozReview-Commit-ID: 96ui8rQf4uz
This commit is contained in:
Edgar Chen
2016-04-22 22:36:54 +08:00
parent db0868d04c
commit aeed512b76
2 changed files with 21 additions and 23 deletions

View File

@@ -646,16 +646,6 @@ HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
}
}
if (GetParent() &&
GetParent()->IsHTMLElement(nsGkAtoms::picture) &&
HTMLPictureElement::IsPictureEnabled()) {
// Being removed from picture re-triggers selection, even if we
// weren't using a <source> peer
if (aNullParent) {
QueueImageLoadTask(true);
}
}
nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
@@ -1084,6 +1074,10 @@ HTMLImageElement::PictureSourceRemoved(nsIContent *aSourceNode)
return;
}
MOZ_ASSERT(aSourceNode == this ||
IsPreviousSibling(aSourceNode, this),
"Should not be getting notifications for non-previous-siblings");
QueueImageLoadTask(true);
}