Bug 1193349 - Part 1: Force a reload only when a source/img is really inserted into a picture; r=jdm

MozReview-Commit-ID: 4FfTwg1nRFO
This commit is contained in:
Edgar Chen
2016-05-04 10:21:45 +08:00
parent e4a9eb4573
commit db0868d04c
4 changed files with 38 additions and 12 deletions

View File

@@ -173,15 +173,6 @@ HTMLSourceElement::BindToTree(nsIDocument *aDocument,
if (aParent && aParent->IsNodeOfType(nsINode::eMEDIA)) {
HTMLMediaElement* media = static_cast<HTMLMediaElement*>(aParent);
media->NotifyAddedSource();
} else if (aParent && aParent->IsHTMLElement(nsGkAtoms::picture)) {
// Find any img siblings after this <source> and notify them
nsCOMPtr<nsIContent> sibling = AsContent();
while ( (sibling = sibling->GetNextSibling()) ) {
if (sibling->IsHTMLElement(nsGkAtoms::img)) {
HTMLImageElement *img = static_cast<HTMLImageElement*>(sibling.get());
img->PictureSourceAdded(AsContent());
}
}
}
return NS_OK;