Bug 1441136: Cleanup a bit the responsive image content setup. r=smaug
Also, clear it in DestroyElementMaps, as the rest of the code. MozReview-Commit-ID: A8D3pgQ8MxX
This commit is contained in:
@@ -632,12 +632,8 @@ HTMLImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
}
|
||||
|
||||
if (mInDocResponsiveContent) {
|
||||
nsIDocument* doc = GetOurOwnerDoc();
|
||||
MOZ_ASSERT(doc);
|
||||
if (doc) {
|
||||
doc->RemoveResponsiveContent(this);
|
||||
mInDocResponsiveContent = false;
|
||||
}
|
||||
OwnerDoc()->RemoveResponsiveContent(this);
|
||||
mInDocResponsiveContent = false;
|
||||
}
|
||||
|
||||
nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
|
||||
@@ -1050,11 +1046,8 @@ HTMLImageElement::PictureSourceSrcsetChanged(nsIContent *aSourceNode,
|
||||
}
|
||||
|
||||
if (!mInDocResponsiveContent && IsInComposedDoc()) {
|
||||
nsIDocument* doc = GetOurOwnerDoc();
|
||||
if (doc) {
|
||||
doc->AddResponsiveContent(this);
|
||||
mInDocResponsiveContent = true;
|
||||
}
|
||||
OwnerDoc()->AddResponsiveContent(this);
|
||||
mInDocResponsiveContent = true;
|
||||
}
|
||||
|
||||
// This always triggers the image update steps per the spec, even if
|
||||
|
||||
Reference in New Issue
Block a user