зеркало из https://github.com/mozilla/gecko-dev.git
Made sure that attributes keys get tracked case-insensitively. Fixed return values from GetAttribute().
This commit is contained in:
Родитель
7892a30704
Коммит
e05d03fac8
|
@ -154,7 +154,9 @@ private:
|
||||||
nsIAtom* mAttr;
|
nsIAtom* mAttr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AttributeKey(const nsString& s) {
|
AttributeKey(const nsString& attr) {
|
||||||
|
nsAutoString s;
|
||||||
|
attr.ToUpperCase(s); // just be case-insensitive
|
||||||
mAttr = NS_NewAtom(s);
|
mAttr = NS_NewAtom(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -897,14 +899,14 @@ nsRDFElement::SetAttribute(const nsString& aName,
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsRDFElement::GetAttribute(const nsString& aName, nsString& aResult) const
|
nsRDFElement::GetAttribute(const nsString& aName, nsString& aResult) const
|
||||||
{
|
{
|
||||||
nsresult rv = NS_ERROR_FAILURE; // XXX is this right?
|
nsresult rv = NS_CONTENT_ATTR_NO_VALUE;
|
||||||
|
|
||||||
if (mAttributes) {
|
if (mAttributes) {
|
||||||
AttributeKey key(aName);
|
AttributeKey key(aName);
|
||||||
nsString* value = NS_STATIC_CAST(nsString*, mAttributes->Get(&key));
|
nsString* value = NS_STATIC_CAST(nsString*, mAttributes->Get(&key));
|
||||||
if (value) {
|
if (value) {
|
||||||
aResult = *value;
|
aResult = *value;
|
||||||
return NS_OK;
|
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче