Back out 0b427bfd720d:79e6231558d7 (bug 836050) for Mac and b2g build bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Wed, 30 Jan 2013 20:41:02 -0800
changeset 120427 21cbd89537b584c83a16dbfd6ca6c776c013b776
parent 120426 91db03dc9c5a32968dd5c14a5328a27479f8cc8c
child 120428 09d8683347473775708c358481b5aba905ba74dc
push id22222
push userphilringnalda@gmail.com
push dateThu, 31 Jan 2013 04:41:18 +0000
treeherdermozilla-inbound@09d868334747 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs836050
milestone21.0a1
backs out0b427bfd720d4e07b83edaaaf17ed3cf7a6c8855
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
Back out 0b427bfd720d:79e6231558d7 (bug 836050) for Mac and b2g build bustage CLOSED TREE
content/base/public/Element.h
content/base/public/nsIContent.h
content/base/src/DocumentFragment.h
content/base/src/Element.cpp
content/base/src/nsGenericDOMDataNode.cpp
content/base/src/nsGenericDOMDataNode.h
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -116,18 +116,18 @@ enum {
 namespace mozilla {
 namespace dom {
 
 class Link;
 class UndoManager;
 
 // IID for the dom::Element interface
 #define NS_ELEMENT_IID \
-{ 0xcae9f7e7, 0x6163, 0x47b5, \
- { 0xa1, 0x63, 0x30, 0xc8, 0x1d, 0x2d, 0x79, 0x39 } }
+{ 0xc6c049a1, 0x96e8, 0x4580, \
+  { 0xa6, 0x93, 0xb9, 0x5f, 0x53, 0xbe, 0xe8, 0x1c } }
 
 class Element : public FragmentOrElement
 {
 public:
 #ifdef MOZILLA_INTERNAL_API
   Element(already_AddRefed<nsINodeInfo> aNodeInfo) :
     FragmentOrElement(aNodeInfo),
     mState(NS_EVENT_STATE_MOZ_READONLY)
@@ -457,28 +457,26 @@ public:
     }
     return false;
   }
 
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
                            const nsAString& aValue, bool aNotify);
   nsresult SetParsedAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
                          nsAttrValue& aParsedValue, bool aNotify);
-  // GetAttr is not inlined on purpose, to keep down codesize from all
-  // the inlined nsAttrValue bits for C++ callers.
-  bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-               nsAString& aResult) const;
-  inline bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const;
+  virtual bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
+                       nsAString& aResult) const;
+  virtual bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const;
   // aCaseSensitive == eIgnoreCaase means ASCII case-insensitive matching.
-  inline bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
-                          const nsAString& aValue,
-                          nsCaseTreatment aCaseSensitive) const;
-  inline bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
-                          nsIAtom* aValue,
-                          nsCaseTreatment aCaseSensitive) const;
+  virtual bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
+                             const nsAString& aValue,
+                             nsCaseTreatment aCaseSensitive) const;
+  virtual bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
+                             nsIAtom* aValue,
+                             nsCaseTreatment aCaseSensitive) const;
   virtual int32_t FindAttrValueIn(int32_t aNameSpaceID,
                                   nsIAtom* aName,
                                   AttrValuesArray* aValues,
                                   nsCaseTreatment aCaseSensitive) const;
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
   virtual const nsAttrName* GetAttrNameAt(uint32_t aIndex) const;
   virtual uint32_t GetAttrCount() const;
@@ -1161,53 +1159,16 @@ private:
   nsresult GetMarkup(bool aIncludeSelf, nsAString& aMarkup);
 
   // Data members
   nsEventStates mState;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID)
 
-inline bool
-Element::HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const
-{
-  NS_ASSERTION(nullptr != aName, "must have attribute name");
-  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
-               "must have a real namespace ID!");
-
-  return mAttrsAndChildren.IndexOfAttr(aName, aNameSpaceID) >= 0;
-}
-
-inline bool
-Element::AttrValueIs(int32_t aNameSpaceID,
-                     nsIAtom* aName,
-                     const nsAString& aValue,
-                     nsCaseTreatment aCaseSensitive) const
-{
-  NS_ASSERTION(aName, "Must have attr name");
-  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
-
-  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
-  return val && val->Equals(aValue, aCaseSensitive);
-}
-
-inline bool
-Element::AttrValueIs(int32_t aNameSpaceID,
-                     nsIAtom* aName,
-                     nsIAtom* aValue,
-                     nsCaseTreatment aCaseSensitive) const
-{
-  NS_ASSERTION(aName, "Must have attr name");
-  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
-  NS_ASSERTION(aValue, "Null value atom");
-
-  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
-  return val && val->Equals(aValue, aCaseSensitive);
-}
-
 } // namespace dom
 } // namespace mozilla
 
 inline mozilla::dom::Element* nsINode::AsElement()
 {
   MOZ_ASSERT(IsElement());
   return static_cast<mozilla::dom::Element*>(this);
 }
