Bug 1786455 - Clear the pending image load task after we destroy the image element. r=emilio
It doesn't make sense to load the selected image after we destroy the image element because this is unnecessary and may cause unexpected behaviors. We can reproduce this by running layout/style/test/test_bug418986-2.html with xorigin, if we don't apply this patch. Differential Revision: https://phabricator.services.mozilla.com/D155419
This commit is contained in:
@@ -1261,6 +1261,10 @@ bool HTMLImageElement::SelectSourceForTagWithAttrs(
|
||||
}
|
||||
|
||||
void HTMLImageElement::DestroyContent() {
|
||||
// Clear mPendingImageLoadTask to avoid running LoadSelectedImage() after
|
||||
// getting destroyed.
|
||||
mPendingImageLoadTask = nullptr;
|
||||
|
||||
mResponsiveSelector = nullptr;
|
||||
|
||||
nsImageLoadingContent::Destroy();
|
||||
|
||||
Reference in New Issue
Block a user