Issue #2135 - Bug 1518795: Properly track responsive content in a connected ShadowRoot

This commit is contained in:
FranklinDM 2023-03-04 13:01:56 +08:00 committed by roytam1
commit 7b395189ac
2 changed files with 8 additions and 9 deletions

View file

@ -623,8 +623,9 @@ HTMLImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
}
if (HaveSrcsetOrInPicture()) {
if (aDocument && !mInDocResponsiveContent) {
aDocument->AddResponsiveContent(this);
nsIDocument* doc = GetComposedDoc();
if (doc && !mInDocResponsiveContent) {
doc->AddResponsiveContent(this);
mInDocResponsiveContent = true;
}