@@ -1218,51 +1179,16 @@ inline const mozilla::dom::Element* nsIN
   return static_cast<const mozilla::dom::Element*>(this);
 }
 
 inline bool nsINode::HasAttributes() const
 {
   return IsElement() && AsElement()->GetAttrCount() > 0;
 }
 
-inline bool nsIContent::GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-                                nsAString& aResult) const
-{
-  if (IsElement()) {
-    return AsElement()->GetAttr(aNameSpaceID, aName, aResult);
-  }
-  aResult.Truncate();
-  return false;
-}
-
-inline bool nsIContent::HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const
-{
-  return IsElement() && AsElement()->HasAttr(aNameSpaceID, aName);
-}
-
-inline bool
-nsIContent::AttrValueIs(int32_t aNameSpaceID,
-                        nsIAtom* aName,
-                        const nsAString& aValue,
-                        nsCaseTreatment aCaseSensitive) const
-{
-  return IsElement() &&
-    AsElement()->AttrValueIs(aNameSpaceID, aName, aValue, aCaseSensitive);
-}
-
-inline bool
-nsIContent::AttrValueIs(int32_t aNameSpaceID,
-                        nsIAtom* aName,
-                        nsIAtom* aValue,
-                        nsCaseTreatment aCaseSensitive) const
-{
-  return IsElement() &&
-    AsElement()->AttrValueIs(aNameSpaceID, aName, aValue, aCaseSensitive);
-}
-
 /**
  * Macros to implement Clone(). _elementName is the class for which to implement
  * Clone.
  */
 #define NS_IMPL_ELEMENT_CLONE(_elementName)                                 \
 nsresult                                                                    \
 _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const        \
 {                                                                           \
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -29,18 +29,18 @@ struct IMEState;
 enum nsLinkState {
   eLinkState_Unvisited  = 1,
   eLinkState_Visited    = 2,
   eLinkState_NotLink    = 3 
 };
 
 // IID for the nsIContent interface
 #define NS_ICONTENT_IID \
-{ 0x8a8b4b1d, 0x72d8, 0x428e, \
- { 0x95, 0x75, 0xf9, 0x18, 0xba, 0xf6, 0x9e, 0xa1 } }
+{ 0xe2985850, 0x81ca, 0x4b5d, \
+  { 0xb0, 0xf3, 0xe3, 0x95, 0xd5, 0x0d, 0x85, 0x64 } }
 
 /**
  * A node of content in a document's content model. This interface
  * is supported by all content objects.
  */
 class nsIContent : public nsINode {
 public:
   typedef mozilla::widget::IMEState IMEState;
@@ -366,66 +366,64 @@ public:
    * Get the current value of the attribute. This returns a form that is
    * suitable for passing back into SetAttr.
    *
    * @param aNameSpaceID the namespace of the attr
    * @param aName the name of the attr
    * @param aResult the value (may legitimately be the empty string) [OUT]
    * @returns true if the attribute was set (even when set to empty string)
    *          false when not set.
-   *
-   * Implemented inline in Element.h
    */
-  bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
-               nsAString& aResult) const;
+  virtual bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName, 
+                         nsAString& aResult) const = 0;
 
   /**
    * Determine if an attribute has been set (empty string or otherwise).
    *
    * @param aNameSpaceId the namespace id of the attribute
    * @param aAttr the attribute name
    * @return whether an attribute exists
-   *
-   * Implemented inline in Element.h
    */
-  bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const;
+  virtual bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const = 0;
 
   /**
    * Test whether this content node's given attribute has the given value.  If
    * the attribute is not set at all, this will return false.
    *
    * @param aNameSpaceID The namespace ID of the attribute.  Must not
    *                     be kNameSpaceID_Unknown.
    * @param aName The name atom of the attribute.  Must not be null.
    * @param aValue The value to compare to.
    * @param aCaseSensitive Whether to do a case-sensitive compare on the value.
-   *
-   * Implemented inline in Element.h
    */
-  bool AttrValueIs(int32_t aNameSpaceID,
-                   nsIAtom* aName,
-                   const nsAString& aValue,
-                   nsCaseTreatment aCaseSensitive) const;
+  virtual bool AttrValueIs(int32_t aNameSpaceID,
+                             nsIAtom* aName,
+                             const nsAString& aValue,
+                             nsCaseTreatment aCaseSensitive) const
+  {
+    return false;
+  }
   
   /**
    * Test whether this content node's given attribute has the given value.  If
    * the attribute is not set at all, this will return false.
    *
    * @param aNameSpaceID The namespace ID of the attribute.  Must not
    *                     be kNameSpaceID_Unknown.
    * @param aName The name atom of the attribute.  Must not be null.
    * @param aValue The value to compare to.  Must not be null.
    * @param aCaseSensitive Whether to do a case-sensitive compare on the value.
-   *
-   * Implemented inline in Element.h
    */
