diff --git a/content/base/public/nsIContent.h b/content/base/public/nsIContent.h index 30061100a16..75ba02b19d7 100644 --- a/content/base/public/nsIContent.h +++ b/content/base/public/nsIContent.h @@ -98,8 +98,8 @@ public: * @param aName out parameter representing the complete name of the * attribute */ - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo) = 0; + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo) = 0; /** * Set attribute values. All attribute values are assumed to have a @@ -115,9 +115,9 @@ public: * @param aUpdateMask specifies how whether or not the document should be * notified of the attribute change. */ - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, - PRBool aNotify) = 0; + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify) = 0; /** * Set attribute values. All attribute values are assumed to have a @@ -133,9 +133,9 @@ public: * @param aNotify specifies whether or not the document should be * notified of the attribute change. */ - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify) = 0; + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) = 0; /** * Get the current value of the attribute. This returns a form that is @@ -154,8 +154,8 @@ public: * * */ - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsAWritableString& aResult) const = 0; + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsAWritableString& aResult) const = 0; /** * Get the current value and prefix of the attribute. This returns a form @@ -177,8 +177,8 @@ public: * NOTE! aPrefix is an OUT parameter. */ - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsIAtom*& aPrefix, nsAWritableString& aResult) const = 0; + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsIAtom*& aPrefix, nsAWritableString& aResult) const = 0; /** * Remove an attribute so that it is no longer explicitly specified. @@ -189,8 +189,8 @@ public: * notified of the attribute change * */ - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - PRBool aNotify) = 0; + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRBool aNotify) = 0; /** @@ -201,10 +201,10 @@ public: * @param aName an out param if the attribute name * */ - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const = 0; + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const = 0; /** * Get the number of all specified attributes. @@ -213,7 +213,7 @@ public: * the number of attributes * */ - NS_IMETHOD GetAttributeCount(PRInt32& aCountResult) const = 0; + NS_IMETHOD GetAttrCount(PRInt32& aCountResult) const = 0; /** * Get the size of the content object. The size value should include diff --git a/content/base/src/nsCommentNode.cpp b/content/base/src/nsCommentNode.cpp index 65a8664dfef..62c6c739f0d 100644 --- a/content/base/src/nsCommentNode.cpp +++ b/content/base/src/nsCommentNode.cpp @@ -102,38 +102,38 @@ public: NS_IMETHOD GetNodeInfo(nsINodeInfo*& aResult) const { aResult = nsnull; return NS_OK; } - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo) { + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo) { aNodeInfo = nsnull; return NS_OK; } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, - nsAWritableString& aResult) const { + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, + nsAWritableString& aResult) const { return mInner.GetAttribute(aNameSpaceID, aAttribute, aResult); } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, - nsIAtom*& aPrefix, nsAWritableString& aResult) const { + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, + nsIAtom*& aPrefix, nsAWritableString& aResult) const { return mInner.GetAttribute(aNameSpaceID, aAttribute, aPrefix, aResult); } - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - const nsAReadableString& aValue, PRBool aNotify) { + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + const nsAReadableString& aValue, PRBool aNotify) { return mInner.SetAttribute(aNameSpaceID, aAttribute, aValue, aNotify); } - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, PRBool aNotify) { + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, PRBool aNotify) { return mInner.SetAttribute(aNodeInfo, aValue, aNotify); } - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - PRBool aNotify) { + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRBool aNotify) { return mInner.UnsetAttribute(aNameSpaceID, aAttribute, aNotify); } - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const { + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const { return mInner.GetAttributeNameAt(aIndex, aNameSpaceID, aName, aPrefix); } - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { + NS_IMETHOD GetAttrCount(PRInt32& aResult) const { return mInner.GetAttributeCount(aResult); } NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; diff --git a/content/base/src/nsContentList.cpp b/content/base/src/nsContentList.cpp index 4af51353232..d1002f3e0ee 100644 --- a/content/base/src/nsContentList.cpp +++ b/content/base/src/nsContentList.cpp @@ -425,9 +425,9 @@ nsContentList::NamedItem(const nsAReadableString& aName, nsIDOMNode** aReturn, P if (content) { nsAutoString name; // XXX Should it be an EqualsIgnoreCase? - if (((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, name) == NS_CONTENT_ATTR_HAS_VALUE) && + if (((content->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, name) == NS_CONTENT_ATTR_HAS_VALUE) && (aName.Equals(name))) || - ((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::id, name) == NS_CONTENT_ATTR_HAS_VALUE) && + ((content->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::id, name) == NS_CONTENT_ATTR_HAS_VALUE) && (aName.Equals(name)))) { return CallQueryInterface(content, aReturn); } diff --git a/content/base/src/nsDOMAttribute.cpp b/content/base/src/nsDOMAttribute.cpp index 1ef54a60280..8a9760da0b6 100644 --- a/content/base/src/nsDOMAttribute.cpp +++ b/content/base/src/nsDOMAttribute.cpp @@ -114,7 +114,7 @@ nsDOMAttribute::GetValue(nsAWritableString& aValue) mNodeInfo->GetNamespaceID(nameSpaceID); nsAutoString tmpValue; - attrResult = mContent->GetAttribute(nameSpaceID, name, tmpValue); + attrResult = mContent->GetAttr(nameSpaceID, name, tmpValue); if (NS_CONTENT_ATTR_NOT_THERE != attrResult) { mValue = tmpValue; } @@ -130,7 +130,7 @@ nsDOMAttribute::SetValue(const nsAReadableString& aValue) nsresult result = NS_OK; if (mContent) { - result = mContent->SetAttribute(mNodeInfo, aValue, PR_TRUE); + result = mContent->SetAttr(mNodeInfo, aValue, PR_TRUE); } mValue=aValue; @@ -155,7 +155,7 @@ nsDOMAttribute::GetSpecified(PRBool* aSpecified) mNodeInfo->GetNameAtom(*getter_AddRefs(name)); mNodeInfo->GetNamespaceID(nameSpaceID); - attrResult = mContent->GetAttribute(nameSpaceID, name, value); + attrResult = mContent->GetAttr(nameSpaceID, name, value); if (NS_CONTENT_ATTR_HAS_VALUE == attrResult) { *aSpecified = PR_TRUE; } @@ -360,7 +360,7 @@ nsDOMAttribute::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) mNodeInfo->GetNameAtom(*getter_AddRefs(name)); mNodeInfo->GetNamespaceID(nameSpaceID); - mContent->GetAttribute(nameSpaceID, name, value); + mContent->GetAttr(nameSpaceID, name, value); newAttr = new nsDOMAttribute(nsnull, mNodeInfo, value); } else { @@ -431,11 +431,11 @@ nsDOMAttribute::SetPrefix(const nsAReadableString& aPrefix) mNodeInfo->GetNameAtom(*getter_AddRefs(name)); mNodeInfo->GetNamespaceID(nameSpaceID); - rv = mContent->GetAttribute(nameSpaceID, name, tmpValue); + rv = mContent->GetAttr(nameSpaceID, name, tmpValue); if (rv == NS_CONTENT_ATTR_HAS_VALUE) { - mContent->UnsetAttribute(nameSpaceID, name, PR_TRUE); + mContent->UnsetAttr(nameSpaceID, name, PR_TRUE); - mContent->SetAttribute(newNodeInfo, tmpValue, PR_TRUE); + mContent->SetAttr(newNodeInfo, tmpValue, PR_TRUE); } } diff --git a/content/base/src/nsDOMAttributeMap.cpp b/content/base/src/nsDOMAttributeMap.cpp index 127dec562fc..73980a63c98 100644 --- a/content/base/src/nsDOMAttributeMap.cpp +++ b/content/base/src/nsDOMAttributeMap.cpp @@ -69,7 +69,7 @@ nsDOMAttributeMap::GetNamedItem(const nsAReadableString& aAttrName, nsresult rv = NS_OK; if (mContent) { nsCOMPtr ni; - mContent->NormalizeAttributeString(aAttrName, *getter_AddRefs(ni)); + mContent->NormalizeAttrString(aAttrName, *getter_AddRefs(ni)); NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); PRInt32 nsid; @@ -81,7 +81,7 @@ nsDOMAttributeMap::GetNamedItem(const nsAReadableString& aAttrName, nsresult attrResult; nsAutoString value; - attrResult = mContent->GetAttribute(nsid, nameAtom, value); + attrResult = mContent->GetAttr(nsid, nameAtom, value); if (NS_CONTENT_ATTR_NOT_THERE != attrResult && NS_SUCCEEDED(attrResult)) { nsDOMAttribute* domAttribute; @@ -120,7 +120,7 @@ nsDOMAttributeMap::SetNamedItem(nsIDOMNode *aNode, nsIDOMNode **aReturn) attribute->GetName(name); nsCOMPtr ni; - mContent->NormalizeAttributeString(name, *getter_AddRefs(ni)); + mContent->NormalizeAttrString(name, *getter_AddRefs(ni)); NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); nsCOMPtr nameAtom; @@ -129,7 +129,7 @@ nsDOMAttributeMap::SetNamedItem(nsIDOMNode *aNode, nsIDOMNode **aReturn) ni->GetNamespaceID(nsid); ni->GetNameAtom(*getter_AddRefs(nameAtom)); - nsresult attrResult = mContent->GetAttribute(nsid, nameAtom, value); + nsresult attrResult = mContent->GetAttr(nsid, nameAtom, value); if (NS_CONTENT_ATTR_NOT_THERE != attrResult && NS_SUCCEEDED(attrResult)) { nsDOMAttribute* domAttribute; @@ -146,7 +146,7 @@ nsDOMAttributeMap::SetNamedItem(nsIDOMNode *aNode, nsIDOMNode **aReturn) attribute->GetValue(value); - rv = mContent->SetAttribute(ni, value, PR_TRUE); + rv = mContent->SetAttr(ni, value, PR_TRUE); } return rv; @@ -163,7 +163,7 @@ nsDOMAttributeMap::RemoveNamedItem(const nsAReadableString& aName, if (mContent) { nsCOMPtr ni; - mContent->NormalizeAttributeString(aName, *getter_AddRefs(ni)); + mContent->NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); nsCOMPtr nameAtom; @@ -176,7 +176,7 @@ nsDOMAttributeMap::RemoveNamedItem(const nsAReadableString& aName, nsresult attrResult; nsAutoString value; - attrResult = mContent->GetAttribute(nsid, nameAtom, value); + attrResult = mContent->GetAttr(nsid, nameAtom, value); if (NS_CONTENT_ATTR_NOT_THERE != attrResult && NS_SUCCEEDED(attrResult)) { nsDOMAttribute* domAttribute; @@ -191,7 +191,7 @@ nsDOMAttributeMap::RemoveNamedItem(const nsAReadableString& aName, return NS_ERROR_DOM_NOT_FOUND_ERR; } - rv = mContent->UnsetAttribute(nsid, nameAtom, PR_TRUE); + rv = mContent->UnsetAttr(nsid, nameAtom, PR_TRUE); } return rv; @@ -207,12 +207,12 @@ nsDOMAttributeMap::Item(PRUint32 aIndex, nsIDOMNode** aReturn) nsresult rv = NS_OK; if (mContent && - NS_SUCCEEDED(mContent->GetAttributeNameAt(aIndex, - nameSpaceID, - *getter_AddRefs(nameAtom), - *getter_AddRefs(prefix)))) { + NS_SUCCEEDED(mContent->GetAttrNameAt(aIndex, + nameSpaceID, + *getter_AddRefs(nameAtom), + *getter_AddRefs(prefix)))) { nsAutoString value, name; - mContent->GetAttribute(nameSpaceID, nameAtom, value); + mContent->GetAttr(nameSpaceID, nameAtom, value); nsCOMPtr ni; mContent->GetNodeInfo(*getter_AddRefs(ni)); @@ -247,7 +247,7 @@ nsDOMAttributeMap::GetLength(PRUint32 *aLength) nsresult rv = NS_OK; if (nsnull != mContent) { - rv = mContent->GetAttributeCount(n); + rv = mContent->GetAttrCount(n); *aLength = PRUint32(n); } else { *aLength = 0; @@ -291,8 +291,8 @@ nsDOMAttributeMap::GetNamedItemNS(const nsAReadableString& aNamespaceURI, nsresult attrResult; nsAutoString value; - attrResult = mContent->GetAttribute(nameSpaceID, nameAtom, - *getter_AddRefs(prefix), value); + attrResult = mContent->GetAttr(nameSpaceID, nameAtom, + *getter_AddRefs(prefix), value); if (NS_CONTENT_ATTR_NOT_THERE != attrResult && NS_SUCCEEDED(attrResult)) { nimgr->GetNodeInfo(nameAtom, prefix, nameSpaceID, *getter_AddRefs(ni)); @@ -347,7 +347,7 @@ nsDOMAttributeMap::SetNamedItemNS(nsIDOMNode* aArg, nsIDOMNode** aReturn) ni->GetNameAtom(*getter_AddRefs(nameAtom)); ni->GetNamespaceID(nameSpaceID); - nsresult attrResult = mContent->GetAttribute(nameSpaceID, nameAtom, value); + nsresult attrResult = mContent->GetAttr(nameSpaceID, nameAtom, value); if (NS_CONTENT_ATTR_NOT_THERE != attrResult && NS_SUCCEEDED(attrResult)) { nsDOMAttribute* domAttribute; @@ -364,7 +364,7 @@ nsDOMAttributeMap::SetNamedItemNS(nsIDOMNode* aArg, nsIDOMNode** aReturn) attribute->GetValue(value); - rv = mContent->SetAttribute(ni, value, PR_TRUE); + rv = mContent->SetAttr(ni, value, PR_TRUE); } return rv; @@ -407,8 +407,8 @@ nsDOMAttributeMap::RemoveNamedItemNS(const nsAReadableString& aNamespaceURI, nsresult attrResult; nsAutoString value; - attrResult = mContent->GetAttribute(nameSpaceID, nameAtom, - *getter_AddRefs(prefix), value); + attrResult = mContent->GetAttr(nameSpaceID, nameAtom, + *getter_AddRefs(prefix), value); if (NS_CONTENT_ATTR_NOT_THERE != attrResult && NS_SUCCEEDED(attrResult)) { nimgr->GetNodeInfo(nameAtom, prefix, nameSpaceID, *getter_AddRefs(ni)); @@ -426,7 +426,7 @@ nsDOMAttributeMap::RemoveNamedItemNS(const nsAReadableString& aNamespaceURI, return NS_ERROR_DOM_NOT_FOUND_ERR; } - rv = mContent->UnsetAttribute(nameSpaceID, nameAtom, PR_TRUE); + rv = mContent->UnsetAttr(nameSpaceID, nameAtom, PR_TRUE); } return rv; diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index de422fc9740..af57f14cbe8 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -2113,7 +2113,7 @@ GetElementByAttribute(nsIContent* aContent, nsIDOMElement** aResult) { nsAutoString value; - nsresult rv = aContent->GetAttribute(kNameSpaceID_None, aAttrName, value); + nsresult rv = aContent->GetAttr(kNameSpaceID_None, aAttrName, value); if (rv == NS_CONTENT_ATTR_HAS_VALUE) { if (aUniversalMatch || value.Equals(aAttrValue)) return aContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aResult); diff --git a/content/base/src/nsDocumentFragment.cpp b/content/base/src/nsDocumentFragment.cpp index f972f43ab93..b4a880a351d 100644 --- a/content/base/src/nsDocumentFragment.cpp +++ b/content/base/src/nsDocumentFragment.cpp @@ -108,27 +108,27 @@ public: // nsIContent NS_IMETHOD SetParent(nsIContent* aParent) { return NS_OK; } - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, - PRBool aNotify) + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify) { return NS_OK; } - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify) + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) { return NS_OK; } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsAWritableString& aResult) const + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsAWritableString& aResult) const { return NS_CONTENT_ATTR_NOT_THERE; } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsIAtom*& aPrefix, nsAWritableString& aResult) const + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsIAtom*& aPrefix, nsAWritableString& aResult) const { return NS_CONTENT_ATTR_NOT_THERE; } - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - PRBool aNotify) + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRBool aNotify) { return NS_OK; } - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const { aName = nsnull; aPrefix = nsnull; diff --git a/content/base/src/nsGenericDOMDataNode.h b/content/base/src/nsGenericDOMDataNode.h index 21e9f9b43fa..70c0d7ab4d9 100644 --- a/content/base/src/nsGenericDOMDataNode.h +++ b/content/base/src/nsGenericDOMDataNode.h @@ -462,37 +462,37 @@ struct nsGenericDOMDataNode { } \ NS_IMETHOD GetTag(nsIAtom*& aResult) const; \ NS_IMETHOD GetNodeInfo(nsINodeInfo*& aResult) const; \ - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, \ - nsINodeInfo*& aNodeInfo) { \ + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, \ + nsINodeInfo*& aNodeInfo) { \ return _g.NormalizeAttributeString(aStr, aNodeInfo); \ } \ - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, \ - nsAWritableString& aResult) const { \ + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, \ + nsAWritableString& aResult) const { \ return _g.GetAttribute(aNameSpaceID, aAttribute, aResult); \ } \ - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, \ - nsIAtom*& aPrefix, nsAWritableString& aResult) const { \ + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, \ + nsIAtom*& aPrefix, nsAWritableString& aResult) const { \ return _g.GetAttribute(aNameSpaceID, aAttribute, aPrefix, aResult); \ } \ - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, \ - const nsAReadableString& aValue, PRBool aNotify) { \ + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, \ + const nsAReadableString& aValue, PRBool aNotify) { \ return _g.SetAttribute(aNameSpaceID, aAttribute, aValue, aNotify); \ } \ - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, \ - const nsAReadableString& aValue, PRBool aNotify) { \ + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, \ + const nsAReadableString& aValue, PRBool aNotify) { \ return _g.SetAttribute(aNodeInfo, aValue, aNotify); \ } \ - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, \ - PRBool aNotify) { \ + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, \ + PRBool aNotify) { \ return _g.UnsetAttribute(aNameSpaceID, aAttribute, aNotify); \ } \ - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, \ - PRInt32& aNameSpaceID, \ - nsIAtom*& aName, \ - nsIAtom*& aPrefix) const { \ + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, \ + PRInt32& aNameSpaceID, \ + nsIAtom*& aName, \ + nsIAtom*& aPrefix) const { \ return _g.GetAttributeNameAt(aIndex, aNameSpaceID, aName, aPrefix); \ } \ - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { \ + NS_IMETHOD GetAttrCount(PRInt32& aResult) const { \ return _g.GetAttributeCount(aResult); \ } \ NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; \ diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index e9d71468f7f..5d8509a9aa6 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -937,7 +937,7 @@ nsGenericElement::HasAttributes(PRBool* aReturn) NS_ENSURE_ARG_POINTER(aReturn); PRInt32 attrCount = 0; - GetAttributeCount(attrCount); + GetAttrCount(attrCount); *aReturn = !!attrCount; @@ -985,7 +985,7 @@ nsGenericElement::GetAttribute(const nsAReadableString& aName, nsAWritableString& aReturn) { nsCOMPtr ni; - NormalizeAttributeString(aName, *getter_AddRefs(ni)); + NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); PRInt32 nsid; @@ -995,7 +995,7 @@ nsGenericElement::GetAttribute(const nsAReadableString& aName, ni->GetNameAtom(*getter_AddRefs(nameAtom)); nsresult rv = NS_STATIC_CAST(nsIContent *, - this)->GetAttribute(nsid, nameAtom, aReturn); + this)->GetAttr(nsid, nameAtom, aReturn); if (rv == NS_CONTENT_ATTR_NOT_THERE) { SetDOMStringToNull(aReturn); @@ -1009,15 +1009,15 @@ nsGenericElement::SetAttribute(const nsAReadableString& aName, const nsAReadableString& aValue) { nsCOMPtr ni; - NormalizeAttributeString(aName, *getter_AddRefs(ni)); - return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(ni, aValue, PR_TRUE); + NormalizeAttrString(aName, *getter_AddRefs(ni)); + return NS_STATIC_CAST(nsIContent *, this)->SetAttr(ni, aValue, PR_TRUE); } nsresult nsGenericElement::RemoveAttribute(const nsAReadableString& aName) { nsCOMPtr ni; - NormalizeAttributeString(aName, *getter_AddRefs(ni)); + NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); PRInt32 nsid; @@ -1026,7 +1026,7 @@ nsGenericElement::RemoveAttribute(const nsAReadableString& aName) ni->GetNamespaceID(nsid); ni->GetNameAtom(*getter_AddRefs(tag)); - return UnsetAttribute(nsid, tag, PR_TRUE); + return UnsetAttr(nsid, tag, PR_TRUE); } nsresult @@ -1158,7 +1158,7 @@ nsGenericElement::GetAttributeNS(const nsAReadableString& aNamespaceURI, return NS_OK; } - NS_STATIC_CAST(nsIContent *, this)->GetAttribute(nsid, name, aReturn); + NS_STATIC_CAST(nsIContent *, this)->GetAttr(nsid, name, aReturn); return NS_OK; } @@ -1177,7 +1177,7 @@ nsGenericElement::SetAttributeNS(const nsAReadableString& aNamespaceURI, *getter_AddRefs(ni)); NS_ENSURE_SUCCESS(rv, rv); - return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(ni, aValue, PR_TRUE); + return NS_STATIC_CAST(nsIContent *, this)->SetAttr(ni, aValue, PR_TRUE); } nsresult @@ -1204,7 +1204,7 @@ nsGenericElement::RemoveAttributeNS(const nsAReadableString& aNamespaceURI, } nsAutoString tmp; - UnsetAttribute(nsid, name, PR_TRUE); + UnsetAttr(nsid, name, PR_TRUE); return NS_OK; } @@ -1304,7 +1304,7 @@ nsGenericElement::HasAttribute(const nsAReadableString& aName, PRBool* aReturn) NS_ENSURE_ARG_POINTER(aReturn); nsCOMPtr ni; - NormalizeAttributeString(aName, *getter_AddRefs(ni)); + NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); PRInt32 nsid; @@ -1314,9 +1314,9 @@ nsGenericElement::HasAttribute(const nsAReadableString& aName, PRBool* aReturn) ni->GetNameAtom(*getter_AddRefs(nameAtom)); nsAutoString tmp; - nsresult rv = NS_STATIC_CAST(nsIContent *, this)->GetAttribute(nsid, - nameAtom, - tmp); + nsresult rv = NS_STATIC_CAST(nsIContent *, this)->GetAttr(nsid, + nameAtom, + tmp); *aReturn = rv == NS_CONTENT_ATTR_NOT_THERE ? PR_FALSE : PR_TRUE; @@ -1351,8 +1351,7 @@ nsGenericElement::HasAttributeNS(const nsAReadableString& aNamespaceURI, } nsAutoString tmp; - nsresult rv = NS_STATIC_CAST(nsIContent *, this)->GetAttribute(nsid, name, - tmp); + nsresult rv = NS_STATIC_CAST(nsIContent *, this)->GetAttr(nsid, name, tmp); *aReturn = rv == NS_CONTENT_ATTR_NOT_THERE ? PR_FALSE : PR_TRUE; @@ -1956,7 +1955,7 @@ nsresult nsGenericElement::SetFocus(nsIPresContext* aPresContext) { nsAutoString disabled; - if (NS_CONTENT_ATTR_HAS_VALUE == NS_STATIC_CAST(nsIContent *, this)->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled)) { + if (NS_CONTENT_ATTR_HAS_VALUE == NS_STATIC_CAST(nsIContent *, this)->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled)) { return NS_OK; } @@ -2770,7 +2769,7 @@ nsGenericContainerElement::~nsGenericContainerElement() } nsresult -nsGenericContainerElement::NormalizeAttributeString(const nsAReadableString& aStr, nsINodeInfo*& aNodeInfo) +nsGenericContainerElement::NormalizeAttrString(const nsAReadableString& aStr, nsINodeInfo*& aNodeInfo) { if (mAttributes) { PRInt32 indx, count = mAttributes->Count(); @@ -2807,7 +2806,7 @@ nsGenericContainerElement::CopyInnerTo(nsIContent* aSrcContent, attr = (nsGenericAttribute*)mAttributes->ElementAt(index); // XXX Not very efficient, since SetAttribute does a linear search // through its attributes before setting each attribute. - result = aDst->SetAttribute(attr->mNodeInfo, attr->mValue, PR_FALSE); + result = aDst->SetAttr(attr->mNodeInfo, attr->mValue, PR_FALSE); if (NS_OK != result) { return result; } @@ -2907,9 +2906,9 @@ nsGenericContainerElement::GetLastChild(nsIDOMNode** aNode) } nsresult -nsGenericContainerElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, - PRBool aNotify) +nsGenericContainerElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify) { nsresult rv; nsCOMPtr nimgr; @@ -2921,7 +2920,7 @@ nsGenericContainerElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, *getter_AddRefs(ni)); NS_ENSURE_SUCCESS(rv, rv); - return SetAttribute(ni, aValue, aNotify); + return SetAttr(ni, aValue, aNotify); } // Static helper method @@ -2995,9 +2994,9 @@ PRBool nsGenericElement::HasMutationListeners(nsIContent* aContent, } nsresult -nsGenericContainerElement::SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify) +nsGenericContainerElement::SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) { NS_ENSURE_ARG_POINTER(aNodeInfo); @@ -3091,17 +3090,17 @@ nsGenericContainerElement::SetAttribute(nsINodeInfo* aNodeInfo, } nsresult -nsGenericContainerElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsAWritableString& aResult) const +nsGenericContainerElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsAWritableString& aResult) const { nsCOMPtr prefix; - return GetAttribute(aNameSpaceID, aName, *getter_AddRefs(prefix), aResult); + return GetAttr(aNameSpaceID, aName, *getter_AddRefs(prefix), aResult); } nsresult -nsGenericContainerElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsIAtom*& aPrefix, - nsAWritableString& aResult) const +nsGenericContainerElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsIAtom*& aPrefix, + nsAWritableString& aResult) const { NS_ASSERTION(nsnull != aName, "must have attribute name"); if (nsnull == aName) { @@ -3143,8 +3142,8 @@ nsGenericContainerElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, } nsresult -nsGenericContainerElement::UnsetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, PRBool aNotify) +nsGenericContainerElement::UnsetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, PRBool aNotify) { NS_ASSERTION(nsnull != aName, "must have attribute name"); if (nsnull == aName) { @@ -3218,10 +3217,10 @@ nsGenericContainerElement::UnsetAttribute(PRInt32 aNameSpaceID, } nsresult -nsGenericContainerElement::GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const +nsGenericContainerElement::GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const { if (nsnull != mAttributes) { nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(aIndex); @@ -3239,7 +3238,7 @@ nsGenericContainerElement::GetAttributeNameAt(PRInt32 aIndex, } nsresult -nsGenericContainerElement::GetAttributeCount(PRInt32& aResult) const +nsGenericContainerElement::GetAttrCount(PRInt32& aResult) const { if (nsnull != mAttributes) { aResult = mAttributes->Count(); @@ -3254,7 +3253,7 @@ void nsGenericContainerElement::ListAttributes(FILE* out) const { PRInt32 index, count; - GetAttributeCount(count); + GetAttrCount(count); for (index = 0; index < count; index++) { const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index); diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index fde5c05e6b8..cafcb77dcba 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -229,26 +229,26 @@ public: // PRBool aNotify); // NS_IMETHOD AppendChildTo(nsIContent* aKid, PRBool aNotify); // NS_IMETHOD RemoveChildAt(PRInt32 aIndex, PRBool aNotify); - // NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - // nsINodeInfo*& aNodeInfo); - // NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - // const nsAReadableString& aValue, - // PRBool aNotify); - // NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - // const nsAReadableString& aValue, - // PRBool aNotify); - // NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - // nsAWritableString& aResult) const; - // NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - // nsIAtom*& aPrefix, - // nsAWritableString& aResult) const; - // NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - // PRBool aNotify); - // NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - // PRInt32& aNameSpaceID, - // nsIAtom*& aName, - // nsIAtom*& aPrefix) const; - // NS_IMETHOD GetAttributeCount(PRInt32& aResult) const; + // NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + // nsINodeInfo*& aNodeInfo); + // NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + // const nsAReadableString& aValue, + // PRBool aNotify); + // NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + // const nsAReadableString& aValue, + // PRBool aNotify); + // NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + // nsAWritableString& aResult) const; + // NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + // nsIAtom*& aPrefix, + // nsAWritableString& aResult) const; + // NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + // PRBool aNotify); + // NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + // PRInt32& aNameSpaceID, + // nsIAtom*& aName, + // nsIAtom*& aPrefix) const; + // NS_IMETHOD GetAttrCount(PRInt32& aResult) const; // NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; // NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const; NS_IMETHOD RangeAdd(nsIDOMRange& aRange); @@ -448,25 +448,25 @@ public: } // Remainder of nsIContent - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo); - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, const nsAReadableString& aValue, PRBool aNotify); - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify); - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsAWritableString& aResult) const; - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsIAtom*& aPrefix, nsAWritableString& aResult) const; - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - PRBool aNotify); - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const; - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const; + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify); + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsAWritableString& aResult) const; + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsIAtom*& aPrefix, nsAWritableString& aResult) const; + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRBool aNotify); + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const; + NS_IMETHOD GetAttrCount(PRInt32& aResult) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const; NS_IMETHOD CanContainChildren(PRBool& aResult) const; diff --git a/content/base/src/nsHTMLContentSerializer.cpp b/content/base/src/nsHTMLContentSerializer.cpp index e24c14816a3..da11696838d 100644 --- a/content/base/src/nsHTMLContentSerializer.cpp +++ b/content/base/src/nsHTMLContentSerializer.cpp @@ -281,13 +281,13 @@ nsHTMLContentSerializer::SerializeAttributes(nsIContent* aContent, PRInt32 namespaceID; nsCOMPtr attrName, attrPrefix; - aContent->GetAttributeCount(count); + aContent->GetAttrCount(count); for (index = 0; index < count; index++) { - aContent->GetAttributeNameAt(index, - namespaceID, - *getter_AddRefs(attrName), - *getter_AddRefs(attrPrefix)); + aContent->GetAttrNameAt(index, + namespaceID, + *getter_AddRefs(attrName), + *getter_AddRefs(attrPrefix)); // Filter out any attribute starting with _moz const PRUnichar* sharedName; @@ -298,7 +298,7 @@ nsHTMLContentSerializer::SerializeAttributes(nsIContent* aContent, continue; } - aContent->GetAttribute(namespaceID, attrName, valueStr); + aContent->GetAttr(namespaceID, attrName, valueStr); // // Filter out special case of
or
, @@ -408,7 +408,7 @@ nsHTMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, if (name.get() == nsHTMLAtoms::textarea) { nsAutoString valueStr; - content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, valueStr); + content->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::value, valueStr); AppendToString(valueStr, aStr); } @@ -703,9 +703,9 @@ nsHTMLContentSerializer::HasDirtyAttr(nsIContent* aContent) { nsAutoString val; - if (NS_CONTENT_ATTR_NOT_THERE != aContent->GetAttribute(kNameSpaceID_None, - nsLayoutAtoms::mozdirty, - val)) { + if (NS_CONTENT_ATTR_NOT_THERE != aContent->GetAttr(kNameSpaceID_None, + nsLayoutAtoms::mozdirty, + val)) { return PR_TRUE; } else { diff --git a/content/base/src/nsPlainTextSerializer.cpp b/content/base/src/nsPlainTextSerializer.cpp index 94671d7798a..e478fc04904 100644 --- a/content/base/src/nsPlainTextSerializer.cpp +++ b/content/base/src/nsPlainTextSerializer.cpp @@ -1545,8 +1545,8 @@ nsPlainTextSerializer::GetAttributeValue(nsIAtom* aName, nsString& aValueRet) { if (mContent) { - if (NS_CONTENT_ATTR_NOT_THERE != mContent->GetAttribute(kNameSpaceID_None, - aName, aValueRet)) { + if (NS_CONTENT_ATTR_NOT_THERE != mContent->GetAttr(kNameSpaceID_None, + aName, aValueRet)) { return NS_OK; } } diff --git a/content/base/src/nsXMLContentSerializer.cpp b/content/base/src/nsXMLContentSerializer.cpp index 49337c3a609..1949f053f4c 100644 --- a/content/base/src/nsXMLContentSerializer.cpp +++ b/content/base/src/nsXMLContentSerializer.cpp @@ -402,20 +402,20 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, nsAutoString nameStr, prefixStr, uriStr, valueStr; nsCOMPtr attrName, attrPrefix; - content->GetAttributeCount(count); + content->GetAttrCount(count); // First scan for namespace declarations, pushing each on the stack for (index = 0; index < count; index++) { - content->GetAttributeNameAt(index, - namespaceID, - *getter_AddRefs(attrName), - *getter_AddRefs(attrPrefix)); + content->GetAttrNameAt(index, + namespaceID, + *getter_AddRefs(attrName), + *getter_AddRefs(attrPrefix)); if (namespaceID == kNameSpaceID_XMLNS || elementNamespaceID == kNameSpaceID_HTML /*XXX Hack*/) { PRBool hasPrefix = attrPrefix ? PR_TRUE : PR_FALSE; - content->GetAttribute(namespaceID, attrName, uriStr); + content->GetAttr(namespaceID, attrName, uriStr); attrName->ToString(nameStr); // XXX We shouldn't need this hack @@ -467,10 +467,10 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, } for (index = 0; index < count; index++) { - content->GetAttributeNameAt(index, - namespaceID, - *getter_AddRefs(attrName), - *getter_AddRefs(attrPrefix)); + content->GetAttrNameAt(index, + namespaceID, + *getter_AddRefs(attrName), + *getter_AddRefs(attrPrefix)); if (attrPrefix) { attrPrefix->ToString(prefixStr); } @@ -484,7 +484,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement, addNSAttr = ConfirmPrefix(prefixStr, uriStr); } - content->GetAttribute(namespaceID, attrName, valueStr); + content->GetAttr(namespaceID, attrName, valueStr); attrName->ToString(nameStr); if (elementNamespaceID == kNameSpaceID_HTML && nameStr.Equals(NS_LITERAL_STRING("xmlns:xmlns"))) diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 2d63ced1d60..4c3471accb2 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -1074,7 +1074,7 @@ nsEventListenerManager::CompileEventHandlerInternal(nsIScriptContext *aContext, NS_ASSERTION(content, "only content should have event handler attributes"); if (content) { nsAutoString handlerBody; - result = content->GetAttribute(kNameSpaceID_None, aName, handlerBody); + result = content->GetAttr(kNameSpaceID_None, aName, handlerBody); if (NS_SUCCEEDED(result)) { if (handlerOwner) { diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index 3dca1763c28..0066775b78a 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -800,7 +800,7 @@ nsEventStateManager :: CreateClickHoldTimer ( nsIPresContext* inPresContext, nsG if ( clickedContent ) { // check for the |popup| attribute nsAutoString popup; - clickedContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popup, popup); + clickedContent->GetAttr(kNameSpaceID_None, nsXULAtoms::popup, popup); if ( popup != NS_LITERAL_STRING("") ) return; @@ -917,7 +917,7 @@ nsEventStateManager :: FireContextClick ( ) // of all input elements, only ones dealing with text are allowed to have context menus if ( tag == nsHTMLAtoms::input ) { nsAutoString type; - lastContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, type); + lastContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, type); if ( type != NS_LITERAL_STRING("") && type != NS_LITERAL_STRING("text") && type != NS_LITERAL_STRING("password") && type != NS_LITERAL_STRING("file") ) allowedToDispatch = PR_FALSE; @@ -1868,9 +1868,9 @@ nsEventStateManager::CheckDisabled(nsIContent* aContent) nsHTMLAtoms::textarea == tag.get() || nsHTMLAtoms::button == tag.get()) { nsAutoString empty; - if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - empty)) { + if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + empty)) { disabled = PR_TRUE; } } @@ -2987,7 +2987,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent, nsIFrame* map->ChildAt(index, *getter_AddRefs(childArea)); if (childArea.get() == mCurrentFocus) { nsAutoString tabIndexStr; - childArea->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); + childArea->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); PRInt32 val = 0; if (!tabIndexStr.IsEmpty()) { PRInt32 ec, tabIndexVal = tabIndexStr.ToInteger(&ec); @@ -3012,7 +3012,7 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent, nsIFrame* //Got the map area, check its tabindex. nsAutoString tabIndexStr; - childArea->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); + childArea->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); PRInt32 val = 0; if (!tabIndexStr.IsEmpty()) { PRInt32 ec, tabIndexVal = tabIndexStr.ToInteger(&ec); @@ -3047,9 +3047,9 @@ nsEventStateManager::GetNextTabbableContent(nsIContent* aRootContent, nsIFrame* } else { nsAutoString value; - child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, value); + child->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, value); nsAutoString tabStr; - child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::tabindex, tabStr); + child->GetAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex, tabStr); if (!tabStr.IsEmpty()) { PRInt32 errorCode; tabIndex = tabStr.ToInteger(&errorCode); @@ -3105,7 +3105,7 @@ nsEventStateManager::GetNextTabIndex(nsIContent* aParent, PRBool forward) } nsAutoString tabIndexStr; - child->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); + child->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); PRInt32 ec, val = tabIndexStr.ToInteger(&ec); if (NS_OK == ec && val > mCurrentTabIndex && val != tabIndex) { tabIndex = (tabIndex == 0 || val < tabIndex) ? val : tabIndex; @@ -3123,7 +3123,7 @@ nsEventStateManager::GetNextTabIndex(nsIContent* aParent, PRBool forward) } nsAutoString tabIndexStr; - child->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); + child->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); PRInt32 ec, val = tabIndexStr.ToInteger(&ec); if (NS_OK == ec) { if ((mCurrentTabIndex==0 && val > tabIndex) || @@ -3193,7 +3193,7 @@ nsEventStateManager::HasPositiveTabIndex(nsIContent* aContent, *aResult = PR_FALSE; nsAutoString tabIndexStr; - aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); + aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndexStr); if (!tabIndexStr.IsEmpty()) { PRInt32 ec, tabIndexVal = tabIndexStr.ToInteger(&ec); if (NS_SUCCEEDED(ec)) { @@ -3717,7 +3717,7 @@ nsEventStateManager::SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aCo } nsAutoString tabIndex; - aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndex); + aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::tabindex, tabIndex); PRInt32 ec, val = tabIndex.ToInteger(&ec); if (NS_OK == ec) { mCurrentTabIndex = val; diff --git a/content/html/content/src/nsAttributeContent.cpp b/content/html/content/src/nsAttributeContent.cpp index e6cb33042c7..e2f763bb1ca 100644 --- a/content/html/content/src/nsAttributeContent.cpp +++ b/content/html/content/src/nsAttributeContent.cpp @@ -98,8 +98,8 @@ public: } - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo) { + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo) { aNodeInfo = nsnull; return NS_OK; } @@ -123,20 +123,20 @@ public: return NS_ERROR_NOT_IMPLEMENTED; } - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, const nsAReadableString& aValue, - PRBool aNotify) { return NS_OK; } - NS_IMETHOD SetAttribute(nsINodeInfo *aNodeInfo, const nsAReadableString& aValue, - PRBool aNotify) { return NS_OK; } - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify) { return NS_OK; } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, nsAWritableString& aResult) const {return NS_CONTENT_ATTR_NOT_THERE; } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, nsIAtom*& aPrefix, nsAWritableString& aResult) const {return NS_CONTENT_ATTR_NOT_THERE; } - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, PRInt32& aNameSpaceID, nsIAtom*& aName, nsIAtom*& aPrefix) const { + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, const nsAReadableString& aValue, + PRBool aNotify) { return NS_OK; } + NS_IMETHOD SetAttr(nsINodeInfo *aNodeInfo, const nsAReadableString& aValue, + PRBool aNotify) { return NS_OK; } + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify) { return NS_OK; } + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, nsAWritableString& aResult) const {return NS_CONTENT_ATTR_NOT_THERE; } + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, nsIAtom*& aPrefix, nsAWritableString& aResult) const {return NS_CONTENT_ATTR_NOT_THERE; } + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, PRInt32& aNameSpaceID, nsIAtom*& aName, nsIAtom*& aPrefix) const { aName = nsnull; aPrefix = nsnull; return NS_ERROR_ILLEGAL_VALUE; } - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { aResult = 0; return NS_OK; } + NS_IMETHOD GetAttrCount(PRInt32& aResult) const { aResult = 0; return NS_OK; } NS_IMETHOD List(FILE* out, PRInt32 aIndent) const { return NS_OK; } NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const { return NS_OK; } @@ -368,7 +368,7 @@ nsAttributeContent::ValidateTextFragment() { if (nsnull != mContent) { nsAutoString result; - mContent->GetAttribute(mNameSpaceID, mAttrName, result); + mContent->GetAttr(mNameSpaceID, mAttrName, result); PRUnichar * text = result.ToNewUnicode(); mText.SetTo(text, result.Length()); diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index e245ed170d2..92ba9691d8a 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -618,42 +618,42 @@ nsGenericHTMLElement::GetElementsByTagName(const nsAReadableString& aTagname, nsresult nsGenericHTMLElement::GetId(nsAWritableString& aId) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, aId); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, aId); return NS_OK; } nsresult nsGenericHTMLElement::SetId(const nsAReadableString& aId) { - SetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, aId, PR_TRUE); + SetAttr(kNameSpaceID_None, nsHTMLAtoms::id, aId, PR_TRUE); return NS_OK; } nsresult nsGenericHTMLElement::GetTitle(nsAWritableString& aTitle) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::title, aTitle); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::title, aTitle); return NS_OK; } nsresult nsGenericHTMLElement::SetTitle(const nsAReadableString& aTitle) { - SetAttribute(kNameSpaceID_None, nsHTMLAtoms::title, aTitle, PR_TRUE); + SetAttr(kNameSpaceID_None, nsHTMLAtoms::title, aTitle, PR_TRUE); return NS_OK; } nsresult nsGenericHTMLElement::GetLang(nsAWritableString& aLang) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::lang, aLang); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::lang, aLang); return NS_OK; } nsresult nsGenericHTMLElement::SetLang(const nsAReadableString& aLang) { - SetAttribute(kNameSpaceID_None, nsHTMLAtoms::lang, aLang, PR_TRUE); + SetAttr(kNameSpaceID_None, nsHTMLAtoms::lang, aLang, PR_TRUE); return NS_OK; } @@ -679,21 +679,21 @@ nsGenericHTMLElement::GetDir(nsAWritableString& aDir) nsresult nsGenericHTMLElement::SetDir(const nsAReadableString& aDir) { - SetAttribute(kNameSpaceID_None, nsHTMLAtoms::dir, aDir, PR_TRUE); + SetAttr(kNameSpaceID_None, nsHTMLAtoms::dir, aDir, PR_TRUE); return NS_OK; } nsresult nsGenericHTMLElement::GetClassName(nsAWritableString& aClassName) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::kClass, aClassName); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::kClass, aClassName); return NS_OK; } nsresult nsGenericHTMLElement::SetClassName(const nsAReadableString& aClassName) { - SetAttribute(kNameSpaceID_None, nsHTMLAtoms::kClass, aClassName, PR_TRUE); + SetAttr(kNameSpaceID_None, nsHTMLAtoms::kClass, aClassName, PR_TRUE); return NS_OK; } @@ -1310,7 +1310,7 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter, nsAutoString target; nsCOMPtr baseURL; GetBaseURL(*getter_AddRefs(baseURL)); - GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, target); + GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::target, target); if (target.Length() == 0) { GetBaseTarget(target); } @@ -1372,7 +1372,7 @@ nsGenericHTMLElement::HandleDOMEventForAnchors(nsIContent* aOuter, nsAutoString target; nsCOMPtr baseURL; GetBaseURL(*getter_AddRefs(baseURL)); - GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, target); + GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::target, target); if (target.Length() == 0) { GetBaseTarget(target); } @@ -1415,8 +1415,8 @@ nsGenericHTMLElement::GetNameSpaceID(PRInt32& aID) const } nsresult -nsGenericHTMLElement::NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo) +nsGenericHTMLElement::NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo) { // XXX need to validate/strip namespace prefix nsAutoString lower(aStr); @@ -1430,10 +1430,10 @@ nsGenericHTMLElement::NormalizeAttributeString(const nsAReadableString& aStr, } nsresult -nsGenericHTMLElement::SetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - const nsAReadableString& aValue, - PRBool aNotify) +nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + const nsAReadableString& aValue, + PRBool aNotify) { nsresult result = NS_OK; NS_ASSERTION((kNameSpaceID_HTML == aNameSpaceID) || @@ -1487,7 +1487,7 @@ nsGenericHTMLElement::SetAttribute(PRInt32 aNameSpaceID, } // don't do any update if old == new - result = GetAttribute(aNameSpaceID, aAttribute, strValue); + result = GetAttr(aNameSpaceID, aAttribute, strValue); if ((NS_CONTENT_ATTR_NOT_THERE != result) && aValue.Equals(strValue)) { return NS_OK; } @@ -1570,9 +1570,9 @@ nsGenericHTMLElement::SetAttribute(PRInt32 aNameSpaceID, } NS_IMETHODIMP -nsGenericHTMLElement::SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify) +nsGenericHTMLElement::SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) { NS_ENSURE_ARG_POINTER(aNodeInfo); @@ -1584,8 +1584,8 @@ nsGenericHTMLElement::SetAttribute(nsINodeInfo* aNodeInfo, // We still rely on the old way of setting the attribute. - return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(nsid, atom, aValue, - aNotify); + return NS_STATIC_CAST(nsIContent *, this)->SetAttr(nsid, atom, aValue, + aNotify); } PRBool nsGenericHTMLElement::IsEventName(nsIAtom* aName) @@ -1739,7 +1739,7 @@ nsGenericHTMLElement::SetHTMLAttribute(nsIAtom* aAttribute, } nsresult -nsGenericHTMLElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify) +nsGenericHTMLElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify) { nsresult result = NS_OK; @@ -1844,17 +1844,17 @@ nsGenericHTMLElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, } nsresult -nsGenericHTMLElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, - nsIAtom*& aPrefix, nsAWritableString& aResult) const +nsGenericHTMLElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, + nsIAtom*& aPrefix, nsAWritableString& aResult) const { aPrefix = nsnull; - return GetAttribute(aNameSpaceID, aAttribute, aResult); + return GetAttr(aNameSpaceID, aAttribute, aResult); } nsresult -nsGenericHTMLElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, - nsAWritableString& aResult) const +nsGenericHTMLElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, + nsAWritableString& aResult) const { aResult.SetLength(0); @@ -1955,10 +1955,10 @@ nsGenericHTMLElement::GetHTMLAttribute(nsIAtom* aAttribute, } nsresult -nsGenericHTMLElement::GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const +nsGenericHTMLElement::GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const { aNameSpaceID = kNameSpaceID_None; aPrefix = nsnull; @@ -1970,7 +1970,7 @@ nsGenericHTMLElement::GetAttributeNameAt(PRInt32 aIndex, } nsresult -nsGenericHTMLElement::GetAttributeCount(PRInt32& aCount) const +nsGenericHTMLElement::GetAttrCount(PRInt32& aCount) const { if (nsnull != mAttributes) { return mAttributes->GetAttributeCount(aCount); @@ -2112,13 +2112,13 @@ void nsGenericHTMLElement::ListAttributes(FILE* out) const { PRInt32 index, count; - GetAttributeCount(count); + GetAttrCount(count); for (index = 0; index < count; index++) { // name nsIAtom* attr = nsnull; nsIAtom* prefix = nsnull; PRInt32 nameSpaceID; - GetAttributeNameAt(index, nameSpaceID, attr, prefix); + GetAttrNameAt(index, nameSpaceID, attr, prefix); NS_IF_RELEASE(prefix); nsAutoString buffer; @@ -2126,7 +2126,7 @@ nsGenericHTMLElement::ListAttributes(FILE* out) const // value nsAutoString value; - GetAttribute(nameSpaceID, attr, value); + GetAttr(nameSpaceID, attr, value); buffer.AppendWithConversion("="); buffer.Append(value); @@ -3894,8 +3894,8 @@ nsGenericHTMLContainerFormElement::SetForm(nsIDOMHTMLFormElement* aForm, nsAutoString nameVal, idVal; if (aRemoveFromForm) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, nameVal); - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, idVal); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, nameVal); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, idVal); if (mForm) { mForm->RemoveElement(this); @@ -4005,7 +4005,7 @@ nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm, // Add & remove the control to and/or from the hash table if (aForm && (aName == nsHTMLAtoms::name || aName == nsHTMLAtoms::id)) { - GetAttribute(kNameSpaceID_None, aName, tmp); + GetAttr(kNameSpaceID_None, aName, tmp); if (!tmp.IsEmpty()) { aForm->RemoveElementFromTable(thisControl, tmp); @@ -4015,13 +4015,13 @@ nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm, } if (aForm && aName == nsHTMLAtoms::type) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, tmp); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, tmp); if (!tmp.IsEmpty()) { aForm->RemoveElementFromTable(thisControl, tmp); } - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, tmp); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, tmp); if (!tmp.IsEmpty()) { aForm->RemoveElementFromTable(thisControl, tmp); @@ -4030,11 +4030,10 @@ nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm, aForm->RemoveElement(thisControl); } - rv = nsGenericHTMLElement::SetAttribute(aNameSpaceID, aName, aValue, - aNotify); + rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aValue, aNotify); if (aForm && (aName == nsHTMLAtoms::name || aName == nsHTMLAtoms::id)) { - GetAttribute(kNameSpaceID_None, aName, tmp); + GetAttr(kNameSpaceID_None, aName, tmp); if (!tmp.IsEmpty()) { aForm->AddElementToTable(thisControl, tmp); @@ -4044,13 +4043,13 @@ nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm, } if (aForm && aName == nsHTMLAtoms::type) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, tmp); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, tmp); if (!tmp.IsEmpty()) { aForm->AddElementToTable(thisControl, tmp); } - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, tmp); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, tmp); if (!tmp.IsEmpty()) { aForm->AddElementToTable(thisControl, tmp); @@ -4063,14 +4062,22 @@ nsGenericHTMLElement::SetFormControlAttribute(nsIForm* aForm, } NS_IMETHODIMP -nsGenericHTMLContainerFormElement::SetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, - const nsAReadableString& aVal, - PRBool aNotify) +nsGenericHTMLContainerFormElement::SetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, + const nsAReadableString& aVal, + PRBool aNotify) { return SetFormControlAttribute(mForm, aNameSpaceID, aName, aVal, aNotify); } +NS_IMETHODIMP +nsGenericHTMLContainerFormElement::SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) +{ + return nsGenericHTMLElement::SetAttr(aNodeInfo, aValue, aNotify); +} + //---------------------------------------------------------------------- nsGenericHTMLLeafFormElement::nsGenericHTMLLeafFormElement() @@ -4119,8 +4126,8 @@ nsGenericHTMLLeafFormElement::SetForm(nsIDOMHTMLFormElement* aForm, nsAutoString nameVal, idVal; if (aRemoveFromForm) { - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, nameVal); - GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, idVal); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, nameVal); + GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, idVal); if (mForm) { mForm->RemoveElement(this); @@ -4217,14 +4224,22 @@ nsGenericHTMLLeafFormElement::SetDocument(nsIDocument* aDocument, } NS_IMETHODIMP -nsGenericHTMLLeafFormElement::SetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, - const nsAReadableString& aValue, - PRBool aNotify) +nsGenericHTMLLeafFormElement::SetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify) { return SetFormControlAttribute(mForm, aNameSpaceID, aName, aValue, aNotify); } +NS_IMETHODIMP +nsGenericHTMLLeafFormElement::SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) +{ + return nsGenericHTMLLeafElement::SetAttr(aNodeInfo, aValue, aNotify); +} + nsresult nsGenericHTMLElement::SetElementFocus(PRBool aDoFocus) { diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 1f849c3a894..49b5281a9a4 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -114,25 +114,25 @@ public: NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileEventHandlers); NS_IMETHOD GetNameSpaceID(PRInt32& aID) const; - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo); - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, PRBool aNotify); - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify); - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsAWritableString& aResult) const; - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - nsIAtom*& aPrefix, nsAWritableString& aResult) const; - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - PRBool aNotify); - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const; - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const; + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify); + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsAWritableString& aResult) const; + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + nsIAtom*& aPrefix, nsAWritableString& aResult) const; + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + PRBool aNotify); + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const; + NS_IMETHOD GetAttrCount(PRInt32& aResult) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const; NS_IMETHOD_(PRBool) IsContentOfType(PRUint32 aFlags); @@ -497,12 +497,19 @@ public: PRBool aRemoveFromForm = PR_TRUE); NS_IMETHOD Init(); + // nsIContent NS_IMETHOD SetParent(nsIContent *aParent); NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileEventHandlers); - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, PRBool aNotify); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, PRBool aNotify); + + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify); + + NS_METHOD SetAttribute(const nsAReadableString& aName, const nsAReadableString& aValue) { @@ -532,12 +539,19 @@ public: PRBool aRemoveFromForm = PR_TRUE); NS_IMETHOD Init(); + // nsIContent NS_IMETHOD SetParent(nsIContent *aParent); NS_IMETHOD SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileEventHandlers); - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, PRBool aNotify); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, PRBool aNotify); + + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify); + + NS_METHOD SetAttribute(const nsAReadableString& aName, const nsAReadableString& aValue) { @@ -560,13 +574,13 @@ protected: NS_IMETHODIMP \ _class::Get##_method(nsAWritableString& aValue) \ { \ - NS_STATIC_CAST(nsIHTMLContent *, this)->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_atom, aValue); \ + NS_STATIC_CAST(nsIHTMLContent *, this)->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::_atom, aValue); \ return NS_OK; \ } \ NS_IMETHODIMP \ _class::Set##_method(const nsAReadableString& aValue) \ { \ - return NS_STATIC_CAST(nsIHTMLContent *, this)->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_atom, aValue, PR_TRUE); \ + return NS_STATIC_CAST(nsIHTMLContent *, this)->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::_atom, aValue, PR_TRUE); \ } /** @@ -592,7 +606,7 @@ protected: return NS_STATIC_CAST(nsIHTMLContent *, this)->SetHTMLAttribute(nsHTMLAtoms::_atom, empty, PR_TRUE); \ } \ else { \ - NS_STATIC_CAST(nsIHTMLContent *, this)->UnsetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_atom, PR_TRUE); \ + NS_STATIC_CAST(nsIHTMLContent *, this)->UnsetAttr(kNameSpaceID_HTML, nsHTMLAtoms::_atom, PR_TRUE); \ return NS_OK; \ } \ } diff --git a/content/html/content/src/nsHTMLAnchorElement.cpp b/content/html/content/src/nsHTMLAnchorElement.cpp index 69c7d9d8069..7651890345e 100644 --- a/content/html/content/src/nsHTMLAnchorElement.cpp +++ b/content/html/content/src/nsHTMLAnchorElement.cpp @@ -198,9 +198,9 @@ NS_IMPL_STRING_ATTR(nsHTMLAnchorElement, Type, type) NS_IMETHODIMP nsHTMLAnchorElement::GetAccessKey(nsAWritableString& aValue) { - NS_STATIC_CAST(nsIHTMLContent *, this)->GetAttribute(kNameSpaceID_None, - nsHTMLAtoms::accesskey, - aValue); + NS_STATIC_CAST(nsIHTMLContent *, this)->GetAttr(kNameSpaceID_None, + nsHTMLAtoms::accesskey, + aValue); return NS_OK; } @@ -210,10 +210,10 @@ nsHTMLAnchorElement::SetAccessKey(const nsAReadableString& aValue) RegUnRegAccessKey(PR_FALSE); nsresult rv = NS_STATIC_CAST(nsIHTMLContent *, - this)->SetAttribute(kNameSpaceID_None, - nsHTMLAtoms::accesskey, - aValue, - PR_TRUE); + this)->SetAttr(kNameSpaceID_None, + nsHTMLAtoms::accesskey, + aValue, + PR_TRUE); if (!aValue.IsEmpty()) { RegUnRegAccessKey(PR_TRUE); @@ -232,9 +232,9 @@ nsresult nsHTMLAnchorElement::RegUnRegAccessKey(PRBool aDoReg) nsAutoString accessKey; nsresult rv; - rv = NS_STATIC_CAST(nsIContent *, this)->GetAttribute(kNameSpaceID_None, - nsHTMLAtoms::accesskey, - accessKey); + rv = NS_STATIC_CAST(nsIContent *, this)->GetAttr(kNameSpaceID_None, + nsHTMLAtoms::accesskey, + accessKey); if (NS_CONTENT_ATTR_NOT_THERE != rv) { nsCOMPtr presContext; @@ -424,9 +424,9 @@ nsHTMLAnchorElement::SetHref(const nsAReadableString& aValue) // somebody asks for it. mLinkState = eLinkState_Unknown; - return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::href, - aValue, PR_TRUE); + return NS_STATIC_CAST(nsIContent *, this)->SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::href, + aValue, PR_TRUE); } NS_IMETHODIMP @@ -435,9 +435,9 @@ nsHTMLAnchorElement::GetTarget(nsAWritableString& aValue) aValue.Truncate(); nsresult rv; - rv = NS_STATIC_CAST(nsIContent *, this)->GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::target, - aValue); + rv = NS_STATIC_CAST(nsIContent *, this)->GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::target, + aValue); if (rv == NS_CONTENT_ATTR_NOT_THERE && mDocument) { rv = mDocument->GetBaseTarget(aValue); NS_ENSURE_SUCCESS(rv, rv); @@ -448,9 +448,9 @@ nsHTMLAnchorElement::GetTarget(nsAWritableString& aValue) NS_IMETHODIMP nsHTMLAnchorElement::SetTarget(const nsAReadableString& aValue) { - return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::target, - aValue, PR_TRUE); + return NS_STATIC_CAST(nsIContent *, this)->SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::target, + aValue, PR_TRUE); } NS_IMETHODIMP @@ -714,9 +714,9 @@ nsHTMLAnchorElement::GetHrefCString(char* &aBuf) nsAutoString relURLSpec; if (NS_CONTENT_ATTR_HAS_VALUE == - NS_STATIC_CAST(nsIContent *, this)->GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::href, - relURLSpec)) { + NS_STATIC_CAST(nsIContent *, this)->GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::href, + relURLSpec)) { // Clean up any leading or trailing whitespace relURLSpec.Trim(" \t\n\r"); diff --git a/content/html/content/src/nsHTMLAreaElement.cpp b/content/html/content/src/nsHTMLAreaElement.cpp index e129a111b6d..f3565fcf846 100644 --- a/content/html/content/src/nsHTMLAreaElement.cpp +++ b/content/html/content/src/nsHTMLAreaElement.cpp @@ -247,9 +247,9 @@ nsHTMLAreaElement::SetHref(const nsAReadableString& aValue) // asks for it. mLinkState = eLinkState_Unknown; - return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::href, - aValue, PR_TRUE); + return NS_STATIC_CAST(nsIContent *, this)->SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::href, + aValue, PR_TRUE); } NS_IMETHODIMP @@ -479,9 +479,9 @@ nsHTMLAreaElement::GetHrefCString(char* &aBuf) nsAutoString relURLSpec; if (NS_CONTENT_ATTR_HAS_VALUE == - NS_STATIC_CAST(nsIContent *, this)->GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::href, - relURLSpec)) { + NS_STATIC_CAST(nsIContent *, this)->GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::href, + relURLSpec)) { // Clean up any leading or trailing whitespace relURLSpec.Trim(" \t\n\r"); diff --git a/content/html/content/src/nsHTMLBodyElement.cpp b/content/html/content/src/nsHTMLBodyElement.cpp index 82cb89f5866..51212f0ee03 100644 --- a/content/html/content/src/nsHTMLBodyElement.cpp +++ b/content/html/content/src/nsHTMLBodyElement.cpp @@ -285,7 +285,7 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData) nsHTMLValue value; PRInt32 attrCount; - mPart->GetAttributeCount(attrCount); + mPart->GetAttrCount(attrCount); PRInt32 bodyMarginWidth = -1; PRInt32 bodyMarginHeight = -1; @@ -806,7 +806,7 @@ nsHTMLBodyElement::GetBgColor(nsAWritableString& aBgColor) { // If we don't have an attribute, find the actual color used for // (generally from the user agent style sheet) for compatibility - if (NS_CONTENT_ATTR_NOT_THERE == nsBodySuper::GetAttribute(kNameSpaceID_None, nsHTMLAtoms::bgcolor, aBgColor)) { + if (NS_CONTENT_ATTR_NOT_THERE == nsBodySuper::GetAttr(kNameSpaceID_None, nsHTMLAtoms::bgcolor, aBgColor)) { nsresult result = NS_OK; if (mDocument) { // Make sure the presentation is up-to-date @@ -853,8 +853,8 @@ nsHTMLBodyElement::GetBgColor(nsAWritableString& aBgColor) NS_IMETHODIMP nsHTMLBodyElement::SetBgColor(const nsAReadableString& aBgColor) { - return nsBodySuper::SetAttribute(kNameSpaceID_None, nsHTMLAtoms::bgcolor, - aBgColor, PR_TRUE); + return nsBodySuper::SetAttr(kNameSpaceID_None, nsHTMLAtoms::bgcolor, + aBgColor, PR_TRUE); } NS_IMETHODIMP diff --git a/content/html/content/src/nsHTMLButtonElement.cpp b/content/html/content/src/nsHTMLButtonElement.cpp index 06d615ec8d2..8e99bbdd377 100644 --- a/content/html/content/src/nsHTMLButtonElement.cpp +++ b/content/html/content/src/nsHTMLButtonElement.cpp @@ -156,7 +156,7 @@ nsHTMLButtonElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aResult) const { if (aName == nsHTMLAtoms::disabled) { - nsresult rv = nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, aResult); + nsresult rv = nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, aResult); if (rv == NS_CONTENT_ATTR_NOT_THERE) { aResult.Assign(NS_LITERAL_STRING("false")); } else { @@ -166,8 +166,8 @@ nsHTMLButtonElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, return rv; } - return nsGenericHTMLContainerFormElement::GetAttribute(aNameSpaceID, aName, - aResult); + return nsGenericHTMLContainerFormElement::GetAttr(aNameSpaceID, aName, + aResult); } NS_IMETHODIMP @@ -179,11 +179,11 @@ nsHTMLButtonElement::SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, if (aName == nsHTMLAtoms::disabled && value.EqualsWithConversion("false", PR_TRUE)) { - return UnsetAttribute(aNameSpaceID, aName, aNotify); + return UnsetAttr(aNameSpaceID, aName, aNotify); } - return nsGenericHTMLContainerFormElement::SetAttribute(aNameSpaceID, aName, - aValue, aNotify); + return nsGenericHTMLContainerFormElement::SetAttr(aNameSpaceID, aName, + aValue, aNotify); } diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index edbce5e31d3..4e524fa31ac 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -320,17 +320,17 @@ nsHTMLFormElement::GetElements(nsIDOMHTMLCollection** aElements) NS_IMETHODIMP nsHTMLFormElement::GetName(nsAWritableString& aValue) { - return nsGenericHTMLContainerElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::name, - aValue); + return nsGenericHTMLContainerElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::name, + aValue); } NS_IMETHODIMP nsHTMLFormElement::SetName(const nsAReadableString& aValue) { - return nsGenericHTMLContainerElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::name, - aValue, PR_TRUE); + return nsGenericHTMLContainerElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::name, + aValue, PR_TRUE); } NS_IMPL_STRING_ATTR(nsHTMLFormElement, AcceptCharset, acceptcharset) diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp index 34a43905b98..47bb5764af2 100644 --- a/content/html/content/src/nsHTMLImageElement.cpp +++ b/content/html/content/src/nsHTMLImageElement.cpp @@ -415,9 +415,9 @@ nsHTMLImageElement::SetHeight(PRInt32 aHeight) val.AppendInt(aHeight); - return nsGenericHTMLLeafElement::SetAttribute(kNameSpaceID_None, - nsHTMLAtoms::height, - val, PR_TRUE); + return nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_None, + nsHTMLAtoms::height, + val, PR_TRUE); } NS_IMETHODIMP @@ -473,9 +473,9 @@ nsHTMLImageElement::SetWidth(PRInt32 aWidth) val.AppendInt(aWidth); - return nsGenericHTMLLeafElement::SetAttribute(kNameSpaceID_None, - nsHTMLAtoms::width, - val, PR_TRUE); + return nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_None, + nsHTMLAtoms::width, + val, PR_TRUE); } NS_IMETHODIMP @@ -735,8 +735,8 @@ nsHTMLImageElement::GetSrc(nsAWritableString& aSrc) GetBaseURL(*getter_AddRefs(baseURL)); // Get href= attribute (relative URL). - nsGenericHTMLLeafElement::GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, - relURLSpec); + nsGenericHTMLLeafElement::GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, + relURLSpec); relURLSpec.Trim(" \t\n\r"); if (baseURL && relURLSpec.Length() > 0) { @@ -774,15 +774,15 @@ NS_IMETHODIMP nsHTMLImageElement::OnStartContainer(imgIRequest *request, nsISupp nsAutoString tmpStr; tmpStr.AppendInt(size.width); - NS_STATIC_CAST(nsIContent *, this)->SetAttribute(kNameSpaceID_None, - nsHTMLAtoms::width, - tmpStr, PR_FALSE); + NS_STATIC_CAST(nsIContent *, this)->SetAttr(kNameSpaceID_None, + nsHTMLAtoms::width, + tmpStr, PR_FALSE); tmpStr.Truncate(); tmpStr.AppendInt(size.height); - NS_STATIC_CAST(nsIContent *, this)->SetAttribute(kNameSpaceID_None, - nsHTMLAtoms::height, - tmpStr, PR_FALSE); + NS_STATIC_CAST(nsIContent *, this)->SetAttr(kNameSpaceID_None, + nsHTMLAtoms::height, + tmpStr, PR_FALSE); return NS_OK; } @@ -908,9 +908,9 @@ nsHTMLImageElement::SetSrcInner(nsIURI* aBaseURL, { nsresult result = NS_OK; - result = nsGenericHTMLLeafElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::src, aSrc, - PR_TRUE); + result = nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::src, aSrc, + PR_TRUE); if (NS_SUCCEEDED(result) && mOwnerDocument) { nsCOMPtr shell; diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index 5c586186c54..537625d2f48 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -221,8 +221,8 @@ protected: { nsAutoString tmp; - nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::type, tmp); + nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::type, tmp); return tmp.EqualsIgnoreCase("image"); } @@ -332,17 +332,17 @@ nsHTMLInputElement::GetForm(nsIDOMHTMLFormElement** aForm) NS_IMETHODIMP nsHTMLInputElement::GetDefaultValue(nsAWritableString& aDefaultValue) { - return nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - aDefaultValue); + return nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + aDefaultValue); } NS_IMETHODIMP nsHTMLInputElement::SetDefaultValue(const nsAReadableString& aDefaultValue) { - return nsGenericHTMLLeafFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - aDefaultValue, PR_TRUE); + return nsGenericHTMLLeafFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + aDefaultValue, PR_TRUE); } NS_IMETHODIMP @@ -366,7 +366,7 @@ nsHTMLInputElement::SetDefaultChecked(PRBool aDefaultChecked) if (aDefaultChecked) { rv = SetHTMLAttribute(nsHTMLAtoms::checked, empty, PR_TRUE); } else { - rv = UnsetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::checked, PR_TRUE); + rv = UnsetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, PR_TRUE); } if (NS_SUCCEEDED(rv)) { @@ -397,9 +397,9 @@ NS_IMPL_STRING_ATTR(nsHTMLInputElement, UseMap, usemap) NS_IMETHODIMP nsHTMLInputElement::GetType(nsAWritableString& aValue) { - nsresult rv = nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::type, - aValue); + nsresult rv = nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::type, + aValue); if (rv == NS_CONTENT_ATTR_NOT_THERE) aValue.Assign(NS_LITERAL_STRING("text")); @@ -410,9 +410,9 @@ nsHTMLInputElement::GetType(nsAWritableString& aValue) NS_IMETHODIMP nsHTMLInputElement::SetType(const nsAReadableString& aValue) { - return nsGenericHTMLLeafFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::type, aValue, - PR_TRUE); + return nsGenericHTMLLeafFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::type, aValue, + PR_TRUE); } NS_IMETHODIMP @@ -443,9 +443,9 @@ nsHTMLInputElement::GetValue(nsAWritableString& aValue) } // Treat value == defaultValue for other input elements - nsresult rv = nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - aValue); + nsresult rv = nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + aValue); if (rv == NS_CONTENT_ATTR_NOT_THERE && type == NS_FORM_INPUT_RADIO) { // The defauly value of a radio input is "on". @@ -511,9 +511,9 @@ nsHTMLInputElement::SetValue(const nsAReadableString& aValue) } // Treat value == defaultValue for other input elements. - return nsGenericHTMLLeafFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - aValue, PR_TRUE); + return nsGenericHTMLLeafFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + aValue, PR_TRUE); } NS_IMETHODIMP @@ -666,9 +666,9 @@ nsHTMLInputElement::SetFocus(nsIPresContext* aPresContext) // first see if we are disabled or not. If disabled then do nothing. nsAutoString disabled; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - disabled)) { + nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + disabled)) { return NS_OK; } @@ -754,9 +754,9 @@ nsHTMLInputElement::Select() // first see if we are disabled or not. If disabled then do nothing. nsAutoString disabled; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - disabled)) { + nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + disabled)) { return rv; } @@ -824,9 +824,9 @@ nsHTMLInputElement::Click() // first see if we are disabled or not. If disabled then do nothing. nsAutoString disabled; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLLeafFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - disabled)) { + nsGenericHTMLLeafFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + disabled)) { return rv; } diff --git a/content/html/content/src/nsHTMLLabelElement.cpp b/content/html/content/src/nsHTMLLabelElement.cpp index d136cc8b1a8..2d3102fb0ff 100644 --- a/content/html/content/src/nsHTMLLabelElement.cpp +++ b/content/html/content/src/nsHTMLLabelElement.cpp @@ -269,8 +269,8 @@ NS_IMPL_STRING_ATTR(nsHTMLLabelElement, AccessKey, accesskey) NS_IMETHODIMP nsHTMLLabelElement::GetHtmlFor(nsAWritableString& aValue) { - nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::_for, aValue); + nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::_for, aValue); return NS_OK; } @@ -281,9 +281,9 @@ nsHTMLLabelElement::SetHtmlFor(const nsAReadableString& aValue) static char whitespace[] = " \r\n\t"; nsAutoString value(aValue); value.Trim(whitespace, PR_TRUE, PR_TRUE); - return nsGenericHTMLContainerFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::_for, - value, PR_TRUE); + return nsGenericHTMLContainerFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::_for, + value, PR_TRUE); } NS_IMETHODIMP diff --git a/content/html/content/src/nsHTMLLinkElement.cpp b/content/html/content/src/nsHTMLLinkElement.cpp index 8aa5e820968..2483c93db77 100644 --- a/content/html/content/src/nsHTMLLinkElement.cpp +++ b/content/html/content/src/nsHTMLLinkElement.cpp @@ -80,15 +80,15 @@ public: NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, const nsAReadableString& aValue, PRBool aNotify) { - nsresult rv = nsGenericHTMLLeafElement::SetAttribute(aNameSpaceID, aName, - aValue, aNotify); + nsresult rv = nsGenericHTMLLeafElement::SetAttr(aNameSpaceID, aName, + aValue, aNotify); UpdateStyleSheet(aNotify); return rv; } NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, const nsAReadableString& aValue, PRBool aNotify) { - nsresult rv = nsGenericHTMLLeafElement::SetAttribute(aNodeInfo, aValue, - aNotify); + nsresult rv = nsGenericHTMLLeafElement::SetAttr(aNodeInfo, aValue, + aNotify); // nsGenericHTMLLeafElement::SetAttribute(nsINodeInfo* aNodeInfo, // const nsAReadableString& aValue, @@ -106,11 +106,11 @@ public: return rv; } - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - PRBool aNotify) { - nsresult rv = nsGenericHTMLLeafElement::UnsetAttribute(aNameSpaceID, - aAttribute, - aNotify); + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRBool aNotify) { + nsresult rv = nsGenericHTMLLeafElement::UnsetAttr(aNameSpaceID, + aAttribute, + aNotify); UpdateStyleSheet(aNotify); return rv; } @@ -274,10 +274,10 @@ nsHTMLLinkElement::SetHref(const nsAReadableString& aValue) // somebody asks for it. mLinkState = eLinkState_Unknown; - nsresult rv = nsGenericHTMLLeafElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::href, - aValue, - PR_TRUE); + nsresult rv = nsGenericHTMLLeafElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::href, + aValue, + PR_TRUE); UpdateStyleSheet(PR_TRUE); return rv; } @@ -322,8 +322,8 @@ nsHTMLLinkElement::GetHrefCString(char* &aBuf) nsAutoString relURLSpec; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLLeafElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::href, relURLSpec)) { + nsGenericHTMLLeafElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::href, relURLSpec)) { // Clean up any leading or trailing whitespace relURLSpec.Trim(" \t\n\r"); diff --git a/content/html/content/src/nsHTMLOptionElement.cpp b/content/html/content/src/nsHTMLOptionElement.cpp index 0b081cbffee..f22d2f4a445 100644 --- a/content/html/content/src/nsHTMLOptionElement.cpp +++ b/content/html/content/src/nsHTMLOptionElement.cpp @@ -333,7 +333,7 @@ nsHTMLOptionElement::SetDisabled(PRBool aDisabled) } } } else { - rv = UnsetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::selected, PR_TRUE); + rv = UnsetAttr(kNameSpaceID_HTML, nsHTMLAtoms::selected, PR_TRUE); } return NS_OK; @@ -342,8 +342,8 @@ nsHTMLOptionElement::SetDisabled(PRBool aDisabled) NS_IMETHODIMP nsHTMLOptionElement::GetLabel(nsAWritableString& aValue) { - nsGenericHTMLContainerElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::label, aValue); + nsGenericHTMLContainerElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::label, aValue); return NS_OK; } @@ -352,9 +352,9 @@ nsHTMLOptionElement::SetLabel(const nsAReadableString& aValue) { nsresult result; - result = nsGenericHTMLContainerElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::label, - aValue, PR_TRUE); + result = nsGenericHTMLContainerElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::label, + aValue, PR_TRUE); if (NS_SUCCEEDED(result)) { nsIFormControlFrame* fcFrame = nsnull; @@ -395,7 +395,7 @@ nsHTMLOptionElement::SetDefaultSelected(PRBool aDefaultSelected) if (aDefaultSelected) { rv = SetHTMLAttribute(nsHTMLAtoms::selected, empty, PR_TRUE); } else { - rv = UnsetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::selected, PR_TRUE); + rv = UnsetAttr(kNameSpaceID_HTML, nsHTMLAtoms::selected, PR_TRUE); } if (NS_SUCCEEDED(rv)) { @@ -716,9 +716,9 @@ nsHTMLOptionElement::Initialize(JSContext* aContext, nsAutoString value(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr))); - result = nsGenericHTMLContainerElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - value, PR_FALSE); + result = nsGenericHTMLContainerElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + value, PR_FALSE); if (NS_FAILED(result)) { return result; } diff --git a/content/html/content/src/nsHTMLSelectElement.cpp b/content/html/content/src/nsHTMLSelectElement.cpp index 6fb3d7d3256..b77831c758d 100644 --- a/content/html/content/src/nsHTMLSelectElement.cpp +++ b/content/html/content/src/nsHTMLSelectElement.cpp @@ -1021,9 +1021,9 @@ nsHTMLSelectElement::SetFocus(nsIPresContext* aPresContext) nsAutoString disabled; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - disabled)) { + nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + disabled)) { return NS_OK; } @@ -1667,11 +1667,11 @@ nsHTMLOptionCollection::NamedItem(const nsAReadableString& aName, nsAutoString name; // XXX Should it be an EqualsIgnoreCase? - if (((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, - name) == NS_CONTENT_ATTR_HAS_VALUE) && + if (((content->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, + name) == NS_CONTENT_ATTR_HAS_VALUE) && (aName.Equals(name))) || - ((content->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::id, - name) == NS_CONTENT_ATTR_HAS_VALUE) && + ((content->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::id, + name) == NS_CONTENT_ATTR_HAS_VALUE) && (aName.Equals(name)))) { result = option->QueryInterface(NS_GET_IID(nsIDOMNode), (void **)aReturn); diff --git a/content/html/content/src/nsHTMLStyleElement.cpp b/content/html/content/src/nsHTMLStyleElement.cpp index 79d14c2233b..92c44f16791 100644 --- a/content/html/content/src/nsHTMLStyleElement.cpp +++ b/content/html/content/src/nsHTMLStyleElement.cpp @@ -72,17 +72,17 @@ public: return rv; } - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, - const nsAReadableString& aValue, PRBool aNotify) { - nsresult rv = nsGenericHTMLContainerElement::SetAttribute(aNameSpaceID, aName, - aValue, aNotify); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, PRBool aNotify) { + nsresult rv = nsGenericHTMLContainerElement::SetAttr(aNameSpaceID, aName, + aValue, aNotify); UpdateStyleSheet(aNotify); return rv; } - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, PRBool aNotify) { - nsresult rv = nsGenericHTMLContainerElement::SetAttribute(aNodeInfo, aValue, - aNotify); + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, PRBool aNotify) { + nsresult rv = nsGenericHTMLContainerElement::SetAttr(aNodeInfo, aValue, + aNotify); // nsGenericHTMLContainerElement::SetAttribute(nsINodeInfo* aNodeInfo, // const nsAReadableString& aValue, @@ -98,11 +98,11 @@ public: return rv; } - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRBool aNotify) { - nsresult rv = nsGenericHTMLContainerElement::UnsetAttribute(aNameSpaceID, - aAttribute, - aNotify); + nsresult rv = nsGenericHTMLContainerElement::UnsetAttr(aNameSpaceID, + aAttribute, + aNotify); UpdateStyleSheet(aNotify); return rv; } @@ -252,8 +252,8 @@ nsHTMLStyleElement::GetHrefCString(char* &aBuf) nsAutoString relURLSpec; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLContainerElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::src, relURLSpec)) { + nsGenericHTMLContainerElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::src, relURLSpec)) { // Clean up any leading or trailing whitespace relURLSpec.Trim(" \t\n\r"); diff --git a/content/html/content/src/nsHTMLTextAreaElement.cpp b/content/html/content/src/nsHTMLTextAreaElement.cpp index 1b170db347b..c3121d055a9 100644 --- a/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -212,9 +212,9 @@ nsHTMLTextAreaElement::SetFocus(nsIPresContext* aPresContext) nsAutoString disabled; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - disabled)) { + nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + disabled)) { return NS_OK; } @@ -279,9 +279,9 @@ nsHTMLTextAreaElement::Select() // first see if we are disabled or not. If disabled then do nothing. nsAutoString disabled; if (NS_CONTENT_ATTR_HAS_VALUE == - nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::disabled, - disabled)) { + nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::disabled, + disabled)) { return rv; } @@ -370,9 +370,9 @@ nsHTMLTextAreaElement::GetValue(nsAWritableString& aValue) return NS_OK; } //XXX: Should this ASSERT instead of getting the default value here? - return nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - aValue); + return nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + aValue); } @@ -392,8 +392,8 @@ nsHTMLTextAreaElement::SetValue(const nsAReadableString& aValue) // Set the attribute in the DOM too, we call SetAttribute with aNotify // false so that we don't generate unnecessary reflows. - nsGenericHTMLContainerFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, aValue, + nsGenericHTMLContainerFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, aValue, PR_FALSE); return NS_OK; @@ -402,9 +402,9 @@ nsHTMLTextAreaElement::SetValue(const nsAReadableString& aValue) NS_IMETHODIMP nsHTMLTextAreaElement::GetDefaultValue(nsAWritableString& aDefaultValue) { - nsGenericHTMLContainerFormElement::GetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::defaultvalue, - aDefaultValue); + nsGenericHTMLContainerFormElement::GetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::defaultvalue, + aDefaultValue); return NS_OK; } @@ -424,12 +424,12 @@ nsHTMLTextAreaElement::SetDefaultValue(const nsAReadableString& aDefaultValue) defaultValue.Cut(0,1); } - nsGenericHTMLContainerFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::defaultvalue, - defaultValue, PR_TRUE); - nsGenericHTMLContainerFormElement::SetAttribute(kNameSpaceID_HTML, - nsHTMLAtoms::value, - defaultValue, PR_TRUE); + nsGenericHTMLContainerFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::defaultvalue, + defaultValue, PR_TRUE); + nsGenericHTMLContainerFormElement::SetAttr(kNameSpaceID_HTML, + nsHTMLAtoms::value, + defaultValue, PR_TRUE); return NS_OK; } diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index a409a1f5a40..303e95b02cf 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -776,7 +776,7 @@ HTMLContentSink::AddAttributes(const nsIParserNode& aNode, GetAttributeValueAt(aNode, i, v); // Add attribute to content - aContent->SetAttribute(kNameSpaceID_HTML, keyAtom, v,aNotify); + aContent->SetAttr(kNameSpaceID_HTML, keyAtom, v,aNotify); } NS_RELEASE(keyAtom); } @@ -4014,10 +4014,10 @@ void HTMLContentSink::AddBaseTagInfo(nsIHTMLContent* aContent) { if (mBaseHREF.Length() > 0) { - aContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_baseHref, mBaseHREF, PR_FALSE); + aContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::_baseHref, mBaseHREF, PR_FALSE); } if (mBaseTarget.Length() > 0) { - aContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::_baseTarget, mBaseTarget, PR_FALSE); + aContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::_baseTarget, mBaseTarget, PR_FALSE); } } @@ -4148,10 +4148,10 @@ HTMLContentSink::ProcessBASETag(const nsIParserNode& aNode) parent->AppendChildTo(element, PR_FALSE, PR_FALSE); if (!mInsideNoXXXTag) { nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::href, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == element->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::href, value)) { ProcessBaseHref(value); } - if (NS_CONTENT_ATTR_HAS_VALUE == element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == element->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::target, value)) { ProcessBaseTarget(value); } } @@ -4541,10 +4541,10 @@ HTMLContentSink::ProcessMETATag(const nsIParserNode& aNode) // set any HTTP-EQUIV data into document's header data as well as url nsAutoString header; - it->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::httpEquiv, header); + it->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::httpEquiv, header); if (header.Length() > 0) { nsAutoString result; - it->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::content, result); + it->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::content, result); if (result.Length() > 0) { header.ToLowerCase(); nsCOMPtr fieldAtom(dont_AddRef(NS_NewAtom(header))); @@ -5080,7 +5080,7 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode) } nsAutoString src; - element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src); + element->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, src); src.StripWhitespace(); if (!mInsideNoXXXTag && NS_SUCCEEDED(rv) && src.IsEmpty()) { @@ -5088,11 +5088,11 @@ HTMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode) nsAutoString type; nsAutoString media; - element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::title, title); + element->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::title, title); title.CompressWhitespace(); - element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); - element->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::media, media); + element->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + element->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::media, media); media.ToLowerCase(); // HTML4.0 spec is inconsistent, make it case INSENSITIVE nsAutoString mimeType; diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index ad59bd11944..4e8131edc69 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -1273,7 +1273,7 @@ nsHTMLDocument::AttributeChanged(nsIContent* aContent, PRInt32 aNameSpaceID, } else if (aAttribute == nsHTMLAtoms::id) { nsAutoString value; - aContent->GetAttribute(aNameSpaceID, nsHTMLAtoms::id, value); + aContent->GetAttr(aNameSpaceID, nsHTMLAtoms::id, value); if (!value.IsEmpty()) { nsresult rv = AddToIdTable(value, aContent, PR_TRUE); @@ -1908,7 +1908,7 @@ nsHTMLDocument::MatchLinks(nsIContent *aContent, nsString* aData) if ((nsnull != name) && ((nsHTMLAtoms::area == name) || (nsHTMLAtoms::a == name)) && - (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::href, attr))) { + (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::href, attr))) { result = PR_TRUE; } @@ -1943,7 +1943,7 @@ nsHTMLDocument::MatchAnchors(nsIContent *aContent, nsString* aData) if ((nsnull != name) && (nsHTMLAtoms::a == name) && - (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, attr))) { + (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, attr))) { result = PR_TRUE; } @@ -2117,17 +2117,17 @@ nsHTMLDocument::OpenCommon(nsIURI* aSourceURL) count = 0; - mRootContent->GetAttributeCount(count); + mRootContent->GetAttrCount(count); // Remove all attributes from the root element while (--count >= 0) { nsCOMPtr name, prefix; PRInt32 nsid; - root->GetAttributeNameAt(count, nsid, *getter_AddRefs(name), - *getter_AddRefs(prefix)); + root->GetAttrNameAt(count, nsid, *getter_AddRefs(name), + *getter_AddRefs(prefix)); - root->UnsetAttribute(nsid, name, PR_FALSE); + root->UnsetAttr(nsid, name, PR_FALSE); } // Remove the root from the childlist @@ -2473,8 +2473,8 @@ nsHTMLDocument::MatchId(nsIContent *aContent, const nsAReadableString& aId) { nsAutoString value; - nsresult rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::id, - value); + nsresult rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::id, + value); if (rv == NS_CONTENT_ATTR_HAS_VALUE && aId.Equals(value)) { return aContent; @@ -2569,8 +2569,8 @@ nsHTMLDocument::MatchNameAttribute(nsIContent* aContent, nsString* aData) { nsAutoString name; - nsresult rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, - name); + nsresult rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, + name); if (NS_SUCCEEDED(rv) && aData && name.Equals(*aData)) { return PR_TRUE; @@ -3156,7 +3156,7 @@ IsNamedItem(nsIContent* aContent, nsIAtom *aTag, nsAWritableString& aName) if ((aTag == nsHTMLAtoms::img) || (aTag == nsHTMLAtoms::form) || (aTag == nsHTMLAtoms::applet) || (aTag == nsHTMLAtoms::embed) || (aTag == nsHTMLAtoms::object)) { - aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, aName); + aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, aName); if (!aName.IsEmpty()) { return PR_TRUE; @@ -3226,7 +3226,7 @@ nsHTMLDocument::RemoveFromIdTable(nsIContent *aContent) { nsAutoString value; - aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, value); + aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, value); if (value.IsEmpty()) { return NS_OK; @@ -3310,7 +3310,7 @@ nsHTMLDocument::RegisterNamedItems(nsIContent *aContent) AddToNameTable(value, aContent); } - aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, value); + aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, value); if (!value.IsEmpty()) { nsresult rv = AddToIdTable(value, aContent, PR_FALSE); @@ -3355,7 +3355,7 @@ nsHTMLDocument::FindNamedItems(const nsAReadableString& aName, if (IsNamedItem(aContent, tag, value) && value.Equals(aName)) { aList.AppendElement(aContent); } else { - aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, value); + aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, value); if (value.Equals(aName)) { AddToIdTable(value, aContent, PR_TRUE); diff --git a/content/html/document/src/nsHTMLFragmentContentSink.cpp b/content/html/document/src/nsHTMLFragmentContentSink.cpp index ac121594230..8875579fe50 100644 --- a/content/html/document/src/nsHTMLFragmentContentSink.cpp +++ b/content/html/document/src/nsHTMLFragmentContentSink.cpp @@ -443,10 +443,10 @@ void nsHTMLFragmentContentSink::ProcessBaseTag(nsIHTMLContent* aContent) { nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, value)) { mBaseHREF = value; } - if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::target, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::target, value)) { mBaseTarget = value; } } @@ -456,10 +456,10 @@ nsHTMLFragmentContentSink::AddBaseTagInfo(nsIHTMLContent* aContent) { if (aContent) { if (mBaseHREF.Length() > 0) { - aContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::_baseHref, mBaseHREF, PR_FALSE); + aContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::_baseHref, mBaseHREF, PR_FALSE); } if (mBaseTarget.Length() > 0) { - aContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::_baseTarget, mBaseTarget, PR_FALSE); + aContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::_baseTarget, mBaseTarget, PR_FALSE); } } } @@ -883,12 +883,12 @@ nsHTMLFragmentContentSink::AddAttributes(const nsIParserNode& aNode, nsIAtom* keyAtom = NS_NewAtom(k); if (NS_CONTENT_ATTR_NOT_THERE == - aContent->GetAttribute(kNameSpaceID_HTML, keyAtom, v)) { + aContent->GetAttr(kNameSpaceID_HTML, keyAtom, v)) { // Get value and remove mandatory quotes GetAttributeValueAt(aNode, i, v); // Add attribute to content - aContent->SetAttribute(kNameSpaceID_HTML, keyAtom, v, PR_FALSE); + aContent->SetAttr(kNameSpaceID_HTML, keyAtom, v, PR_FALSE); } NS_RELEASE(keyAtom); } diff --git a/content/html/style/src/nsCSSStyleSheet.cpp b/content/html/style/src/nsCSSStyleSheet.cpp index d545c57097f..025a1eec4eb 100644 --- a/content/html/style/src/nsCSSStyleSheet.cpp +++ b/content/html/style/src/nsCSSStyleSheet.cpp @@ -2761,7 +2761,7 @@ struct SelectorMatchesData { nsLinkState mLinkState; // if a link, this is the state, otherwise unknown PRBool mIsQuirkMode; // Possibly remove use of this in SelectorMatches? PRInt32 mEventState; // if content, eventStateMgr->GetContentState() - PRBool mHasAttributes; // if content, content->GetAttributeCount() > 0 + PRBool mHasAttributes; // if content, content->GetAttrCount() > 0 PRInt32 mNameSpaceID; // if content, content->GetNameSapce() SelectorMatchesData* mPreviousSiblingData; SelectorMatchesData* mParentData; @@ -2827,7 +2827,7 @@ SelectorMatchesData::SelectorMatchesData(nsIPresContext* aPresContext, nsIConten // see if there are attributes for the content PRInt32 attrCount = 0; - aContent->GetAttributeCount(attrCount); + aContent->GetAttrCount(attrCount); mHasAttributes = PRBool(attrCount > 0); // check for HTMLContent and Link status @@ -3157,7 +3157,7 @@ static PRBool SelectorMatches(SelectorMatchesData &data, nsAttrSelector* attr = aSelector->mAttrList; nsAutoString value; do { - nsresult attrState = data.mContent->GetAttribute(attr->mNameSpace, attr->mAttr, value); + nsresult attrState = data.mContent->GetAttr(attr->mNameSpace, attr->mAttr, value); if (NS_FAILED(attrState) || (NS_CONTENT_ATTR_NOT_THERE == attrState)) { result = localFalse; } diff --git a/content/html/style/src/nsHTMLStyleSheet.cpp b/content/html/style/src/nsHTMLStyleSheet.cpp index 74486ab776a..52d02404e40 100644 --- a/content/html/style/src/nsHTMLStyleSheet.cpp +++ b/content/html/style/src/nsHTMLStyleSheet.cpp @@ -886,7 +886,7 @@ HTMLStyleSheetImpl::HasStateDependentStyle(nsIPresContext* aPresContext, // if we have anchor colors, check if this is an anchor with an href if (tag == nsHTMLAtoms::a) { nsAutoString href; - nsresult attrState = styledContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href); + nsresult attrState = styledContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, href); if (NS_CONTENT_ATTR_HAS_VALUE == attrState) { result = NS_OK; // yes, style will depend on link state } diff --git a/content/html/style/src/nsStyleUtil.cpp b/content/html/style/src/nsStyleUtil.cpp index 737fc15b1d2..56a3c310664 100644 --- a/content/html/style/src/nsStyleUtil.cpp +++ b/content/html/style/src/nsStyleUtil.cpp @@ -676,12 +676,12 @@ PRBool nsStyleUtil::IsSimpleXlink(nsIContent *aContent, nsIPresContext *aPresCon if (xml) { // see if it is type=simple (we don't deal with other types) nsAutoString val; - aContent->GetAttribute(kNameSpaceID_XLink, nsHTMLAtoms::type, val); + aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, val); if (val == NS_LITERAL_STRING("simple")) { // see if there is an xlink namespace'd href attribute: // - get it if there is, if not no big deal, it is not required for xlinks // is it bad to re-use val here? - aContent->GetAttribute(kNameSpaceID_XLink, nsHTMLAtoms::href, val); + aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::href, val); // It's an XLink. Resolve it relative to its document. nsCOMPtr baseURI; diff --git a/content/shared/src/nsStyleUtil.cpp b/content/shared/src/nsStyleUtil.cpp index 737fc15b1d2..56a3c310664 100644 --- a/content/shared/src/nsStyleUtil.cpp +++ b/content/shared/src/nsStyleUtil.cpp @@ -676,12 +676,12 @@ PRBool nsStyleUtil::IsSimpleXlink(nsIContent *aContent, nsIPresContext *aPresCon if (xml) { // see if it is type=simple (we don't deal with other types) nsAutoString val; - aContent->GetAttribute(kNameSpaceID_XLink, nsHTMLAtoms::type, val); + aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, val); if (val == NS_LITERAL_STRING("simple")) { // see if there is an xlink namespace'd href attribute: // - get it if there is, if not no big deal, it is not required for xlinks // is it bad to re-use val here? - aContent->GetAttribute(kNameSpaceID_XLink, nsHTMLAtoms::href, val); + aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::href, val); // It's an XLink. Resolve it relative to its document. nsCOMPtr baseURI; diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index e338eefa30a..23d9c767835 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -683,7 +683,7 @@ nsXBLBinding::GenerateAnonymousContent() #ifdef DEBUG // See if there's an includes attribute. nsAutoString includes; - content->GetAttribute(kNameSpaceID_None, kIncludesAtom, includes); + content->GetAttr(kNameSpaceID_None, kIncludesAtom, includes); if (!includes.IsEmpty()) { nsCAutoString id; mPrototypeBinding->GetID(id); @@ -853,28 +853,28 @@ nsXBLBinding::GenerateAnonymousContent() // This shorthand hack always happens, even when we didn't // build anonymous content. PRInt32 length; - content->GetAttributeCount(length); + content->GetAttrCount(length); PRInt32 namespaceID; nsCOMPtr name; nsCOMPtr prefix; for (PRInt32 i = 0; i < length; ++i) { - content->GetAttributeNameAt(i, namespaceID, *getter_AddRefs(name), *getter_AddRefs(prefix)); + content->GetAttrNameAt(i, namespaceID, *getter_AddRefs(name), *getter_AddRefs(prefix)); if (name.get() != kIncludesAtom) { nsAutoString value; - mBoundElement->GetAttribute(namespaceID, name, value); + mBoundElement->GetAttr(namespaceID, name, value); if (value.IsEmpty()) { nsAutoString value2; - content->GetAttribute(namespaceID, name, value2); - mBoundElement->SetAttribute(namespaceID, name, value2, PR_FALSE); + content->GetAttr(namespaceID, name, value2); + mBoundElement->SetAttr(namespaceID, name, value2, PR_FALSE); } } // Conserve space by wiping the attributes off the clone. if (mContent) - mContent->UnsetAttribute(namespaceID, name, PR_FALSE); + mContent->UnsetAttr(namespaceID, name, PR_FALSE); } return NS_OK; @@ -915,7 +915,7 @@ nsXBLBinding::InstallEventHandlers() /* // Disable ATTACHTO capability for Mozilla 1.0 nsAutoString attachType; - child->GetAttribute(kNameSpaceID_None, kAttachToAtom, attachType); + child->GetAttr(kNameSpaceID_None, kAttachToAtom, attachType); if (attachType == NS_LITERAL_STRING("_document") || attachType == NS_LITERAL_STRING("_window")) { @@ -941,7 +941,7 @@ nsXBLBinding::InstallEventHandlers() // Figure out if we're using capturing or not. PRBool useCapture = PR_FALSE; nsAutoString capturer; - child->GetAttribute(kNameSpaceID_None, kPhaseAtom, capturer); + child->GetAttr(kNameSpaceID_None, kPhaseAtom, capturer); if (capturer == NS_LITERAL_STRING("capturing")) useCapture = PR_TRUE; @@ -1021,7 +1021,7 @@ nsXBLBinding::InstallEventHandlers() else { NS_WARNING("***** Non-compliant XBL event listener attached! *****"); nsAutoString value; - child->GetAttribute(kNameSpaceID_None, kActionAtom, value); + child->GetAttr(kNameSpaceID_None, kActionAtom, value); if (value.IsEmpty()) GetTextData(child, value); AddScriptEventListener(mBoundElement, eventAtom, value); @@ -1091,7 +1091,7 @@ nsXBLBinding::InstallProperties() // Init our class and insert it into the prototype chain. nsAutoString className; nsCAutoString classStr; - interfaceElement->GetAttribute(kNameSpaceID_None, kNameAtom, className); + interfaceElement->GetAttr(kNameSpaceID_None, kNameAtom, className); if (!className.IsEmpty()) { classStr.AssignWithConversion(className); } @@ -1120,7 +1120,7 @@ nsXBLBinding::InstallProperties() if (tagName.get() == kMethodAtom && classObject) { // Obtain our name attribute. nsAutoString name, body; - child->GetAttribute(kNameSpaceID_None, kNameAtom, name); + child->GetAttr(kNameSpaceID_None, kNameAtom, name); // Now walk all of our args. // XXX I'm lame. 32 max args allowed. @@ -1137,7 +1137,7 @@ nsXBLBinding::InstallProperties() if (kidTagName.get() == kParameterAtom) { // Get the argname and add it to the array. nsAutoString argName; - arg->GetAttribute(kNameSpaceID_None, kNameAtom, argName); + arg->GetAttr(kNameSpaceID_None, kNameAtom, argName); char* argStr = argName.ToNewCString(); args[argCount] = argStr; argCount++; @@ -1187,14 +1187,14 @@ nsXBLBinding::InstallProperties() else if (tagName.get() == kPropertyAtom) { // Obtain our name attribute. nsAutoString name; - child->GetAttribute(kNameSpaceID_None, kNameAtom, name); + child->GetAttr(kNameSpaceID_None, kNameAtom, name); if (!name.IsEmpty()) { // We have a property. nsAutoString getter, setter, readOnly; - child->GetAttribute(kNameSpaceID_None, kOnGetAtom, getter); - child->GetAttribute(kNameSpaceID_None, kOnSetAtom, setter); - child->GetAttribute(kNameSpaceID_None, kReadOnlyAtom, readOnly); + child->GetAttr(kNameSpaceID_None, kOnGetAtom, getter); + child->GetAttr(kNameSpaceID_None, kOnSetAtom, setter); + child->GetAttr(kNameSpaceID_None, kReadOnlyAtom, readOnly); void* getFunc = nsnull; void* setFunc = nsnull; diff --git a/content/xbl/src/nsXBLEventHandler.cpp b/content/xbl/src/nsXBLEventHandler.cpp index 44c8ba60de6..5cc9da2bd3b 100644 --- a/content/xbl/src/nsXBLEventHandler.cpp +++ b/content/xbl/src/nsXBLEventHandler.cpp @@ -127,12 +127,12 @@ nsXBLEventHandler::RemoveEventHandlers() PRBool useCapture = PR_FALSE; nsAutoString capturer; - handlerElement->GetAttribute(kNameSpaceID_None, nsXBLBinding::kPhaseAtom, capturer); + handlerElement->GetAttr(kNameSpaceID_None, nsXBLBinding::kPhaseAtom, capturer); if (capturer == NS_LITERAL_STRING("capturing")) useCapture = PR_TRUE; nsAutoString type; - handlerElement->GetAttribute(kNameSpaceID_None, nsXBLBinding::kEventAtom, type); + handlerElement->GetAttr(kNameSpaceID_None, nsXBLBinding::kEventAtom, type); PRBool found = PR_FALSE; nsIID iid; diff --git a/content/xbl/src/nsXBLPrototypeBinding.cpp b/content/xbl/src/nsXBLPrototypeBinding.cpp index 32bde4fb8d5..da4ab77e160 100644 --- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -390,7 +390,7 @@ nsXBLPrototypeBinding::SetBindingElement(nsIContent* aElement) { mBinding = aElement; nsAutoString inheritStyle; - mBinding->GetAttribute(kNameSpaceID_None, kInheritStyleAtom, inheritStyle); + mBinding->GetAttr(kNameSpaceID_None, kInheritStyleAtom, inheritStyle); if (inheritStyle == NS_LITERAL_STRING("false")) mInheritStyle = PR_FALSE; @@ -490,7 +490,7 @@ nsXBLPrototypeBinding::LoadResources(PRBool* aResult) resource->GetTag(*getter_AddRefs(tag)); nsAutoString src; - resource->GetAttribute(kNameSpaceID_None, kSrcAtom, src); + resource->GetAttr(kNameSpaceID_None, kSrcAtom, src); if (src.Length() == 0) continue; @@ -528,7 +528,7 @@ nsXBLPrototypeBinding::LoadResources(PRBool* aResult) // Kick off the load of the stylesheet. PRBool doneLoading; nsAutoString empty, media; - resource->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::media, media); + resource->GetAttr(kNameSpaceID_None, nsHTMLAtoms::media, media); PRInt32 numSheets = 0; doc->GetNumberOfStyleSheets(&numSheets); rv = cssLoader->LoadStyleLink(nsnull, url, empty, media, kNameSpaceID_Unknown, @@ -646,7 +646,7 @@ nsXBLPrototypeBinding::AttributeChanged(nsIAtom* aAttribute, PRInt32 aNameSpaceI xblAttr->GetDstAttribute(getter_AddRefs(dstAttr)); if (aRemoveFlag) - realElement->UnsetAttribute(aNameSpaceID, dstAttr, PR_TRUE); + realElement->UnsetAttr(aNameSpaceID, dstAttr, PR_TRUE); else { PRBool attrPresent = PR_TRUE; nsAutoString value; @@ -662,13 +662,13 @@ nsXBLPrototypeBinding::AttributeChanged(nsIAtom* aAttribute, PRInt32 aNameSpaceI attrPresent = PR_FALSE; } else { - nsresult result = aChangedElement->GetAttribute(aNameSpaceID, aAttribute, value); + nsresult result = aChangedElement->GetAttr(aNameSpaceID, aAttribute, value); attrPresent = (result == NS_CONTENT_ATTR_NO_VALUE || result == NS_CONTENT_ATTR_HAS_VALUE); } if (attrPresent) - realElement->SetAttribute(aNameSpaceID, dstAttr, value, PR_TRUE); + realElement->SetAttr(aNameSpaceID, dstAttr, value, PR_TRUE); } // See if we're the tag in XUL, and see if value is being @@ -686,7 +686,7 @@ nsXBLPrototypeBinding::AttributeChanged(nsIAtom* aAttribute, PRInt32 aNameSpaceI if (!aRemoveFlag) { // Construct a new text node and insert it. nsAutoString value; - aChangedElement->GetAttribute(aNameSpaceID, aAttribute, value); + aChangedElement->GetAttr(aNameSpaceID, aAttribute, value); if (!value.IsEmpty()) { nsCOMPtr textNode; nsCOMPtr doc; @@ -1086,7 +1086,7 @@ PRBool PR_CALLBACK SetAttrs(nsHashKey* aKey, void* aData, void* aClosure) attrPresent = PR_FALSE; } else { - nsresult result = changeData->mBoundElement->GetAttribute(kNameSpaceID_None, src, value); + nsresult result = changeData->mBoundElement->GetAttr(kNameSpaceID_None, src, value); attrPresent = (result == NS_CONTENT_ATTR_NO_VALUE || result == NS_CONTENT_ATTR_HAS_VALUE); } @@ -1106,7 +1106,7 @@ PRBool PR_CALLBACK SetAttrs(nsHashKey* aKey, void* aData, void* aClosure) changeData->mProto->LocateInstance(changeData->mBoundElement, content, changeData->mContent, element, getter_AddRefs(realElement)); if (realElement) { - realElement->SetAttribute(kNameSpaceID_None, dst, value, PR_FALSE); + realElement->SetAttr(kNameSpaceID_None, dst, value, PR_FALSE); nsCOMPtr tag; realElement->GetTag(*getter_AddRefs(tag)); if (dst.get() == nsXBLPrototypeBinding::kXBLTextAtom || @@ -1176,7 +1176,7 @@ void nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent* aElement) { nsAutoString inherits; - aElement->GetAttribute(kNameSpaceID_None, kInheritsAtom, inherits); + aElement->GetAttr(kNameSpaceID_None, kInheritsAtom, inherits); if (!inherits.IsEmpty()) { if (!mAttributeTable) { mAttributeTable = new nsSupportsHashtable(4); @@ -1238,7 +1238,7 @@ nsXBLPrototypeBinding::ConstructAttributeTable(nsIContent* aElement) // Now remove the inherits attribute from the element so that it doesn't // show up on clones of the element. It is used // by the template only, and we don't need it anymore. - aElement->UnsetAttribute(kNameSpaceID_None, kInheritsAtom, PR_FALSE); + aElement->UnsetAttr(kNameSpaceID_None, kInheritsAtom, PR_FALSE); token = nsCRT::strtok( newStr, ", ", &newStr ); } @@ -1282,7 +1282,7 @@ nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent* aContent) nsXBLInsertionPointEntry* xblIns = nsXBLInsertionPointEntry::Create(parent); nsAutoString includes; - child->GetAttribute(kNameSpaceID_None, kIncludesAtom, includes); + child->GetAttr(kNameSpaceID_None, kIncludesAtom, includes); if (includes.IsEmpty()) { nsISupportsKey key(kChildrenAtom); mInsertionPointTable->Put(&key, xblIns); @@ -1348,7 +1348,7 @@ void nsXBLPrototypeBinding::ConstructInterfaceTable(nsIContent* aElement) { nsAutoString impls; - aElement->GetAttribute(kNameSpaceID_None, kImplementsAtom, impls); + aElement->GetAttr(kNameSpaceID_None, kImplementsAtom, impls); if (!impls.IsEmpty()) { // Obtain the interface info manager that can tell us the IID // for a given interface name. diff --git a/content/xbl/src/nsXBLPrototypeHandler.cpp b/content/xbl/src/nsXBLPrototypeHandler.cpp index fa04efe64d5..3d46c87b4af 100644 --- a/content/xbl/src/nsXBLPrototypeHandler.cpp +++ b/content/xbl/src/nsXBLPrototypeHandler.cpp @@ -209,7 +209,7 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver, // This is a special-case optimization to make command handling fast. // It isn't really a part of XBL, but it helps speed things up. nsAutoString command; - mHandlerElement->GetAttribute(kNameSpaceID_None, kCommandAtom, command); + mHandlerElement->GetAttr(kNameSpaceID_None, kCommandAtom, command); if (!command.IsEmpty() && !isReceiverCommandElement) { // Make sure the XBL doc is chrome or resource @@ -323,19 +323,19 @@ nsXBLPrototypeHandler::ExecuteHandler(nsIDOMEventReceiver* aReceiver, // Compile the event handler. nsAutoString handlerText; - mHandlerElement->GetAttribute(kNameSpaceID_None, kActionAtom, handlerText); + mHandlerElement->GetAttr(kNameSpaceID_None, kActionAtom, handlerText); if (handlerText.IsEmpty()) { // look to see if action content is contained by the handler element GetTextData(mHandlerElement, handlerText); if (handlerText.IsEmpty()) { // Try an oncommand attribute (used by XUL elements, which // are implemented using this code). - mHandlerElement->GetAttribute(kNameSpaceID_None, kOnCommandAtom, handlerText); + mHandlerElement->GetAttr(kNameSpaceID_None, kOnCommandAtom, handlerText); if (handlerText.IsEmpty()) { // Maybe the receiver is a elt. if (isReceiverCommandElement) // It is! See if it has an oncommand attribute. - content->GetAttribute(kNameSpaceID_None, kOnCommandAtom, handlerText); + content->GetAttr(kNameSpaceID_None, kOnCommandAtom, handlerText); if (handlerText.IsEmpty()) return NS_ERROR_FAILURE; // For whatever reason, they didn't give us anything to do. @@ -916,7 +916,7 @@ PRInt32 nsXBLPrototypeHandler::KeyToMask(PRInt32 key) void nsXBLPrototypeHandler::GetEventType(nsAWritableString &type) { - mHandlerElement->GetAttribute(kNameSpaceID_None, kTypeAtom, type); + mHandlerElement->GetAttr(kNameSpaceID_None, kTypeAtom, type); if (type.IsEmpty()) { // If we're a XUL key element, let's assume that we're "keypress". @@ -935,7 +935,7 @@ nsXBLPrototypeHandler::ConstructMask() mKeyMask = 0; nsAutoString type; - mHandlerElement->GetAttribute(kNameSpaceID_None, kTypeAtom, type); + mHandlerElement->GetAttr(kNameSpaceID_None, kTypeAtom, type); if (type.IsEmpty()) { // If we're a XUL key element, let's assume that we're "keypress". @@ -949,8 +949,8 @@ nsXBLPrototypeHandler::ConstructMask() mEventName = getter_AddRefs(NS_NewAtom(type)); nsAutoString buttonStr, clickCountStr; - mHandlerElement->GetAttribute(kNameSpaceID_None, kClickCountAtom, clickCountStr); - mHandlerElement->GetAttribute(kNameSpaceID_None, kButtonAtom, buttonStr); + mHandlerElement->GetAttr(kNameSpaceID_None, kClickCountAtom, clickCountStr); + mHandlerElement->GetAttr(kNameSpaceID_None, kButtonAtom, buttonStr); if (!buttonStr.IsEmpty()) { PRInt32 error; @@ -963,7 +963,7 @@ nsXBLPrototypeHandler::ConstructMask() } nsAutoString modifiers; - mHandlerElement->GetAttribute(kNameSpaceID_None, kModifiersAtom, modifiers); + mHandlerElement->GetAttr(kNameSpaceID_None, kModifiersAtom, modifiers); if (!modifiers.IsEmpty()) { char* str = modifiers.ToNewCString(); char* newStr; @@ -989,9 +989,9 @@ nsXBLPrototypeHandler::ConstructMask() } nsAutoString key; - mHandlerElement->GetAttribute(kNameSpaceID_None, kKeyAtom, key); + mHandlerElement->GetAttr(kNameSpaceID_None, kKeyAtom, key); if (key.IsEmpty()) - mHandlerElement->GetAttribute(kNameSpaceID_None, kCharCodeAtom, key); + mHandlerElement->GetAttr(kNameSpaceID_None, kCharCodeAtom, key); if (!key.IsEmpty()) { @@ -1004,7 +1004,7 @@ nsXBLPrototypeHandler::ConstructMask() mDetail = key[0]; } else { - mHandlerElement->GetAttribute(kNameSpaceID_None, kKeyCodeAtom, key); + mHandlerElement->GetAttr(kNameSpaceID_None, kKeyCodeAtom, key); if (!key.IsEmpty()) mDetail = GetMatchingKeyCode(key); } diff --git a/content/xbl/src/nsXBLService.cpp b/content/xbl/src/nsXBLService.cpp index 433f0926ddf..dbc2353bbf1 100644 --- a/content/xbl/src/nsXBLService.cpp +++ b/content/xbl/src/nsXBLService.cpp @@ -980,7 +980,7 @@ NS_IMETHODIMP nsXBLService::GetBindingInternal(nsIContent* aBoundElement, root->ChildAt(i, *getter_AddRefs(child)); nsAutoString value; - child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, value); + child->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, value); // If no ref is specified just use this. if ((bindingName.IsEmpty()) || (bindingName == value)) { @@ -1028,8 +1028,8 @@ NS_IMETHODIMP nsXBLService::GetBindingInternal(nsIContent* aBoundElement, else if (hasBase) { // Check for the presence of 'extends' and 'display' attributes nsAutoString display, extends; - child->GetAttribute(kNameSpaceID_None, kDisplayAtom, display); - child->GetAttribute(kNameSpaceID_None, kExtendsAtom, extends); + child->GetAttr(kNameSpaceID_None, kDisplayAtom, display); + child->GetAttr(kNameSpaceID_None, kExtendsAtom, extends); PRBool hasDisplay = !display.IsEmpty(); PRBool hasExtends = !extends.IsEmpty(); @@ -1411,7 +1411,7 @@ nsXBLService::BuildHandlerChain(nsIContent* aContent, nsIXBLPrototypeHandler** a aContent->ChildAt(j, *getter_AddRefs(handler)); nsAutoString event; - handler->GetAttribute(kNameSpaceID_None, kEventAtom, event); + handler->GetAttr(kNameSpaceID_None, kEventAtom, event); nsCOMPtr newHandler; NS_NewXBLPrototypeHandler(handler, getter_AddRefs(newHandler)); diff --git a/content/xbl/src/nsXBLWindowHandler.cpp b/content/xbl/src/nsXBLWindowHandler.cpp index a0b18b028bf..c1d026792ae 100644 --- a/content/xbl/src/nsXBLWindowHandler.cpp +++ b/content/xbl/src/nsXBLWindowHandler.cpp @@ -144,7 +144,7 @@ nsXBLSpecialDocInfo::GetHandlers(nsIXBLDocumentInfo* aInfo, nsCOMPtr child; root->ChildAt(i, *getter_AddRefs(child)); nsAutoString id; - child->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, id); + child->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, id); if (id.EqualsWithConversion(PromiseFlatCString(aRef).get())) { NS_NewXBLPrototypeBinding(aRef, child, aInfo, getter_AddRefs(binding)); aInfo->SetPrototypeBinding(aRef, binding); @@ -286,7 +286,7 @@ nsXBLWindowHandler::WalkHandlersInternal(nsIDOMEvent* aEvent, nsIAtom* aEventTyp if (mElement) { // We are. Obtain our command attribute. nsAutoString command; - elt->GetAttribute(kNameSpaceID_None, nsXULAtoms::command, command); + elt->GetAttr(kNameSpaceID_None, nsXULAtoms::command, command); if (!command.IsEmpty()) { // Locate the command element in question. nsCOMPtr doc; diff --git a/content/xml/content/src/nsXMLElement.cpp b/content/xml/content/src/nsXMLElement.cpp index dd5a53c024f..2f9c58b8e27 100644 --- a/content/xml/content/src/nsXMLElement.cpp +++ b/content/xml/content/src/nsXMLElement.cpp @@ -182,7 +182,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI) nsCOMPtr content(do_QueryInterface(NS_STATIC_CAST(nsIXMLContent*,this),&rv)); while (NS_SUCCEEDED(rv) && content) { nsAutoString value; - rv = content->GetAttribute(kNameSpaceID_XML,kBaseAtom,value); + rv = content->GetAttr(kNameSpaceID_XML,kBaseAtom,value); PRInt32 value_len; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { PRInt32 colon = value.FindChar(':',PR_FALSE); @@ -254,10 +254,19 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI) return rv; } +NS_IMETHODIMP +nsXMLElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify) +{ + return nsGenericContainerElement::SetAttr(aNameSpaceID, aName, aValue, + aNotify); +} + NS_IMETHODIMP -nsXMLElement::SetAttribute(nsINodeInfo *aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify) +nsXMLElement::SetAttr(nsINodeInfo *aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) { NS_ENSURE_ARG_POINTER(aNodeInfo); @@ -280,7 +289,7 @@ nsXMLElement::SetAttribute(nsINodeInfo *aNodeInfo, // We will check for actuate="onLoad" in MaybeTriggerAutoLink } - return nsGenericContainerElement::SetAttribute(aNodeInfo, aValue, aNotify); + return nsGenericContainerElement::SetAttr(aNodeInfo, aValue, aNotify); } static nsresult WebShellToPresContext(nsIWebShell *aShell, @@ -358,16 +367,16 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell) do { // actuate="onLoad" ? nsAutoString value; - rv = nsGenericContainerElement::GetAttribute(kNameSpaceID_XLink, - kActuateAtom, - value); + rv = nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, + kActuateAtom, + value); if (rv == NS_CONTENT_ATTR_HAS_VALUE && value.EqualsAtom(kOnLoadAtom,PR_FALSE)) { // show= ? nsLinkVerb verb = eLinkVerb_Undefined; - rv = nsGenericContainerElement::GetAttribute(kNameSpaceID_XLink, - kShowAtom, value); + rv = nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, + kShowAtom, value); if (NS_FAILED(rv)) break; @@ -391,9 +400,9 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell) break; // href= ? - rv = nsGenericContainerElement::GetAttribute(kNameSpaceID_XLink, - kHrefAtom, - value); + rv = nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, + kHrefAtom, + value); if (rv == NS_CONTENT_ATTR_HAS_VALUE && !value.IsEmpty()) { nsCOMPtr uri; rv = CheckLoadURI(base,value,getter_AddRefs(uri)); @@ -449,17 +458,17 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext, nsAutoString show, href, target; nsIURI* baseURL = nsnull; nsLinkVerb verb = eLinkVerb_Undefined; - nsGenericContainerElement::GetAttribute(kNameSpaceID_XLink, - kHrefAtom, - href); + nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, + kHrefAtom, + href); if (href.IsEmpty()) { *aEventStatus = nsEventStatus_eConsumeDoDefault; break; } - nsGenericContainerElement::GetAttribute(kNameSpaceID_XLink, - kShowAtom, - show); + nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, + kShowAtom, + show); // XXX Should probably do this using atoms if (show.EqualsWithConversion("new")) { @@ -489,8 +498,8 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext, { nsAutoString href, target; nsIURI* baseURL = nsnull; - nsGenericContainerElement::GetAttribute(kNameSpaceID_XLink, kHrefAtom, - href); + nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, kHrefAtom, + href); if (href.IsEmpty()) { *aEventStatus = nsEventStatus_eConsumeDoDefault; break; @@ -672,8 +681,8 @@ nsXMLElement::GetID(nsIAtom*& aResult) const aResult = nsnull; if (NS_SUCCEEDED(rv) && atom) { nsAutoString value; - rv = nsGenericContainerElement::GetAttribute(kNameSpaceID_Unknown, atom, - value); + rv = nsGenericContainerElement::GetAttr(kNameSpaceID_Unknown, atom, + value); if (NS_SUCCEEDED(rv)) aResult = NS_NewAtom(value); } diff --git a/content/xml/content/src/nsXMLElement.h b/content/xml/content/src/nsXMLElement.h index f7dba1c0342..efd6b4bb1a8 100644 --- a/content/xml/content/src/nsXMLElement.h +++ b/content/xml/content/src/nsXMLElement.h @@ -62,9 +62,12 @@ public: NS_IMETHOD GetID(nsIAtom*& aResult) const; // nsIContent - NS_IMETHOD SetAttribute(nsINodeInfo *aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify); + NS_IMETHOD SetAttr(nsINodeInfo *aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify); NS_IMETHOD HandleDOMEvent(nsIPresContext* aPresContext, nsEvent* aEvent, nsIDOMEvent** aDOMEvent, diff --git a/content/xml/content/src/nsXMLProcessingInstruction.cpp b/content/xml/content/src/nsXMLProcessingInstruction.cpp index 46b71905709..ad599209c36 100644 --- a/content/xml/content/src/nsXMLProcessingInstruction.cpp +++ b/content/xml/content/src/nsXMLProcessingInstruction.cpp @@ -184,37 +184,37 @@ public: } NS_IMETHOD GetTag(nsIAtom*& aResult) const; NS_IMETHOD GetNodeInfo(nsINodeInfo*& aResult) const; - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo) { + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo) { return mInner.NormalizeAttributeString(aStr, aNodeInfo); } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, - nsAWritableString& aResult) const { + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, + nsAWritableString& aResult) const { return mInner.GetAttribute(aNameSpaceID, aAttribute, aResult); } - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom *aAttribute, - nsIAtom*& aPrefix, nsAWritableString& aResult) const { + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute, + nsIAtom*& aPrefix, nsAWritableString& aResult) const { return mInner.GetAttribute(aNameSpaceID, aAttribute, aPrefix, aResult); } - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - const nsAReadableString& aValue, PRBool aNotify) { + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + const nsAReadableString& aValue, PRBool aNotify) { return mInner.SetAttribute(aNameSpaceID, aAttribute, aValue, aNotify); } - NS_IMETHOD SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, PRBool aNotify) { + NS_IMETHOD SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, PRBool aNotify) { return mInner.SetAttribute(aNodeInfo, aValue, aNotify); } - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aAttribute, - PRBool aNotify) { + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRBool aNotify) { return mInner.UnsetAttribute(aNameSpaceID, aAttribute, aNotify); } - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const { + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const { return mInner.GetAttributeNameAt(aIndex, aNameSpaceID, aName, aPrefix); } - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const { + NS_IMETHOD GetAttrCount(PRInt32& aResult) const { return mInner.GetAttributeCount(aResult); } NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 8fb2127ac27..53623905d6c 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -514,7 +514,7 @@ nsXMLContentSink::AddAttributes(const nsIParserNode& aNode, NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE); // Add attribute to content - aContent->SetAttribute(ni, aNode.GetValueAt(i), PR_FALSE); + aContent->SetAttr(ni, aNode.GetValueAt(i), PR_FALSE); } // Give autoloading links a chance to fire @@ -1128,13 +1128,13 @@ nsXMLContentSink::ProcessSTYLETag(const nsIParserNode& aNode) nsAutoString type; nsAutoString media; - mStyleElement->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::title, title); + mStyleElement->GetAttr(kNameSpaceID_None, nsHTMLAtoms::title, title); title.CompressWhitespace(); - mStyleElement->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, type); + mStyleElement->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, type); type.StripWhitespace(); - mStyleElement->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::media, media); + mStyleElement->GetAttr(kNameSpaceID_None, nsHTMLAtoms::media, media); media.ToLowerCase(); nsAutoString mimeType; @@ -1187,11 +1187,11 @@ nsXMLContentSink::ProcessBASETag() if (mDocument) { nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mBaseElement->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::target, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mBaseElement->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::target, value)) { mDocument->SetBaseTarget(value); } - if (NS_CONTENT_ATTR_HAS_VALUE == mBaseElement->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::href, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mBaseElement->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::href, value)) { nsCOMPtr baseURI; rv = NS_NewURI(getter_AddRefs(baseURI), value, nsnull); if (NS_SUCCEEDED(rv)) { @@ -1241,10 +1241,10 @@ nsXMLContentSink::ProcessMETATag() // set any HTTP-EQUIV data into document's header data as well as url nsAutoString header; - mMetaElement->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::httpEquiv, header); + mMetaElement->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::httpEquiv, header); if (header.Length() > 0) { nsAutoString result; - mMetaElement->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::content, result); + mMetaElement->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::content, result); if (result.Length() > 0) { header.ToLowerCase(); nsCOMPtr fieldAtom(dont_AddRef(NS_NewAtom(header))); diff --git a/content/xml/document/src/nsXMLDocument.cpp b/content/xml/document/src/nsXMLDocument.cpp index 675365b29d1..e0d32aba6a5 100644 --- a/content/xml/document/src/nsXMLDocument.cpp +++ b/content/xml/document/src/nsXMLDocument.cpp @@ -945,7 +945,7 @@ MatchId(nsIContent *aContent, const nsAReadableString& aName) aContent->GetNameSpaceID(ns); if (kNameSpaceID_HTML == ns) { - if ((NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, value)) && + if ((NS_CONTENT_ATTR_HAS_VALUE == aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, value)) && aName.Equals(value)) { return aContent; } diff --git a/content/xul/content/src/nsXULAttributes.cpp b/content/xul/content/src/nsXULAttributes.cpp index 3ae6154142e..7b18c62002b 100644 --- a/content/xul/content/src/nsXULAttributes.cpp +++ b/content/xul/content/src/nsXULAttributes.cpp @@ -480,7 +480,7 @@ nsXULAttribute::SetValue(const nsAReadableString& aValue) { // We call back to the content node's SetValue() method so we can // share all of the work that it does. - return mContent->SetAttribute(mNodeInfo, aValue, PR_TRUE); + return mContent->SetAttr(mNodeInfo, aValue, PR_TRUE); } NS_IMETHODIMP @@ -599,14 +599,14 @@ nsXULAttributes::GetNamedItem(const nsAReadableString& aName, // PRInt32 nameSpaceID; nsCOMPtr inpNodeInfo; - if (NS_FAILED(rv = mContent->NormalizeAttributeString(aName, *getter_AddRefs(inpNodeInfo)))) + if (NS_FAILED(rv = mContent->NormalizeAttrString(aName, *getter_AddRefs(inpNodeInfo)))) return rv; // if (kNameSpaceID_Unknown == nameSpaceID) { // nameSpaceID = kNameSpaceID_None; // ignore unknown prefix XXX is this correct? // } - // XXX doing this instead of calling mContent->GetAttribute() will + // XXX doing this instead of calling mContent->GetAttr() will // make it a lot harder to lazily instantiate properties from the // graph. The problem is, how else do we get the named item? for (PRInt32 i = mAttributes.Count() - 1; i >= 0; --i) { diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index a128ef1d431..d085044fe31 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -1256,7 +1256,7 @@ nsXULElement::HasAttributes(PRBool* aReturn) PRInt32 attrCount = 0; - GetAttributeCount(attrCount); + GetAttrCount(attrCount); *aReturn = (attrCount > 0); @@ -1306,8 +1306,8 @@ nsXULElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) rv = attr->GetValue(value); if (NS_FAILED(rv)) return rv; - rv = result->SetAttribute(attr->GetNodeInfo(), value, - PR_FALSE); + rv = result->SetAttr(attr->GetNodeInfo(), value, + PR_FALSE); if (NS_FAILED(rv)) return rv; } } @@ -1400,8 +1400,8 @@ nsXULElement::GetAttribute(const nsAReadableString& aName, nsCOMPtr nameAtom; nsCOMPtr nodeInfo; - if (NS_FAILED(rv = NormalizeAttributeString(aName, - *getter_AddRefs(nodeInfo)))) { + if (NS_FAILED(rv = NormalizeAttrString(aName, + *getter_AddRefs(nodeInfo)))) { NS_WARNING("unable to normalize attribute name"); return rv; } @@ -1409,7 +1409,7 @@ nsXULElement::GetAttribute(const nsAReadableString& aName, nodeInfo->GetNameAtom(*getter_AddRefs(nameAtom)); nodeInfo->GetNamespaceID(nameSpaceID); - GetAttribute(nameSpaceID, nameAtom, aReturn); + GetAttr(nameSpaceID, nameAtom, aReturn); return NS_OK; } @@ -1422,11 +1422,11 @@ nsXULElement::SetAttribute(const nsAReadableString& aName, nsCOMPtr ni; - rv = NormalizeAttributeString(aName, *getter_AddRefs(ni)); + rv = NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to normalize attribute name"); if (NS_SUCCEEDED(rv)) { - rv = SetAttribute(ni, aValue, PR_TRUE); + rv = SetAttr(ni, aValue, PR_TRUE); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to set attribute"); } @@ -1443,14 +1443,14 @@ nsXULElement::RemoveAttribute(const nsAReadableString& aName) nsCOMPtr tag; nsCOMPtr ni; - rv = NormalizeAttributeString(aName, *getter_AddRefs(ni)); + rv = NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to parse attribute name"); if (NS_SUCCEEDED(rv)) { ni->GetNameAtom(*getter_AddRefs(tag)); ni->GetNamespaceID(nameSpaceID); - rv = UnsetAttribute(nameSpaceID, tag, PR_TRUE); + rv = UnsetAttr(nameSpaceID, tag, PR_TRUE); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to remove attribute"); } @@ -1557,7 +1557,7 @@ nsXULElement::GetAttributeNS(const nsAReadableString& aNamespaceURI, return NS_OK; } - GetAttribute(nsid, name, aReturn); + GetAttr(nsid, name, aReturn); return NS_OK; } @@ -1575,7 +1575,7 @@ nsXULElement::SetAttributeNS(const nsAReadableString& aNamespaceURI, rv = nimgr->GetNodeInfo(aQualifiedName, aNamespaceURI, *getter_AddRefs(ni)); NS_ENSURE_SUCCESS(rv, rv); - return SetAttribute(ni, aValue, PR_TRUE); + return SetAttr(ni, aValue, PR_TRUE); } NS_IMETHODIMP @@ -1587,7 +1587,7 @@ nsXULElement::RemoveAttributeNS(const nsAReadableString& aNamespaceURI, gNameSpaceManager->GetNameSpaceID(aNamespaceURI, nameSpaceId); - nsresult rv = UnsetAttribute(nameSpaceId, tag, PR_TRUE); + nsresult rv = UnsetAttr(nameSpaceId, tag, PR_TRUE); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to remove attribute"); return NS_OK; @@ -1678,14 +1678,14 @@ nsXULElement::HasAttribute(const nsAReadableString& aName, PRBool* aReturn) nsCOMPtr ni; PRInt32 nsid; - nsresult rv = NormalizeAttributeString(aName, *getter_AddRefs(ni)); + nsresult rv = NormalizeAttrString(aName, *getter_AddRefs(ni)); NS_ENSURE_SUCCESS(rv, rv); ni->GetNameAtom(*getter_AddRefs(name)); ni->GetNamespaceID(nsid); nsAutoString tmp; - rv = GetAttribute(nsid, name, tmp); + rv = GetAttr(nsid, name, tmp); *aReturn = rv == NS_CONTENT_ATTR_NOT_THERE ? PR_FALSE : PR_TRUE; @@ -1712,7 +1712,7 @@ nsXULElement::HasAttributeNS(const nsAReadableString& aNamespaceURI, } nsAutoString tmp; - nsresult rv = GetAttribute(nsid, name, tmp); + nsresult rv = GetAttr(nsid, name, tmp); *aReturn = rv == NS_CONTENT_ATTR_NOT_THERE ? PR_FALSE : PR_TRUE; @@ -2448,12 +2448,12 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileE // attributes that are dependant on the document. Do that // now. PRInt32 count; - GetAttributeCount(count); + GetAttrCount(count); for (PRInt32 i = 0; i < count; ++i) { PRInt32 nameSpaceID; nsCOMPtr attr, prefix; - GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attr), *getter_AddRefs(prefix)); + GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attr), *getter_AddRefs(prefix)); PRBool reset = PR_FALSE; @@ -2478,10 +2478,10 @@ nsXULElement::SetDocument(nsIDocument* aDocument, PRBool aDeep, PRBool aCompileE if (reset) { nsAutoString value; - rv = GetAttribute(nameSpaceID, attr, value); + rv = GetAttr(nameSpaceID, attr, value); if (NS_FAILED(rv)) return rv; - rv = SetAttribute(nameSpaceID, attr, value, PR_FALSE); + rv = SetAttr(nameSpaceID, attr, value, PR_FALSE); if (NS_FAILED(rv)) return rv; } } @@ -2751,7 +2751,7 @@ nsXULElement::RemoveChildAt(PRInt32 aIndex, PRBool aNotify) itemList->Item(i, getter_AddRefs(node)); if (IsAncestor(parentKid, node)) { nsCOMPtr content = do_QueryInterface(node); - content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::selected, PR_FALSE); + content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::selected, PR_FALSE); nsCOMPtr tree = do_QueryInterface(treeElement); nsCOMPtr domxulnode = do_QueryInterface(node); if (tree && domxulnode) @@ -2844,8 +2844,8 @@ nsXULElement::GetTag(nsIAtom*& aResult) const } NS_IMETHODIMP -nsXULElement::NormalizeAttributeString(const nsAReadableString& aStr, - nsINodeInfo*& aNodeInfo) +nsXULElement::NormalizeAttrString(const nsAReadableString& aStr, + nsINodeInfo*& aNodeInfo) { PRInt32 i, count = Attributes() ? Attributes()->Count() : 0; for (i = 0; i < count; i++) { @@ -2885,9 +2885,9 @@ nsXULElement::NormalizeAttributeString(const nsAReadableString& aStr, // this class could probably just use nsGenericContainerElement // needed to maintain attribute namespace ID as well as ordering NS_IMETHODIMP -nsXULElement::SetAttribute(nsINodeInfo* aNodeInfo, - const nsAReadableString& aValue, - PRBool aNotify) +nsXULElement::SetAttr(nsINodeInfo* aNodeInfo, + const nsAReadableString& aValue, + PRBool aNotify) { NS_ASSERTION(nsnull != aNodeInfo, "must have attribute nodeinfo"); if (nsnull == aNodeInfo) @@ -3093,10 +3093,10 @@ nsXULElement::SetAttribute(nsINodeInfo* aNodeInfo, } NS_IMETHODIMP -nsXULElement::SetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, - const nsAReadableString& aValue, - PRBool aNotify) +nsXULElement::SetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, + const nsAReadableString& aValue, + PRBool aNotify) { nsCOMPtr nimgr; @@ -3106,23 +3106,23 @@ nsXULElement::SetAttribute(PRInt32 aNameSpaceID, nsCOMPtr ni; nimgr->GetNodeInfo(aName, nsnull, aNameSpaceID, *getter_AddRefs(ni)); - return SetAttribute(ni, aValue, aNotify); + return SetAttr(ni, aValue, aNotify); } NS_IMETHODIMP -nsXULElement::GetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, - nsAWritableString& aResult) const +nsXULElement::GetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, + nsAWritableString& aResult) const { nsCOMPtr prefix; - return GetAttribute(aNameSpaceID, aName, *getter_AddRefs(prefix), aResult); + return GetAttr(aNameSpaceID, aName, *getter_AddRefs(prefix), aResult); } NS_IMETHODIMP -nsXULElement::GetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, - nsIAtom*& aPrefix, - nsAWritableString& aResult) const +nsXULElement::GetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, + nsIAtom*& aPrefix, + nsAWritableString& aResult) const { NS_ASSERTION(nsnull != aName, "must have attribute name"); if (nsnull == aName) { @@ -3166,8 +3166,8 @@ nsXULElement::GetAttribute(PRInt32 aNameSpaceID, } NS_IMETHODIMP -nsXULElement::UnsetAttribute(PRInt32 aNameSpaceID, - nsIAtom* aName, PRBool aNotify) +nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, + nsIAtom* aName, PRBool aNotify) { NS_ASSERTION(nsnull != aName, "must have attribute name"); if (nsnull == aName) @@ -3350,10 +3350,10 @@ nsXULElement::UnsetAttribute(PRInt32 aNameSpaceID, } NS_IMETHODIMP -nsXULElement::GetAttributeNameAt(PRInt32 aIndex, - PRInt32& aNameSpaceID, - nsIAtom*& aName, - nsIAtom*& aPrefix) const +nsXULElement::GetAttrNameAt(PRInt32 aIndex, + PRInt32& aNameSpaceID, + nsIAtom*& aName, + nsIAtom*& aPrefix) const { if (Attributes()) { nsXULAttribute* attr = NS_REINTERPRET_CAST(nsXULAttribute*, Attributes()->ElementAt(aIndex)); @@ -3382,7 +3382,7 @@ nsXULElement::GetAttributeNameAt(PRInt32 aIndex, } NS_IMETHODIMP -nsXULElement::GetAttributeCount(PRInt32& aResult) const +nsXULElement::GetAttrCount(PRInt32& aResult) const { nsresult rv = NS_OK; if (Attributes()) { @@ -3424,16 +3424,16 @@ nsXULElement::List(FILE* out, PRInt32 aIndent) const fprintf(out, "@%p", this); PRInt32 nattrs; - GetAttributeCount(nattrs); + GetAttrCount(nattrs); for (i = 0; i < nattrs; ++i) { nsCOMPtr attr; nsCOMPtr prefix; PRInt32 nameSpaceID; - GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attr), *getter_AddRefs(prefix)); + GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attr), *getter_AddRefs(prefix)); nsAutoString v; - GetAttribute(nameSpaceID, attr, v); + GetAttr(nameSpaceID, attr, v); fputs(" ", out); @@ -3837,7 +3837,7 @@ nsXULElement::AddBroadcastListener(const nsAReadableString& attr, // We aren't the id atom, so it's ok to set us in the listener. nsAutoString value; attr->GetValue(value); - listener->SetAttribute(ni, value, PR_TRUE); + listener->SetAttr(ni, value, PR_TRUE); } } } @@ -3846,7 +3846,7 @@ nsXULElement::AddBroadcastListener(const nsAReadableString& attr, nsCOMPtr kAtom = dont_AddRef(NS_NewAtom(attr)); nsAutoString attrValue; - nsresult result = GetAttribute(kNameSpaceID_None, kAtom, attrValue); + nsresult result = GetAttr(kNameSpaceID_None, kAtom, attrValue); PRBool attrPresent = (result == NS_CONTENT_ATTR_NO_VALUE || result == NS_CONTENT_ATTR_HAS_VALUE); @@ -3906,11 +3906,11 @@ nsXULElement::GetResource(nsIRDFResource** aResource) nsresult rv; nsAutoString id; - rv = GetAttribute(kNameSpaceID_None, nsXULAtoms::ref, id); + rv = GetAttr(kNameSpaceID_None, nsXULAtoms::ref, id); if (NS_FAILED(rv)) return rv; if (rv != NS_CONTENT_ATTR_HAS_VALUE) { - rv = GetAttribute(kNameSpaceID_None, nsXULAtoms::id, id); + rv = GetAttr(kNameSpaceID_None, nsXULAtoms::id, id); if (NS_FAILED(rv)) return rv; } @@ -5166,7 +5166,7 @@ nsXULPrototypeElement::Deserialize(nsIObjectInputStream* aStream, nsresult -nsXULPrototypeElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aValue) +nsXULPrototypeElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aValue) { for (PRInt32 i = 0; i < mNumAttributes; ++i) { if (mAttributes[i].mNodeInfo->Equals(aName, aNameSpaceID)) { diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h index af5de624be0..78713eaaf70 100644 --- a/content/xul/content/src/nsXULElement.h +++ b/content/xul/content/src/nsXULElement.h @@ -233,7 +233,7 @@ public: nsCOMPtr mInlineStyleRule; // [OWNER] nsClassList* mClassList; - nsresult GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aValue); + nsresult GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aValue); }; struct JSRuntime; @@ -370,15 +370,15 @@ public: NS_IMETHOD GetNameSpaceID(PRInt32& aNameSpeceID) const; NS_IMETHOD GetTag(nsIAtom*& aResult) const; NS_IMETHOD GetNodeInfo(nsINodeInfo*& aResult) const; - NS_IMETHOD NormalizeAttributeString(const nsAReadableString& aStr, nsINodeInfo*& aNodeInfo); - NS_IMETHOD SetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, const nsAReadableString& aValue, PRBool aNotify); - NS_IMETHOD SetAttribute(nsINodeInfo *aNodeInfo, const nsAReadableString& aValue, PRBool aNotify); - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aResult) const; - NS_IMETHOD GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom*& aPrefix, nsAWritableString& aResult) const; - NS_IMETHOD UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify); - NS_IMETHOD GetAttributeNameAt(PRInt32 aIndex, PRInt32& aNameSpaceID, - nsIAtom*& aName, nsIAtom*& aPrefix) const; - NS_IMETHOD GetAttributeCount(PRInt32& aResult) const; + NS_IMETHOD NormalizeAttrString(const nsAReadableString& aStr, nsINodeInfo*& aNodeInfo); + NS_IMETHOD SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, const nsAReadableString& aValue, PRBool aNotify); + NS_IMETHOD SetAttr(nsINodeInfo *aNodeInfo, const nsAReadableString& aValue, PRBool aNotify); + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsAWritableString& aResult) const; + NS_IMETHOD GetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, nsIAtom*& aPrefix, nsAWritableString& aResult) const; + NS_IMETHOD UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify); + NS_IMETHOD GetAttrNameAt(PRInt32 aIndex, PRInt32& aNameSpaceID, + nsIAtom*& aName, nsIAtom*& aPrefix) const; + NS_IMETHOD GetAttrCount(PRInt32& aResult) const; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const; NS_IMETHOD DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const { return NS_OK; } NS_IMETHOD SizeOf(nsISizeOfHandler* aSizer, PRUint32* aResult) const; diff --git a/content/xul/content/src/nsXULTreeElement.cpp b/content/xul/content/src/nsXULTreeElement.cpp index 0c68cbcb213..28826223c98 100644 --- a/content/xul/content/src/nsXULTreeElement.cpp +++ b/content/xul/content/src/nsXULTreeElement.cpp @@ -228,7 +228,7 @@ nsXULTreeElement::ClearItemSelection() nsCOMPtr node; mSelectedItems->Item(0, getter_AddRefs(node)); nsCOMPtr content = do_QueryInterface(node); - content->UnsetAttribute(kNameSpaceID_None, kSelectedAtom, PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, kSelectedAtom, PR_TRUE); } mSelectionStart = nsnull; @@ -245,7 +245,7 @@ nsXULTreeElement::AddItemToSelection(nsIDOMXULElement* aTreeItem) // Without clearing the selection, perform the add. nsCOMPtr content = do_QueryInterface(aTreeItem); - content->SetAttribute(kNameSpaceID_None, kSelectedAtom, NS_LITERAL_STRING("true"), PR_TRUE); + content->SetAttr(kNameSpaceID_None, kSelectedAtom, NS_LITERAL_STRING("true"), PR_TRUE); if (!mSuppressOnSelect) FireOnSelectHandler(); @@ -257,7 +257,7 @@ NS_IMETHODIMP nsXULTreeElement::RemoveItemFromSelection(nsIDOMXULElement* aTreeItem) { nsCOMPtr content = do_QueryInterface(aTreeItem); - content->UnsetAttribute(kNameSpaceID_None, kSelectedAtom, PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, kSelectedAtom, PR_TRUE); if (!mSuppressOnSelect) FireOnSelectHandler(); @@ -356,7 +356,7 @@ nsXULTreeElement::SelectItemRange(nsIDOMXULElement* aStartItem, nsIDOMXULElement content = do_QueryInterface(currentItem); content->GetTag(*getter_AddRefs(tag)); if (tag && tag.get() == kTreeItemAtom) - content->SetAttribute(kNameSpaceID_None, kSelectedAtom, + content->SetAttr(kNameSpaceID_None, kSelectedAtom, trueString, /*aNotify*/ PR_TRUE); if (currentItem == aEndItem) break; @@ -436,7 +436,7 @@ nsXULTreeElement::FireOnSelectHandler() // for us. Look for that and bail if it's present. nsCOMPtr kSuppressSelectChange = dont_AddRef(NS_NewAtom("suppressonselect")); nsAutoString value; - content->GetAttribute(kNameSpaceID_None, kSuppressSelectChange, value); + content->GetAttr(kNameSpaceID_None, kSuppressSelectChange, value); if (value.EqualsWithConversion("true")) return NS_OK; @@ -477,14 +477,14 @@ nsXULTreeElement::SetCurrentItem(nsIDOMXULElement* aCurrentItem) nsCOMPtr current; if (mCurrentItem) { current = do_QueryInterface(mCurrentItem); - current->UnsetAttribute(kNameSpaceID_None, kCurrentAtom, PR_TRUE); + current->UnsetAttr(kNameSpaceID_None, kCurrentAtom, PR_TRUE); NS_RELEASE(mCurrentItem); } mCurrentItem = aCurrentItem; NS_IF_ADDREF(aCurrentItem); current = do_QueryInterface(mCurrentItem); if (current) - current->SetAttribute(kNameSpaceID_None, kCurrentAtom, NS_LITERAL_STRING("true"), PR_TRUE); + current->SetAttr(kNameSpaceID_None, kCurrentAtom, NS_LITERAL_STRING("true"), PR_TRUE); return NS_OK; } diff --git a/content/xul/document/src/nsXULContentSink.cpp b/content/xul/document/src/nsXULContentSink.cpp index f18752722dd..7ee22e30bee 100644 --- a/content/xul/document/src/nsXULContentSink.cpp +++ b/content/xul/document/src/nsXULContentSink.cpp @@ -1268,7 +1268,7 @@ XULContentSinkImpl::AddAttributes(const nsIParserNode& aNode, nsXULPrototypeElem nsAutoString value; // Compute the element's class list if the element has a 'class' attribute. - rv = aElement->GetAttribute(kNameSpaceID_None, kClassAtom, value); + rv = aElement->GetAttr(kNameSpaceID_None, kClassAtom, value); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { @@ -1277,7 +1277,7 @@ XULContentSinkImpl::AddAttributes(const nsIParserNode& aNode, nsXULPrototypeElem } // Parse the element's 'style' attribute - rv = aElement->GetAttribute(kNameSpaceID_None, kStyleAtom, value); + rv = aElement->GetAttr(kNameSpaceID_None, kStyleAtom, value); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index f4f43039b16..c2080ef7c5b 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -1746,7 +1746,7 @@ nsXULDocument::AttributeChanged(nsIContent* aElement, // // XXX Namespace handling broken :-( nsAutoString persist; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::persist, persist); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::persist, persist); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { @@ -2564,7 +2564,7 @@ nsXULDocument::Persist(const nsAReadableString& aID, PRInt32 nameSpaceID; nsCOMPtr tag; nsCOMPtr ni; - rv = element->NormalizeAttributeString(aAttr, *getter_AddRefs(ni)); + rv = element->NormalizeAttrString(aAttr, *getter_AddRefs(ni)); if (NS_FAILED(rv)) return rv; ni->GetNameAtom(*getter_AddRefs(tag)); @@ -2610,7 +2610,7 @@ nsXULDocument::Persist(nsIContent* aElement, PRInt32 aNameSpaceID, // Turn the value into a literal nsAutoString valuestr; - rv = aElement->GetAttribute(kNameSpaceID_None, aAttribute, valuestr); + rv = aElement->GetAttr(kNameSpaceID_None, aAttribute, valuestr); if (NS_FAILED(rv)) return rv; PRBool novalue = (rv != NS_CONTENT_ATTR_HAS_VALUE); @@ -2901,7 +2901,7 @@ GetElementByAttribute(nsIContent* aContent, nsIDOMElement** aResult) { nsAutoString value; - nsresult rv = aContent->GetAttribute(kNameSpaceID_None, aAttrName, value); + nsresult rv = aContent->GetAttr(kNameSpaceID_None, aAttrName, value); if (rv == NS_CONTENT_ATTR_HAS_VALUE) { if (aUniversalMatch || value.Equals(aAttrValue)) return aContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aResult); @@ -3276,7 +3276,7 @@ nsXULDocument::AddElementToDocumentPre(nsIContent* aElement) // "commandupdater='true'" attribute), then add the element to the // document's command dispatcher nsAutoString value; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::commandupdater, value); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::commandupdater, value); if ((rv == NS_CONTENT_ATTR_HAS_VALUE) && value == NS_LITERAL_STRING("true")) { rv = nsXULContentUtils::SetCommandUpdater(this, aElement); if (NS_FAILED(rv)) return rv; @@ -3380,7 +3380,7 @@ nsXULDocument::RemoveSubtreeFromDocument(nsIContent* aElement) // 3. If the element is a 'command updater', then remove the // element from the document's command dispatcher. nsAutoString value; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::commandupdater, value); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::commandupdater, value); if ((rv == NS_CONTENT_ATTR_HAS_VALUE) && value == NS_LITERAL_STRING("true")) { nsCOMPtr domelement = do_QueryInterface(aElement); NS_ASSERTION(domelement != nsnull, "not a DOM element"); @@ -3441,7 +3441,7 @@ nsXULDocument::AddElementToMap(nsIContent* aElement) for (PRInt32 i = 0; kIdentityAttrs[i] != nsnull; ++i) { nsAutoString value; - rv = aElement->GetAttribute(kNameSpaceID_None, *kIdentityAttrs[i], value); + rv = aElement->GetAttr(kNameSpaceID_None, *kIdentityAttrs[i], value); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get attribute"); if (NS_FAILED(rv)) return rv; @@ -3463,7 +3463,7 @@ nsXULDocument::RemoveElementFromMap(nsIContent* aElement) for (PRInt32 i = 0; kIdentityAttrs[i] != nsnull; ++i) { nsAutoString value; - rv = aElement->GetAttribute(kNameSpaceID_None, *kIdentityAttrs[i], value); + rv = aElement->GetAttr(kNameSpaceID_None, *kIdentityAttrs[i], value); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get attribute"); if (NS_FAILED(rv)) return rv; @@ -4926,10 +4926,10 @@ nsXULDocument::ApplyPersistentAttributesToElements(nsIRDFResource* aResource, ns nsCOMPtr element = do_QueryInterface(isupports2); NS_RELEASE(isupports2); - rv = element->SetAttribute(/* XXX */ kNameSpaceID_None, - attr, - nsAutoString(wrapper), - PR_FALSE); + rv = element->SetAttr(/* XXX */ kNameSpaceID_None, + attr, + nsAutoString(wrapper), + PR_FALSE); } } @@ -5839,9 +5839,9 @@ nsXULDocument::AddAttributes(nsXULPrototypeElement* aPrototype, nsIContent* aEle nsAutoString valueStr; protoattr->mValue.GetValue( valueStr ); - rv = aElement->SetAttribute(protoattr->mNodeInfo, - valueStr, - PR_FALSE); + rv = aElement->SetAttr(protoattr->mNodeInfo, + valueStr, + PR_FALSE); if (NS_FAILED(rv)) return rv; } @@ -5870,7 +5870,7 @@ nsXULDocument::CheckTemplateBuilder(nsIContent* aElement) } nsAutoString datasources; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::datasources, datasources); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::datasources, datasources); if (NS_FAILED(rv)) return rv; if (rv != NS_CONTENT_ATTR_HAS_VALUE) @@ -5994,7 +5994,7 @@ nsXULDocument::OverlayForwardReference::Resolve() nsresult rv; nsAutoString id; - rv = mOverlay->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, id); + rv = mOverlay->GetAttr(kNameSpaceID_None, nsXULAtoms::id, id); if (NS_FAILED(rv)) return eResolve_Error; nsCOMPtr domtarget; @@ -6049,13 +6049,13 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode, // Merge attributes from the overlay content node to that of the // actual document. PRInt32 attrCount, i; - rv = aOverlayNode->GetAttributeCount(attrCount); + rv = aOverlayNode->GetAttrCount(attrCount); if (NS_FAILED(rv)) return rv; for (i = 0; i < attrCount; ++i) { PRInt32 nameSpaceID; nsCOMPtr attr, prefix; - rv = aOverlayNode->GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attr), *getter_AddRefs(prefix)); + rv = aOverlayNode->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attr), *getter_AddRefs(prefix)); if (NS_FAILED(rv)) return rv; // We don't want to swap IDs, they should be the same. @@ -6063,11 +6063,11 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode, continue; nsAutoString value; - rv = aOverlayNode->GetAttribute(nameSpaceID, attr, value); + rv = aOverlayNode->GetAttr(nameSpaceID, attr, value); if (NS_FAILED(rv)) return rv; nsAutoString tempID; - rv = aOverlayNode->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, tempID); + rv = aOverlayNode->GetAttr(kNameSpaceID_None, nsXULAtoms::id, tempID); // Element in the overlay has the 'removeelement' attribute set // so remove it from the actual document. @@ -6094,7 +6094,7 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode, *getter_AddRefs(ni)); } - rv = aTargetNode->SetAttribute(ni, value, PR_FALSE); + rv = aTargetNode->SetAttr(ni, value, PR_FALSE); if (NS_FAILED(rv)) return rv; } @@ -6116,7 +6116,7 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode, if (NS_FAILED(rv)) return rv; nsAutoString id; - rv = currContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, id); + rv = currContent->GetAttr(kNameSpaceID_None, nsXULAtoms::id, id); if (NS_FAILED(rv)) return rv; nsCOMPtr nodeInDocument; @@ -6144,8 +6144,8 @@ nsXULDocument::OverlayForwardReference::Merge(nsIContent* aTargetNode, // also has aTargetNode as its parent. nsAutoString documentParentID; - rv = aTargetNode->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, - documentParentID); + rv = aTargetNode->GetAttr(kNameSpaceID_None, nsXULAtoms::id, + documentParentID); if (NS_FAILED(rv)) return rv; nsCOMPtr nodeParent; @@ -6184,7 +6184,7 @@ nsXULDocument::OverlayForwardReference::~OverlayForwardReference() #ifdef PR_LOGGING if (PR_LOG_TEST(gXULLog, PR_LOG_ALWAYS) && !mResolved) { nsAutoString id; - mOverlay->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, id); + mOverlay->GetAttr(kNameSpaceID_None, nsXULAtoms::id, id); nsCAutoString idC; idC.AssignWithConversion(id); @@ -6229,14 +6229,14 @@ nsXULDocument::BroadcasterHookup::~BroadcasterHookup() nsAutoString attribute; if (tag.get() == nsXULAtoms::observes) { - rv = mObservesElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::element, broadcasterID); + rv = mObservesElement->GetAttr(kNameSpaceID_None, nsXULAtoms::element, broadcasterID); if (NS_FAILED(rv)) return; - rv = mObservesElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::attribute, attribute); + rv = mObservesElement->GetAttr(kNameSpaceID_None, nsXULAtoms::attribute, attribute); if (NS_FAILED(rv)) return; } else { - rv = mObservesElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::observes, broadcasterID); + rv = mObservesElement->GetAttr(kNameSpaceID_None, nsXULAtoms::observes, broadcasterID); if (NS_FAILED(rv)) return; attribute.Assign(NS_LITERAL_STRING("*")); @@ -6311,10 +6311,10 @@ nsXULDocument::CheckBroadcasterHookup(nsXULDocument* aDocument, listener = do_QueryInterface(parent); - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::element, broadcasterID); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::element, broadcasterID); if (NS_FAILED(rv)) return rv; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::attribute, attribute); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::attribute, attribute); if (NS_FAILED(rv)) return rv; } else { @@ -6322,13 +6322,13 @@ nsXULDocument::CheckBroadcasterHookup(nsXULDocument* aDocument, // value of the 'observes' attribute to determine the ID of // the broadcaster element, and we'll watch _all_ of its // values. - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::observes, broadcasterID); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::observes, broadcasterID); if (NS_FAILED(rv)) return rv; // Bail if there's no broadcasterID if ((rv != NS_CONTENT_ATTR_HAS_VALUE) || (broadcasterID.Length() == 0)) { // Try the command attribute next. - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::command, broadcasterID); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::command, broadcasterID); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE && broadcasterID.Length() > 0) { @@ -6425,12 +6425,12 @@ nsXULDocument::InsertElement(nsIContent* aParent, nsIContent* aChild) PRBool wasInserted = PR_FALSE; // insert after an element of a given id - rv = aChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::insertafter, posStr); + rv = aChild->GetAttr(kNameSpaceID_None, nsXULAtoms::insertafter, posStr); if (NS_FAILED(rv)) return rv; PRBool isInsertAfter = PR_TRUE; if (rv != NS_CONTENT_ATTR_HAS_VALUE) { - rv = aChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::insertbefore, posStr); + rv = aChild->GetAttr(kNameSpaceID_None, nsXULAtoms::insertbefore, posStr); if (NS_FAILED(rv)) return rv; isInsertAfter = PR_FALSE; } @@ -6477,7 +6477,7 @@ nsXULDocument::InsertElement(nsIContent* aParent, nsIContent* aChild) if (!wasInserted) { - rv = aChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::position, posStr); + rv = aChild->GetAttr(kNameSpaceID_None, nsXULAtoms::position, posStr); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { diff --git a/content/xul/templates/src/nsXULContentBuilder.cpp b/content/xul/templates/src/nsXULContentBuilder.cpp index 32739843563..5afbeb60f1b 100644 --- a/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/content/xul/templates/src/nsXULContentBuilder.cpp @@ -430,7 +430,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, tag->ToString(tagstr); nsAutoString templatestr; - aTemplateNode->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, templatestr); + aTemplateNode->GetAttr(kNameSpaceID_None, nsXULAtoms::id, templatestr); nsCAutoString templatestrC,tagstrC; tagstrC.AssignWithConversion(tagstr); templatestrC.AssignWithConversion(templatestr); @@ -505,7 +505,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, // "uri='rdf:*'" attribute. (We also support the older // "uri='...'" syntax.) nsAutoString uri; - tmplKid->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri); + tmplKid->GetAttr(kNameSpaceID_None, nsXULAtoms::uri, uri); if ( !uri.IsEmpty() ) { if (aMatch->mRule && uri[0] == PRUnichar('?')) { @@ -619,7 +619,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, // compiler-generated temporary around. NS_ConvertUTF8toUCS2 x(uri); const nsAReadableString& id = x; - rv = realKid->SetAttribute(kNameSpaceID_None, nsXULAtoms::id, id, PR_FALSE); + rv = realKid->SetAttr(kNameSpaceID_None, nsXULAtoms::id, id, PR_FALSE); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to set id attribute"); if (NS_FAILED(rv)) return rv; @@ -656,16 +656,16 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, if (NS_FAILED(rv)) return rv; if (iscontainer) { - realKid->SetAttribute(kNameSpaceID_None, nsXULAtoms::container, - NS_LITERAL_STRING("true"), PR_FALSE); + realKid->SetAttr(kNameSpaceID_None, nsXULAtoms::container, + NS_LITERAL_STRING("true"), PR_FALSE); if (! (mFlags & eDontTestEmpty)) { NS_NAMED_LITERAL_STRING(true_, "true"); NS_NAMED_LITERAL_STRING(false_, "false"); - realKid->SetAttribute(kNameSpaceID_None, nsXULAtoms::empty, - isempty ? true_ : false_, - PR_FALSE); + realKid->SetAttr(kNameSpaceID_None, nsXULAtoms::empty, + isempty ? true_ : false_, + PR_FALSE); } } } @@ -675,7 +675,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, // given node. PRUnichar attrbuf[128]; nsAutoString attrValue(CBufDescriptor(attrbuf, PR_TRUE, sizeof(attrbuf) / sizeof(PRUnichar), 0)); - rv = tmplKid->GetAttribute(kNameSpaceID_None, nsXULAtoms::value, attrValue); + rv = tmplKid->GetAttr(kNameSpaceID_None, nsXULAtoms::value, attrValue); if (NS_FAILED(rv)) return rv; if ((rv == NS_CONTENT_ATTR_HAS_VALUE) && (attrValue.Length() > 0)) { @@ -731,14 +731,14 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, // Copy all attributes from the template to the new // element. PRInt32 numAttribs; - rv = tmplKid->GetAttributeCount(numAttribs); + rv = tmplKid->GetAttrCount(numAttribs); if (NS_FAILED(rv)) return rv; for (PRInt32 attr = 0; attr < numAttribs; attr++) { PRInt32 attribNameSpaceID; nsCOMPtr attribName, prefix; - rv = tmplKid->GetAttributeNameAt(attr, attribNameSpaceID, *getter_AddRefs(attribName), *getter_AddRefs(prefix)); + rv = tmplKid->GetAttrNameAt(attr, attribNameSpaceID, *getter_AddRefs(attribName), *getter_AddRefs(prefix)); if (NS_FAILED(rv)) return rv; if (! IsIgnoreableAttribute(attribNameSpaceID, attribName)) { @@ -748,7 +748,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, // longish. PRUnichar attrbuf[128]; nsAutoString attribValue(CBufDescriptor(attrbuf, PR_TRUE, sizeof(attrbuf) / sizeof(PRUnichar), 0)); - rv = tmplKid->GetAttribute(attribNameSpaceID, attribName, attribValue); + rv = tmplKid->GetAttr(attribNameSpaceID, attribName, attribValue); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { @@ -756,7 +756,7 @@ nsXULContentBuilder::BuildContentFromTemplate(nsIContent *aTemplateNode, rv = SubstituteText(*aMatch, attribValue, value); if (NS_FAILED(rv)) return rv; - rv = realKid->SetAttribute(attribNameSpaceID, attribName, value, PR_FALSE); + rv = realKid->SetAttr(attribNameSpaceID, attribName, value, PR_FALSE); if (NS_FAILED(rv)) return rv; } } @@ -847,7 +847,7 @@ nsXULContentBuilder::AddPersistentAttributes(nsIContent* aTemplateNode, nsresult rv; nsAutoString persist; - rv = aTemplateNode->GetAttribute(kNameSpaceID_None, nsXULAtoms::persist, persist); + rv = aTemplateNode->GetAttr(kNameSpaceID_None, nsXULAtoms::persist, persist); if (NS_FAILED(rv)) return rv; if (rv != NS_CONTENT_ATTR_HAS_VALUE) @@ -875,8 +875,8 @@ nsXULContentBuilder::AddPersistentAttributes(nsIContent* aTemplateNode, PRInt32 nameSpaceID; nsCOMPtr tag; nsCOMPtr ni; - rv = aTemplateNode->NormalizeAttributeString(attribute, - *getter_AddRefs(ni)); + rv = aTemplateNode->NormalizeAttrString(attribute, + *getter_AddRefs(ni)); if (NS_FAILED(rv)) return rv; ni->GetNameAtom(*getter_AddRefs(tag)); @@ -902,7 +902,7 @@ nsXULContentBuilder::AddPersistentAttributes(nsIContent* aTemplateNode, rv = value->GetValueConst(&valueStr); if (NS_FAILED(rv)) return rv; - rv = aRealNode->SetAttribute(nameSpaceID, tag, nsAutoString(valueStr), PR_FALSE); + rv = aRealNode->SetAttr(nameSpaceID, tag, nsAutoString(valueStr), PR_FALSE); if (NS_FAILED(rv)) return rv; } @@ -921,17 +921,17 @@ nsXULContentBuilder::SynchronizeUsingTemplate(nsIContent* aTemplateNode, // update the equivalent attribute on the content node PRInt32 numAttribs; - rv = aTemplateNode->GetAttributeCount(numAttribs); + rv = aTemplateNode->GetAttrCount(numAttribs); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { for (PRInt32 aLoop=0; aLoop attribName, prefix; - rv = aTemplateNode->GetAttributeNameAt(aLoop, - attribNameSpaceID, - *getter_AddRefs(attribName), - *getter_AddRefs(prefix)); + rv = aTemplateNode->GetAttrNameAt(aLoop, + attribNameSpaceID, + *getter_AddRefs(attribName), + *getter_AddRefs(prefix)); if (NS_FAILED(rv)) break; // See if it's one of the attributes that we unilaterally @@ -940,9 +940,9 @@ nsXULContentBuilder::SynchronizeUsingTemplate(nsIContent* aTemplateNode, continue; nsAutoString attribValue; - rv = aTemplateNode->GetAttribute(attribNameSpaceID, - attribName, - attribValue); + rv = aTemplateNode->GetAttr(attribNameSpaceID, + attribName, + attribValue); if (! IsAttrImpactedByVars(aMatch, attribValue, aModifiedVars)) continue; @@ -951,15 +951,15 @@ nsXULContentBuilder::SynchronizeUsingTemplate(nsIContent* aTemplateNode, SubstituteText(aMatch, attribValue, newvalue); if (newvalue.Length() > 0) { - aRealElement->SetAttribute(attribNameSpaceID, - attribName, - newvalue, - PR_TRUE); + aRealElement->SetAttr(attribNameSpaceID, + attribName, + newvalue, + PR_TRUE); } else { - aRealElement->UnsetAttribute(attribNameSpaceID, - attribName, - PR_TRUE); + aRealElement->UnsetAttr(attribNameSpaceID, + attribName, + PR_TRUE); } } } @@ -1398,7 +1398,7 @@ nsXULContentBuilder::IsOpen(nsIContent* aElement) return PR_TRUE; nsAutoString value; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::open, value); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::open, value); NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get open attribute"); if (NS_FAILED(rv)) return PR_FALSE; @@ -1597,7 +1597,7 @@ nsXULContentBuilder::SetContainerAttrs(nsIContent *aElement, const nsTemplateMat aMatch->mAssignments.GetAssignmentFor(aMatch->mRule->GetContainerVariable(), &containerval); nsAutoString oldcontainer; - aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::container, oldcontainer); + aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::container, oldcontainer); PRBool iscontainer, isempty; CheckContainer(VALUE_TO_IRDFRESOURCE(containerval), &iscontainer, &isempty); @@ -1609,20 +1609,20 @@ nsXULContentBuilder::SetContainerAttrs(nsIContent *aElement, const nsTemplateMat iscontainer ? true_ : false_; if (oldcontainer != newcontainer) { - aElement->SetAttribute(kNameSpaceID_None, nsXULAtoms::container, - newcontainer, PR_TRUE); + aElement->SetAttr(kNameSpaceID_None, nsXULAtoms::container, + newcontainer, PR_TRUE); } if (! (mFlags & eDontTestEmpty)) { nsAutoString oldempty; - aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::empty, oldempty); + aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::empty, oldempty); const nsAReadableString& newempty = (iscontainer && isempty) ? true_ : false_; if (oldempty != newempty) { - aElement->SetAttribute(kNameSpaceID_None, nsXULAtoms::empty, - newempty, PR_TRUE); + aElement->SetAttr(kNameSpaceID_None, nsXULAtoms::empty, + newempty, PR_TRUE); } } @@ -1787,7 +1787,7 @@ nsXULContentBuilder::AttributeChanged(nsIDocument* aDocument, if ((nameSpaceID == kNameSpaceID_XUL) && (aAttribute == nsXULAtoms::open)) { // We're on a XUL tag, and an ``open'' attribute changed. nsAutoString open; - aContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::open, open); + aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open); if (open == NS_LITERAL_STRING("true")) OpenContainer(aContent); @@ -2197,7 +2197,7 @@ nsXULContentBuilder::CompileContentCondition(nsTemplateRule* aRule, // uri nsAutoString uri; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::uri, uri); if (uri[0] != PRUnichar('?')) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -2226,7 +2226,7 @@ nsXULContentBuilder::CompileContentCondition(nsTemplateRule* aRule, nsCOMPtr tag; nsAutoString tagstr; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::tag, tagstr); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::tag, tagstr); if (tagstr.Length()) { tag = dont_AddRef(NS_NewAtom(tagstr)); diff --git a/content/xul/templates/src/nsXULContentUtils.cpp b/content/xul/templates/src/nsXULContentUtils.cpp index bc9232d172e..29e7b7ce6fb 100644 --- a/content/xul/templates/src/nsXULContentUtils.cpp +++ b/content/xul/templates/src/nsXULContentUtils.cpp @@ -245,7 +245,7 @@ nsXULContentUtils::GetElementResource(nsIContent* aElement, nsIRDFResource** aRe PRUnichar buf[128]; nsAutoString id(CBufDescriptor(buf, PR_TRUE, sizeof(buf) / sizeof(PRUnichar), 0)); - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::id, id); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::id, id); NS_ASSERTION(NS_SUCCEEDED(rv), "severe error retrieving attribute"); if (NS_FAILED(rv)) return rv; @@ -279,7 +279,7 @@ nsXULContentUtils::GetElementRefResource(nsIContent* aElement, nsIRDFResource** PRUnichar buf[128]; nsAutoString uri(CBufDescriptor(buf, PR_TRUE, sizeof(buf) / sizeof(PRUnichar), 0)); - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::ref, uri); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, uri); NS_ASSERTION(NS_SUCCEEDED(rv), "severe error retrieving attribute"); if (NS_FAILED(rv)) return rv; @@ -428,7 +428,7 @@ nsXULContentUtils::GetElementLogString(nsIContent* aElement, nsAWritableString& aResult.Append(unicodeString); PRInt32 count; - rv = aElement->GetAttributeCount(count); + rv = aElement->GetAttrCount(count); if (NS_FAILED(rv)) return rv; for (PRInt32 i = 0; i < count; ++i) { @@ -436,7 +436,7 @@ nsXULContentUtils::GetElementLogString(nsIContent* aElement, nsAWritableString& PRInt32 nameSpaceID; nsCOMPtr name, prefix; - rv = aElement->GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(name), *getter_AddRefs(prefix)); + rv = aElement->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(name), *getter_AddRefs(prefix)); if (NS_FAILED(rv)) return rv; nsAutoString attr; @@ -446,7 +446,7 @@ nsXULContentUtils::GetElementLogString(nsIContent* aElement, nsAWritableString& aResult.Append(NS_LITERAL_STRING("=\"")); nsAutoString value; - rv = aElement->GetAttribute(nameSpaceID, name, value); + rv = aElement->GetAttr(nameSpaceID, name, value); if (NS_FAILED(rv)) return rv; aResult.Append(value); @@ -709,13 +709,13 @@ nsXULContentUtils::SetCommandUpdater(nsIDocument* aDocument, nsIContent* aElemen return NS_ERROR_UNEXPECTED; nsAutoString events; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::events, events); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::events, events); if (rv != NS_CONTENT_ATTR_HAS_VALUE) events.Assign(NS_LITERAL_STRING("*")); nsAutoString targets; - rv = aElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::targets, targets); + rv = aElement->GetAttr(kNameSpaceID_None, nsXULAtoms::targets, targets); if (rv != NS_CONTENT_ATTR_HAS_VALUE) targets.Assign(NS_LITERAL_STRING("*")); diff --git a/content/xul/templates/src/nsXULOutlinerBuilder.cpp b/content/xul/templates/src/nsXULOutlinerBuilder.cpp index 1ea43989b05..47d340a8dcf 100644 --- a/content/xul/templates/src/nsXULOutlinerBuilder.cpp +++ b/content/xul/templates/src/nsXULOutlinerBuilder.cpp @@ -402,7 +402,7 @@ nsXULOutlinerBuilder::GetRowProperties(PRInt32 aIndex, nsISupportsArray* aProper GetTemplateActionRowFor(aIndex, getter_AddRefs(row)); if (row) { nsAutoString raw; - row->GetAttribute(kNameSpaceID_None, nsXULAtoms::properties, raw); + row->GetAttr(kNameSpaceID_None, nsXULAtoms::properties, raw); if (raw.Length()) { nsAutoString cooked; @@ -426,7 +426,7 @@ nsXULOutlinerBuilder::GetCellProperties(PRInt32 aRow, const PRUnichar* aColID, n GetTemplateActionCellFor(aRow, aColID, getter_AddRefs(cell)); if (cell) { nsAutoString raw; - cell->GetAttribute(kNameSpaceID_None, nsXULAtoms::properties, raw); + cell->GetAttr(kNameSpaceID_None, nsXULAtoms::properties, raw); if (raw.Length()) { nsAutoString cooked; @@ -573,7 +573,7 @@ nsXULOutlinerBuilder::GetCellText(PRInt32 aRow, const PRUnichar* aColID, PRUnich GetTemplateActionCellFor(aRow, aColID, getter_AddRefs(cell)); if (cell) { nsAutoString raw; - cell->GetAttribute(kNameSpaceID_None, nsXULAtoms::label, raw); + cell->GetAttr(kNameSpaceID_None, nsXULAtoms::label, raw); nsAutoString cooked; SubstituteText(*(mRows[aRow]->mMatch), raw, cooked); @@ -681,7 +681,7 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme return NS_ERROR_FAILURE; nsAutoString sort; - header->GetAttribute(kNameSpaceID_None, nsXULAtoms::sort, sort); + header->GetAttr(kNameSpaceID_None, nsXULAtoms::sort, sort); if (sort.Length()) { // Grab the new sort variable @@ -689,7 +689,7 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme // Cycle the sort direction nsAutoString dir; - header->GetAttribute(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); + header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); if (dir == NS_LITERAL_STRING("ascending")) { dir = NS_LITERAL_STRING("descending"); @@ -709,7 +709,7 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme mRows.InvalidateCachedRow(); mBoxObject->Invalidate(); - header->SetAttribute(kNameSpaceID_None, nsXULAtoms::sortDirection, dir, PR_FALSE); + header->SetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir, PR_FALSE); // Unset sort attribute(s) on the other columns nsCOMPtr parentContent; @@ -727,8 +727,8 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme if (childContent) { childContent->GetTag(*getter_AddRefs(childTag)); if (childTag.get() == nsXULAtoms::outlinercol && childContent != header) { - childContent->UnsetAttribute(kNameSpaceID_None, - nsXULAtoms::sortDirection, PR_FALSE); + childContent->UnsetAttr(kNameSpaceID_None, + nsXULAtoms::sortDirection, PR_FALSE); } } } @@ -1095,7 +1095,7 @@ nsXULOutlinerBuilder::GetSortVariables(VariableSet& aVariables) continue; nsAutoString sort; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::sort, sort); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::sort, sort); if (! sort.Length()) continue; @@ -1103,10 +1103,10 @@ nsXULOutlinerBuilder::GetSortVariables(VariableSet& aVariables) aVariables.Add(var); nsAutoString active; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::sortActive, active); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, active); if (active == NS_LITERAL_STRING("true")) { nsAutoString dir; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); if (dir == NS_LITERAL_STRING("none")) mSortDirection = eDirection_Natural; @@ -1196,7 +1196,7 @@ nsXULOutlinerBuilder::CompileOutlinerRowCondition(nsTemplateRule* aRule, // propogation. The ``uri'' attribute must be set. nsAutoString uri; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::uri, uri); if (uri[0] != PRUnichar('?')) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -1275,7 +1275,7 @@ nsXULOutlinerBuilder::GetTemplateActionCellFor(PRInt32 aRow, continue; nsAutoString ref; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::ref, ref); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref); if (ref.Equals(aColID)) { NS_ADDREF(*aResult = child.get()); diff --git a/content/xul/templates/src/nsXULSortService.cpp b/content/xul/templates/src/nsXULSortService.cpp index 188751a1197..df2e64224e3 100644 --- a/content/xul/templates/src/nsXULSortService.cpp +++ b/content/xul/templates/src/nsXULSortService.cpp @@ -622,7 +622,7 @@ XULSortServiceImpl::GetSortColumnIndex(nsIContent *tree, const nsString &sortRes { nsAutoString value; - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kResourceAtom, value)) + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kResourceAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { PRBool setFlag = PR_FALSE; @@ -636,14 +636,14 @@ XULSortServiceImpl::GetSortColumnIndex(nsIContent *tree, const nsString &sortRes setFlag = PR_TRUE; // secondary sort info is optional - if (NS_FAILED(rv = child->GetAttribute(kNameSpaceID_None, kResource2Atom, + if (NS_FAILED(rv = child->GetAttr(kNameSpaceID_None, kResource2Atom, sortResource2)) || (rv != NS_CONTENT_ATTR_HAS_VALUE)) { sortResource2.Truncate(); } } } - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kSortSeparatorsAtom, value)) + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kSortSeparatorsAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE) && (value.EqualsIgnoreCase(*trueStr))) { inbetweenSeparatorSort = PR_TRUE; @@ -651,16 +651,16 @@ XULSortServiceImpl::GetSortColumnIndex(nsIContent *tree, const nsString &sortRes if (setFlag == PR_TRUE) { - child->SetAttribute(kNameSpaceID_None, kSortActiveAtom, *trueStr, PR_TRUE); - child->SetAttribute(kNameSpaceID_None, kSortDirectionAtom, sortDirection, PR_TRUE); + child->SetAttr(kNameSpaceID_None, kSortActiveAtom, *trueStr, PR_TRUE); + child->SetAttr(kNameSpaceID_None, kSortDirectionAtom, sortDirection, PR_TRUE); // Note: don't break out of loop; want to set/unset attribs on ALL sort columns // break; } else { - child->UnsetAttribute(kNameSpaceID_None, kSortActiveAtom, PR_TRUE); - child->UnsetAttribute(kNameSpaceID_None, kSortDirectionAtom, PR_TRUE); + child->UnsetAttr(kNameSpaceID_None, kSortActiveAtom, PR_TRUE); + child->UnsetAttr(kNameSpaceID_None, kSortDirectionAtom, PR_TRUE); } } ++colIndex; @@ -680,26 +680,26 @@ XULSortServiceImpl::SetSortHints(nsIContent *tree, const nsString &sortResource, if (found == PR_TRUE) { // set hints on tree root node - tree->SetAttribute(kNameSpaceID_None, kSortActiveAtom, *trueStr, PR_FALSE); - tree->SetAttribute(kNameSpaceID_None, kSortDirectionAtom, sortDirection, PR_FALSE); - tree->SetAttribute(kNameSpaceID_None, kResourceAtom, sortResource, PR_FALSE); + tree->SetAttr(kNameSpaceID_None, kSortActiveAtom, *trueStr, PR_FALSE); + tree->SetAttr(kNameSpaceID_None, kSortDirectionAtom, sortDirection, PR_FALSE); + tree->SetAttr(kNameSpaceID_None, kResourceAtom, sortResource, PR_FALSE); if (sortResource2.Length() > 0) - tree->SetAttribute(kNameSpaceID_None, kResource2Atom, sortResource2, PR_FALSE); - else tree->UnsetAttribute(kNameSpaceID_None, kResource2Atom, PR_FALSE); + tree->SetAttr(kNameSpaceID_None, kResource2Atom, sortResource2, PR_FALSE); + else tree->UnsetAttr(kNameSpaceID_None, kResource2Atom, PR_FALSE); } else { - tree->UnsetAttribute(kNameSpaceID_None, kSortActiveAtom, PR_FALSE); - tree->UnsetAttribute(kNameSpaceID_None, kSortDirectionAtom, PR_FALSE); - tree->UnsetAttribute(kNameSpaceID_None, kResourceAtom, PR_FALSE); - tree->UnsetAttribute(kNameSpaceID_None, kResource2Atom, PR_FALSE); + tree->UnsetAttr(kNameSpaceID_None, kSortActiveAtom, PR_FALSE); + tree->UnsetAttr(kNameSpaceID_None, kSortDirectionAtom, PR_FALSE); + tree->UnsetAttr(kNameSpaceID_None, kResourceAtom, PR_FALSE); + tree->UnsetAttr(kNameSpaceID_None, kResource2Atom, PR_FALSE); } // optional hint if (inbetweenSeparatorSort == PR_TRUE) - tree->SetAttribute(kNameSpaceID_None, kSortSeparatorsAtom, *trueStr, PR_FALSE); - else tree->UnsetAttribute(kNameSpaceID_None, kSortSeparatorsAtom, PR_FALSE); + tree->SetAttr(kNameSpaceID_None, kSortSeparatorsAtom, *trueStr, PR_FALSE); + else tree->UnsetAttr(kNameSpaceID_None, kSortSeparatorsAtom, PR_FALSE); return(NS_OK); } @@ -716,21 +716,21 @@ XULSortServiceImpl::NodeHasSortInfo(nsIContent *child, nsString &sortResource, n found = PR_FALSE; nsAutoString value; - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kSortActiveAtom, value)) + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kSortActiveAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { if (value.EqualsIgnoreCase(*trueStr)) { - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kResourceAtom, + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kResourceAtom, sortResource)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kSortDirectionAtom, + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kSortDirectionAtom, sortDirection)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { found = PR_TRUE; // sort separator flag is optional - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kSortSeparatorsAtom, + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kSortSeparatorsAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { if (value.EqualsIgnoreCase(*trueStr)) @@ -740,7 +740,7 @@ XULSortServiceImpl::NodeHasSortInfo(nsIContent *child, nsString &sortResource, n } // secondary sort info is optional - if (NS_FAILED(rv = child->GetAttribute(kNameSpaceID_None, kResource2Atom, + if (NS_FAILED(rv = child->GetAttr(kNameSpaceID_None, kResource2Atom, sortResource2)) || (rv != NS_CONTENT_ATTR_HAS_VALUE)) { sortResource2.Truncate(); @@ -1259,7 +1259,7 @@ XULSortServiceImpl::GetNodeValue(nsIContent *node1, sortPtr sortInfo, PRBool fir if (htmlDom) { nsAutoString htmlID; - if (NS_SUCCEEDED(rv = node1->GetAttribute(kNameSpaceID_None, kIdAtom, htmlID)) + if (NS_SUCCEEDED(rv = node1->GetAttr(kNameSpaceID_None, kIdAtom, htmlID)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { if (NS_FAILED(rv = gRDFService->GetUnicodeResource(htmlID.get(), @@ -1429,7 +1429,7 @@ XULSortServiceImpl::GetNodeValue(contentSortInfo *info1, sortPtr sortInfo, PRBoo if (htmlDom) { nsAutoString htmlID; - if (NS_SUCCEEDED(rv = node1->GetAttribute(kNameSpaceID_None, kIdAtom, htmlID)) + if (NS_SUCCEEDED(rv = node1->GetAttr(kNameSpaceID_None, kIdAtom, htmlID)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { if (NS_FAILED(rv = gRDFService->GetUnicodeResource(htmlID.get(), @@ -1826,7 +1826,7 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, sortPtr sortInfo, PR nsAutoString type; for (loop=currentElement; loop< currentElement + numElements; loop++) { - if (NS_SUCCEEDED(rv = contentSortInfoArray[loop]->content->GetAttribute(kNameSpaceID_RDF, + if (NS_SUCCEEDED(rv = contentSortInfoArray[loop]->content->GetAttr(kNameSpaceID_RDF, kRDF_type, type)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { if (type.EqualsWithConversion(kURINC_BookmarkSeparator)) @@ -1891,7 +1891,7 @@ XULSortServiceImpl::SortTreeChildren(nsIContent *container, sortPtr sortInfo, PR delete contentSortInfo; // if its a container, find its treechildren node, and sort those - if (NS_FAILED(rv = parentNode->GetAttribute(kNameSpaceID_None, kContainerAtom, value)) || + if (NS_FAILED(rv = parentNode->GetAttr(kNameSpaceID_None, kContainerAtom, value)) || (rv != NS_CONTENT_ATTR_HAS_VALUE) || (!value.EqualsIgnoreCase(*trueStr))) continue; if (NS_FAILED(rv = parentNode->ChildCount(numChildren))) continue; @@ -1997,15 +1997,15 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort { // not a tree, so look for sorting info on root node - if (NS_SUCCEEDED(rv = root->GetAttribute(kNameSpaceID_None, kSortResourceAtom, + if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, kSortResourceAtom, sortResource)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { - if (NS_SUCCEEDED(rv = root->GetAttribute(kNameSpaceID_None, kSortDirectionAtom, + if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, kSortDirectionAtom, sortDirection)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { sortInfoAvailable = PR_TRUE; - if (NS_FAILED(rv = root->GetAttribute(kNameSpaceID_None, kSortResource2Atom, + if (NS_FAILED(rv = root->GetAttr(kNameSpaceID_None, kSortResource2Atom, sortResource2)) || (rv != NS_CONTENT_ATTR_HAS_VALUE)) { sortResource2.Truncate(); @@ -2122,10 +2122,10 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort if (NS_FAILED(rv = trueParent->GetTag(*getter_AddRefs(tag)))) return(rv); - rv = trueParent->GetAttribute(kNameSpaceID_None, kRefAtom, id); + rv = trueParent->GetAttr(kNameSpaceID_None, kRefAtom, id); if (id.Length() == 0) { - rv = trueParent->GetAttribute(kNameSpaceID_None, kIdAtom, id); + rv = trueParent->GetAttr(kNameSpaceID_None, kIdAtom, id); } if (id.Length() > 0) { @@ -2155,7 +2155,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort PRInt32 staticCount = 0; nsAutoString staticValue; - if (NS_SUCCEEDED(rv = container->GetAttribute(kNameSpaceID_None, kStaticHintAtom, staticValue)) + if (NS_SUCCEEDED(rv = container->GetAttr(kNameSpaceID_None, kStaticHintAtom, staticValue)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { // found "static" XUL element count hint @@ -2172,7 +2172,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort container->ChildAt(childLoop, *getter_AddRefs(child)); if (!child) break; - if (NS_SUCCEEDED(rv = child->GetAttribute(kNameSpaceID_None, kTemplateAtom, valueStr)) + if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kTemplateAtom, valueStr)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { break; @@ -2182,7 +2182,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort ++staticCount; } } - if (NS_SUCCEEDED(rv = container->GetAttribute(kNameSpaceID_None, kStaticsSortLastHintAtom, valueStr)) + if (NS_SUCCEEDED(rv = container->GetAttr(kNameSpaceID_None, kStaticsSortLastHintAtom, valueStr)) && (rv == NS_CONTENT_ATTR_HAS_VALUE) && (valueStr.EqualsIgnoreCase(*trueStr))) { // indicate that static XUL comes after RDF-generated content by making negative @@ -2192,7 +2192,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort // save the "static" XUL element count hint valueStr.Truncate(); valueStr.AppendInt(staticCount); - container->SetAttribute(kNameSpaceID_None, kStaticHintAtom, valueStr, PR_FALSE); + container->SetAttr(kNameSpaceID_None, kStaticHintAtom, valueStr, PR_FALSE); } if (staticCount <= 0) @@ -2337,13 +2337,13 @@ XULSortServiceImpl::DoSort(nsIDOMNode* node, const nsString& sortResource, // then just reverse-index the current tree PRBool invertTreeFlag = PR_FALSE; nsAutoString value; - if (NS_SUCCEEDED(rv = treeNode->GetAttribute(kNameSpaceID_None, kSortActiveAtom, value)) + if (NS_SUCCEEDED(rv = treeNode->GetAttr(kNameSpaceID_None, kSortActiveAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE) && (value.EqualsIgnoreCase(*trueStr))) { - if (NS_SUCCEEDED(rv = treeNode->GetAttribute(kNameSpaceID_None, kResourceAtom, + if (NS_SUCCEEDED(rv = treeNode->GetAttr(kNameSpaceID_None, kResourceAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE) && (value.EqualsIgnoreCase(sortResource))) { - if (NS_SUCCEEDED(rv = treeNode->GetAttribute(kNameSpaceID_None, kSortDirectionAtom, + if (NS_SUCCEEDED(rv = treeNode->GetAttr(kNameSpaceID_None, kSortDirectionAtom, value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE)) { if ((value.Equals(*descendingStr) && sortDirection.Equals(*ascendingStr)) || @@ -2356,11 +2356,11 @@ XULSortServiceImpl::DoSort(nsIDOMNode* node, const nsString& sortResource, } // remove any sort hints on tree root node - treeNode->UnsetAttribute(kNameSpaceID_None, kSortActiveAtom, PR_FALSE); - treeNode->UnsetAttribute(kNameSpaceID_None, kSortDirectionAtom, PR_FALSE); - treeNode->UnsetAttribute(kNameSpaceID_None, kSortSeparatorsAtom, PR_FALSE); - treeNode->UnsetAttribute(kNameSpaceID_None, kResourceAtom, PR_FALSE); - treeNode->UnsetAttribute(kNameSpaceID_None, kResource2Atom, PR_FALSE); + treeNode->UnsetAttr(kNameSpaceID_None, kSortActiveAtom, PR_FALSE); + treeNode->UnsetAttr(kNameSpaceID_None, kSortDirectionAtom, PR_FALSE); + treeNode->UnsetAttr(kNameSpaceID_None, kSortSeparatorsAtom, PR_FALSE); + treeNode->UnsetAttr(kNameSpaceID_None, kResourceAtom, PR_FALSE); + treeNode->UnsetAttr(kNameSpaceID_None, kResource2Atom, PR_FALSE); nsCOMPtr cds; if (NS_SUCCEEDED(rv = domXulTree->GetDatabase(getter_AddRefs(cds)))) diff --git a/content/xul/templates/src/nsXULTemplateBuilder.cpp b/content/xul/templates/src/nsXULTemplateBuilder.cpp index 15ca6b660f6..64b9a3294f2 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -759,12 +759,12 @@ nsXULTemplateBuilder::LoadDataSources() // check for magical attributes. XXX move to ``flags''? nsAutoString coalesce; - mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::coalesceduplicatearcs, coalesce); + mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::coalesceduplicatearcs, coalesce); if (coalesce == NS_LITERAL_STRING("false")) mDB->SetCoalesceDuplicateArcs(PR_FALSE); nsAutoString allowneg; - mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::allownegativeassertions, allowneg); + mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::allownegativeassertions, allowneg); if (allowneg == NS_LITERAL_STRING("false")) mDB->SetAllowNegativeAssertions(PR_FALSE); @@ -802,7 +802,7 @@ nsXULTemplateBuilder::LoadDataSources() doc->GetDocumentURL(getter_AddRefs(docurl)); nsAutoString datasources; - mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::datasources, datasources); + mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::datasources, datasources); PRUint32 first = 0; @@ -1376,7 +1376,7 @@ nsXULTemplateBuilder::ComputeContainmentProperties() mContainmentProperties.Clear(); nsAutoString containment; - rv = mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::containment, containment); + rv = mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::containment, containment); if (NS_FAILED(rv)) return rv; PRUint32 len = containment.Length(); @@ -1445,7 +1445,7 @@ nsXULTemplateBuilder::InitializeRuleNetwork() mFlags = 0; nsAutoString flags; - mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::flags, flags); + mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::flags, flags); if (flags.Find(NS_LITERAL_STRING("dont-test-empty").get()) >= 0) mFlags |= eDontTestEmpty; @@ -1478,7 +1478,7 @@ nsXULTemplateBuilder::GetTemplateRoot(nsIContent** aResult) // // nsAutoString templateID; - mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::templateAtom, templateID); + mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::templateAtom, templateID); if (templateID.Length()) { nsCOMPtr doc; @@ -1580,12 +1580,12 @@ nsXULTemplateBuilder::CompileRules() // Set the "container" and "member" variables, if the user has // specified them. mContainerSymbol.Truncate(); - tmpl->GetAttribute(kNameSpaceID_None, nsXULAtoms::container, mContainerSymbol); + tmpl->GetAttr(kNameSpaceID_None, nsXULAtoms::container, mContainerSymbol); if (mContainerSymbol.Length()) mRules.PutSymbol(mContainerSymbol.get(), mContainerVar); mMemberSymbol.Truncate(); - tmpl->GetAttribute(kNameSpaceID_None, nsXULAtoms::member, mMemberSymbol); + tmpl->GetAttr(kNameSpaceID_None, nsXULAtoms::member, mMemberSymbol); if (mMemberSymbol.Length()) mRules.PutSymbol(mMemberSymbol.get(), mMemberVar); @@ -1701,7 +1701,7 @@ nsXULTemplateBuilder::CompileExtendedRule(nsIContent* aRuleElement, unvisited.RemoveElementAt(0); nsAutoString uri; - next->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri); + next->GetAttr(kNameSpaceID_None, nsXULAtoms::uri, uri); if (!uri.IsEmpty() && uri[0] == PRUnichar('?')) { // Found it. @@ -1869,7 +1869,7 @@ nsXULTemplateBuilder::CompileTripleCondition(nsTemplateRule* aRule, // subject nsAutoString subject; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::subject, subject); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::subject, subject); PRInt32 svar = 0; nsCOMPtr sres; @@ -1880,7 +1880,7 @@ nsXULTemplateBuilder::CompileTripleCondition(nsTemplateRule* aRule, // predicate nsAutoString predicate; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::predicate, predicate); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::predicate, predicate); nsCOMPtr pres; if (predicate[0] == PRUnichar('?')) { @@ -1895,7 +1895,7 @@ nsXULTemplateBuilder::CompileTripleCondition(nsTemplateRule* aRule, // object nsAutoString object; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::object, object); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::object, object); PRInt32 ovar = 0; nsCOMPtr onode; @@ -1954,7 +1954,7 @@ nsXULTemplateBuilder::CompileMemberCondition(nsTemplateRule* aRule, // container nsAutoString container; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::container, container); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::container, container); if (container[0] != PRUnichar('?')) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -1967,7 +1967,7 @@ nsXULTemplateBuilder::CompileMemberCondition(nsTemplateRule* aRule, // child nsAutoString child; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::child, child); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::child, child); if (child[0] != PRUnichar('?')) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -2051,7 +2051,7 @@ nsXULTemplateBuilder::CompileBinding(nsTemplateRule* aRule, // subject nsAutoString subject; - aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::subject, subject); + aBinding->GetAttr(kNameSpaceID_None, nsXULAtoms::subject, subject); if (! subject.Length()) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -2073,7 +2073,7 @@ nsXULTemplateBuilder::CompileBinding(nsTemplateRule* aRule, // predicate nsAutoString predicate; - aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::predicate, predicate); + aBinding->GetAttr(kNameSpaceID_None, nsXULAtoms::predicate, predicate); if (! predicate.Length()) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, ("xultemplate[%p] requires `predicate'", this)); @@ -2094,7 +2094,7 @@ nsXULTemplateBuilder::CompileBinding(nsTemplateRule* aRule, // object nsAutoString object; - aBinding->GetAttribute(kNameSpaceID_None, nsXULAtoms::object, object); + aBinding->GetAttr(kNameSpaceID_None, nsXULAtoms::object, object); if (! object.Length()) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -2128,15 +2128,15 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement, PRBool hasContainerTest = PR_FALSE; PRInt32 count; - aRuleElement->GetAttributeCount(count); + aRuleElement->GetAttrCount(count); // Add constraints for the LHS for (PRInt32 i = 0; i < count; ++i) { PRInt32 attrNameSpaceID; nsCOMPtr attr, prefix; - rv = aRuleElement->GetAttributeNameAt(i, attrNameSpaceID, - *getter_AddRefs(attr), - *getter_AddRefs(prefix)); + rv = aRuleElement->GetAttrNameAt(i, attrNameSpaceID, + *getter_AddRefs(attr), + *getter_AddRefs(prefix)); if (NS_FAILED(rv)) return rv; // Note: some attributes must be skipped on XUL template rule subtree @@ -2152,7 +2152,7 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement, continue; nsAutoString value; - rv = aRuleElement->GetAttribute(attrNameSpaceID, attr, value); + rv = aRuleElement->GetAttr(attrNameSpaceID, attr, value); if (NS_FAILED(rv)) return rv; TestNode* testnode = nsnull; @@ -2171,7 +2171,7 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement, nsRDFConInstanceTestNode::Test iscontainer = nsRDFConInstanceTestNode::eDontCare; - rv = aRuleElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::iscontainer, value); + rv = aRuleElement->GetAttr(kNameSpaceID_None, nsXULAtoms::iscontainer, value); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { @@ -2186,7 +2186,7 @@ nsXULTemplateBuilder::CompileSimpleRule(nsIContent* aRuleElement, nsRDFConInstanceTestNode::Test isempty = nsRDFConInstanceTestNode::eDontCare; - rv = aRuleElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::isempty, value); + rv = aRuleElement->GetAttr(kNameSpaceID_None, nsXULAtoms::isempty, value); if (NS_FAILED(rv)) return rv; if (rv == NS_CONTENT_ATTR_HAS_VALUE) { @@ -2298,17 +2298,17 @@ nsXULTemplateBuilder::AddSimpleRuleBindings(nsTemplateRule* aRule, nsIContent* a // Iterate through its attributes, looking for substitutions // that we need to add as bindings. PRInt32 count; - element->GetAttributeCount(count); + element->GetAttrCount(count); for (i = 0; i < count; ++i) { PRInt32 nameSpaceID; nsCOMPtr attr, prefix; - element->GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attr), - *getter_AddRefs(prefix)); + element->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attr), + *getter_AddRefs(prefix)); nsAutoString value; - element->GetAttribute(nameSpaceID, attr, value); + element->GetAttr(nameSpaceID, attr, value); // Scan the attribute for variables, adding a binding for // each one. diff --git a/content/xul/templates/src/nsXULTreeBuilder.cpp b/content/xul/templates/src/nsXULTreeBuilder.cpp index 1ea43989b05..47d340a8dcf 100644 --- a/content/xul/templates/src/nsXULTreeBuilder.cpp +++ b/content/xul/templates/src/nsXULTreeBuilder.cpp @@ -402,7 +402,7 @@ nsXULOutlinerBuilder::GetRowProperties(PRInt32 aIndex, nsISupportsArray* aProper GetTemplateActionRowFor(aIndex, getter_AddRefs(row)); if (row) { nsAutoString raw; - row->GetAttribute(kNameSpaceID_None, nsXULAtoms::properties, raw); + row->GetAttr(kNameSpaceID_None, nsXULAtoms::properties, raw); if (raw.Length()) { nsAutoString cooked; @@ -426,7 +426,7 @@ nsXULOutlinerBuilder::GetCellProperties(PRInt32 aRow, const PRUnichar* aColID, n GetTemplateActionCellFor(aRow, aColID, getter_AddRefs(cell)); if (cell) { nsAutoString raw; - cell->GetAttribute(kNameSpaceID_None, nsXULAtoms::properties, raw); + cell->GetAttr(kNameSpaceID_None, nsXULAtoms::properties, raw); if (raw.Length()) { nsAutoString cooked; @@ -573,7 +573,7 @@ nsXULOutlinerBuilder::GetCellText(PRInt32 aRow, const PRUnichar* aColID, PRUnich GetTemplateActionCellFor(aRow, aColID, getter_AddRefs(cell)); if (cell) { nsAutoString raw; - cell->GetAttribute(kNameSpaceID_None, nsXULAtoms::label, raw); + cell->GetAttr(kNameSpaceID_None, nsXULAtoms::label, raw); nsAutoString cooked; SubstituteText(*(mRows[aRow]->mMatch), raw, cooked); @@ -681,7 +681,7 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme return NS_ERROR_FAILURE; nsAutoString sort; - header->GetAttribute(kNameSpaceID_None, nsXULAtoms::sort, sort); + header->GetAttr(kNameSpaceID_None, nsXULAtoms::sort, sort); if (sort.Length()) { // Grab the new sort variable @@ -689,7 +689,7 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme // Cycle the sort direction nsAutoString dir; - header->GetAttribute(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); + header->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); if (dir == NS_LITERAL_STRING("ascending")) { dir = NS_LITERAL_STRING("descending"); @@ -709,7 +709,7 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme mRows.InvalidateCachedRow(); mBoxObject->Invalidate(); - header->SetAttribute(kNameSpaceID_None, nsXULAtoms::sortDirection, dir, PR_FALSE); + header->SetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir, PR_FALSE); // Unset sort attribute(s) on the other columns nsCOMPtr parentContent; @@ -727,8 +727,8 @@ nsXULOutlinerBuilder::CycleHeader(const PRUnichar* aColID, nsIDOMElement* aEleme if (childContent) { childContent->GetTag(*getter_AddRefs(childTag)); if (childTag.get() == nsXULAtoms::outlinercol && childContent != header) { - childContent->UnsetAttribute(kNameSpaceID_None, - nsXULAtoms::sortDirection, PR_FALSE); + childContent->UnsetAttr(kNameSpaceID_None, + nsXULAtoms::sortDirection, PR_FALSE); } } } @@ -1095,7 +1095,7 @@ nsXULOutlinerBuilder::GetSortVariables(VariableSet& aVariables) continue; nsAutoString sort; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::sort, sort); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::sort, sort); if (! sort.Length()) continue; @@ -1103,10 +1103,10 @@ nsXULOutlinerBuilder::GetSortVariables(VariableSet& aVariables) aVariables.Add(var); nsAutoString active; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::sortActive, active); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, active); if (active == NS_LITERAL_STRING("true")) { nsAutoString dir; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, dir); if (dir == NS_LITERAL_STRING("none")) mSortDirection = eDirection_Natural; @@ -1196,7 +1196,7 @@ nsXULOutlinerBuilder::CompileOutlinerRowCondition(nsTemplateRule* aRule, // propogation. The ``uri'' attribute must be set. nsAutoString uri; - aCondition->GetAttribute(kNameSpaceID_None, nsXULAtoms::uri, uri); + aCondition->GetAttr(kNameSpaceID_None, nsXULAtoms::uri, uri); if (uri[0] != PRUnichar('?')) { PR_LOG(gXULTemplateLog, PR_LOG_ALWAYS, @@ -1275,7 +1275,7 @@ nsXULOutlinerBuilder::GetTemplateActionCellFor(PRInt32 aRow, continue; nsAutoString ref; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::ref, ref); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::ref, ref); if (ref.Equals(aColID)) { NS_ADDREF(*aResult = child.get()); diff --git a/editor/base/nsHTMLEditorStyle.cpp b/editor/base/nsHTMLEditorStyle.cpp index 5ebef44d212..1e55971c52e 100644 --- a/editor/base/nsHTMLEditorStyle.cpp +++ b/editor/base/nsHTMLEditorStyle.cpp @@ -580,12 +580,12 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode, PRInt32 attrCount, i, nameSpaceID; nsCOMPtr attrName, prefix; - content->GetAttributeCount(attrCount); + content->GetAttrCount(attrCount); for (i=0; iGetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attrName), - *getter_AddRefs(prefix)); + content->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attrName), + *getter_AddRefs(prefix)); nsAutoString attrString, tmp; if (!attrName) continue; // ooops attrName->ToString(attrString); @@ -615,13 +615,13 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1, PRInt32 attrCount, i, nameSpaceID, realCount1=0, realCount2=0; nsCOMPtr attrName, prefix; nsresult res, res2; - content1->GetAttributeCount(attrCount); + content1->GetAttrCount(attrCount); nsAutoString attrString, tmp, attrVal1, attrVal2; for (i=0; iGetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attrName), - *getter_AddRefs(prefix)); + content1->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attrName), + *getter_AddRefs(prefix)); if (!attrName) continue; // ooops attrName->ToString(attrString); // if it's a special _moz... attribute, keep going @@ -630,17 +630,17 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1, // otherwise, it's another attribute, so count it realCount1++; // and compare it to element2's attributes - res = content1->GetAttribute(nameSpaceID, attrName, attrVal1); - res2 = content2->GetAttribute(nameSpaceID, attrName, attrVal2); + res = content1->GetAttr(nameSpaceID, attrName, attrVal1); + res2 = content2->GetAttr(nameSpaceID, attrName, attrVal2); if (res != res2) return PR_FALSE; if (!attrVal1.EqualsIgnoreCase(attrVal2)) return PR_FALSE; } - content2->GetAttributeCount(attrCount); + content2->GetAttrCount(attrCount); for (i=0; iGetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attrName), - *getter_AddRefs(prefix)); + content2->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attrName), + *getter_AddRefs(prefix)); if (!attrName) continue; // ooops attrName->ToString(attrString); // if it's a special _moz... attribute, keep going diff --git a/editor/libeditor/html/nsHTMLEditorStyle.cpp b/editor/libeditor/html/nsHTMLEditorStyle.cpp index 5ebef44d212..1e55971c52e 100644 --- a/editor/libeditor/html/nsHTMLEditorStyle.cpp +++ b/editor/libeditor/html/nsHTMLEditorStyle.cpp @@ -580,12 +580,12 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode, PRInt32 attrCount, i, nameSpaceID; nsCOMPtr attrName, prefix; - content->GetAttributeCount(attrCount); + content->GetAttrCount(attrCount); for (i=0; iGetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attrName), - *getter_AddRefs(prefix)); + content->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attrName), + *getter_AddRefs(prefix)); nsAutoString attrString, tmp; if (!attrName) continue; // ooops attrName->ToString(attrString); @@ -615,13 +615,13 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1, PRInt32 attrCount, i, nameSpaceID, realCount1=0, realCount2=0; nsCOMPtr attrName, prefix; nsresult res, res2; - content1->GetAttributeCount(attrCount); + content1->GetAttrCount(attrCount); nsAutoString attrString, tmp, attrVal1, attrVal2; for (i=0; iGetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attrName), - *getter_AddRefs(prefix)); + content1->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attrName), + *getter_AddRefs(prefix)); if (!attrName) continue; // ooops attrName->ToString(attrString); // if it's a special _moz... attribute, keep going @@ -630,17 +630,17 @@ nsHTMLEditor::HasMatchingAttributes(nsIDOMNode *aNode1, // otherwise, it's another attribute, so count it realCount1++; // and compare it to element2's attributes - res = content1->GetAttribute(nameSpaceID, attrName, attrVal1); - res2 = content2->GetAttribute(nameSpaceID, attrName, attrVal2); + res = content1->GetAttr(nameSpaceID, attrName, attrVal1); + res2 = content2->GetAttr(nameSpaceID, attrName, attrVal2); if (res != res2) return PR_FALSE; if (!attrVal1.EqualsIgnoreCase(attrVal2)) return PR_FALSE; } - content2->GetAttributeCount(attrCount); + content2->GetAttrCount(attrCount); for (i=0; iGetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attrName), - *getter_AddRefs(prefix)); + content2->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attrName), + *getter_AddRefs(prefix)); if (!attrName) continue; // ooops attrName->ToString(attrString); // if it's a special _moz... attribute, keep going diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index d01022f4385..0714a044969 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1732,7 +1732,7 @@ nsCSSFrameConstructor::CreateInputFrame(nsIPresShell *aPresShell, // Figure out which type of input frame to create nsAutoString val; - if (NS_OK == aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, val)) { + if (NS_OK == aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, val)) { if (val.EqualsIgnoreCase("submit")) { rv = ConstructButtonControlFrame(aPresShell, aPresContext, aFrame); } @@ -5533,7 +5533,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, isReplaced = PR_TRUE; if (aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) { nsAutoString value; - if (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value) == + if (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value) == NS_CONTENT_ATTR_NOT_THERE) return NS_OK; } @@ -5734,7 +5734,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, NS_NewTreeLayout(aPresShell, layout); nsAutoString outer; - rv = aContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::outer, outer); + rv = aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::outer, outer); if (outer.EqualsIgnoreCase("true")) { rv = NS_NewXULTreeOuterGroupFrame(aPresShell, &newFrame, PR_FALSE, layout); ((nsXULTreeGroupFrame*)newFrame)->InitGroup(this, aPresContext, (nsXULTreeOuterGroupFrame*) newFrame); @@ -8083,7 +8083,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, aContainer->GetParent(*getter_AddRefs(parent)); if (parent) { nsAutoString open; - parent->GetAttribute(kNameSpaceID_None, nsXULAtoms::open, open); + parent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open); if (open.EqualsIgnoreCase("true")) { // Clear our undisplayed content. nsCOMPtr frameManager; @@ -10290,19 +10290,19 @@ GetAlternateTextFor(nsIContent* aContent, // The "alt" attribute specifies alternate text that is rendered // when the image can not be displayed - rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); + rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); // If there's no "alt" attribute, then use the value of the "title" // attribute. Note that this is not the same as a value of "" if (NS_CONTENT_ATTR_NOT_THERE == rv) { - rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::title, - aAltText); + rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::title, + aAltText); // If there's no "alt" or "title" attribute, and aContent is an input // element, then use the value of the "value" attribute if ((NS_CONTENT_ATTR_NOT_THERE == rv) && (nsHTMLAtoms::input == aTag)) { - rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, - aAltText); + rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, + aAltText); // If there's no "value" attribute either, then use the localized string // for "Submit" as the alternate text. diff --git a/layout/base/nsFrameManager.cpp b/layout/base/nsFrameManager.cpp index 26a7708071f..ef4c20d16ed 100644 --- a/layout/base/nsFrameManager.cpp +++ b/layout/base/nsFrameManager.cpp @@ -2346,7 +2346,7 @@ FrameManager::GenerateStateKey(nsIContent* aContent, KeyAppendAtom(tag, aKey); nsAutoString name; - aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, name); + aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, name); KeyAppendString(name, aKey); } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 416700335e6..8ad2b9781c5 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4830,9 +4830,9 @@ PresShell::HandlePostedAttributeChanges() } if (node->type == eChangeType_Set) - node->content->SetAttribute(node->nameSpaceID, node->name, node->value, node->notify); + node->content->SetAttr(node->nameSpaceID, node->name, node->value, node->notify); else - node->content->UnsetAttribute(node->nameSpaceID, node->name, node->notify); + node->content->UnsetAttr(node->nameSpaceID, node->name, node->notify); NS_RELEASE(node->content); node->nsAttributeChangeRequest::~nsAttributeChangeRequest(); diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp index b34f6809960..d5688858a85 100644 --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -78,9 +78,9 @@ nsButtonFrameRenderer::SetDisabled(PRBool aDisabled, PRBool notify) mFrame->GetContent(getter_AddRefs(content)); if (aDisabled) - content->SetAttribute(mNameSpace, nsHTMLAtoms::disabled, nsAutoString(), notify); + content->SetAttr(mNameSpace, nsHTMLAtoms::disabled, nsAutoString(), notify); else - content->UnsetAttribute(mNameSpace, nsHTMLAtoms::disabled, notify); + content->UnsetAttr(mNameSpace, nsHTMLAtoms::disabled, notify); } @@ -91,7 +91,7 @@ nsButtonFrameRenderer::isDisabled() nsCOMPtr content; mFrame->GetContent(getter_AddRefs(content)); nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(mNameSpace, nsHTMLAtoms::disabled, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(mNameSpace, nsHTMLAtoms::disabled, value)) return PR_TRUE; return PR_FALSE; diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 11a03b6e62b..06ea9cd5cf9 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -2337,7 +2337,7 @@ nsComboboxControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, eventReceiver->AddEventListenerByIID(mButtonListener, NS_GET_IID(nsIDOMMouseListener)); } - btnContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE); + btnContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE); aChildList.AppendElement(btnContent); } } diff --git a/layout/forms/nsFileControlFrame.cpp b/layout/forms/nsFileControlFrame.cpp index 1b38d9c0520..946c53dae57 100644 --- a/layout/forms/nsFileControlFrame.cpp +++ b/layout/forms/nsFileControlFrame.cpp @@ -133,7 +133,7 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, rv = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mTextContent); if (NS_SUCCEEDED(rv)) { - mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE); + mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE); if (nsFormFrame::GetDisabled(this)) { nsCOMPtr textControl = do_QueryInterface(mTextContent); if (textControl) { @@ -150,8 +150,8 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, mBrowse = do_QueryInterface(content,&rv); if (NS_SUCCEEDED(rv)) { - mBrowse->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE); - //browse->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, nsAutoString("browse..."), PR_FALSE); + mBrowse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE); + //browse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::value, nsAutoString("browse..."), PR_FALSE); aChildList.AppendElement(mBrowse); @@ -161,8 +161,8 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, } nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value)) { - mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_FALSE); + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value)) { + mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_FALSE); } return NS_OK; @@ -458,7 +458,7 @@ nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame* // It's an input, is it a text input? nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value)) { if (value.EqualsIgnoreCase("text")) { result = (nsNewFrame*)childFrame; } @@ -555,8 +555,8 @@ nsFileControlFrame::AttributeChanged(nsIPresContext* aPresContext, } } else if (nsHTMLAtoms::size == aAttribute) { nsString value; - if (nsnull != mTextContent && NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value)) { - mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_TRUE); + if (nsnull != mTextContent && NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value)) { + mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_TRUE); if (aHint != NS_STYLE_HINT_REFLOW) { nsFormFrame::StyleChangeReflow(aPresContext, this); } diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index c6337bb88dd..a799515641a 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -550,7 +550,7 @@ nsFormControlFrame::RegUnRegAccessKey(nsIPresContext* aPresContext, nsIFrame * a PRInt32 nameSpaceID; content->GetNameSpaceID(nameSpaceID); nsAutoString resultValue; - rv = content->GetAttribute(nameSpaceID, nsHTMLAtoms::accesskey, accessKey); + rv = content->GetAttr(nameSpaceID, nsHTMLAtoms::accesskey, accessKey); #else nsCOMPtr inputElement(do_QueryInterface(content)); if (inputElement) { diff --git a/layout/forms/nsFormControlHelper.cpp b/layout/forms/nsFormControlHelper.cpp index fc9b42c0a0e..e06bb6f56f6 100644 --- a/layout/forms/nsFormControlHelper.cpp +++ b/layout/forms/nsFormControlHelper.cpp @@ -434,7 +434,7 @@ nsFormControlHelper::CalculateSize (nsIPresContext* aPresContext, nsAutoString valAttr; nsresult valStatus = NS_CONTENT_ATTR_NOT_THERE; if (nsnull != aSpec.mColValueAttr) { - valStatus = hContent->GetAttribute(kNameSpaceID_HTML, aSpec.mColValueAttr, valAttr); + valStatus = hContent->GetAttr(kNameSpaceID_HTML, aSpec.mColValueAttr, valAttr); } nsHTMLValue colAttr; nsresult colStatus = NS_CONTENT_ATTR_NOT_THERE; diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp index a3159d21263..72bc54f51f4 100644 --- a/layout/forms/nsGfxButtonControlFrame.cpp +++ b/layout/forms/nsGfxButtonControlFrame.cpp @@ -180,7 +180,7 @@ nsGfxButtonControlFrame::IsBrowse(PRInt32 type) // It's an input, is it a file input? nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == parentContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == parentContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value)) { if (value.EqualsIgnoreCase("file")) { rv = PR_TRUE; } @@ -547,7 +547,7 @@ nsGfxButtonControlFrame::AttributeChanged(nsIPresContext* aPresContext, if (nsHTMLAtoms::value == aAttribute) { nsAutoString value; if (mTextContent && mContent) { - if (NS_CONTENT_ATTR_HAS_VALUE != mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE != mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value)) { value.SetLength(0); } rv = mTextContent->SetText(value.get(), value.Length(), PR_TRUE); @@ -723,7 +723,7 @@ nsGfxButtonControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** NS_ERROR_UNEXPECTED); nsAutoString defaultStateString; if (!mDefaultValueWasChanged) { - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, defaultStateString); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, defaultStateString); } if (mDefaultValueWasChanged || !stateString.Equals(defaultStateString)) { diff --git a/layout/forms/nsGfxCheckboxControlFrame.cpp b/layout/forms/nsGfxCheckboxControlFrame.cpp index 331c9c9c129..191d0945ca6 100644 --- a/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -134,13 +134,13 @@ nsGfxCheckboxControlFrame::Init(nsIPresContext* aPresContext, // we've been running for a while, so more code is in AttributeChanged() to pick // that up. Regardless, we need this check when initializing. nsAutoString value; - nsresult res = mContent->GetAttribute ( kNameSpaceID_None, GetTristateAtom(), value ); + nsresult res = mContent->GetAttr ( kNameSpaceID_None, GetTristateAtom(), value ); if ( res == NS_CONTENT_ATTR_HAS_VALUE ) mIsTristate = PR_TRUE; // give the attribute a default value so it's always present, if we're a tristate if ( IsTristateCheckbox() ) - mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), NS_ConvertASCIItoUCS2("0"), PR_FALSE ); + mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), NS_ConvertASCIItoUCS2("0"), PR_FALSE ); return NS_OK; } @@ -239,7 +239,7 @@ nsGfxCheckboxControlFrame::AttributeChanged(nsIPresContext* aPresContext, { if ( aAttribute == GetTristateAtom() ) { nsAutoString value; - nsresult res = mContent->GetAttribute ( kNameSpaceID_None, GetTristateAtom(), value ); + nsresult res = mContent->GetAttr ( kNameSpaceID_None, GetTristateAtom(), value ); PRBool isNowTristate = (res == NS_CONTENT_ATTR_HAS_VALUE); if ( isNowTristate != mIsTristate ) SwitchModesWithEmergencyBrake(aPresContext, isNowTristate); @@ -248,7 +248,7 @@ nsGfxCheckboxControlFrame::AttributeChanged(nsIPresContext* aPresContext, // ignore this change if we're not a tri-state checkbox if ( IsTristateCheckbox() ) { nsAutoString value; - nsresult res = mContent->GetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value ); + nsresult res = mContent->GetAttr ( kNameSpaceID_None, GetTristateValueAtom(), value ); if ( res == NS_CONTENT_ATTR_HAS_VALUE ) SetCheckboxControlFrameState(aPresContext, value); } @@ -597,7 +597,7 @@ nsGfxCheckboxControlFrame::SwitchModesWithEmergencyBrake ( nsIPresContext* aPres // our parallel attribute. nsAutoString value; CheckStateToString ( GetCheckboxState(), value ); - mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); + mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); } else { // we were a tri-state checkbox, and now we're a normal checkbox. The current @@ -606,7 +606,7 @@ nsGfxCheckboxControlFrame::SwitchModesWithEmergencyBrake ( nsIPresContext* aPres // parallel attribute so that we're nice and HTML4 compliant. if ( GetCheckboxState() == eMixed ) SetCheckboxState(aPresContext, eOn); - mContent->UnsetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), PR_FALSE ); + mContent->UnsetAttr ( kNameSpaceID_None, GetTristateValueAtom(), PR_FALSE ); } // switch! diff --git a/layout/forms/nsGfxRadioControlFrame.cpp b/layout/forms/nsGfxRadioControlFrame.cpp index c0dea745876..d682b2a570c 100644 --- a/layout/forms/nsGfxRadioControlFrame.cpp +++ b/layout/forms/nsGfxRadioControlFrame.cpp @@ -203,9 +203,9 @@ nsGfxRadioControlFrame::SetChecked(nsIPresContext* aPresContext, PRBool aValue, { if (aSetInitialValue) { if (aValue) { - mContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("1"), PR_FALSE); // XXX should be "empty" value + mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("1"), PR_FALSE); // XXX should be "empty" value } else { - mContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("0"), PR_FALSE); + mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("0"), PR_FALSE); } } diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 68fb617b164..0d4023a1aac 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -330,7 +330,7 @@ nsHTMLButtonControlFrame::IsSubmit(nsIPresContext* aPresContext, PRInt32 type) // and oif it wasn't explicitly then we we allow to be a submit if (NS_FORM_BUTTON_BUTTON == type) { nsAutoString type; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type)) { return PR_FALSE; } else { return PR_TRUE; @@ -810,7 +810,7 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::SetProperty(nsIPresContext* aPresContext if (nsHTMLAtoms::value == aName) { nsCOMPtr formControl(do_QueryInterface(mContent)); if (formControl) { - return formControl->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, aValue, PR_TRUE); + return formControl->SetAttr(kNameSpaceID_None, nsHTMLAtoms::value, aValue, PR_TRUE); } } return NS_OK; @@ -821,7 +821,7 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::GetProperty(nsIAtom* aName, nsAWritableS if (nsHTMLAtoms::value == aName) { nsCOMPtr formControl(do_QueryInterface(mContent)); if (formControl) { - formControl->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, aValue); + formControl->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, aValue); } } return NS_OK; diff --git a/layout/forms/nsIsIndexFrame.cpp b/layout/forms/nsIsIndexFrame.cpp index 1c2788a0c90..799c9554a9b 100644 --- a/layout/forms/nsIsIndexFrame.cpp +++ b/layout/forms/nsIsIndexFrame.cpp @@ -255,7 +255,7 @@ nsIsIndexFrame::CreateAnonymousContent(nsIPresContext* aPresContext, result = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mInputContent); if (NS_SUCCEEDED(result)) { - mInputContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE); + mInputContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE); aChildList.AppendElement(mInputContent); // Register as an event listener to submit on Enter press diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index c180cc95b2e..a2782052e96 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -1251,7 +1251,7 @@ void nsListControlFrame::DisplaySelected(nsIContent* aContent) { // ignore return value, not much we can do if it fails - aContent->SetAttribute(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, nsAutoString(), mIsAllFramesHere); + aContent->SetAttr(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, nsAutoString(), mIsAllFramesHere); } //--------------------------------------------------------- @@ -1259,7 +1259,7 @@ void nsListControlFrame::DisplayDeselected(nsIContent* aContent) { // ignore return value, not much we can do if it fails - aContent->UnsetAttribute(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, mIsAllFramesHere); + aContent->UnsetAttr(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, mIsAllFramesHere); } @@ -1970,7 +1970,7 @@ nsListControlFrame::IsContentSelected(nsIContent* aContent) { nsString value; //nsIAtom * selectedAtom = NS_NewAtom("selected"); - nsresult result = aContent->GetAttribute(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, value); + nsresult result = aContent->GetAttr(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, value); return (NS_CONTENT_ATTR_NOT_THERE == result ? PR_FALSE : PR_TRUE); } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 3a7cf1e69c0..316346ea06d 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1100,7 +1100,7 @@ nsFrame::HandlePress(nsIPresContext* aPresContext, // Fix for bug #53326: Make sure we bail only // in the presence of an href with a value! nsAutoString href; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, href)) {// fix for bug #55921 nsIView *dummyView = 0; nsRect frameRect = mRect; diff --git a/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index fa13e494dd2..e54c112b577 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/layout/generic/nsFrameFrame.cpp @@ -614,7 +614,7 @@ nsHTMLFrameInnerFrame::~nsHTMLFrameInnerFrame() PRBool nsHTMLFrameInnerFrame::GetURL(nsIContent* aContent, nsString& aResult) { aResult.SetLength(0); - if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::src, aResult))) { + if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, aResult))) { if (aResult.Length() > 0) { return PR_TRUE; } @@ -627,7 +627,7 @@ PRBool nsHTMLFrameInnerFrame::GetName(nsIContent* aContent, nsString& aResult) { aResult.SetLength(0); - if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, aResult))) { + if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, aResult))) { if (aResult.Length() > 0) { return PR_TRUE; } @@ -978,7 +978,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext, PRBool isContent; isContent = PR_FALSE; - if (NS_SUCCEEDED(parentContent->GetAttribute(kNameSpaceID_None, + if (NS_SUCCEEDED(parentContent->GetAttr(kNameSpaceID_None, typeAtom, value))) { // we accept "content" and "content-xxx" values. diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 22d9be6c4b8..7890254a477 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -411,22 +411,22 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, nsCOMPtr content; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::orient, - NS_LITERAL_STRING("horizontal"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::orient, + NS_LITERAL_STRING("horizontal"), PR_FALSE); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_LITERAL_STRING("true"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_LITERAL_STRING("true"), PR_FALSE); aAnonymousChildren.AppendElement(content); // create vertical scrollbar content = nsnull; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::orient, - NS_LITERAL_STRING("vertical"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::orient, + NS_LITERAL_STRING("vertical"), PR_FALSE); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_LITERAL_STRING("true"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_LITERAL_STRING("true"), PR_FALSE); aAnonymousChildren.AppendElement(content); @@ -879,7 +879,7 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument, nscoord y = 0; nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == hcontent->GetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == hcontent->GetAttr(kNameSpaceID_None, nsXULAtoms::curpos, value)) { PRInt32 error; @@ -887,7 +887,7 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument, x = value.ToInteger(&error); } - if (NS_CONTENT_ATTR_HAS_VALUE == vcontent->GetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == vcontent->GetAttr(kNameSpaceID_None, nsXULAtoms::curpos, value)) { PRInt32 error; @@ -1420,7 +1420,7 @@ nsGfxScrollFrameInner::SetAttribute(nsIBox* aBox, nsIAtom* aAtom, nscoord aSize, frame->GetContent(getter_AddRefs(content)); nsAutoString newValue; newValue.AppendInt(aSize); - content->SetAttribute(kNameSpaceID_None, aAtom, newValue, aReflow); + content->SetAttr(kNameSpaceID_None, aAtom, newValue, aReflow); return PR_TRUE; } @@ -1475,16 +1475,16 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisibl nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, value)) old = PR_FALSE; if (aVisible == old) return; if (!aVisible) - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE); else - content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE); nsCOMPtr scrollbar(do_QueryInterface(aScrollbar)); if (scrollbar) { @@ -1508,7 +1508,7 @@ nsGfxScrollFrameInner::GetIntegerAttribute(nsIBox* aBox, nsIAtom* atom, PRInt32 frame->GetContent(getter_AddRefs(content)); nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, atom, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, atom, value)) { PRInt32 error; diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index f2498c927f1..984fc8da1bd 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -225,7 +225,7 @@ nsImageFrame::Init(nsIPresContext* aPresContext, // See if we have a SRC attribute nsAutoString src; nsresult ca; - ca = mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src); + ca = mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, src); if ((NS_CONTENT_ATTR_HAS_VALUE != ca) || (src.Length() == 0)) { // Let's see if this is an object tag and we have a DATA attribute @@ -233,14 +233,14 @@ nsImageFrame::Init(nsIPresContext* aPresContext, mContent->GetTag(tag); if(tag == nsHTMLAtoms::object) - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, src); NS_IF_RELEASE(tag); } nsAutoString lowSrc; nsresult lowSrcResult; - lowSrcResult = mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::lowsrc, lowSrc); + lowSrcResult = mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::lowsrc, lowSrc); // Set the image loader's source URL and base URL if (NS_CONTENT_ATTR_HAS_VALUE == lowSrcResult && !lowSrc.IsEmpty()) { @@ -526,7 +526,7 @@ NS_IMETHODIMP nsImageFrame::OnStopDecode(imgIRequest *aRequest, nsIPresContext * if (imageFailedToLoad && presShell) { if (mFailureReplace) { nsAutoString usemap; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); // We failed to load the image. Notify the pres shell if we aren't an image map if (usemap.IsEmpty()) { presShell->CantRenderReplacedElement(aPresContext, this); @@ -928,7 +928,7 @@ nsImageFrame::DisplayAltFeedback(nsIPresContext* aPresContext, // If there's still room, display the alt-text if (!inner.IsEmpty()) { nsAutoString altText; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::alt, altText)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::alt, altText)) { DisplayAltText(aPresContext, aRenderingContext, altText, inner); } } @@ -1072,7 +1072,7 @@ nsImageFrame::GetImageMap(nsIPresContext* aPresContext) } nsAutoString usemap; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); nsCOMPtr map; if (NS_SUCCEEDED(nsImageMapUtils::FindImageMap(doc,usemap,getter_AddRefs(map))) && map) { @@ -1142,7 +1142,7 @@ nsImageFrame::IsServerImageMap() { nsAutoString ismap; return NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::ismap, ismap); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::ismap, ismap); } PRIntn @@ -1150,7 +1150,7 @@ nsImageFrame::GetSuppress() { nsAutoString s; if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::suppress, s)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::suppress, s)) { if (s.EqualsIgnoreCase("true")) { return SUPPRESS; } else if (s.EqualsIgnoreCase("false")) { @@ -1375,7 +1375,7 @@ nsImageFrame::AttributeChanged(nsIPresContext* aPresContext, } if (nsHTMLAtoms::src == aAttribute) { nsAutoString newSRC; - aChild->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::src, newSRC); + aChild->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, newSRC); PRUint32 loadStatus = imgIRequest::STATUS_ERROR; diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp index 5614bd824f5..00419ee7962 100644 --- a/layout/generic/nsImageMap.cpp +++ b/layout/generic/nsImageMap.cpp @@ -106,7 +106,7 @@ Area::GetHREF(nsString& aHref) const { aHref.Truncate(); if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, aHref); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, aHref); } } @@ -115,7 +115,7 @@ Area::GetTarget(nsString& aTarget) const { aTarget.Truncate(); if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::target, aTarget); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::target, aTarget); } } @@ -124,7 +124,7 @@ Area::GetAltText(nsString& aAltText) const { aAltText.Truncate(); if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); } } @@ -328,9 +328,9 @@ void Area::ToHTML(nsString& aResult) nsAutoString href, target, altText; if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href); - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::target, target); - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, altText); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, href); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::target, target); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::alt, altText); } aResult.Truncate(); @@ -897,9 +897,9 @@ nsresult nsImageMap::AddArea(nsIContent* aArea) { nsAutoString shape, coords, baseURL, noHref; - aArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::shape, shape); - aArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::coords, coords); - PRBool hasURL = (PRBool)(NS_CONTENT_ATTR_HAS_VALUE != aArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::nohref, noHref)); + aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::shape, shape); + aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::coords, coords); + PRBool hasURL = (PRBool)(NS_CONTENT_ATTR_HAS_VALUE != aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::nohref, noHref)); PRBool suppress = PR_FALSE;/* XXX */ //Add focus listener to track area focus changes diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 22d42fa3b6e..242b165517f 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -367,7 +367,7 @@ void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage) return; nsAutoString type; - nsresult rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + nsresult rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (type.Length() > 0)) { // should be really call to imlib @@ -386,13 +386,13 @@ void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage) } nsAutoString data; - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, data); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, data); PRBool havedata = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0); if(!havedata) {// try it once more for SRC attrubute - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, data); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, data); havedata = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0); } @@ -432,7 +432,7 @@ void nsObjectFrame::IsSupportedDocument(nsIContent* aContent, PRBool* aDoc) if (NS_FAILED(rv)) return; nsAutoString type; - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (type.Length() > 0)) { nsXPIDLCString value; @@ -447,7 +447,7 @@ void nsObjectFrame::IsSupportedDocument(nsIContent* aContent, PRBool* aDoc) // if we don't have a TYPE= try getting the mime-type via the DATA= url nsAutoString data; - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, data); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, data); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0)) { nsCOMPtr uri; @@ -542,9 +542,9 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, // fix up DATA= to SRC= nsAutoString url; if (NS_CONTENT_ATTR_HAS_VALUE != - aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, url)) + aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, url)) return rv; // if DATA= is empty, what shall we do? bail for now... - aContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, url, PR_FALSE); + aContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, url, PR_FALSE); nsCOMPtr shell; aPresContext->GetShell(getter_AddRefs(shell)); @@ -853,7 +853,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, // if we have a clsid, we're either an internal widget, an ActiveX control, or an applet mContent->GetNameSpaceID(nameSpaceID); - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(nameSpaceID, nsHTMLAtoms::classid, classid)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(nameSpaceID, nsHTMLAtoms::classid, classid)) { PRBool bJavaObject = PR_FALSE; PRBool bJavaPluginClsid = PR_FALSE; @@ -874,7 +874,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, nsAutoString codeBase; if ((NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) && + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) && !bJavaPluginClsid) { nsCOMPtr codeBaseURL; rv = NS_NewURI(getter_AddRefs(codeBaseURL), codeBase, baseURL); @@ -912,7 +912,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, // if we have a codebase, add it to the fullURL nsAutoString codeBase; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { nsCOMPtr codeBaseURL; rv = NS_NewURI(getter_AddRefs(fullURL), codeBase, baseURL); if (NS_SUCCEEDED(rv)) { @@ -957,9 +957,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, nsCOMPtr tag; mContent->GetTag(*getter_AddRefs(tag)); if (tag.get() == nsHTMLAtoms::applet) { - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::code, src)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::code, src)) { nsAutoString codeBase; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { nsCOMPtr codeBaseURL; rv = NS_NewURI(getter_AddRefs(codeBaseURL), codeBase, baseURL); if(rv == NS_OK) { @@ -975,14 +975,14 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, } else { // traditional plugin nsXPIDLCString mimeTypeStr; nsAutoString type; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if (type.Length()) { mimeTypeStr.Adopt(ToNewCString(type)); } //stream in the object source if there is one... if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) { // Create an absolute URL rv = NS_NewURI(getter_AddRefs(fullURL), src, baseURL); if (NS_FAILED(rv)) { @@ -993,7 +993,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, } } else if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, src)) { // Create an absolute URL rv = NS_NewURI(getter_AddRefs(fullURL), src, baseURL); if (NS_FAILED(rv)) { @@ -1362,7 +1362,7 @@ nsObjectFrame::IsHidden() const // The tag doesn't support the 'hidden' attribute, but // everything else does... nsAutoString hidden; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); // Yes, these are really the kooky ways that you could tell 4.x // not to hide the once you'd put the 'hidden' attribute @@ -1841,7 +1841,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetAttributes(PRUint16& n, if (NS_SUCCEEDED(rv)) { PRInt32 count; - if (NS_SUCCEEDED(iContent->GetAttributeCount(count))) { + if (NS_SUCCEEDED(iContent->GetAttrCount(count))) { PRInt32 index; mAttrNames = (char **)PR_Calloc(sizeof(char *) * count, 1); mAttrVals = (char **)PR_Calloc(sizeof(char *) * count, 1); @@ -1852,12 +1852,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetAttributes(PRUint16& n, PRInt32 nameSpaceID; nsCOMPtr atom; nsCOMPtr prefix; - iContent->GetAttributeNameAt(index, nameSpaceID, - *getter_AddRefs(atom), - *getter_AddRefs(prefix)); + iContent->GetAttrNameAt(index, nameSpaceID, + *getter_AddRefs(atom), + *getter_AddRefs(prefix)); nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == - iContent->GetAttribute(nameSpaceID, atom, value)) { + iContent->GetAttr(nameSpaceID, atom, value)) { nsAutoString name; atom->ToString(name); @@ -2364,8 +2364,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetParameters(PRUint16& n, const char*const //add param to list... - if ((NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, name)) && - (NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, val))) + if ((NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, name)) && + (NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::value, val))) { /* Changing to ToNewUTF8String addressing 17169, 39789 diff --git a/layout/generic/nsSpacerFrame.cpp b/layout/generic/nsSpacerFrame.cpp index 0fead047d08..fad5f8e2183 100644 --- a/layout/generic/nsSpacerFrame.cpp +++ b/layout/generic/nsSpacerFrame.cpp @@ -160,7 +160,7 @@ SpacerFrame::GetType() PRUint8 type = TYPE_WORD; nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, value)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, value)) { if (value.EqualsIgnoreCase("line") || value.EqualsIgnoreCase("vert") || value.EqualsIgnoreCase("vertical")) { diff --git a/layout/html/base/src/nsFrame.cpp b/layout/html/base/src/nsFrame.cpp index 3a7cf1e69c0..316346ea06d 100644 --- a/layout/html/base/src/nsFrame.cpp +++ b/layout/html/base/src/nsFrame.cpp @@ -1100,7 +1100,7 @@ nsFrame::HandlePress(nsIPresContext* aPresContext, // Fix for bug #53326: Make sure we bail only // in the presence of an href with a value! nsAutoString href; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, href)) {// fix for bug #55921 nsIView *dummyView = 0; nsRect frameRect = mRect; diff --git a/layout/html/base/src/nsFrameManager.cpp b/layout/html/base/src/nsFrameManager.cpp index 26a7708071f..ef4c20d16ed 100644 --- a/layout/html/base/src/nsFrameManager.cpp +++ b/layout/html/base/src/nsFrameManager.cpp @@ -2346,7 +2346,7 @@ FrameManager::GenerateStateKey(nsIContent* aContent, KeyAppendAtom(tag, aKey); nsAutoString name; - aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, name); + aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, name); KeyAppendString(name, aKey); } diff --git a/layout/html/base/src/nsGfxScrollFrame.cpp b/layout/html/base/src/nsGfxScrollFrame.cpp index 22d9be6c4b8..7890254a477 100644 --- a/layout/html/base/src/nsGfxScrollFrame.cpp +++ b/layout/html/base/src/nsGfxScrollFrame.cpp @@ -411,22 +411,22 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext, nsCOMPtr content; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::orient, - NS_LITERAL_STRING("horizontal"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::orient, + NS_LITERAL_STRING("horizontal"), PR_FALSE); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_LITERAL_STRING("true"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_LITERAL_STRING("true"), PR_FALSE); aAnonymousChildren.AppendElement(content); // create vertical scrollbar content = nsnull; elementFactory->CreateInstanceByTag(nodeInfo, getter_AddRefs(content)); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::orient, - NS_LITERAL_STRING("vertical"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::orient, + NS_LITERAL_STRING("vertical"), PR_FALSE); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_LITERAL_STRING("true"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_LITERAL_STRING("true"), PR_FALSE); aAnonymousChildren.AppendElement(content); @@ -879,7 +879,7 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument, nscoord y = 0; nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == hcontent->GetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == hcontent->GetAttr(kNameSpaceID_None, nsXULAtoms::curpos, value)) { PRInt32 error; @@ -887,7 +887,7 @@ nsGfxScrollFrameInner::AttributeChanged(nsIDocument *aDocument, x = value.ToInteger(&error); } - if (NS_CONTENT_ATTR_HAS_VALUE == vcontent->GetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == vcontent->GetAttr(kNameSpaceID_None, nsXULAtoms::curpos, value)) { PRInt32 error; @@ -1420,7 +1420,7 @@ nsGfxScrollFrameInner::SetAttribute(nsIBox* aBox, nsIAtom* aAtom, nscoord aSize, frame->GetContent(getter_AddRefs(content)); nsAutoString newValue; newValue.AppendInt(aSize); - content->SetAttribute(kNameSpaceID_None, aAtom, newValue, aReflow); + content->SetAttr(kNameSpaceID_None, aAtom, newValue, aReflow); return PR_TRUE; } @@ -1475,16 +1475,16 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisibl nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, value)) old = PR_FALSE; if (aVisible == old) return; if (!aVisible) - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE); else - content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE); nsCOMPtr scrollbar(do_QueryInterface(aScrollbar)); if (scrollbar) { @@ -1508,7 +1508,7 @@ nsGfxScrollFrameInner::GetIntegerAttribute(nsIBox* aBox, nsIAtom* atom, PRInt32 frame->GetContent(getter_AddRefs(content)); nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, atom, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, atom, value)) { PRInt32 error; diff --git a/layout/html/base/src/nsImageFrame.cpp b/layout/html/base/src/nsImageFrame.cpp index f2498c927f1..984fc8da1bd 100644 --- a/layout/html/base/src/nsImageFrame.cpp +++ b/layout/html/base/src/nsImageFrame.cpp @@ -225,7 +225,7 @@ nsImageFrame::Init(nsIPresContext* aPresContext, // See if we have a SRC attribute nsAutoString src; nsresult ca; - ca = mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src); + ca = mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, src); if ((NS_CONTENT_ATTR_HAS_VALUE != ca) || (src.Length() == 0)) { // Let's see if this is an object tag and we have a DATA attribute @@ -233,14 +233,14 @@ nsImageFrame::Init(nsIPresContext* aPresContext, mContent->GetTag(tag); if(tag == nsHTMLAtoms::object) - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, src); NS_IF_RELEASE(tag); } nsAutoString lowSrc; nsresult lowSrcResult; - lowSrcResult = mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::lowsrc, lowSrc); + lowSrcResult = mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::lowsrc, lowSrc); // Set the image loader's source URL and base URL if (NS_CONTENT_ATTR_HAS_VALUE == lowSrcResult && !lowSrc.IsEmpty()) { @@ -526,7 +526,7 @@ NS_IMETHODIMP nsImageFrame::OnStopDecode(imgIRequest *aRequest, nsIPresContext * if (imageFailedToLoad && presShell) { if (mFailureReplace) { nsAutoString usemap; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); // We failed to load the image. Notify the pres shell if we aren't an image map if (usemap.IsEmpty()) { presShell->CantRenderReplacedElement(aPresContext, this); @@ -928,7 +928,7 @@ nsImageFrame::DisplayAltFeedback(nsIPresContext* aPresContext, // If there's still room, display the alt-text if (!inner.IsEmpty()) { nsAutoString altText; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::alt, altText)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::alt, altText)) { DisplayAltText(aPresContext, aRenderingContext, altText, inner); } } @@ -1072,7 +1072,7 @@ nsImageFrame::GetImageMap(nsIPresContext* aPresContext) } nsAutoString usemap; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::usemap, usemap); nsCOMPtr map; if (NS_SUCCEEDED(nsImageMapUtils::FindImageMap(doc,usemap,getter_AddRefs(map))) && map) { @@ -1142,7 +1142,7 @@ nsImageFrame::IsServerImageMap() { nsAutoString ismap; return NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::ismap, ismap); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::ismap, ismap); } PRIntn @@ -1150,7 +1150,7 @@ nsImageFrame::GetSuppress() { nsAutoString s; if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::suppress, s)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::suppress, s)) { if (s.EqualsIgnoreCase("true")) { return SUPPRESS; } else if (s.EqualsIgnoreCase("false")) { @@ -1375,7 +1375,7 @@ nsImageFrame::AttributeChanged(nsIPresContext* aPresContext, } if (nsHTMLAtoms::src == aAttribute) { nsAutoString newSRC; - aChild->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::src, newSRC); + aChild->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, newSRC); PRUint32 loadStatus = imgIRequest::STATUS_ERROR; diff --git a/layout/html/base/src/nsImageMap.cpp b/layout/html/base/src/nsImageMap.cpp index 5614bd824f5..00419ee7962 100644 --- a/layout/html/base/src/nsImageMap.cpp +++ b/layout/html/base/src/nsImageMap.cpp @@ -106,7 +106,7 @@ Area::GetHREF(nsString& aHref) const { aHref.Truncate(); if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, aHref); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, aHref); } } @@ -115,7 +115,7 @@ Area::GetTarget(nsString& aTarget) const { aTarget.Truncate(); if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::target, aTarget); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::target, aTarget); } } @@ -124,7 +124,7 @@ Area::GetAltText(nsString& aAltText) const { aAltText.Truncate(); if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); } } @@ -328,9 +328,9 @@ void Area::ToHTML(nsString& aResult) nsAutoString href, target, altText; if (mArea) { - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href); - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::target, target); - mArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, altText); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, href); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::target, target); + mArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::alt, altText); } aResult.Truncate(); @@ -897,9 +897,9 @@ nsresult nsImageMap::AddArea(nsIContent* aArea) { nsAutoString shape, coords, baseURL, noHref; - aArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::shape, shape); - aArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::coords, coords); - PRBool hasURL = (PRBool)(NS_CONTENT_ATTR_HAS_VALUE != aArea->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::nohref, noHref)); + aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::shape, shape); + aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::coords, coords); + PRBool hasURL = (PRBool)(NS_CONTENT_ATTR_HAS_VALUE != aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::nohref, noHref)); PRBool suppress = PR_FALSE;/* XXX */ //Add focus listener to track area focus changes diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 22d42fa3b6e..242b165517f 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -367,7 +367,7 @@ void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage) return; nsAutoString type; - nsresult rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + nsresult rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (type.Length() > 0)) { // should be really call to imlib @@ -386,13 +386,13 @@ void nsObjectFrame::IsSupportedImage(nsIContent* aContent, PRBool* aImage) } nsAutoString data; - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, data); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, data); PRBool havedata = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0); if(!havedata) {// try it once more for SRC attrubute - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, data); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, data); havedata = (rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0); } @@ -432,7 +432,7 @@ void nsObjectFrame::IsSupportedDocument(nsIContent* aContent, PRBool* aDoc) if (NS_FAILED(rv)) return; nsAutoString type; - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (type.Length() > 0)) { nsXPIDLCString value; @@ -447,7 +447,7 @@ void nsObjectFrame::IsSupportedDocument(nsIContent* aContent, PRBool* aDoc) // if we don't have a TYPE= try getting the mime-type via the DATA= url nsAutoString data; - rv = aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, data); + rv = aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, data); if((rv == NS_CONTENT_ATTR_HAS_VALUE) && (data.Length() > 0)) { nsCOMPtr uri; @@ -542,9 +542,9 @@ nsObjectFrame::Init(nsIPresContext* aPresContext, // fix up DATA= to SRC= nsAutoString url; if (NS_CONTENT_ATTR_HAS_VALUE != - aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, url)) + aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, url)) return rv; // if DATA= is empty, what shall we do? bail for now... - aContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, url, PR_FALSE); + aContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, url, PR_FALSE); nsCOMPtr shell; aPresContext->GetShell(getter_AddRefs(shell)); @@ -853,7 +853,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, // if we have a clsid, we're either an internal widget, an ActiveX control, or an applet mContent->GetNameSpaceID(nameSpaceID); - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(nameSpaceID, nsHTMLAtoms::classid, classid)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(nameSpaceID, nsHTMLAtoms::classid, classid)) { PRBool bJavaObject = PR_FALSE; PRBool bJavaPluginClsid = PR_FALSE; @@ -874,7 +874,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, nsAutoString codeBase; if ((NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) && + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) && !bJavaPluginClsid) { nsCOMPtr codeBaseURL; rv = NS_NewURI(getter_AddRefs(codeBaseURL), codeBase, baseURL); @@ -912,7 +912,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, // if we have a codebase, add it to the fullURL nsAutoString codeBase; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { nsCOMPtr codeBaseURL; rv = NS_NewURI(getter_AddRefs(fullURL), codeBase, baseURL); if (NS_SUCCEEDED(rv)) { @@ -957,9 +957,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, nsCOMPtr tag; mContent->GetTag(*getter_AddRefs(tag)); if (tag.get() == nsHTMLAtoms::applet) { - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::code, src)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::code, src)) { nsAutoString codeBase; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::codebase, codeBase)) { nsCOMPtr codeBaseURL; rv = NS_NewURI(getter_AddRefs(codeBaseURL), codeBase, baseURL); if(rv == NS_OK) { @@ -975,14 +975,14 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, } else { // traditional plugin nsXPIDLCString mimeTypeStr; nsAutoString type; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type); if (type.Length()) { mimeTypeStr.Adopt(ToNewCString(type)); } //stream in the object source if there is one... if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::src, src)) { // Create an absolute URL rv = NS_NewURI(getter_AddRefs(fullURL), src, baseURL); if (NS_FAILED(rv)) { @@ -993,7 +993,7 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext, } } else if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::data, src)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::data, src)) { // Create an absolute URL rv = NS_NewURI(getter_AddRefs(fullURL), src, baseURL); if (NS_FAILED(rv)) { @@ -1362,7 +1362,7 @@ nsObjectFrame::IsHidden() const // The tag doesn't support the 'hidden' attribute, but // everything else does... nsAutoString hidden; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::hidden, hidden); // Yes, these are really the kooky ways that you could tell 4.x // not to hide the once you'd put the 'hidden' attribute @@ -1841,7 +1841,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetAttributes(PRUint16& n, if (NS_SUCCEEDED(rv)) { PRInt32 count; - if (NS_SUCCEEDED(iContent->GetAttributeCount(count))) { + if (NS_SUCCEEDED(iContent->GetAttrCount(count))) { PRInt32 index; mAttrNames = (char **)PR_Calloc(sizeof(char *) * count, 1); mAttrVals = (char **)PR_Calloc(sizeof(char *) * count, 1); @@ -1852,12 +1852,12 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetAttributes(PRUint16& n, PRInt32 nameSpaceID; nsCOMPtr atom; nsCOMPtr prefix; - iContent->GetAttributeNameAt(index, nameSpaceID, - *getter_AddRefs(atom), - *getter_AddRefs(prefix)); + iContent->GetAttrNameAt(index, nameSpaceID, + *getter_AddRefs(atom), + *getter_AddRefs(prefix)); nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == - iContent->GetAttribute(nameSpaceID, atom, value)) { + iContent->GetAttr(nameSpaceID, atom, value)) { nsAutoString name; atom->ToString(name); @@ -2364,8 +2364,8 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetParameters(PRUint16& n, const char*const //add param to list... - if ((NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::name, name)) && - (NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, val))) + if ((NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::name, name)) && + (NS_CONTENT_ATTR_HAS_VALUE == kid->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::value, val))) { /* Changing to ToNewUTF8String addressing 17169, 39789 diff --git a/layout/html/base/src/nsPresShell.cpp b/layout/html/base/src/nsPresShell.cpp index 416700335e6..8ad2b9781c5 100644 --- a/layout/html/base/src/nsPresShell.cpp +++ b/layout/html/base/src/nsPresShell.cpp @@ -4830,9 +4830,9 @@ PresShell::HandlePostedAttributeChanges() } if (node->type == eChangeType_Set) - node->content->SetAttribute(node->nameSpaceID, node->name, node->value, node->notify); + node->content->SetAttr(node->nameSpaceID, node->name, node->value, node->notify); else - node->content->UnsetAttribute(node->nameSpaceID, node->name, node->notify); + node->content->UnsetAttr(node->nameSpaceID, node->name, node->notify); NS_RELEASE(node->content); node->nsAttributeChangeRequest::~nsAttributeChangeRequest(); diff --git a/layout/html/base/src/nsSpacerFrame.cpp b/layout/html/base/src/nsSpacerFrame.cpp index 0fead047d08..fad5f8e2183 100644 --- a/layout/html/base/src/nsSpacerFrame.cpp +++ b/layout/html/base/src/nsSpacerFrame.cpp @@ -160,7 +160,7 @@ SpacerFrame::GetType() PRUint8 type = TYPE_WORD; nsAutoString value; if (NS_CONTENT_ATTR_HAS_VALUE == - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, value)) { + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, value)) { if (value.EqualsIgnoreCase("line") || value.EqualsIgnoreCase("vert") || value.EqualsIgnoreCase("vertical")) { diff --git a/layout/html/document/src/nsFrameFrame.cpp b/layout/html/document/src/nsFrameFrame.cpp index fa13e494dd2..e54c112b577 100644 --- a/layout/html/document/src/nsFrameFrame.cpp +++ b/layout/html/document/src/nsFrameFrame.cpp @@ -614,7 +614,7 @@ nsHTMLFrameInnerFrame::~nsHTMLFrameInnerFrame() PRBool nsHTMLFrameInnerFrame::GetURL(nsIContent* aContent, nsString& aResult) { aResult.SetLength(0); - if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::src, aResult))) { + if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, aResult))) { if (aResult.Length() > 0) { return PR_TRUE; } @@ -627,7 +627,7 @@ PRBool nsHTMLFrameInnerFrame::GetName(nsIContent* aContent, nsString& aResult) { aResult.SetLength(0); - if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, aResult))) { + if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, aResult))) { if (aResult.Length() > 0) { return PR_TRUE; } @@ -978,7 +978,7 @@ nsHTMLFrameInnerFrame::CreateDocShell(nsIPresContext* aPresContext, PRBool isContent; isContent = PR_FALSE; - if (NS_SUCCEEDED(parentContent->GetAttribute(kNameSpaceID_None, + if (NS_SUCCEEDED(parentContent->GetAttr(kNameSpaceID_None, typeAtom, value))) { // we accept "content" and "content-xxx" values. diff --git a/layout/html/forms/src/nsButtonFrameRenderer.cpp b/layout/html/forms/src/nsButtonFrameRenderer.cpp index b34f6809960..d5688858a85 100644 --- a/layout/html/forms/src/nsButtonFrameRenderer.cpp +++ b/layout/html/forms/src/nsButtonFrameRenderer.cpp @@ -78,9 +78,9 @@ nsButtonFrameRenderer::SetDisabled(PRBool aDisabled, PRBool notify) mFrame->GetContent(getter_AddRefs(content)); if (aDisabled) - content->SetAttribute(mNameSpace, nsHTMLAtoms::disabled, nsAutoString(), notify); + content->SetAttr(mNameSpace, nsHTMLAtoms::disabled, nsAutoString(), notify); else - content->UnsetAttribute(mNameSpace, nsHTMLAtoms::disabled, notify); + content->UnsetAttr(mNameSpace, nsHTMLAtoms::disabled, notify); } @@ -91,7 +91,7 @@ nsButtonFrameRenderer::isDisabled() nsCOMPtr content; mFrame->GetContent(getter_AddRefs(content)); nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(mNameSpace, nsHTMLAtoms::disabled, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(mNameSpace, nsHTMLAtoms::disabled, value)) return PR_TRUE; return PR_FALSE; diff --git a/layout/html/forms/src/nsComboboxControlFrame.cpp b/layout/html/forms/src/nsComboboxControlFrame.cpp index 11a03b6e62b..06ea9cd5cf9 100644 --- a/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -2337,7 +2337,7 @@ nsComboboxControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, eventReceiver->AddEventListenerByIID(mButtonListener, NS_GET_IID(nsIDOMMouseListener)); } - btnContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE); + btnContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("button"), PR_FALSE); aChildList.AppendElement(btnContent); } } diff --git a/layout/html/forms/src/nsFileControlFrame.cpp b/layout/html/forms/src/nsFileControlFrame.cpp index 1b38d9c0520..946c53dae57 100644 --- a/layout/html/forms/src/nsFileControlFrame.cpp +++ b/layout/html/forms/src/nsFileControlFrame.cpp @@ -133,7 +133,7 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, rv = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mTextContent); if (NS_SUCCEEDED(rv)) { - mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE); + mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("text"), PR_FALSE); if (nsFormFrame::GetDisabled(this)) { nsCOMPtr textControl = do_QueryInterface(mTextContent); if (textControl) { @@ -150,8 +150,8 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, mBrowse = do_QueryInterface(content,&rv); if (NS_SUCCEEDED(rv)) { - mBrowse->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE); - //browse->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, nsAutoString("browse..."), PR_FALSE); + mBrowse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_LITERAL_STRING("button"), PR_FALSE); + //browse->SetAttr(kNameSpaceID_None, nsHTMLAtoms::value, nsAutoString("browse..."), PR_FALSE); aChildList.AppendElement(mBrowse); @@ -161,8 +161,8 @@ nsFileControlFrame::CreateAnonymousContent(nsIPresContext* aPresContext, } nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value)) { - mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_FALSE); + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value)) { + mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_FALSE); } return NS_OK; @@ -458,7 +458,7 @@ nsFileControlFrame::GetTextControlFrame(nsIPresContext* aPresContext, nsIFrame* // It's an input, is it a text input? nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value)) { if (value.EqualsIgnoreCase("text")) { result = (nsNewFrame*)childFrame; } @@ -555,8 +555,8 @@ nsFileControlFrame::AttributeChanged(nsIPresContext* aPresContext, } } else if (nsHTMLAtoms::size == aAttribute) { nsString value; - if (nsnull != mTextContent && NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value)) { - mTextContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_TRUE); + if (nsnull != mTextContent && NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value)) { + mTextContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::size, value, PR_TRUE); if (aHint != NS_STYLE_HINT_REFLOW) { nsFormFrame::StyleChangeReflow(aPresContext, this); } diff --git a/layout/html/forms/src/nsFormControlFrame.cpp b/layout/html/forms/src/nsFormControlFrame.cpp index c6337bb88dd..a799515641a 100644 --- a/layout/html/forms/src/nsFormControlFrame.cpp +++ b/layout/html/forms/src/nsFormControlFrame.cpp @@ -550,7 +550,7 @@ nsFormControlFrame::RegUnRegAccessKey(nsIPresContext* aPresContext, nsIFrame * a PRInt32 nameSpaceID; content->GetNameSpaceID(nameSpaceID); nsAutoString resultValue; - rv = content->GetAttribute(nameSpaceID, nsHTMLAtoms::accesskey, accessKey); + rv = content->GetAttr(nameSpaceID, nsHTMLAtoms::accesskey, accessKey); #else nsCOMPtr inputElement(do_QueryInterface(content)); if (inputElement) { diff --git a/layout/html/forms/src/nsFormControlHelper.cpp b/layout/html/forms/src/nsFormControlHelper.cpp index fc9b42c0a0e..e06bb6f56f6 100644 --- a/layout/html/forms/src/nsFormControlHelper.cpp +++ b/layout/html/forms/src/nsFormControlHelper.cpp @@ -434,7 +434,7 @@ nsFormControlHelper::CalculateSize (nsIPresContext* aPresContext, nsAutoString valAttr; nsresult valStatus = NS_CONTENT_ATTR_NOT_THERE; if (nsnull != aSpec.mColValueAttr) { - valStatus = hContent->GetAttribute(kNameSpaceID_HTML, aSpec.mColValueAttr, valAttr); + valStatus = hContent->GetAttr(kNameSpaceID_HTML, aSpec.mColValueAttr, valAttr); } nsHTMLValue colAttr; nsresult colStatus = NS_CONTENT_ATTR_NOT_THERE; diff --git a/layout/html/forms/src/nsGfxButtonControlFrame.cpp b/layout/html/forms/src/nsGfxButtonControlFrame.cpp index a3159d21263..72bc54f51f4 100644 --- a/layout/html/forms/src/nsGfxButtonControlFrame.cpp +++ b/layout/html/forms/src/nsGfxButtonControlFrame.cpp @@ -180,7 +180,7 @@ nsGfxButtonControlFrame::IsBrowse(PRInt32 type) // It's an input, is it a file input? nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == parentContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == parentContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value)) { if (value.EqualsIgnoreCase("file")) { rv = PR_TRUE; } @@ -547,7 +547,7 @@ nsGfxButtonControlFrame::AttributeChanged(nsIPresContext* aPresContext, if (nsHTMLAtoms::value == aAttribute) { nsAutoString value; if (mTextContent && mContent) { - if (NS_CONTENT_ATTR_HAS_VALUE != mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE != mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value)) { value.SetLength(0); } rv = mTextContent->SetText(value.get(), value.Length(), PR_TRUE); @@ -723,7 +723,7 @@ nsGfxButtonControlFrame::SaveState(nsIPresContext* aPresContext, nsIPresState** NS_ERROR_UNEXPECTED); nsAutoString defaultStateString; if (!mDefaultValueWasChanged) { - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, defaultStateString); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, defaultStateString); } if (mDefaultValueWasChanged || !stateString.Equals(defaultStateString)) { diff --git a/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index 331c9c9c129..191d0945ca6 100644 --- a/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -134,13 +134,13 @@ nsGfxCheckboxControlFrame::Init(nsIPresContext* aPresContext, // we've been running for a while, so more code is in AttributeChanged() to pick // that up. Regardless, we need this check when initializing. nsAutoString value; - nsresult res = mContent->GetAttribute ( kNameSpaceID_None, GetTristateAtom(), value ); + nsresult res = mContent->GetAttr ( kNameSpaceID_None, GetTristateAtom(), value ); if ( res == NS_CONTENT_ATTR_HAS_VALUE ) mIsTristate = PR_TRUE; // give the attribute a default value so it's always present, if we're a tristate if ( IsTristateCheckbox() ) - mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), NS_ConvertASCIItoUCS2("0"), PR_FALSE ); + mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), NS_ConvertASCIItoUCS2("0"), PR_FALSE ); return NS_OK; } @@ -239,7 +239,7 @@ nsGfxCheckboxControlFrame::AttributeChanged(nsIPresContext* aPresContext, { if ( aAttribute == GetTristateAtom() ) { nsAutoString value; - nsresult res = mContent->GetAttribute ( kNameSpaceID_None, GetTristateAtom(), value ); + nsresult res = mContent->GetAttr ( kNameSpaceID_None, GetTristateAtom(), value ); PRBool isNowTristate = (res == NS_CONTENT_ATTR_HAS_VALUE); if ( isNowTristate != mIsTristate ) SwitchModesWithEmergencyBrake(aPresContext, isNowTristate); @@ -248,7 +248,7 @@ nsGfxCheckboxControlFrame::AttributeChanged(nsIPresContext* aPresContext, // ignore this change if we're not a tri-state checkbox if ( IsTristateCheckbox() ) { nsAutoString value; - nsresult res = mContent->GetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value ); + nsresult res = mContent->GetAttr ( kNameSpaceID_None, GetTristateValueAtom(), value ); if ( res == NS_CONTENT_ATTR_HAS_VALUE ) SetCheckboxControlFrameState(aPresContext, value); } @@ -597,7 +597,7 @@ nsGfxCheckboxControlFrame::SwitchModesWithEmergencyBrake ( nsIPresContext* aPres // our parallel attribute. nsAutoString value; CheckStateToString ( GetCheckboxState(), value ); - mContent->SetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); + mContent->SetAttr ( kNameSpaceID_None, GetTristateValueAtom(), value, PR_FALSE ); } else { // we were a tri-state checkbox, and now we're a normal checkbox. The current @@ -606,7 +606,7 @@ nsGfxCheckboxControlFrame::SwitchModesWithEmergencyBrake ( nsIPresContext* aPres // parallel attribute so that we're nice and HTML4 compliant. if ( GetCheckboxState() == eMixed ) SetCheckboxState(aPresContext, eOn); - mContent->UnsetAttribute ( kNameSpaceID_None, GetTristateValueAtom(), PR_FALSE ); + mContent->UnsetAttr ( kNameSpaceID_None, GetTristateValueAtom(), PR_FALSE ); } // switch! diff --git a/layout/html/forms/src/nsGfxRadioControlFrame.cpp b/layout/html/forms/src/nsGfxRadioControlFrame.cpp index c0dea745876..d682b2a570c 100644 --- a/layout/html/forms/src/nsGfxRadioControlFrame.cpp +++ b/layout/html/forms/src/nsGfxRadioControlFrame.cpp @@ -203,9 +203,9 @@ nsGfxRadioControlFrame::SetChecked(nsIPresContext* aPresContext, PRBool aValue, { if (aSetInitialValue) { if (aValue) { - mContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("1"), PR_FALSE); // XXX should be "empty" value + mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("1"), PR_FALSE); // XXX should be "empty" value } else { - mContent->SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("0"), PR_FALSE); + mContent->SetAttr(kNameSpaceID_HTML, nsHTMLAtoms::checked, NS_ConvertASCIItoUCS2("0"), PR_FALSE); } } diff --git a/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/layout/html/forms/src/nsGfxTextControlFrame2.cpp index 8df11a44aa2..758bc1ef422 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -1934,7 +1934,7 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext, // Set the neccessary style attributes on the text control. if (IsSingleLineTextControl()) - rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, NS_ConvertASCIItoUCS2(DIV_STRING_SINGLELINE), PR_FALSE); + rv = divContent->SetAttr(kNameSpaceID_None,nsHTMLAtoms::style, NS_ConvertASCIItoUCS2(DIV_STRING_SINGLELINE), PR_FALSE); else { nsAutoString divStr; divStr.AssignWithConversion(DIV_STRING); const nsStyleDisplay* disp = (const nsStyleDisplay*) @@ -1944,13 +1944,13 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext, else if (disp->mOverflow == NS_STYLE_OVERFLOW_HIDDEN) divStr += NS_LITERAL_STRING("overflow:hidden;"); else divStr += NS_LITERAL_STRING("overflow:auto;"); - rv = divContent->SetAttribute(kNameSpaceID_None,nsHTMLAtoms::style, divStr, PR_FALSE); + rv = divContent->SetAttr(kNameSpaceID_None,nsHTMLAtoms::style, divStr, PR_FALSE); } if (NS_FAILED(rv)) return rv; - // rv = divContent->SetAttribute(kNameSpaceID_None,nsXULAtoms::debug, NS_LITERAL_STRING("true"), PR_FALSE); + // rv = divContent->SetAttr(kNameSpaceID_None,nsXULAtoms::debug, NS_LITERAL_STRING("true"), PR_FALSE); rv = aChildList.AppendElement(divContent); if (NS_FAILED(rv)) @@ -2151,7 +2151,7 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext, // Check if the readonly attribute is set. - rv = mContent->GetAttribute(nameSpaceID, nsHTMLAtoms::readonly, resultValue); + rv = mContent->GetAttr(nameSpaceID, nsHTMLAtoms::readonly, resultValue); if (NS_FAILED(rv)) return rv; @@ -2161,7 +2161,7 @@ nsGfxTextControlFrame2::CreateAnonymousContent(nsIPresContext* aPresContext, // Check if the disabled attribute is set. - rv = mContent->GetAttribute(nameSpaceID, nsHTMLAtoms::disabled, resultValue); + rv = mContent->GetAttr(nameSpaceID, nsHTMLAtoms::disabled, resultValue); if (NS_FAILED(rv)) return rv; @@ -2922,7 +2922,7 @@ nsGfxTextControlFrame2::AttributeChanged(nsIPresContext* aPresContext, if (mEditor && mContent) { nsString value; - mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, value); + mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::value, value); mEditor->EnableUndo(PR_FALSE); // wipe out undo info SetTextControlFrameState(value); // set new text value mEditor->EnableUndo(PR_TRUE); // fire up a new txn stack diff --git a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 68fb617b164..0d4023a1aac 100644 --- a/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -330,7 +330,7 @@ nsHTMLButtonControlFrame::IsSubmit(nsIPresContext* aPresContext, PRInt32 type) // and oif it wasn't explicitly then we we allow to be a submit if (NS_FORM_BUTTON_BUTTON == type) { nsAutoString type; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, type)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, type)) { return PR_FALSE; } else { return PR_TRUE; @@ -810,7 +810,7 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::SetProperty(nsIPresContext* aPresContext if (nsHTMLAtoms::value == aName) { nsCOMPtr formControl(do_QueryInterface(mContent)); if (formControl) { - return formControl->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, aValue, PR_TRUE); + return formControl->SetAttr(kNameSpaceID_None, nsHTMLAtoms::value, aValue, PR_TRUE); } } return NS_OK; @@ -821,7 +821,7 @@ NS_IMETHODIMP nsHTMLButtonControlFrame::GetProperty(nsIAtom* aName, nsAWritableS if (nsHTMLAtoms::value == aName) { nsCOMPtr formControl(do_QueryInterface(mContent)); if (formControl) { - formControl->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, aValue); + formControl->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, aValue); } } return NS_OK; diff --git a/layout/html/forms/src/nsIsIndexFrame.cpp b/layout/html/forms/src/nsIsIndexFrame.cpp index 1c2788a0c90..799c9554a9b 100644 --- a/layout/html/forms/src/nsIsIndexFrame.cpp +++ b/layout/html/forms/src/nsIsIndexFrame.cpp @@ -255,7 +255,7 @@ nsIsIndexFrame::CreateAnonymousContent(nsIPresContext* aPresContext, result = content->QueryInterface(NS_GET_IID(nsIHTMLContent),(void**)&mInputContent); if (NS_SUCCEEDED(result)) { - mInputContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE); + mInputContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type, NS_ConvertASCIItoUCS2("text"), PR_FALSE); aChildList.AppendElement(mInputContent); // Register as an event listener to submit on Enter press diff --git a/layout/html/forms/src/nsListControlFrame.cpp b/layout/html/forms/src/nsListControlFrame.cpp index c180cc95b2e..a2782052e96 100644 --- a/layout/html/forms/src/nsListControlFrame.cpp +++ b/layout/html/forms/src/nsListControlFrame.cpp @@ -1251,7 +1251,7 @@ void nsListControlFrame::DisplaySelected(nsIContent* aContent) { // ignore return value, not much we can do if it fails - aContent->SetAttribute(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, nsAutoString(), mIsAllFramesHere); + aContent->SetAttr(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, nsAutoString(), mIsAllFramesHere); } //--------------------------------------------------------- @@ -1259,7 +1259,7 @@ void nsListControlFrame::DisplayDeselected(nsIContent* aContent) { // ignore return value, not much we can do if it fails - aContent->UnsetAttribute(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, mIsAllFramesHere); + aContent->UnsetAttr(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, mIsAllFramesHere); } @@ -1970,7 +1970,7 @@ nsListControlFrame::IsContentSelected(nsIContent* aContent) { nsString value; //nsIAtom * selectedAtom = NS_NewAtom("selected"); - nsresult result = aContent->GetAttribute(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, value); + nsresult result = aContent->GetAttr(kNameSpaceID_None, nsLayoutAtoms::optionSelectedPseudo, value); return (NS_CONTENT_ATTR_NOT_THERE == result ? PR_FALSE : PR_TRUE); } diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index d01022f4385..0714a044969 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -1732,7 +1732,7 @@ nsCSSFrameConstructor::CreateInputFrame(nsIPresShell *aPresShell, // Figure out which type of input frame to create nsAutoString val; - if (NS_OK == aContent->GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::type, val)) { + if (NS_OK == aContent->GetAttr(kNameSpaceID_HTML, nsHTMLAtoms::type, val)) { if (val.EqualsIgnoreCase("submit")) { rv = ConstructButtonControlFrame(aPresShell, aPresContext, aFrame); } @@ -5533,7 +5533,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, isReplaced = PR_TRUE; if (aTag == nsHTMLAtoms::label || aTag == nsXULAtoms::description) { nsAutoString value; - if (aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value) == + if (aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value) == NS_CONTENT_ATTR_NOT_THERE) return NS_OK; } @@ -5734,7 +5734,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell, NS_NewTreeLayout(aPresShell, layout); nsAutoString outer; - rv = aContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::outer, outer); + rv = aContent->GetAttr(kNameSpaceID_None, nsXULAtoms::outer, outer); if (outer.EqualsIgnoreCase("true")) { rv = NS_NewXULTreeOuterGroupFrame(aPresShell, &newFrame, PR_FALSE, layout); ((nsXULTreeGroupFrame*)newFrame)->InitGroup(this, aPresContext, (nsXULTreeOuterGroupFrame*) newFrame); @@ -8083,7 +8083,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, aContainer->GetParent(*getter_AddRefs(parent)); if (parent) { nsAutoString open; - parent->GetAttribute(kNameSpaceID_None, nsXULAtoms::open, open); + parent->GetAttr(kNameSpaceID_None, nsXULAtoms::open, open); if (open.EqualsIgnoreCase("true")) { // Clear our undisplayed content. nsCOMPtr frameManager; @@ -10290,19 +10290,19 @@ GetAlternateTextFor(nsIContent* aContent, // The "alt" attribute specifies alternate text that is rendered // when the image can not be displayed - rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); + rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::alt, aAltText); // If there's no "alt" attribute, then use the value of the "title" // attribute. Note that this is not the same as a value of "" if (NS_CONTENT_ATTR_NOT_THERE == rv) { - rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::title, - aAltText); + rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::title, + aAltText); // If there's no "alt" or "title" attribute, and aContent is an input // element, then use the value of the "value" attribute if ((NS_CONTENT_ATTR_NOT_THERE == rv) && (nsHTMLAtoms::input == aTag)) { - rv = aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, - aAltText); + rv = aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, + aAltText); // If there's no "value" attribute either, then use the localized string // for "Submit" as the alternate text. diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index d545c57097f..025a1eec4eb 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -2761,7 +2761,7 @@ struct SelectorMatchesData { nsLinkState mLinkState; // if a link, this is the state, otherwise unknown PRBool mIsQuirkMode; // Possibly remove use of this in SelectorMatches? PRInt32 mEventState; // if content, eventStateMgr->GetContentState() - PRBool mHasAttributes; // if content, content->GetAttributeCount() > 0 + PRBool mHasAttributes; // if content, content->GetAttrCount() > 0 PRInt32 mNameSpaceID; // if content, content->GetNameSapce() SelectorMatchesData* mPreviousSiblingData; SelectorMatchesData* mParentData; @@ -2827,7 +2827,7 @@ SelectorMatchesData::SelectorMatchesData(nsIPresContext* aPresContext, nsIConten // see if there are attributes for the content PRInt32 attrCount = 0; - aContent->GetAttributeCount(attrCount); + aContent->GetAttrCount(attrCount); mHasAttributes = PRBool(attrCount > 0); // check for HTMLContent and Link status @@ -3157,7 +3157,7 @@ static PRBool SelectorMatches(SelectorMatchesData &data, nsAttrSelector* attr = aSelector->mAttrList; nsAutoString value; do { - nsresult attrState = data.mContent->GetAttribute(attr->mNameSpace, attr->mAttr, value); + nsresult attrState = data.mContent->GetAttr(attr->mNameSpace, attr->mAttr, value); if (NS_FAILED(attrState) || (NS_CONTENT_ATTR_NOT_THERE == attrState)) { result = localFalse; } diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index 74486ab776a..52d02404e40 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -886,7 +886,7 @@ HTMLStyleSheetImpl::HasStateDependentStyle(nsIPresContext* aPresContext, // if we have anchor colors, check if this is an anchor with an href if (tag == nsHTMLAtoms::a) { nsAutoString href; - nsresult attrState = styledContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::href, href); + nsresult attrState = styledContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::href, href); if (NS_CONTENT_ATTR_HAS_VALUE == attrState) { result = NS_OK; // yes, style will depend on link state } diff --git a/layout/style/nsStyleUtil.cpp b/layout/style/nsStyleUtil.cpp index 737fc15b1d2..56a3c310664 100644 --- a/layout/style/nsStyleUtil.cpp +++ b/layout/style/nsStyleUtil.cpp @@ -676,12 +676,12 @@ PRBool nsStyleUtil::IsSimpleXlink(nsIContent *aContent, nsIPresContext *aPresCon if (xml) { // see if it is type=simple (we don't deal with other types) nsAutoString val; - aContent->GetAttribute(kNameSpaceID_XLink, nsHTMLAtoms::type, val); + aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::type, val); if (val == NS_LITERAL_STRING("simple")) { // see if there is an xlink namespace'd href attribute: // - get it if there is, if not no big deal, it is not required for xlinks // is it bad to re-use val here? - aContent->GetAttribute(kNameSpaceID_XLink, nsHTMLAtoms::href, val); + aContent->GetAttr(kNameSpaceID_XLink, nsHTMLAtoms::href, val); // It's an XLink. Resolve it relative to its document. nsCOMPtr baseURI; diff --git a/layout/xul/base/src/nsBox.cpp b/layout/xul/base/src/nsBox.cpp index dce66dde837..79d424b60b7 100644 --- a/layout/xul/base/src/nsBox.cpp +++ b/layout/xul/base/src/nsBox.cpp @@ -1176,7 +1176,7 @@ nsIBox::AddCSSPrefSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize) nsAutoString value; PRInt32 error; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::width, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::width, value)) { float p2t; presContext->GetScaledPixelsToTwips(&p2t); @@ -1187,7 +1187,7 @@ nsIBox::AddCSSPrefSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize) widthSet = PR_TRUE; } - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::height, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::height, value)) { float p2t; presContext->GetScaledPixelsToTwips(&p2t); @@ -1245,7 +1245,7 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize) nsAutoString value; PRInt32 error; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::minwidth, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::minwidth, value)) { float p2t; presContext->GetScaledPixelsToTwips(&p2t); @@ -1258,7 +1258,7 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize) widthSet = PR_TRUE; } - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::minheight, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::minheight, value)) { float p2t; presContext->GetScaledPixelsToTwips(&p2t); @@ -1324,7 +1324,7 @@ nsIBox::AddCSSFlex(nsBoxLayoutState& aState, nsIBox* aBox, nscoord& aFlex) PRInt32 error; nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::flex, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::flex, value)) { value.Trim("%"); aFlex = value.ToInteger(&error); diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index a662d46693a..c704ff2d06e 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -344,7 +344,7 @@ nsBoxFrame::Init(nsIPresContext* aPresContext, if (mContent) { nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::mousethrough, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::mousethrough, value)) { if (value.EqualsIgnoreCase("never")) mMouseThrough = never; else if (value.EqualsIgnoreCase("always")) @@ -425,7 +425,7 @@ nsBoxFrameInner::GetInitialDebug(PRBool& aDebug) return PR_FALSE; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::debug, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::debug, value)) { if (value.EqualsIgnoreCase("true")) { aDebug = PR_TRUE; return PR_TRUE; @@ -448,7 +448,7 @@ nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign) if (!content) return PR_FALSE; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value)) { // XXXdwh Everything inside this if statement is deprecated code. if (value.EqualsIgnoreCase("left")) { aHalign = nsBoxFrame::hAlign_Left; @@ -464,8 +464,8 @@ nsBoxFrame::GetInitialHAlignment(nsBoxFrame::Halignment& aHalign) // we are checking the ALIGN attribute. nsresult res; if (IsHorizontal()) - res = content->GetAttribute(kNameSpaceID_None, nsXULAtoms::pack, value); - else res = content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, value); + res = content->GetAttr(kNameSpaceID_None, nsXULAtoms::pack, value); + else res = content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value); if (res == NS_CONTENT_ATTR_HAS_VALUE) { if (value.EqualsIgnoreCase("start")) { aHalign = nsBoxFrame::hAlign_Left; @@ -531,7 +531,7 @@ nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign) if (!content) return PR_FALSE; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::valign, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::valign, value)) { if (value.EqualsIgnoreCase("top")) { aValign = nsBoxFrame::vAlign_Top; return PR_TRUE; @@ -552,8 +552,8 @@ nsBoxFrame::GetInitialVAlignment(nsBoxFrame::Valignment& aValign) // we are checking the PACK attribute. nsresult res; if (IsHorizontal()) - res = content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, value); - else res = content->GetAttribute(kNameSpaceID_None, nsXULAtoms::pack, value); + res = content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value); + else res = content->GetAttr(kNameSpaceID_None, nsXULAtoms::pack, value); if (res == NS_CONTENT_ATTR_HAS_VALUE) { if (value.EqualsIgnoreCase("start")) { aValign = nsBoxFrame::vAlign_Top; @@ -638,7 +638,7 @@ nsBoxFrame::GetInitialOrientation(PRBool& aIsHorizontal) // Now see if we have an attribute. The attribute overrides // the style system value. - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::orient, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::orient, value)) { if (value.EqualsIgnoreCase("vertical")) aIsHorizontal = PR_FALSE; else if (value.EqualsIgnoreCase("horizontal")) @@ -676,7 +676,7 @@ nsBoxFrame::GetInitialDirection(PRBool& aIsNormal) // Now see if we have an attribute. The attribute overrides // the style system value. - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::dir, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::dir, value)) { if (value.EqualsIgnoreCase("reverse")) aIsNormal = !aIsNormal; // Invert our direction. else if (value.EqualsIgnoreCase("ltr")) @@ -700,7 +700,7 @@ nsBoxFrame::GetInitialEqualSize(PRBool& aEqualSize) if (!content) return PR_FALSE; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::equalsize, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::equalsize, value)) { if (value.EqualsIgnoreCase("always")) { aEqualSize = PR_TRUE; @@ -725,7 +725,7 @@ nsBoxFrame::GetInitialAutoStretch(PRBool& aStretch) return PR_FALSE; PRBool autostretchSet = PR_FALSE; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::autostretch, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::autostretch, value)) { if (value.EqualsIgnoreCase("never")) { aStretch = PR_FALSE; @@ -740,7 +740,7 @@ nsBoxFrame::GetInitialAutoStretch(PRBool& aStretch) if (!autostretchSet) { // Check the align attribute. - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::align, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::align, value)) { aStretch = value.EqualsIgnoreCase("stretch"); return PR_TRUE; } diff --git a/layout/xul/base/src/nsBulletinBoardLayout.cpp b/layout/xul/base/src/nsBulletinBoardLayout.cpp index 672e0541491..e69de29bb2d 100644 --- a/layout/xul/base/src/nsBulletinBoardLayout.cpp +++ b/layout/xul/base/src/nsBulletinBoardLayout.cpp @@ -1,297 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ - -// -// Eric Vaughan -// Netscape Communications -// -// See documentation in associated header file -// - -#include "nsBulletinBoardLayout.h" -#include "nsIStyleContext.h" -#include "nsCOMPtr.h" -#include "nsBoxLayoutState.h" -#include "nsBox.h" -#include "nsHTMLAtoms.h" -#include "nsXULAtoms.h" -#include "nsIContent.h" -#include "nsINameSpaceManager.h" - -nsIBoxLayout* nsBulletinBoardLayout::gInstance = nsnull; - -nsresult -NS_NewBulletinBoardLayout( nsIPresShell* aPresShell, nsCOMPtr& aNewLayout) -{ - if (!nsBulletinBoardLayout::gInstance) { - nsBulletinBoardLayout::gInstance = new nsBulletinBoardLayout(); - NS_IF_ADDREF(nsBulletinBoardLayout::gInstance); - } - // we have not instance variables so just return our static one. - aNewLayout = nsBulletinBoardLayout::gInstance; - return NS_OK; -} - -/*static*/ void -nsBulletinBoardLayout::Shutdown() -{ - NS_IF_RELEASE(gInstance); -} - -nsBulletinBoardLayout::nsBulletinBoardLayout() -{ -} - -NS_IMETHODIMP -nsBulletinBoardLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSize) -{ - aSize.width = 0; - aSize.height = 0; - - // we are as wide as the widest child plus its left offset - // we are tall as the tallest child plus its top offset - nsIBox* child = nsnull; - aBox->GetChildBox(&child); - - while (child) - { - nsSize pref(0,0); - child->GetPrefSize(aState, pref); - - AddMargin(child, pref); - AddOffset(aState, child, pref); - AddLargestSize(aSize, pref); - - child->GetNextBox(&child); - } - - // now add our border and padding and insets - AddBorderAndPadding(aBox, aSize); - AddInset(aBox, aSize); - - return NS_OK; -} - -NS_IMETHODIMP -nsBulletinBoardLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSize) -{ - aSize.width = 0; - aSize.height = 0; - - // run through all the children and get there min, max, and preferred sizes - // return us the size of the box - - nsIBox* child = nsnull; - aBox->GetChildBox(&child); - - while (child) - { - nsSize min(0,0); - child->GetMinSize(aState, min); - AddMargin(child, min); - AddOffset(aState, child, min); - AddLargestSize(aSize, min); - - child->GetNextBox(&child); - } - -// now add our border and padding and insets - AddBorderAndPadding(aBox, aSize); - AddInset(aBox,aSize); - - return NS_OK; -} - -NS_IMETHODIMP -nsBulletinBoardLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSize) -{ - - aSize.width = NS_INTRINSICSIZE; - aSize.height = NS_INTRINSICSIZE; - - // run through all the children and get there min, max, and preferred sizes - // return us the size of the box - - - nsIBox* child = nsnull; - aBox->GetChildBox(&child); - - while (child) - { - // if completely redefined don't even ask our child for its size. - nsSize max(NS_INTRINSICSIZE, NS_INTRINSICSIZE); - child->GetMaxSize(aState, max); - - AddMargin(child, max); - AddOffset(aState, child, max); - AddSmallestSize(aSize, max); - - child->GetNextBox(&child); - - } - - // now add our border and padding and insets - AddBorderAndPadding(aBox, aSize); - AddInset(aBox, aSize); - - return NS_OK; -} - - -NS_IMETHODIMP -nsBulletinBoardLayout::GetAscent(nsIBox* aBox, nsBoxLayoutState& aState, nscoord& aAscent) -{ - nsSize size(0,0); - GetPrefSize(aBox, aState, size); - aAscent = size.height; - return NS_OK; -} - -nsresult -nsBulletinBoardLayout::AddOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsSize& aSize) -{ - nsSize offset(0,0); - - // get the left and top offsets - const nsStylePosition* pos; - nsIFrame* frame; - aChild->GetFrame(&frame); - frame->GetStyleData(eStyleStruct_Position,(const nsStyleStruct*&) pos); - if (eStyleUnit_Coord == pos->mOffset.GetLeftUnit()) { - nsStyleCoord left = 0; - pos->mOffset.GetLeft(left); - offset.width = left.GetCoordValue(); - } - - if (eStyleUnit_Coord == pos->mOffset.GetTopUnit()) { - nsStyleCoord top = 0; - pos->mOffset.GetTop(top); - offset.height = top.GetCoordValue(); - } - - - nsCOMPtr content; - frame->GetContent(getter_AddRefs(content)); - - if (content) { - nsIPresContext* presContext = aState.GetPresContext(); - - nsAutoString value; - PRInt32 error; - - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::left, value)) - { - float p2t; - presContext->GetScaledPixelsToTwips(&p2t); - - value.Trim("%"); - - offset.width = NSIntPixelsToTwips(value.ToInteger(&error), p2t); - } - - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::top, value)) - { - float p2t; - presContext->GetScaledPixelsToTwips(&p2t); - - value.Trim("%"); - - offset.height = NSIntPixelsToTwips(value.ToInteger(&error), p2t); - } - } - - aSize += offset; - - return NS_OK; -} - - -NS_IMETHODIMP -nsBulletinBoardLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState) -{ - nsRect clientRect; - aBox->GetClientRect(clientRect); - - nsRect childRect; - - nsIBox* child = nsnull; - aBox->GetChildBox(&child); - - while (child) - { - // only layout dirty children - PRBool isDirty = PR_FALSE; - PRBool hasDirtyChildren = PR_FALSE; - - child->IsDirty(isDirty); - child->HasDirtyChildren(hasDirtyChildren); - - if (isDirty || hasDirtyChildren) { - - nsRect oldRect; - child->GetBounds(oldRect); - - // get the preferred size of the child - nsSize pref(0,0); - child->GetPrefSize(aState, pref); - - // add in its margin - nsMargin margin; - child->GetMargin(margin); - - // offset it from the inside of our left top border by the offset - nsSize offset(0,0); - AddOffset(aState, child, offset); - - childRect.width = pref.width; - childRect.height = pref.height; - childRect.x = clientRect.x + offset.width + margin.left; - childRect.y = clientRect.y + offset.height + margin.top; - - if (childRect != oldRect) - { - // redraw the new and old positions if the - // child moved. - // if the new and old rect intersect meaning we just moved a little - // then just redraw the intersection. If they don't intersect meaning - // we moved far redraw both separately. - if (childRect.Intersects(oldRect)) { - nsRect u; - u.UnionRect(oldRect, childRect); - aBox->Redraw(aState, &u); - } else { - aBox->Redraw(aState, &oldRect); - aBox->Redraw(aState, &childRect); - } - } - - // layout child - child->SetBounds(aState, childRect); - child->Layout(aState); - } - - child->GetNextBox(&child); - } - - return NS_OK; -} - diff --git a/layout/xul/base/src/nsButtonBoxFrame.cpp b/layout/xul/base/src/nsButtonBoxFrame.cpp index eb913bb411c..24673bb2f72 100644 --- a/layout/xul/base/src/nsButtonBoxFrame.cpp +++ b/layout/xul/base/src/nsButtonBoxFrame.cpp @@ -133,7 +133,7 @@ nsButtonBoxFrame::MouseClicked (nsIPresContext* aPresContext, nsGUIEvent* aEvent { // Don't execute if we're disabled. nsAutoString disabled; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); if (disabled.EqualsWithConversion("true")) return; @@ -165,7 +165,7 @@ nsButtonBoxFrame::MouseClicked (nsIPresContext* aPresContext, nsGUIEvent* aEvent // See if we have a command elt. If so, we execute on the command instead // of on our content element. nsAutoString command; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::command, command); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::command, command); if (!command.IsEmpty()) { nsCOMPtr doc; mContent->GetDocument(*getter_AddRefs(doc)); diff --git a/layout/xul/base/src/nsDeckFrame.cpp b/layout/xul/base/src/nsDeckFrame.cpp index 63c49cbdfc3..1f5e01d6199 100644 --- a/layout/xul/base/src/nsDeckFrame.cpp +++ b/layout/xul/base/src/nsDeckFrame.cpp @@ -269,7 +269,7 @@ nsDeckFrame::GetSelectedIndex() // get the index attribute nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::index, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::index, value)) { PRInt32 error; diff --git a/layout/xul/base/src/nsGrippyFrame.cpp b/layout/xul/base/src/nsGrippyFrame.cpp index 8985901e3d8..c3a9a1a7a3c 100644 --- a/layout/xul/base/src/nsGrippyFrame.cpp +++ b/layout/xul/base/src/nsGrippyFrame.cpp @@ -91,13 +91,13 @@ nsGrippyFrame::MouseClicked (nsIPresContext* aPresContext, nsGUIEvent* aEvent) nsString a; a.AssignWithConversion("collapsed"); nsString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::state, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::state, value)) { if (value.EqualsWithConversion("collapsed")) a.AssignWithConversion("open"); } - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::state, a, PR_TRUE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::state, a, PR_TRUE); } @@ -126,7 +126,7 @@ nsGrippyFrame::MouseClicked(nsIPresContext* aPresContext) // the child before otherwise collapse the child after PRBool before = PR_TRUE; nsString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::collapse, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::collapse, value)) { if (value=="after") before = PR_FALSE; @@ -143,10 +143,10 @@ nsGrippyFrame::MouseClicked(nsIPresContext* aPresContext) style = "visibility: collapse"; mCollapsedChildStyle = ""; - mCollapsedChild->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::style, mCollapsedChildStyle); + mCollapsedChild->GetAttr(kNameSpaceID_None, nsHTMLAtoms::style, mCollapsedChildStyle); } - mCollapsedChild->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::style, style, PR_TRUE); + mCollapsedChild->SetAttr(kNameSpaceID_None, nsHTMLAtoms::style, style, PR_TRUE); mCollapsed = !mCollapsed; diff --git a/layout/xul/base/src/nsImageBoxFrame.cpp b/layout/xul/base/src/nsImageBoxFrame.cpp index 0888d523428..3bc89c5f79a 100644 --- a/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/layout/xul/base/src/nsImageBoxFrame.cpp @@ -192,7 +192,7 @@ void nsImageBoxFrame::GetImageSource(nsString& aResult) { // get the new image src - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::src, aResult); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::src, aResult); // if the new image is empty if (aResult.IsEmpty()) { diff --git a/layout/xul/base/src/nsLeafBoxFrame.cpp b/layout/xul/base/src/nsLeafBoxFrame.cpp index 7c33a6ac1ca..5beea6c4aa0 100644 --- a/layout/xul/base/src/nsLeafBoxFrame.cpp +++ b/layout/xul/base/src/nsLeafBoxFrame.cpp @@ -117,7 +117,7 @@ nsLeafBoxFrame::Init(nsIPresContext* aPresContext, if (mContent) { nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::mousethrough, value)) { + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::mousethrough, value)) { if (value.EqualsIgnoreCase("never")) mMouseThrough = never; else if (value.EqualsIgnoreCase("always")) diff --git a/layout/xul/base/src/nsMenuBarFrame.cpp b/layout/xul/base/src/nsMenuBarFrame.cpp index fa01c3592b8..353c2f101e7 100644 --- a/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/layout/xul/base/src/nsMenuBarFrame.cpp @@ -247,7 +247,7 @@ nsMenuBarFrame::FindMenuWithShortcut(PRUint32 aLetter) if (IsValidItem(current)) { // Get the shortcut attribute. nsAutoString shortcutKey; - current->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, shortcutKey); + current->GetAttr(kNameSpaceID_None, nsXULAtoms::accesskey, shortcutKey); if (!shortcutKey.IsEmpty()) { // We've got something. PRUnichar letter = PRUnichar(aLetter); // throw away the high-zero-fill @@ -683,7 +683,7 @@ PRBool nsMenuBarFrame::IsDisabled(nsIContent* aContent) { nsString disabled; - aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); + aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); if (disabled.EqualsWithConversion("true")) return PR_TRUE; return PR_FALSE; diff --git a/layout/xul/base/src/nsMenuFrame.cpp b/layout/xul/base/src/nsMenuFrame.cpp index 1ab671dda8e..b8a1f8da8dc 100644 --- a/layout/xul/base/src/nsMenuFrame.cpp +++ b/layout/xul/base/src/nsMenuFrame.cpp @@ -354,7 +354,7 @@ nsMenuFrame::GetFrameForPoint(nsIPresContext* aPresContext, if (content) { // This allows selective overriding for subcontent. nsAutoString value; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); if (value.Equals(NS_LITERAL_STRING("true"))) return result; } @@ -442,12 +442,12 @@ nsMenuFrame::HandleEvent(nsIPresContext* aPresContext, if (mType == eMenuType_Checkbox || (mType == eMenuType_Radio && !mChecked)) { if (mChecked) { - mContent->UnsetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, - PR_TRUE); + mContent->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, + PR_TRUE); } else { - mContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, NS_LITERAL_STRING("true"), - PR_TRUE); + mContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, NS_LITERAL_STRING("true"), + PR_TRUE); } /* the AttributeChanged code will update all the internal state */ @@ -536,11 +536,11 @@ nsMenuFrame::SelectMenu(PRBool aActivateFlag) } if (aActivateFlag) { // Highlight the menu. - mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, NS_LITERAL_STRING("true"), PR_TRUE); + mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, NS_LITERAL_STRING("true"), PR_TRUE); } else { // Unhighlight the menu. - mContent->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, PR_TRUE); + mContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, PR_TRUE); } return NS_OK; @@ -556,7 +556,7 @@ PRBool nsMenuFrame::IsGenerated() // a menu forevermore. if (child) { nsString genVal; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, genVal); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, genVal); if (genVal.IsEmpty()) return PR_FALSE; } @@ -575,9 +575,9 @@ nsMenuFrame::MarkAsGenerated() // a menu forevermore. if (child) { nsAutoString genVal; - child->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, genVal); + child->GetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, genVal); if (genVal.IsEmpty()) - child->SetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, NS_LITERAL_STRING("true"), PR_TRUE); + child->SetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, NS_LITERAL_STRING("true"), PR_TRUE); } return NS_OK; @@ -642,7 +642,7 @@ nsMenuFrame::AttributeChanged(nsIPresContext* aPresContext, nsAutoString value; if (aAttribute == nsXULAtoms::open) { - aChild->GetAttribute(kNameSpaceID_None, aAttribute, value); + aChild->GetAttr(kNameSpaceID_None, aAttribute, value); if (value.Equals(NS_LITERAL_STRING("true"))) OpenMenuInternal(PR_TRUE); else { @@ -729,8 +729,8 @@ nsMenuFrame::OpenMenuInternal(PRBool aActivateFlag) // Sync up the view. nsAutoString popupAnchor, popupAlign; - menuPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popupanchor, popupAnchor); - menuPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popupalign, popupAlign); + menuPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::popupanchor, popupAnchor); + menuPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::popupalign, popupAlign); if (onMenuBar) { if (popupAnchor.IsEmpty()) @@ -872,7 +872,7 @@ nsMenuFrame::DoLayout(nsBoxLayoutState& aState) if (popupChild) { nsAutoString sizedToPopup; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::sizetopopup, sizedToPopup); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::sizetopopup, sizedToPopup); PRBool sizeToPopup = (sizedToPopup.EqualsIgnoreCase("true")); nsIBox* ibox = nsnull; @@ -1010,7 +1010,7 @@ nsMenuFrame::SetDebug(nsBoxLayoutState& aState, nsIFrame* aList, PRBool aDebug) static void ConvertPosition(nsIContent* aPopupElt, nsString& aAnchor, nsString& aAlign) { nsAutoString position; - aPopupElt->GetAttribute(kNameSpaceID_None, nsXULAtoms::position, position); + aPopupElt->GetAttr(kNameSpaceID_None, nsXULAtoms::position, position); if (position.IsEmpty()) return; @@ -1065,8 +1065,8 @@ nsMenuFrame::RePositionPopup(nsBoxLayoutState& aState) menuPopup->GetContent(getter_AddRefs(menuPopupContent)); nsAutoString popupAnchor, popupAlign; - menuPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popupanchor, popupAnchor); - menuPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::popupalign, popupAlign); + menuPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::popupanchor, popupAnchor); + menuPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::popupalign, popupAlign); ConvertPosition(menuPopupContent, popupAnchor, popupAlign); @@ -1190,7 +1190,7 @@ nsMenuFrame::Notify(nsITimer* aTimer) if (aTimer == mOpenTimer.get()) { if (!mMenuOpen && mMenuParent) { nsAutoString active; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, active); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, active); if (active.Equals(NS_LITERAL_STRING("true"))) { // We're still the active menu. Make sure all submenus/timers are closed // before opening this one @@ -1209,7 +1209,7 @@ PRBool nsMenuFrame::IsDisabled() { nsAutoString disabled; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); if (disabled.Equals(NS_LITERAL_STRING("true"))) return PR_TRUE; return PR_FALSE; @@ -1219,21 +1219,21 @@ void nsMenuFrame::UpdateMenuType(nsIPresContext* aPresContext) { nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value); if (value.Equals(NS_LITERAL_STRING("checkbox"))) mType = eMenuType_Checkbox; else if (value.Equals(NS_LITERAL_STRING("radio"))) { mType = eMenuType_Radio; nsAutoString valueName; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, valueName); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, valueName); if ( mGroupName != valueName ) mGroupName = valueName; } else { if (mType != eMenuType_Normal) - mContent->UnsetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, - PR_TRUE); + mContent->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, + PR_TRUE); mType = eMenuType_Normal; } UpdateMenuSpecialState(aPresContext); @@ -1245,8 +1245,8 @@ nsMenuFrame::UpdateMenuSpecialState(nsIPresContext* aPresContext) { nsAutoString value; PRBool newChecked; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, - value); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, + value); newChecked = (value.Equals(NS_LITERAL_STRING("true"))); if (newChecked == mChecked) { @@ -1255,7 +1255,7 @@ nsMenuFrame::UpdateMenuSpecialState(nsIPresContext* aPresContext) { if (mType != eMenuType_Radio) return; // only Radio possibly cares about other kinds of change - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::name, value); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, value); if (value == mGroupName) return; // no interesting change } else { @@ -1331,8 +1331,8 @@ nsMenuFrame::UpdateMenuSpecialState(nsIPresContext* aPresContext) { continue; // break? /* uncheck the old item */ - content->UnsetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, - PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, + PR_TRUE); /* XXX in DEBUG, check to make sure that there aren't two checked items */ return; @@ -1346,7 +1346,7 @@ void nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) { nsAutoString accelText; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::acceltext, accelText); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::acceltext, accelText); if (!accelText.IsEmpty()) { // Just use this. aAccelString = accelText; @@ -1355,7 +1355,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) // See if we have a key node and use that instead. nsAutoString keyValue; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::key, keyValue); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::key, keyValue); if (keyValue.IsEmpty()) return; @@ -1381,16 +1381,16 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) // check the key element's attributes in this order: // |keytext|, |key|, |keycode| nsAutoString accelString; - keyElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::keytext, accelString); + keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::keytext, accelString); if (accelString.IsEmpty()) { - keyElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::key, accelString); + keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::key, accelString); if (!accelString.IsEmpty()) { accelString.ToUpperCase(); } else { nsAutoString keyCode; - keyElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::keycode, keyCode); + keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::keycode, keyCode); keyCode.ToUpperCase(); nsresult rv; @@ -1434,7 +1434,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) } nsAutoString modifiers; - keyElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::modifiers, modifiers); + keyElement->GetAttr(kNameSpaceID_None, nsXULAtoms::modifiers, modifiers); char* str = modifiers.ToNewCString(); char* newStr; @@ -1476,7 +1476,7 @@ nsMenuFrame::BuildAcceleratorText(nsString& aAccelString) aAccelString += accelString; - mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::acceltext, aAccelString, PR_FALSE); + mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::acceltext, aAccelString, PR_FALSE); } void @@ -1523,7 +1523,7 @@ nsMenuFrame::Execute() // See if we have a command elt. If so, we execute on the command instead // of on our content element. nsAutoString command; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::command, command); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::command, command); if (!command.IsEmpty()) { nsCOMPtr doc; mContent->GetDocument(*getter_AddRefs(doc)); @@ -1610,7 +1610,7 @@ nsMenuFrame::OnCreate() if (tag.get() == nsXULAtoms::menuitem) { // See if we have a command attribute. nsAutoString command; - grandChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::command, command); + grandChild->GetAttr(kNameSpaceID_None, nsXULAtoms::command, command); if (!command.IsEmpty()) { // We do! Look it up in our document nsCOMPtr commandElt; @@ -1619,13 +1619,13 @@ nsMenuFrame::OnCreate() if ( commandContent ) { nsAutoString commandAttr, menuAttr; - commandContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, commandAttr); - grandChild->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, menuAttr); + commandContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, commandAttr); + grandChild->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, menuAttr); if (!commandAttr.Equals(menuAttr)) { // The menu's disabled state needs to be updated to match the command. if (commandAttr.IsEmpty()) - grandChild->UnsetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, PR_TRUE); - else grandChild->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, commandAttr, PR_TRUE); + grandChild->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, PR_TRUE); + else grandChild->SetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, commandAttr, PR_TRUE); } commandAttr.AssignWithConversion(""); @@ -1634,21 +1634,21 @@ nsMenuFrame::OnCreate() // The menu's label and checked states need to be updated to match the command. // Note that (unlike the disabled state) if the command has *no* label for either, we // assume the menu is supplying its own. - commandContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, commandAttr); - grandChild->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, menuAttr); + commandContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, commandAttr); + grandChild->GetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, menuAttr); if (!commandAttr.Equals(menuAttr)) { if (!commandAttr.IsEmpty()) - grandChild->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, commandAttr, PR_TRUE); + grandChild->SetAttr(kNameSpaceID_None, nsHTMLAtoms::checked, commandAttr, PR_TRUE); } commandAttr.AssignWithConversion(""); menuAttr.AssignWithConversion(""); - commandContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::label, commandAttr); - grandChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::label, menuAttr); + commandContent->GetAttr(kNameSpaceID_None, nsXULAtoms::label, commandAttr); + grandChild->GetAttr(kNameSpaceID_None, nsXULAtoms::label, menuAttr); if (!commandAttr.Equals(menuAttr)) { if (!commandAttr.IsEmpty()) - grandChild->SetAttribute(kNameSpaceID_None, nsXULAtoms::label, commandAttr, PR_TRUE); + grandChild->SetAttr(kNameSpaceID_None, nsXULAtoms::label, commandAttr, PR_TRUE); } } } @@ -1860,7 +1860,7 @@ nsMenuFrame::GetPrefSize(nsBoxLayoutState& aState, nsSize& aSize) nsresult rv = nsBoxFrame::GetPrefSize(aState, aSize); nsAutoString sizedToPopup; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::sizetopopup, sizedToPopup); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::sizetopopup, sizedToPopup); PRBool sizeToPopup = (sizedToPopup.EqualsIgnoreCase("true")); if (sizeToPopup) { diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 17372debe00..cdfa7e9851f 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -916,11 +916,11 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, //viewManager->ResizeView(view, mRect.width, mRect.height); nsAutoString shouldDisplay, menuActive; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, menuActive); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, menuActive); if (menuActive != NS_LITERAL_STRING("true")) { - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); if ( shouldDisplay == NS_LITERAL_STRING("true") ) - mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, NS_LITERAL_STRING("true"), PR_TRUE); + mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, NS_LITERAL_STRING("true"), PR_TRUE); } return NS_OK; @@ -1235,7 +1235,7 @@ nsMenuPopupFrame::FindMenuWithShortcut(PRUint32 aLetter) if (IsValidItem(current)) { // Get the shortcut attribute. nsAutoString shortcutKey; - current->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, shortcutKey); + current->GetAttr(kNameSpaceID_None, nsXULAtoms::accesskey, shortcutKey); if (shortcutKey.Length() > 0) { // We've got something. char tempChar[2]; @@ -1520,7 +1520,7 @@ PRBool nsMenuPopupFrame::IsDisabled(nsIContent* aContent) { nsString disabled; - aContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); + aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); if (disabled == NS_LITERAL_STRING("true")) return PR_TRUE; return PR_FALSE; diff --git a/layout/xul/base/src/nsPopupSetFrame.cpp b/layout/xul/base/src/nsPopupSetFrame.cpp index 3714170f6cf..2c45f9b0947 100644 --- a/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/layout/xul/base/src/nsPopupSetFrame.cpp @@ -514,24 +514,24 @@ nsPopupSetFrame::MarkAsGenerated(nsIContent* aPopupContent) // Retrieve the menugenerated attribute. nsAutoString value; - childContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, - value); + childContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, + value); if (value == NS_LITERAL_STRING("true")) { // Ungenerate this element. - childContent->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, - PR_TRUE); + childContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, + PR_TRUE); } } // Set our attribute, but only if we aren't already generated. // Retrieve the menugenerated attribute. nsAutoString value; - aPopupContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, - value); + aPopupContent->GetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, + value); if (value != NS_LITERAL_STRING("true")) { // Generate this element. - aPopupContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menugenerated, NS_LITERAL_STRING("true"), - PR_TRUE); + aPopupContent->SetAttr(kNameSpaceID_None, nsXULAtoms::menugenerated, NS_LITERAL_STRING("true"), + PR_TRUE); } } @@ -553,7 +553,7 @@ nsPopupSetFrame::OpenPopup(PRBool aActivateFlag) GetContent(getter_AddRefs(content)); nsAutoString property; // Tooltips don't get keyboard navigation - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::ignorekeys, property); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::ignorekeys, property); if ( property != NS_LITERAL_STRING("true") && childPopup && mPopupType != NS_LITERAL_STRING("tooltip") ) @@ -591,10 +591,10 @@ nsPopupSetFrame::ActivatePopup(PRBool aActivateFlag) // is set by setting the |menuactive| attribute. This used to trip css into showing the menu // but now we do it ourselves. if (aActivateFlag) - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, NS_LITERAL_STRING("true"), PR_TRUE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, NS_LITERAL_STRING("true"), PR_TRUE); else { - content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, PR_TRUE); - content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::menuactive, PR_TRUE); + content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, PR_TRUE); // get rid of the reflows we just created. If we leave them hanging around, we // can get into trouble if a dialog with a modal event loop comes along and @@ -667,7 +667,7 @@ nsPopupSetFrame::OnCreate(nsIContent* aPopupContent) if (tag.get() == nsXULAtoms::menuitem) { // See if we have a command attribute. nsAutoString command; - grandChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::command, command); + grandChild->GetAttr(kNameSpaceID_None, nsXULAtoms::command, command); if (!command.IsEmpty()) { // We do! Look it up in our document nsCOMPtr commandElt; @@ -675,24 +675,24 @@ nsPopupSetFrame::OnCreate(nsIContent* aPopupContent) nsCOMPtr commandContent(do_QueryInterface(commandElt)); if ( commandContent ) { nsAutoString commandDisabled, menuDisabled; - commandContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, commandDisabled); - grandChild->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, menuDisabled); + commandContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, commandDisabled); + grandChild->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, menuDisabled); if (!commandDisabled.Equals(menuDisabled)) { // The menu's disabled state needs to be updated to match the command. if (commandDisabled.IsEmpty()) - grandChild->UnsetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, PR_TRUE); - else grandChild->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, commandDisabled, PR_TRUE); + grandChild->UnsetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, PR_TRUE); + else grandChild->SetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, commandDisabled, PR_TRUE); } nsAutoString commandValue, menuValue; - commandContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::label, commandValue); - grandChild->GetAttribute(kNameSpaceID_None, nsXULAtoms::label, menuValue); + commandContent->GetAttr(kNameSpaceID_None, nsXULAtoms::label, commandValue); + grandChild->GetAttr(kNameSpaceID_None, nsXULAtoms::label, menuValue); if (!commandValue.Equals(menuValue)) { // The menu's value state needs to be updated to match the command. // Note that (unlike the disabled state) if the command has *no* value, we // assume the menu is supplying its own. if (!commandValue.IsEmpty()) - grandChild->SetAttribute(kNameSpaceID_None, nsXULAtoms::label, commandValue, PR_TRUE); + grandChild->SetAttr(kNameSpaceID_None, nsXULAtoms::label, commandValue, PR_TRUE); } } } diff --git a/layout/xul/base/src/nsProgressMeterFrame.cpp b/layout/xul/base/src/nsProgressMeterFrame.cpp index 7ccf31d0916..2ae89cec98c 100644 --- a/layout/xul/base/src/nsProgressMeterFrame.cpp +++ b/layout/xul/base/src/nsProgressMeterFrame.cpp @@ -112,7 +112,7 @@ nsProgressMeterFrame::AttributeChanged(nsIPresContext* aPresContext, mContent->ChildAt(1, *getter_AddRefs(progressRemainder)); nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value); PRInt32 error; PRInt32 flex = value.ToInteger(&error); @@ -124,8 +124,8 @@ nsProgressMeterFrame::AttributeChanged(nsIPresContext* aPresContext, nsAutoString leftFlex, rightFlex; leftFlex.AppendInt(flex); rightFlex.AppendInt(remainder); - progressBar->SetAttribute(kNameSpaceID_None, nsXULAtoms::flex, leftFlex, PR_TRUE); - progressRemainder->SetAttribute(kNameSpaceID_None, nsXULAtoms::flex, rightFlex, PR_TRUE); + progressBar->SetAttr(kNameSpaceID_None, nsXULAtoms::flex, leftFlex, PR_TRUE); + progressRemainder->SetAttr(kNameSpaceID_None, nsXULAtoms::flex, rightFlex, PR_TRUE); } } return NS_OK; diff --git a/layout/xul/base/src/nsResizerFrame.cpp b/layout/xul/base/src/nsResizerFrame.cpp index 8cfb6d8a198..ae5fba47f79 100644 --- a/layout/xul/base/src/nsResizerFrame.cpp +++ b/layout/xul/base/src/nsResizerFrame.cpp @@ -315,7 +315,7 @@ nsResizerFrame::GetInitialDirection(eDirection& aDirection) if (!content) return PR_FALSE; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::dir, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::dir, value)) { return EvalDirection(value,aDirection); } diff --git a/layout/xul/base/src/nsScrollbarButtonFrame.cpp b/layout/xul/base/src/nsScrollbarButtonFrame.cpp index fee2351b2dc..10e200130fc 100644 --- a/layout/xul/base/src/nsScrollbarButtonFrame.cpp +++ b/layout/xul/base/src/nsScrollbarButtonFrame.cpp @@ -157,7 +157,7 @@ nsScrollbarButtonFrame::MouseClicked() PRInt32 increment = nsSliderFrame::GetIncrement(content); nsString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::type, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::type, value)) { // if our class is DecrementButton subtract the current pos by increment amount // if our class is IncrementButton increment the current pos by the decrement amount @@ -186,7 +186,7 @@ nsScrollbarButtonFrame::MouseClicked() char v[100]; sprintf(v, "%d", curpos); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(v), PR_TRUE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(v), PR_TRUE); } diff --git a/layout/xul/base/src/nsSliderFrame.cpp b/layout/xul/base/src/nsSliderFrame.cpp index 3c41be41969..e8da81d80a9 100644 --- a/layout/xul/base/src/nsSliderFrame.cpp +++ b/layout/xul/base/src/nsSliderFrame.cpp @@ -201,7 +201,7 @@ PRInt32 nsSliderFrame::GetIntegerAttribute(nsIContent* content, nsIAtom* atom, PRInt32 defaultValue) { nsAutoString value; - if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, atom, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, atom, value)) { PRInt32 error; @@ -255,7 +255,7 @@ nsSliderFrame::AttributeChanged(nsIPresContext* aPresContext, char ch[100]; sprintf(ch,"%d", current); - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(ch), PR_FALSE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(ch), PR_FALSE); } } @@ -777,7 +777,7 @@ nsSliderFrame::SetCurrentPosition(nsIContent* scrollbar, nsIFrame* aThumbFrame, mediator->PositionChanged(GetCurrentPosition(scrollbar), newpos); char ch[100]; sprintf(ch,"%d", newpos); - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(ch), PR_FALSE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(ch), PR_FALSE); CurrentPositionChanged(mPresContext); return; } @@ -787,7 +787,7 @@ nsSliderFrame::SetCurrentPosition(nsIContent* scrollbar, nsIFrame* aThumbFrame, sprintf(ch,"%d", newpos); // set the new position - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(ch), PR_TRUE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, NS_ConvertASCIItoUCS2(ch), PR_TRUE); if (DEBUG_SLIDER) printf("Current Pos=%s\n",ch); diff --git a/layout/xul/base/src/nsSplitterFrame.cpp b/layout/xul/base/src/nsSplitterFrame.cpp index 7e51f60efc2..5614751eec6 100644 --- a/layout/xul/base/src/nsSplitterFrame.cpp +++ b/layout/xul/base/src/nsSplitterFrame.cpp @@ -174,7 +174,7 @@ nsSplitterFrameInner::GetResizeBefore() mOuter->GetContent(getter_AddRefs(content)); nsString value; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::resizebefore, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::resizebefore, value); if (value.EqualsIgnoreCase("farthest")) return Farthest; else @@ -194,7 +194,7 @@ nsSplitterFrameInner::GetResizeAfter() mOuter->GetContent(getter_AddRefs(content)); nsString value; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::resizeafter, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::resizeafter, value); if (value.EqualsIgnoreCase("farthest")) return Farthest; else if (value.EqualsIgnoreCase("grow")) @@ -210,7 +210,7 @@ nsSplitterFrameInner::GetState() mOuter->GetContent(getter_AddRefs(content)); nsString value; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::state, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::state, value); if (value.EqualsIgnoreCase("dragging")) return Dragging; else if (value.EqualsIgnoreCase("collapsed")) @@ -327,7 +327,7 @@ nsSplitterFrame::CreateAnonymousContent(nsIPresContext* aPresContext, // create a spring nsCOMPtr content; CreateAnonymousNode(mContent, nsXULAtoms::spring, nsXULAtoms::nameSpaceID, getter_AddRefs(content)); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::flex, NS_ConvertASCIItoUCS2("100%"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::flex, NS_ConvertASCIItoUCS2("100%"), PR_FALSE); aAnonymousChildren.AppendElement(content); // a grippy @@ -336,7 +336,7 @@ nsSplitterFrame::CreateAnonymousContent(nsIPresContext* aPresContext, // create a spring CreateAnonymousNode(mContent, nsXULAtoms::spring, nsXULAtoms::nameSpaceID, getter_AddRefs(content)); - content->SetAttribute(kNameSpaceID_None, nsXULAtoms::flex, NS_ConvertASCIItoUCS2("100%"), PR_FALSE); + content->SetAttr(kNameSpaceID_None, nsXULAtoms::flex, NS_ConvertASCIItoUCS2("100%"), PR_FALSE); aAnonymousChildren.AppendElement(content); } } @@ -559,7 +559,7 @@ nsSplitterFrameInner::MouseUp(nsIPresContext* aPresContext, nsGUIEvent* aEvent) State newState = GetState(); // if the state is dragging then make it Open. if (newState == Dragging) - mOuter->mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::state, nsAutoString(), PR_TRUE); + mOuter->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::state, nsAutoString(), PR_TRUE); mPressed = PR_FALSE; @@ -653,7 +653,7 @@ nsSplitterFrameInner::MouseDrag(nsIPresContext* aPresContext, nsGUIEvent* aEvent //printf("Collapse right\n"); if (GetCollapseDirection() == After) { - mOuter->mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("collapsed"), PR_TRUE); + mOuter->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("collapsed"), PR_TRUE); } @@ -662,7 +662,7 @@ nsSplitterFrameInner::MouseDrag(nsIPresContext* aPresContext, nsGUIEvent* aEvent //printf("Collapse left\n"); if (GetCollapseDirection() == Before) { - mOuter->mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("collapsed"), PR_TRUE); + mOuter->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("collapsed"), PR_TRUE); } } @@ -672,7 +672,7 @@ nsSplitterFrameInner::MouseDrag(nsIPresContext* aPresContext, nsGUIEvent* aEvent // if we are not in a collapsed position and we are not dragging make sure // we are dragging. if (currentState != Dragging) - mOuter->mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("dragging"), PR_TRUE); + mOuter->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("dragging"), PR_TRUE); if (realTimeDrag) AdjustChildren(aPresContext); @@ -815,7 +815,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent) mOuter->GetContent(getter_AddRefs(content)); nsAutoString disabled; - content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); + content->GetAttr(kNameSpaceID_None, nsHTMLAtoms::disabled, disabled); if (disabled.Equals(NS_LITERAL_STRING("true"))) return NS_OK; @@ -900,7 +900,7 @@ nsSplitterFrameInner::MouseDown(nsIDOMEvent* aMouseEvent) r.Inflate(margin); nsAutoString fixed; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::fixed, fixed); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::fixed, fixed); if (count < childIndex) { if (!fixed.Equals(NS_LITERAL_STRING("true"))) { @@ -998,7 +998,7 @@ nsSplitterFrameInner::MouseMove(nsIDOMEvent* aMouseEvent) if (mDragging) return NS_OK; - mOuter->mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("dragging"), PR_TRUE); + mOuter->mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::state, NS_ConvertASCIItoUCS2("dragging"), PR_TRUE); RemoveListener(); mOuter->CaptureMouse(mOuter->mPresContext, PR_TRUE); @@ -1023,7 +1023,7 @@ nsSplitterFrameInner::CollapseDirection nsSplitterFrameInner::GetCollapseDirection() { nsString value; - if (NS_CONTENT_ATTR_HAS_VALUE == mOuter->mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::collapse, value)) + if (NS_CONTENT_ATTR_HAS_VALUE == mOuter->mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::collapse, value)) { if (value.EqualsIgnoreCase("before")) return Before; @@ -1070,14 +1070,14 @@ nsSplitterFrameInner::UpdateState() if (mState == Collapsed) { // Collapsed -> Open // Collapsed -> Dragging - sibling->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - PR_TRUE); + sibling->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + PR_TRUE); } else if ((mState == Open || mState == Dragging) && newState == Collapsed) { // Open -> Collapsed // Dragging -> Collapsed - sibling->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_ConvertASCIItoUCS2("true"), PR_TRUE); + sibling->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_ConvertASCIItoUCS2("true"), PR_TRUE); } } } @@ -1263,11 +1263,11 @@ nsSplitterFrameInner::SetPreferredSize(nsBoxLayoutState& aState, nsIBox* aChildB char ch[50]; sprintf(ch,"%d",pref/aOnePixel); nsAutoString oldValue; - content->GetAttribute(kNameSpaceID_None, attribute, oldValue); + content->GetAttr(kNameSpaceID_None, attribute, oldValue); if (oldValue.EqualsWithConversion(ch)) return; - content->SetAttribute(kNameSpaceID_None, attribute, NS_ConvertASCIItoUCS2(ch), PR_TRUE); + content->SetAttr(kNameSpaceID_None, attribute, NS_ConvertASCIItoUCS2(ch), PR_TRUE); aChildBox->MarkDirty(aState); } diff --git a/layout/xul/base/src/nsTextBoxFrame.cpp b/layout/xul/base/src/nsTextBoxFrame.cpp index 02b325c1a44..5fc763803d4 100644 --- a/layout/xul/base/src/nsTextBoxFrame.cpp +++ b/layout/xul/base/src/nsTextBoxFrame.cpp @@ -174,7 +174,7 @@ nsTextBoxFrame::UpdateAttributes(nsIPresContext* aPresContext, if (aAttribute == nsnull || aAttribute == nsXULAtoms::crop) { nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::crop, value); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::crop, value); CroppingStyle cropType; if (value.EqualsIgnoreCase(CROP_LEFT) || value.EqualsIgnoreCase(CROP_START)) @@ -205,7 +205,7 @@ nsTextBoxFrame::UpdateAttributes(nsIPresContext* aPresContext, if (aAttribute == nsnull || aAttribute == nsHTMLAtoms::value) { nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value); if (!value.Equals(mTitle)) { mTitle = value; doUpdateTitle = PR_TRUE; @@ -214,12 +214,12 @@ nsTextBoxFrame::UpdateAttributes(nsIPresContext* aPresContext, if (aAttribute == nsnull || aAttribute == nsXULAtoms::accesskey) { nsAutoString accesskey; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::accesskey, accesskey); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::accesskey, accesskey); if (!accesskey.Equals(mAccessKey)) { if (!doUpdateTitle) { // Need to get clean mTitle and didn't already nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, value); + mContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, value); mTitle = value; doUpdateTitle = PR_TRUE; } diff --git a/layout/xul/base/src/nsTreeItemDragCapturer.cpp b/layout/xul/base/src/nsTreeItemDragCapturer.cpp index 9df4c0c4dda..98a99f20efe 100644 --- a/layout/xul/base/src/nsTreeItemDragCapturer.cpp +++ b/layout/xul/base/src/nsTreeItemDragCapturer.cpp @@ -280,9 +280,9 @@ nsTreeItemDragCapturer::DragOver(nsIDOMEvent* aDragEvent) char buffer[10]; sprintf(buffer, "%d", yLoc); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddDropLocationCoord, NS_ConvertASCIItoUCS2(buffer), PR_TRUE ); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddDropLocation, NS_ConvertASCIItoUCS2(beforeMe ? "true" : "false"), PR_FALSE ); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddDropOn, NS_ConvertASCIItoUCS2(onMe ? "true" : "false"), PR_TRUE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddDropLocationCoord, NS_ConvertASCIItoUCS2(buffer), PR_TRUE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddDropLocation, NS_ConvertASCIItoUCS2(beforeMe ? "true" : "false"), PR_FALSE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddDropOn, NS_ConvertASCIItoUCS2(onMe ? "true" : "false"), PR_TRUE ); } // cache the current drop location @@ -313,10 +313,10 @@ nsTreeItemDragCapturer::DragExit(nsIDOMEvent* aDragEvent) // AttributeChanged() about that attribute. char buffer[10]; sprintf(buffer, "%d", kNoDropLoc); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddDropLocationCoord, NS_ConvertASCIItoUCS2(buffer), PR_TRUE ); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddDropLocation, NS_ConvertASCIItoUCS2("false"), PR_TRUE ); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddDropOn, NS_ConvertASCIItoUCS2("false"), PR_TRUE ); - content->SetAttribute ( kNameSpaceID_None, nsXULAtoms::ddTriggerRepaintRestore, NS_ConvertASCIItoUCS2("1"), PR_TRUE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddDropLocationCoord, NS_ConvertASCIItoUCS2(buffer), PR_TRUE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddDropLocation, NS_ConvertASCIItoUCS2("false"), PR_TRUE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddDropOn, NS_ConvertASCIItoUCS2("false"), PR_TRUE ); + content->SetAttr ( kNameSpaceID_None, nsXULAtoms::ddTriggerRepaintRestore, NS_ConvertASCIItoUCS2("1"), PR_TRUE ); } // cache the current drop location diff --git a/layout/xul/base/src/nsTreeLayout.cpp b/layout/xul/base/src/nsTreeLayout.cpp index 92d304ffd51..f838c48e1fd 100644 --- a/layout/xul/base/src/nsTreeLayout.cpp +++ b/layout/xul/base/src/nsTreeLayout.cpp @@ -106,7 +106,7 @@ nsTreeLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState, nsSiz nsCOMPtr content; frame->GetContent(getter_AddRefs(content)); nsAutoString sizeMode; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); if (!sizeMode.IsEmpty()) { nscoord width = frame->ComputeIntrinsicWidth(aBoxLayoutState); if (width > aSize.width) @@ -134,7 +134,7 @@ nsTreeLayout::GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState, nsSize nsCOMPtr content; frame->GetContent(getter_AddRefs(content)); nsAutoString sizeMode; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); if (!sizeMode.IsEmpty()) { nscoord width = frame->ComputeIntrinsicWidth(aBoxLayoutState); if (width > aSize.width) diff --git a/layout/xul/base/src/nsXULTreeCellFrame.cpp b/layout/xul/base/src/nsXULTreeCellFrame.cpp index 6f91ceea346..9d6ff11e118 100644 --- a/layout/xul/base/src/nsXULTreeCellFrame.cpp +++ b/layout/xul/base/src/nsXULTreeCellFrame.cpp @@ -75,7 +75,7 @@ nsXULTreeCellFrame::GetFrameForPoint(nsIPresContext* aPresContext, nsIFrame** aFrame) { nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); if (value.EqualsWithConversion("true")) { return nsBoxFrame::GetFrameForPoint(aPresContext, aPoint, aWhichLayer, aFrame); @@ -164,7 +164,7 @@ nsXULTreeCellFrame::GetFrameForPoint(nsIPresContext* aPresContext, (*aFrame)->GetContent(getter_AddRefs(content)); if (content) { // This allows selective overriding for subcontent. - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); if (value.EqualsWithConversion("true")) return result; } diff --git a/layout/xul/base/src/nsXULTreeFrame.cpp b/layout/xul/base/src/nsXULTreeFrame.cpp index ba320ca2146..089f78f2292 100644 --- a/layout/xul/base/src/nsXULTreeFrame.cpp +++ b/layout/xul/base/src/nsXULTreeFrame.cpp @@ -358,7 +358,7 @@ nsXULTreeFrame::AttributeChanged (nsIPresContext* aPresContext, nsIContent* aChi treeOuterGroup->GetContent(getter_AddRefs(child)); nsAutoString rows; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::rows, rows); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::rows, rows); if (!rows.IsEmpty()) { PRInt32 dummy; @@ -369,7 +369,7 @@ nsXULTreeFrame::AttributeChanged (nsIPresContext* aPresContext, nsIContent* aChi rowHeight = NSTwipsToIntPixels(rowHeight, t2p); nsAutoString value; value.AppendInt(rowHeight*count); - child->SetAttribute(kNameSpaceID_None, nsXULAtoms::minheight, value, PR_FALSE); + child->SetAttr(kNameSpaceID_None, nsXULAtoms::minheight, value, PR_FALSE); nsBoxLayoutState state(aPresContext); treeOuterGroup->MarkDirty(state); diff --git a/layout/xul/base/src/nsXULTreeGroupFrame.cpp b/layout/xul/base/src/nsXULTreeGroupFrame.cpp index 1cc13bb9fa3..22863962df6 100644 --- a/layout/xul/base/src/nsXULTreeGroupFrame.cpp +++ b/layout/xul/base/src/nsXULTreeGroupFrame.cpp @@ -731,12 +731,12 @@ nsXULTreeGroupFrame :: AttributeChanged ( nsIPresContext* aPresContext, nsIConte } else if ( aAttribute == nsXULAtoms::ddDropLocationCoord ) { nsAutoString attribute; - aChild->GetAttribute ( kNameSpaceID_None, aAttribute, attribute ); + aChild->GetAttr ( kNameSpaceID_None, aAttribute, attribute ); mYDropLoc = attribute.ToInteger(&ignore); } else if ( aAttribute == nsXULAtoms::ddDropOn ) { nsAutoString attribute; - aChild->GetAttribute ( kNameSpaceID_None, aAttribute, attribute ); + aChild->GetAttr ( kNameSpaceID_None, aAttribute, attribute ); attribute.ToLowerCase(); mDropOnContainer = attribute.EqualsWithConversion("true"); } diff --git a/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp b/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp index fe1369287ba..8e30f212a70 100644 --- a/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp +++ b/layout/xul/base/src/nsXULTreeOuterGroupFrame.cpp @@ -319,13 +319,13 @@ nsXULTreeOuterGroupFrame::Init(nsIPresContext* aPresContext, nsIContent* aConten nsresult rv = nsXULTreeGroupFrame::Init(aPresContext, aContent, aParent, aContext, aPrevInFlow); nsAutoString value; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::treeitem, value); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::treeitem, value); if (!value.IsEmpty()) mTreeItemTag = getter_AddRefs(NS_NewAtom(value)); - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::treerow, value); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::treerow, value); if (!value.IsEmpty()) mTreeRowTag = getter_AddRefs(NS_NewAtom(value)); - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::treechildren, value); + mContent->GetAttr(kNameSpaceID_None, nsXULAtoms::treechildren, value); if (!value.IsEmpty()) mTreeChildrenTag = getter_AddRefs(NS_NewAtom(value)); @@ -384,7 +384,7 @@ nsXULTreeOuterGroupFrame::Init(nsIPresContext* aPresContext, nsIContent* aConten if ( parent ) { nsAutoString attr; - parent->GetAttribute ( kNameSpaceID_None, nsXULAtoms::ddNoDropBetweenRows, attr ); + parent->GetAttr ( kNameSpaceID_None, nsXULAtoms::ddNoDropBetweenRows, attr ); if ( attr.Equals(NS_ConvertASCIItoUCS2("true")) ) mCanDropBetweenRows = PR_FALSE; } @@ -434,11 +434,11 @@ nsXULTreeOuterGroupFrame::GetFixedRowSize() nsCOMPtr parent; GetTreeContent(getter_AddRefs(parent)); nsAutoString rows; - parent->GetAttribute(kNameSpaceID_None, nsXULAtoms::rows, rows); + parent->GetAttr(kNameSpaceID_None, nsXULAtoms::rows, rows); if (!rows.IsEmpty()) return rows.ToInteger(&dummy); - parent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, rows); + parent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, rows); if (!rows.IsEmpty()) return rows.ToInteger(&dummy); @@ -455,9 +455,9 @@ nsXULTreeOuterGroupFrame::SetRowHeight(nscoord aRowHeight) nsCOMPtr parent; GetTreeContent(getter_AddRefs(parent)); nsAutoString rows; - parent->GetAttribute(kNameSpaceID_None, nsXULAtoms::rows, rows); + parent->GetAttr(kNameSpaceID_None, nsXULAtoms::rows, rows); if (rows.IsEmpty()) - parent->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::size, rows); + parent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, rows); if (!rows.IsEmpty()) { PRInt32 dummy; @@ -467,7 +467,7 @@ nsXULTreeOuterGroupFrame::SetRowHeight(nscoord aRowHeight) PRInt32 rowHeight = NSTwipsToIntPixels(aRowHeight, t2p); nsAutoString value; value.AppendInt(rowHeight*count); - mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::minheight, value, PR_FALSE); + mContent->SetAttr(kNameSpaceID_None, nsXULAtoms::minheight, value, PR_FALSE); } // signal we need to dirty everything @@ -562,7 +562,7 @@ nsXULTreeOuterGroupFrame::ComputeTotalRowCount(PRInt32& aCount, nsIContent* aPar nsAutoString isOpen; nsCOMPtr parent; childContent->GetParent(*getter_AddRefs(parent)); - parent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); + parent->GetAttr(kNameSpaceID_None, openAtom, isOpen); if (isOpen.EqualsWithConversion("true")) ComputeTotalRowCount(aCount, childContent); } @@ -1041,7 +1041,7 @@ nsXULTreeOuterGroupFrame::FindPreviousRowContent(PRInt32& aDelta, nsIContent* aU // If it's open, descend into its treechildren node first. nsCOMPtr openAtom = dont_AddRef(NS_NewAtom("open")); nsAutoString isOpen; - childContent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); + childContent->GetAttr(kNameSpaceID_None, openAtom, isOpen); if (isOpen.EqualsWithConversion("true")) { // Find the node. PRInt32 childContentCount; @@ -1137,7 +1137,7 @@ nsXULTreeOuterGroupFrame::FindNextRowContent(PRInt32& aDelta, nsIContent* aUpwar // If it's open, descend into its treechildren node first. nsCOMPtr openAtom = dont_AddRef(NS_NewAtom("open")); nsAutoString isOpen; - parentContent->GetAttribute(kNameSpaceID_None, openAtom, isOpen); + parentContent->GetAttr(kNameSpaceID_None, openAtom, isOpen); if (isOpen.EqualsWithConversion("true")) { FindNextRowContent(aDelta, nsnull, childContent, aResult); if (aDelta == 0) @@ -1263,7 +1263,7 @@ nsXULTreeOuterGroupFrame::IndexOfItem(nsIContent* aRoot, nsIContent* aContent, // descend as normally, but remember that the parent is closed! else if (childTag == mTreeItemTag) { nsAutoString isOpen; - rv = child->GetAttribute(kNameSpaceID_None, nsXULAtoms::open, isOpen); + rv = child->GetAttr(kNameSpaceID_None, nsXULAtoms::open, isOpen); if (!isOpen.EqualsWithConversion("true")) parentIsOpen=PR_FALSE; @@ -1679,7 +1679,7 @@ nsTreeScrollPortFrame::GetMinSize(nsBoxLayoutState& aBoxLayoutState, nsSize& aSi nsAutoString sizeMode; nsCOMPtr content; outer->GetContent(getter_AddRefs(content)); - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::sizemode, sizeMode); if (!sizeMode.IsEmpty()) { nsCOMPtr scrollFrame(do_QueryInterface(mParent)); if (scrollFrame) { diff --git a/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp b/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp index c8f761494b9..54b026a13b8 100644 --- a/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp +++ b/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp @@ -155,7 +155,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) mColElement = aColElement; // Fetch the ID. - mColElement->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, mID); + mColElement->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, mID); // Cache the ID as an atom. mIDAtom = getter_AddRefs(NS_NewAtom(mID)); @@ -166,7 +166,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) // Fetch the crop style. mCropStyle = 0; nsAutoString crop; - mColElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::crop, crop); + mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::crop, crop); if (crop.EqualsIgnoreCase("center")) mCropStyle = 1; else if (crop.EqualsIgnoreCase("left") || crop.EqualsIgnoreCase("start")) @@ -189,7 +189,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) // and twisties drawn. mIsPrimaryCol = PR_FALSE; nsAutoString primary; - mColElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::primary, primary); + mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::primary, primary); if (primary.EqualsIgnoreCase("true")) mIsPrimaryCol = PR_TRUE; @@ -197,7 +197,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) // to happen). mIsCyclerCol = PR_FALSE; nsAutoString cycler; - mColElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::cycler, cycler); + mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::cycler, cycler); if (cycler.EqualsIgnoreCase("true")) mIsCyclerCol = PR_TRUE; } @@ -625,7 +625,7 @@ nsOutlinerBodyFrame::UpdateScrollbar() nsAutoString curPos; curPos.AppendInt(mTopRowIndex*rowHeightAsPixels); - scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); + scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); } nsresult nsOutlinerBodyFrame::SetVisibleScrollbar(PRBool aSetVisible) @@ -634,15 +634,15 @@ nsresult nsOutlinerBodyFrame::SetVisibleScrollbar(PRBool aSetVisible) mScrollbar->GetContent(getter_AddRefs(scrollbarContent)); nsAutoString isCollapsed; - scrollbarContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - isCollapsed); + scrollbarContent->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + isCollapsed); if (!isCollapsed.IsEmpty() && aSetVisible) - scrollbarContent->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - PR_TRUE); + scrollbarContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + PR_TRUE); else if (isCollapsed.IsEmpty() && !aSetVisible) - scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_LITERAL_STRING("true"), PR_TRUE); + scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_LITERAL_STRING("true"), PR_TRUE); Invalidate(); @@ -680,13 +680,13 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateScrollbar() PRInt32 size = rowHeightAsPixels*(rowCount-mPageCount); maxposStr.AppendInt(size); - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::maxpos, maxposStr, PR_TRUE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::maxpos, maxposStr, PR_TRUE); // Also set our page increment and decrement. nscoord pageincrement = mPageCount*rowHeightAsPixels; nsAutoString pageStr; pageStr.AppendInt(pageincrement); - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::pageincrement, pageStr, PR_TRUE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::pageincrement, pageStr, PR_TRUE); return NS_OK; } @@ -2277,7 +2277,7 @@ nsOutlinerBodyFrame::PositionChanged(PRInt32 aOldIndex, PRInt32& aNewIndex) mScrollbar->GetContent(getter_AddRefs(scrollbarContent)); nsAutoString curPos; curPos.AppendInt(aNewIndex); - scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); + scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); return NS_OK; } diff --git a/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp b/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp index 0e58372c0fb..acdf832ea0e 100644 --- a/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp +++ b/layout/xul/base/src/outliner/src/nsOutlinerColFrame.cpp @@ -133,7 +133,7 @@ nsOutlinerColFrame::GetFrameForPoint(nsIPresContext* aPresContext, if (content) { // This allows selective overriding for subcontent. nsAutoString value; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); if (value.EqualsWithConversion("true")) return result; } diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index c8f761494b9..54b026a13b8 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -155,7 +155,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) mColElement = aColElement; // Fetch the ID. - mColElement->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, mID); + mColElement->GetAttr(kNameSpaceID_None, nsHTMLAtoms::id, mID); // Cache the ID as an atom. mIDAtom = getter_AddRefs(NS_NewAtom(mID)); @@ -166,7 +166,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) // Fetch the crop style. mCropStyle = 0; nsAutoString crop; - mColElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::crop, crop); + mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::crop, crop); if (crop.EqualsIgnoreCase("center")) mCropStyle = 1; else if (crop.EqualsIgnoreCase("left") || crop.EqualsIgnoreCase("start")) @@ -189,7 +189,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) // and twisties drawn. mIsPrimaryCol = PR_FALSE; nsAutoString primary; - mColElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::primary, primary); + mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::primary, primary); if (primary.EqualsIgnoreCase("true")) mIsPrimaryCol = PR_TRUE; @@ -197,7 +197,7 @@ nsOutlinerColumn::nsOutlinerColumn(nsIContent* aColElement, nsIFrame* aFrame) // to happen). mIsCyclerCol = PR_FALSE; nsAutoString cycler; - mColElement->GetAttribute(kNameSpaceID_None, nsXULAtoms::cycler, cycler); + mColElement->GetAttr(kNameSpaceID_None, nsXULAtoms::cycler, cycler); if (cycler.EqualsIgnoreCase("true")) mIsCyclerCol = PR_TRUE; } @@ -625,7 +625,7 @@ nsOutlinerBodyFrame::UpdateScrollbar() nsAutoString curPos; curPos.AppendInt(mTopRowIndex*rowHeightAsPixels); - scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); + scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); } nsresult nsOutlinerBodyFrame::SetVisibleScrollbar(PRBool aSetVisible) @@ -634,15 +634,15 @@ nsresult nsOutlinerBodyFrame::SetVisibleScrollbar(PRBool aSetVisible) mScrollbar->GetContent(getter_AddRefs(scrollbarContent)); nsAutoString isCollapsed; - scrollbarContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - isCollapsed); + scrollbarContent->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + isCollapsed); if (!isCollapsed.IsEmpty() && aSetVisible) - scrollbarContent->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - PR_TRUE); + scrollbarContent->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + PR_TRUE); else if (isCollapsed.IsEmpty() && !aSetVisible) - scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::collapsed, - NS_LITERAL_STRING("true"), PR_TRUE); + scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, + NS_LITERAL_STRING("true"), PR_TRUE); Invalidate(); @@ -680,13 +680,13 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateScrollbar() PRInt32 size = rowHeightAsPixels*(rowCount-mPageCount); maxposStr.AppendInt(size); - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::maxpos, maxposStr, PR_TRUE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::maxpos, maxposStr, PR_TRUE); // Also set our page increment and decrement. nscoord pageincrement = mPageCount*rowHeightAsPixels; nsAutoString pageStr; pageStr.AppendInt(pageincrement); - scrollbar->SetAttribute(kNameSpaceID_None, nsXULAtoms::pageincrement, pageStr, PR_TRUE); + scrollbar->SetAttr(kNameSpaceID_None, nsXULAtoms::pageincrement, pageStr, PR_TRUE); return NS_OK; } @@ -2277,7 +2277,7 @@ nsOutlinerBodyFrame::PositionChanged(PRInt32 aOldIndex, PRInt32& aNewIndex) mScrollbar->GetContent(getter_AddRefs(scrollbarContent)); nsAutoString curPos; curPos.AppendInt(aNewIndex); - scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); + scrollbarContent->SetAttr(kNameSpaceID_None, nsXULAtoms::curpos, curPos, PR_TRUE); return NS_OK; } diff --git a/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index 0e58372c0fb..acdf832ea0e 100644 --- a/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -133,7 +133,7 @@ nsOutlinerColFrame::GetFrameForPoint(nsIPresContext* aPresContext, if (content) { // This allows selective overriding for subcontent. nsAutoString value; - content->GetAttribute(kNameSpaceID_None, nsXULAtoms::allowevents, value); + content->GetAttr(kNameSpaceID_None, nsXULAtoms::allowevents, value); if (value.EqualsWithConversion("true")) return result; } diff --git a/webshell/tests/viewer/nsWebCrawler.cpp b/webshell/tests/viewer/nsWebCrawler.cpp index fa5984f736c..3bec8617a47 100644 --- a/webshell/tests/viewer/nsWebCrawler.cpp +++ b/webshell/tests/viewer/nsWebCrawler.cpp @@ -715,10 +715,10 @@ nsWebCrawler::FindURLsIn(nsIDocument* aDocument, nsIContent* aNode) // Get absolute url that tag targets nsAutoString base, src, absURLSpec; if (atom == mLinkTag) { - aNode->GetAttribute(kNameSpaceID_HTML, mHrefAttr, src); + aNode->GetAttr(kNameSpaceID_HTML, mHrefAttr, src); } else { - aNode->GetAttribute(kNameSpaceID_HTML, mSrcAttr, src); + aNode->GetAttr(kNameSpaceID_HTML, mSrcAttr, src); } nsCOMPtr docURL; aDocument->GetDocumentURL(getter_AddRefs(docURL));