Bug 66835 - fix method hiding warnings by renaming some methods on nsIContent. r=jag, sr=jst.

This commit is contained in:
bryner%netscape.com 2001-08-17 08:14:14 +00:00
parent 600ed88945
commit 422834eff1
138 changed files with 1354 additions and 1314 deletions

View File

@ -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:
*
* </UL>
*/
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

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -69,7 +69,7 @@ nsDOMAttributeMap::GetNamedItem(const nsAReadableString& aAttrName,
nsresult rv = NS_OK;
if (mContent) {
nsCOMPtr<nsINodeInfo> 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<nsINodeInfo> ni;
mContent->NormalizeAttributeString(name, *getter_AddRefs(ni));
mContent->NormalizeAttrString(name, *getter_AddRefs(ni));
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
nsCOMPtr<nsIAtom> 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<nsINodeInfo> ni;
mContent->NormalizeAttributeString(aName, *getter_AddRefs(ni));
mContent->NormalizeAttrString(aName, *getter_AddRefs(ni));
NS_ENSURE_TRUE(ni, NS_ERROR_FAILURE);
nsCOMPtr<nsIAtom> 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<nsINodeInfo> 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;

View File

@ -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);

View File

@ -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;

View File

@ -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; \

View File

@ -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<nsINodeInfo> 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<nsINodeInfo> 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<nsINodeInfo> 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<nsINodeInfo> 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<nsINodeInfoManager> 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<nsIAtom> 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);

View File

@ -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;

View File

@ -281,13 +281,13 @@ nsHTMLContentSerializer::SerializeAttributes(nsIContent* aContent,
PRInt32 namespaceID;
nsCOMPtr<nsIAtom> 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 <br type="_moz"> or <br _moz*>,
@ -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 {

View File

@ -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;
}
}

View File

@ -402,20 +402,20 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
nsAutoString nameStr, prefixStr, uriStr, valueStr;
nsCOMPtr<nsIAtom> 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")))

View File

@ -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) {

View File

@ -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;

View File

@ -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());

View File

@ -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<nsIURI> 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<nsIURI> 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)
{

View File

@ -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; \
} \
}

View File

@ -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<nsIPresContext> 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");

View File

@ -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");

View File

@ -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

View File

@ -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);
}

View File

@ -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)

View File

@ -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<nsIPresShell> shell;

View File

@ -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;
}

View File

@ -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

View File

@ -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");

View File

@ -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;
}

View File

@ -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);

View File

@ -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");

View File

@ -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;
}

View File

@ -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<nsIAtom> 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;

View File

@ -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<nsIAtom> 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);

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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
}

View File

@ -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<nsIURI> baseURI;

View File

@ -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<nsIURI> baseURI;

View File

@ -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<nsIAtom> name;
nsCOMPtr<nsIAtom> 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;

View File

@ -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;

View File

@ -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 <html> 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<nsIDOMText> textNode;
nsCOMPtr<nsIDocument> 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<nsIAtom> 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.

View File

@ -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 <key> 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 <command> 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);
}

View File

@ -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<nsIXBLPrototypeHandler> newHandler;
NS_NewXBLPrototypeHandler(handler, getter_AddRefs(newHandler));

View File

@ -144,7 +144,7 @@ nsXBLSpecialDocInfo::GetHandlers(nsIXBLDocumentInfo* aInfo,
nsCOMPtr<nsIContent> 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<nsIDocument> doc;

View File

@ -182,7 +182,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI)
nsCOMPtr<nsIContent> 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<nsIURI> 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);
}

View File

@ -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,

View File

@ -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;

View File

@ -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<nsIURI> 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<nsIAtom> fieldAtom(dont_AddRef(NS_NewAtom(header)));

View File

@ -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;
}

View File

@ -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<nsINodeInfo> 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) {

View File

@ -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<nsIAtom> nameAtom;
nsCOMPtr<nsINodeInfo> 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<nsINodeInfo> 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<nsIAtom> tag;
nsCOMPtr<nsINodeInfo> 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<nsINodeInfo> 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<nsIAtom> 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<nsIContent> content = do_QueryInterface(node);
content->UnsetAttribute(kNameSpaceID_None, nsXULAtoms::selected, PR_FALSE);
content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::selected, PR_FALSE);
nsCOMPtr<nsIXULTreeContent> tree = do_QueryInterface(treeElement);
nsCOMPtr<nsIDOMXULElement> 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<nsINodeInfoManager> nimgr;
@ -3106,23 +3106,23 @@ nsXULElement::SetAttribute(PRInt32 aNameSpaceID,
nsCOMPtr<nsINodeInfo> 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<nsIAtom> 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<nsIAtom> attr;
nsCOMPtr<nsIAtom> 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<nsIAtom> 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)) {

View File

@ -233,7 +233,7 @@ public:
nsCOMPtr<nsIStyleRule> 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;

View File

@ -228,7 +228,7 @@ nsXULTreeElement::ClearItemSelection()
nsCOMPtr<nsIDOMNode> node;
mSelectedItems->Item(0, getter_AddRefs(node));
nsCOMPtr<nsIContent> 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<nsIContent> 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<nsIContent> 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<nsIAtom> 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<nsIContent> 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;
}

View File