-  bool AttrValueIs(int32_t aNameSpaceID,
-                   nsIAtom* aName,
-                   nsIAtom* aValue,
-                   nsCaseTreatment aCaseSensitive) const;
+  virtual bool AttrValueIs(int32_t aNameSpaceID,
+                             nsIAtom* aName,
+                             nsIAtom* aValue,
+                             nsCaseTreatment aCaseSensitive) const
+  {
+    return false;
+  }
   
   enum {
     ATTR_MISSING = -1,
     ATTR_VALUE_NO_MATCH = -2
   };
   /**
    * Check whether this content node's given attribute has one of a given
    * list of values. If there is a match, we return the index in the list
--- a/content/base/src/DocumentFragment.h
+++ b/content/base/src/DocumentFragment.h
@@ -57,16 +57,25 @@ public:
     return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
   }
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify)
   {
     return NS_OK;
   }
+  virtual bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName, 
+                       nsAString& aResult) const
+  {
+    return false;
+  }
+  virtual bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const
+  {
+    return false;
+  }
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute, 
                              bool aNotify)
   {
     return NS_OK;
   }
   virtual const nsAttrName* GetAttrNameAt(uint32_t aIndex) const
   {
     return nullptr;
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -1962,16 +1962,53 @@ Element::GetAttr(int32_t aNameSpaceID, n
                  nsAString& aResult) const
 {
   DOMString str;
   bool haveAttr = GetAttr(aNameSpaceID, aName, str);
   str.ToString(aResult);
   return haveAttr;
 }
 
+bool
+Element::HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const
+{
+  NS_ASSERTION(nullptr != aName, "must have attribute name");
+  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
+               "must have a real namespace ID!");
+
+  return mAttrsAndChildren.IndexOfAttr(aName, aNameSpaceID) >= 0;
+}
+
+bool
+Element::AttrValueIs(int32_t aNameSpaceID,
+                     nsIAtom* aName,
+                     const nsAString& aValue,
+                     nsCaseTreatment aCaseSensitive) const
+{
+  NS_ASSERTION(aName, "Must have attr name");
+  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
+
+  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
+  return val && val->Equals(aValue, aCaseSensitive);
+}
+
+bool
+Element::AttrValueIs(int32_t aNameSpaceID,
+                     nsIAtom* aName,
+                     nsIAtom* aValue,
+                     nsCaseTreatment aCaseSensitive) const
+{
+  NS_ASSERTION(aName, "Must have attr name");
+  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
+  NS_ASSERTION(aValue, "Null value atom");
+
+  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
+  return val && val->Equals(aValue, aCaseSensitive);
+}
+
 int32_t
 Element::FindAttrValueIn(int32_t aNameSpaceID,
                          nsIAtom* aName,
                          AttrValuesArray* aValues,
                          nsCaseTreatment aCaseSensitive) const
 {
   NS_ASSERTION(aName, "Must have attr name");
   NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -572,16 +572,31 @@ nsGenericDOMDataNode::SetAttr(int32_t aN
 
 nsresult
 nsGenericDOMDataNode::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttr,
                                 bool aNotify)
 {
   return NS_OK;
 }
 
+bool
+nsGenericDOMDataNode::GetAttr(int32_t aNameSpaceID, nsIAtom *aAttr,
+                              nsAString& aResult) const
+{
+  aResult.Truncate();
+
+  return false;
+}
+
+bool
+nsGenericDOMDataNode::HasAttr(int32_t aNameSpaceID, nsIAtom *aAttribute) const
+{
+  return false;
+}
+
 const nsAttrName*
 nsGenericDOMDataNode::GetAttrNameAt(uint32_t aIndex) const
 {
   return nullptr;
 }
 
 uint32_t
 nsGenericDOMDataNode::GetAttrCount() const
--- a/content/base/src/nsGenericDOMDataNode.h
+++ b/content/base/src/nsGenericDOMDataNode.h
@@ -110,16 +110,19 @@ public:
   {
     return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
   }
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify);
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify);
+  virtual bool GetAttr(int32_t aNameSpaceID, nsIAtom *aAttribute,
+                         nsAString& aResult) const;
+  virtual bool HasAttr(int32_t aNameSpaceID, nsIAtom *aAttribute) const;
   virtual const nsAttrName* GetAttrNameAt(uint32_t aIndex) const;
   virtual uint32_t GetAttrCount() const;
   virtual const nsTextFragment *GetText();
   virtual uint32_t TextLength() const;
   virtual nsresult SetText(const PRUnichar* aBuffer, uint32_t aLength,
                            bool aNotify);
   // Need to implement this here too to avoid hiding.
   nsresult SetText(const nsAString& aStr, bool aNotify)