Bug 1133104 - Null check parent node before checking whether it is <picture>. r=bz, a=sledru
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Sat, 14 Feb 2015 13:02:47 +0200
changeset 243785 7f4a993f3336
parent 243784 bbd9460d9987
child 243786 8597521cb8bd
push id4478
push userryanvm@gmail.com
push date2015-02-17 14:44 +0000
treeherdermozilla-beta@8597521cb8bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, sledru
bugs1133104
milestone36.0
Bug 1133104 - Null check parent node before checking whether it is <picture>. r=bz, a=sledru
dom/html/HTMLImageElement.cpp
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -614,18 +614,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);