Bug 1134561 - Use of the namespace when checking the tag name if HTMLPictureElement and HTMLSourceElement. r=jst
authorRobert Longson <longsonr@gmail.com>
Tue, 10 Mar 2015 10:23:14 -0400
changeset 232742 9264aec18c621024190097d3b1542b5649c97a5d
parent 232741 e25c3139edca5eaeb9b2b50d9e458771aca190f5
child 232743 3b2a45bc4307a0a5cff0949a4e30d3b86b5bdb0f
push id56646
push userryanvm@gmail.com
push dateTue, 10 Mar 2015 14:27:41 +0000
treeherdermozilla-inbound@9264aec18c62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs1134561
milestone39.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 1134561 - Use of the namespace when checking the tag name if HTMLPictureElement and HTMLSourceElement. r=jst
dom/html/HTMLPictureElement.cpp
dom/html/HTMLSourceElement.cpp
--- a/dom/html/HTMLPictureElement.cpp
+++ b/dom/html/HTMLPictureElement.cpp
@@ -39,17 +39,17 @@ NS_IMPL_ISUPPORTS_INHERITED(HTMLPictureE
                             nsIDOMHTMLPictureElement)
 
 NS_IMPL_ELEMENT_CLONE(HTMLPictureElement)
 
 void
 HTMLPictureElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
 {
   // Find all img siblings after this <source> to notify them of its demise
-  nsCOMPtr<nsINode> child = GetChildAt(aIndex);
+  nsCOMPtr<nsIContent> child = GetChildAt(aIndex);
   nsCOMPtr<nsIContent> nextSibling;
   if (child && child->IsHTMLElement(nsGkAtoms::source)) {
     nextSibling = child->GetNextSibling();
   }
 
   nsGenericHTMLElement::RemoveChildAt(aIndex, aNotify);
 
   if (nextSibling && nextSibling->GetParentNode() == this) {
--- a/dom/html/HTMLSourceElement.cpp
+++ b/dom/html/HTMLSourceElement.cpp
@@ -75,26 +75,26 @@ HTMLSourceElement::WouldMatchMediaForDoc
 }
 
 nsresult
 HTMLSourceElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                                 const nsAttrValue* aValue, bool aNotify)
 {
   // If we are associated with a <picture> with a valid <img>, notify it of
   // responsive parameter changes
-  nsINode *parent = nsINode::GetParentNode();
+  Element *parent = nsINode::GetParentElement();
   if (aNameSpaceID == kNameSpaceID_None &&
       (aName == nsGkAtoms::srcset ||
        aName == nsGkAtoms::sizes ||
        aName == nsGkAtoms::media ||
        aName == nsGkAtoms::type) &&
       parent && parent->IsHTMLElement(nsGkAtoms::picture)) {
     nsString strVal = aValue ? aValue->GetStringValue() : EmptyString();
     // Find all img siblings after this <source> and notify them of the change
-    nsCOMPtr<nsINode> sibling = AsContent();
+    nsCOMPtr<nsIContent> sibling = AsContent();
     while ( (sibling = sibling->GetNextSibling()) ) {
       if (sibling->IsHTMLElement(nsGkAtoms::img)) {
         HTMLImageElement *img = static_cast<HTMLImageElement*>(sibling.get());
         if (aName == nsGkAtoms::srcset) {
           img->PictureSourceSrcsetChanged(AsContent(), strVal, aNotify);
         } else if (aName == nsGkAtoms::sizes) {
           img->PictureSourceSizesChanged(AsContent(), strVal, aNotify);
         } else if (aName == nsGkAtoms::media ||
@@ -144,17 +144,17 @@ HTMLSourceElement::BindToTree(nsIDocumen
                                                  aCompileEventHandlers);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aParent && aParent->IsNodeOfType(nsINode::eMEDIA)) {
     HTMLMediaElement* media = static_cast<HTMLMediaElement*>(aParent);
     media->NotifyAddedSource();
   } else if (aParent && aParent->IsHTMLElement(nsGkAtoms::picture)) {
     // Find any img siblings after this <source> and notify them
-    nsCOMPtr<nsINode> sibling = AsContent();
+    nsCOMPtr<nsIContent> sibling = AsContent();
     while ( (sibling = sibling->GetNextSibling()) ) {
       if (sibling->IsHTMLElement(nsGkAtoms::img)) {
         HTMLImageElement *img = static_cast<HTMLImageElement*>(sibling.get());
         img->PictureSourceAdded(AsContent());
       }
     }
   }