Bug 1233259, only in-document images should respond to viewport changes, r=mystor
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 18 Dec 2015 03:48:47 +0200
changeset 276853 f1d406297b871ee953775e2764d0641a1fedd886
parent 276852 511840237bb67cc74f2b6874cb55447e877babda
child 276854 646484054aead26e8340edbaf8497570fcf89fbb
push id69305
push useropettay@mozilla.com
push dateFri, 18 Dec 2015 02:25:12 +0000
treeherdermozilla-inbound@f1d406297b87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmystor
bugs1233259
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1233259, only in-document images should respond to viewport changes, r=mystor
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