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

@ -1430,13 +1430,11 @@ nsImageLoadingContent::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,
bool aCompileEventHandlers)
{
// We may be entering the document, so if our image should be tracked,
// track it.
if (!aDocument)
return;
TrackImage(mCurrentRequest);
TrackImage(mPendingRequest);
// We may be getting connected and our image should be tracked.
if (GetOurCurrentDoc()) {
TrackImage(mCurrentRequest);
TrackImage(mPendingRequest);
}
if (mCurrentRequestFlags & REQUEST_BLOCKS_ONLOAD)
aDocument->BlockOnload();