Bug 1233259, only in-document images should respond to viewport changes, r=mystor a=abillings
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 18 Dec 2015 03:48:47 +0200
changeset 298019 92d89aad273cdd1d7d9612e3092b3640541c8c0f
parent 298018 001ddf39af088d7d0916b1a0ffc5220727eb08ec
child 298020 e6a7e8c9e3e2f51c2a48812269b5a30287c29c3c
push id8842
push userkwierso@gmail.com
push dateTue, 22 Dec 2015 21:07:53 +0000
treeherdermozilla-aurora@8fffb7394021 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor, abillings
bugs1233259
milestone45.0a2
Bug 1233259, only in-document images should respond to viewport changes, r=mystor a=abillings
dom/html/HTMLImageElement.cpp
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -991,17 +991,17 @@ HTMLImageElement::PictureSourceSrcsetCha
     mResponsiveSelector ? mResponsiveSelector->Content() : nullptr;
 
   if (aSourceNode == currentSrc) {
     // We're currently using this node as our responsive selector
     // source.
     mResponsiveSelector->SetCandidatesFromSourceSet(aNewValue);
   }
 
-  if (!mInDocResponsiveContent) {
+  if (!mInDocResponsiveContent && IsInComposedDoc()) {
     nsIDocument* doc = GetOurOwnerDoc();
     if (doc) {
       doc->AddResponsiveContent(this);
       mInDocResponsiveContent = true;
     }
   }
 
   // This always triggers the image update steps per the spec, even if