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:
@@ -593,9 +593,10 @@ HTMLImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
mInDocResponsiveContent = true;
|
||||
}
|
||||
|
||||
bool forceLoadEvent = HTMLPictureElement::IsPictureEnabled() &&
|
||||
aParent && aParent->IsHTMLElement(nsGkAtoms::picture);
|
||||
QueueImageLoadTask(forceLoadEvent);
|
||||
// Run selection algorithm when an img element is inserted into a document
|
||||
// in order to react to changes in the environment. See note of
|
||||
// https://html.spec.whatwg.org/multipage/embedded-content.html#img-environment-changes
|
||||
QueueImageLoadTask(false);
|
||||
} else if (!InResponsiveMode() &&
|
||||
HasAttr(kNameSpaceID_None, nsGkAtoms::src)) {
|
||||
// We skip loading when our attributes were set from parser land,
|
||||
@@ -1069,6 +1070,10 @@ HTMLImageElement::PictureSourceAdded(nsIContent *aSourceNode)
|
||||
return;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aSourceNode == this ||
|
||||
IsPreviousSibling(aSourceNode, this),
|
||||
"Should not be getting notifications for non-previous-siblings");
|
||||
|
||||
QueueImageLoadTask(true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user