Bug 1133104, null check parent node before checking whether it is <picture>, r=bz
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sat, 14 Feb 2015 13:02:47 +0200
changeset 256352 d9d47b2795b44f9952a95a6aaca3d37c2f315e7a
parent 256351 a1bd894fbfc812f1f3ba524d8088eea1ab5bb474
child 256353 6952d9fe4f36b90405ed21d4e1d548f913119ed8
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1133104
milestone38.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 1133104, null check parent node before checking whether it is <picture>, r=bz
dom/html/HTMLImageElement.cpp
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -624,18 +624,18 @@ HTMLImageElement::UnbindFromTree(bool aD
   if (mForm) {
     if (aNullParent || !FindAncestorForm(mForm)) {
       ClearForm(true);
     } else {
       UnsetFlags(MAYBE_ORPHAN_FORM_ELEMENT);
     }
   }
 
-  if (aNullParent &&
-      nsINode::GetParentNode()->Tag() == nsGkAtoms::picture &&
+  if (aNullParent && GetParent() &&
+      GetParent()->IsHTML(nsGkAtoms::picture) &&
       HTMLPictureElement::IsPictureEnabled()) {
     // Being removed from picture re-triggers selection, even if we
     // weren't using a <source> peer
     QueueImageLoadTask();
   }
 
   nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);