@ -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) {

View File

@ -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<nsIAtom> tag;
nsCOMPtr<nsINodeInfo> 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<nsIDOMElement> 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<nsIContent> 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<nsIDOMElement> 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<nsIAtom> 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<nsIDOMElement> 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<nsIDOMNode> 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) {

View File

@ -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<nsIAtom> 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<nsIAtom> tag;
nsCOMPtr<nsINodeInfo> 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<numAttribs; aLoop++) {
PRInt32 attribNameSpaceID;
nsCOMPtr<nsIAtom> 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<nsIAtom> 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));

View File

@ -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<nsIAtom> 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("*"));

View File

@ -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<nsIContent> 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());

View File

@ -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<nsIRDFCompositeDataSource> cds;
if (NS_SUCCEEDED(rv = domXulTree->GetDatabase(getter_AddRefs(cds))))

View File

@ -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)
// </window>
//
nsAutoString templateID;
mRoot->GetAttribute(kNameSpaceID_None, nsXULAtoms::templateAtom, templateID);
mRoot->GetAttr(kNameSpaceID_None, nsXULAtoms::templateAtom, templateID);
if (templateID.Length()) {
nsCOMPtr<nsIDocument> 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<nsIRDFResource> 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<nsIRDFResource> 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<nsIRDFNode> 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] <binding> 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<nsIAtom> 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<nsIAtom> 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.

View File

@ -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<nsIContent> 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());

View File

@ -580,12 +580,12 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode,
PRInt32 attrCount, i, nameSpaceID;
nsCOMPtr<nsIAtom> attrName, prefix;
content->GetAttributeCount(attrCount);
content->GetAttrCount(attrCount);
for (i=0; i<attrCount; i++)
{
content->GetAttributeNameAt(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<nsIAtom> attrName, prefix;
nsresult res, res2;
content1->GetAttributeCount(attrCount);
content1->GetAttrCount(attrCount);
nsAutoString attrString, tmp, attrVal1, attrVal2;
for (i=0; i<attrCount; i++)
{
content1->GetAttributeNameAt(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; i<attrCount; i++)
{
content2->GetAttributeNameAt(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

View File

@ -580,12 +580,12 @@ PRBool nsHTMLEditor::IsOnlyAttribute(nsIDOMNode *aNode,
PRInt32 attrCount, i, nameSpaceID;
nsCOMPtr<nsIAtom> attrName, prefix;
content->GetAttributeCount(attrCount);
content->GetAttrCount(attrCount);
for (i=0; i<attrCount; i++)
{
content->GetAttributeNameAt(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<nsIAtom> attrName, prefix;
nsresult res, res2;
content1->GetAttributeCount(attrCount);
content1->GetAttrCount(attrCount);
nsAutoString attrString, tmp, attrVal1, attrVal2;
for (i=0; i<attrCount; i++)
{
content1->GetAttributeNameAt(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; i<attrCount; i++)
{
content2->GetAttributeNameAt(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

View File

@ -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<nsIFrameManager> 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.

View File

@ -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);
}

View File

@ -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();

View File

@ -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<nsIContent> 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;

View File

@ -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);
}
}

View File

@ -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<nsIDOMHTMLInputElement> 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);
}

View File

@ -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<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(content));
if (inputElement) {

View File

@ -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;

View File

@ -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)) {

View File

@ -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!

View File

@ -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);
}
}

View File

@ -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<nsIHTMLContent> 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<nsIHTMLContent> formControl(do_QueryInterface(mContent));
if (formControl) {
formControl->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::value, aValue);
formControl->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, aValue);
}
}
return NS_OK;

View File

@ -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

View File

@ -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);
}

View File

@ -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;

View File

@ -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.

View File

@ -411,22 +411,22 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
nsCOMPtr<nsIContent> 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<nsIScrollbarFrame> 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;

View File

@ -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<nsIDOMHTMLMapElement> 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;

View File

@ -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

View File

@ -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<nsIURI> 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<nsIPresShell> 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<nsIURI> 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<nsIURI> codeBaseURL;
rv = NS_NewURI(getter_AddRefs(fullURL), codeBase, baseURL);
if (NS_SUCCEEDED(rv)) {
@ -957,9 +957,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
nsCOMPtr<nsIAtom> 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<nsIURI> 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 <object> 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 <embed> 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<nsIAtom> atom;
nsCOMPtr<nsIAtom> 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

View File

@ -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")) {

View File

@ -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;

View File

@ -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);
}

View File

@ -411,22 +411,22 @@ nsGfxScrollFrame::CreateAnonymousContent(nsIPresContext* aPresContext,
nsCOMPtr<nsIContent> 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<nsIScrollbarFrame> 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;

View File

@ -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<nsIDOMHTMLMapElement> 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;

View File

@ -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

View File

@ -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<nsIURI> 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<nsIPresShell> 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<nsIURI> 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<nsIURI> codeBaseURL;
rv = NS_NewURI(getter_AddRefs(fullURL), codeBase, baseURL);
if (NS_SUCCEEDED(rv)) {
@ -957,9 +957,9 @@ nsObjectFrame::Reflow(nsIPresContext* aPresContext,
nsCOMPtr<nsIAtom> 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<nsIURI> 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 <object> 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 <embed> 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<nsIAtom> atom;
nsCOMPtr<nsIAtom> 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

View File

@ -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();

View File

@ -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")) {

View File

@ -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.

View File

@ -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<nsIContent> 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;

View File

@ -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);
}
}

View File

@ -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<nsIDOMHTMLInputElement> 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);
}

View File

@ -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<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(content));
if (inputElement) {

View File

@ -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;

View File

@ -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)) {

View File

@ -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!

Some files were not shown because too many files have changed in this diff Show More