Backed out changeset f966e6a3d741 (bug 958596)
authorEd Morley <emorley@mozilla.com>
Tue, 25 Feb 2014 17:17:06 +0000
changeset 170771 e6bd5b650e5825ca4812c1ab7c249e93a7c345de
parent 170770 6cbed6f7c54683fac0e9a6a2c056720aacb255fc
child 170772 9ad415f6d6cb630dc36cbe3c47862b2366f974fd
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs958596
milestone30.0a1
backs outf966e6a3d741f7b6859b71ce7451fc416728f32a
Backed out changeset f966e6a3d741 (bug 958596)
content/base/public/Element.h
content/base/public/nsIContent.h
content/base/src/Element.cpp
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -487,18 +487,16 @@ public:
   {
     List(out, aIndent, EmptyCString());
   }
   virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const MOZ_OVERRIDE;
   void List(FILE* out, int32_t aIndent, const nsCString& aPrefix) const;
   void ListAttributes(FILE* out) const;
 #endif
 
-  void Describe(nsAString& aOutDescription) const MOZ_OVERRIDE;
-
   /*
    * Attribute Mapping Helpers
    */
   struct MappedAttributeEntry {
     nsIAtom** attribute;
   };
 
   /**
@@ -511,18 +509,16 @@ public:
   static bool
   FindAttributeDependence(const nsIAtom* aAttribute,
                           const MappedAttributeEntry* const (&aMaps)[N])
   {
     return FindAttributeDependence(aAttribute, aMaps, N);
   }
 
 private:
-  void DescribeAttribute(uint32_t index, nsAString& aOutDescription) const;
-
   static bool
   FindAttributeDependence(const nsIAtom* aAttribute,
                           const MappedAttributeEntry* const aMaps[],
                           uint32_t aMapCount);
 
 protected:
   inline bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                       DOMString& aResult) const
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -945,25 +945,16 @@ public:
   /**
    * Dump the content (and anything it contains) out to the given
    * file stream. Use aIndent as the base indent during formatting.
    */
   virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
                            bool aDumpAll = true) const = 0;
 #endif
 
-  /**
-   * Append to aOutDescription a short (preferably one line) string
-   * describing the content.
-   * Currently implemented for elements only.
-   */
-  virtual void Describe(nsAString& aOutDescription) const {
-    aOutDescription = NS_LITERAL_STRING("(not an element)");
-  }
-
   enum ETabFocusType {
   //eTabFocus_textControlsMask = (1<<0),  // unused - textboxes always tabbable
     eTabFocus_formElementsMask = (1<<1),  // non-text form elements
     eTabFocus_linksMask = (1<<2),         // links
     eTabFocus_any = 1 + (1<<1) + (1<<2)   // everything that can be focused
   };
 
   // Tab focus model bit field:
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -2127,45 +2127,40 @@ Element::GetAttrNameAt(uint32_t aIndex) 
 }
 
 uint32_t
 Element::GetAttrCount() const
 {
   return mAttrsAndChildren.AttrCount();
 }
 
-void
-Element::DescribeAttribute(uint32_t index, nsAString& aOutDescription) const
-{
-  // name
-  mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(aOutDescription);
-
-  // value
-  aOutDescription.AppendLiteral("=\"");
-  nsAutoString value;
-  mAttrsAndChildren.AttrAt(index)->ToString(value);
-  for (int i = value.Length(); i >= 0; --i) {
-    if (value[i] == char16_t('"'))
-      value.Insert(char16_t('\\'), uint32_t(i));
-  }
-  aOutDescription.Append(value);
-  aOutDescription.AppendLiteral("\"");
-}
-
 #ifdef DEBUG
 void
 Element::ListAttributes(FILE* out) const
 {
   uint32_t index, count = mAttrsAndChildren.AttrCount();
   for (index = 0; index < count; index++) {
-    nsAutoString attributeDescription;
-    DescribeAttribute(index, attributeDescription);
+    nsAutoString buffer;
+
+    // name
+    mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(buffer);
+
+    // value
+    buffer.AppendLiteral("=\"");
+    nsAutoString value;
+    mAttrsAndChildren.AttrAt(index)->ToString(value);
+    for (int i = value.Length(); i >= 0; --i) {
+      if (value[i] == char16_t('"'))
+        value.Insert(char16_t('\\'), uint32_t(i));
+    }
+    buffer.Append(value);
+    buffer.AppendLiteral("\"");
 
     fputs(" ", out);
-    fputs(NS_LossyConvertUTF16toASCII(attributeDescription).get(), out);
+    fputs(NS_LossyConvertUTF16toASCII(buffer).get(), out);
   }
 }
 
 void
 Element::List(FILE* out, int32_t aIndent,
               const nsCString& aPrefix) const
 {
   int32_t indent;
@@ -2279,31 +2274,16 @@ Element::DumpContent(FILE* out, int32_t 
   fputs("</", out);
   fputs(NS_LossyConvertUTF16toASCII(buf).get(), out);
   fputs(">", out);
 
   if(aIndent) fputs("\n", out);
 }
 #endif
 
-void
-Element::Describe(nsAString& aOutDescription) const
-{
-  aOutDescription.Append(mNodeInfo->QualifiedName());
-  aOutDescription.AppendPrintf("@%p", (void *)this);
-
-  uint32_t index, count = mAttrsAndChildren.AttrCount();
-  for (index = 0; index < count; index++) {
-    aOutDescription.Append(' ');
-    nsAutoString attributeDescription;
-    DescribeAttribute(index, attributeDescription);
-    aOutDescription.Append(attributeDescription);
-  }
-}
-
 bool
 Element::CheckHandleEventForLinksPrecondition(nsEventChainVisitor& aVisitor,
                                               nsIURI** aURI) const
 {
   if (aVisitor.mEventStatus == nsEventStatus_eConsumeNoDefault ||
       (!aVisitor.mEvent->mFlags.mIsTrusted &&
        (aVisitor.mEvent->message != NS_MOUSE_CLICK) &&
        (aVisitor.mEvent->message != NS_KEY_PRESS) &&