зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
0c3b21fb32
Коммит
82573e49d6
|
@ -8638,6 +8638,7 @@ nsIDocument::DestroyElementMaps()
|
|||
#endif
|
||||
mStyledLinks.Clear();
|
||||
mIdentifierMap.Clear();
|
||||
mResponsiveContent.Clear();
|
||||
IncrementExpandoGeneration(*this);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче