diff options
Diffstat (limited to 'dom/html')
-rw-r--r-- | dom/html/HTMLImageElement.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp index b11cd101a0..b697dcabea 100644 --- a/dom/html/HTMLImageElement.cpp +++ b/dom/html/HTMLImageElement.cpp @@ -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; } |