made attribute accessors respect unknown namespace for getters (wildcard)

This commit is contained in:
peterl%netscape.com 1999-01-30 06:20:39 +00:00
Родитель cda3bca867
Коммит 77e6eb5115
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -1713,7 +1713,8 @@ nsGenericContainerElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
PRInt32 index; PRInt32 index;
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index); const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index);
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) { if (((kNameSpaceID_Unknown == aNameSpaceID) || (attr->mNameSpaceID == aNameSpaceID)) &&
(attr->mName == aName)) {
aResult = attr->mValue; aResult = attr->mValue;
if (0 < aResult.Length()) { if (0 < aResult.Length()) {
rv = NS_CONTENT_ATTR_HAS_VALUE; rv = NS_CONTENT_ATTR_HAS_VALUE;
@ -1746,7 +1747,8 @@ nsGenericContainerElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
PRBool found = PR_FALSE; PRBool found = PR_FALSE;
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(index); nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(index);
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) { if (((kNameSpaceID_Unknown == aNameSpaceID) || (attr->mNameSpaceID == aNameSpaceID)) &&
(attr->mName == aName)) {
mAttributes->RemoveElementAt(index); mAttributes->RemoveElementAt(index);
delete attr; delete attr;
found = PR_TRUE; found = PR_TRUE;

Просмотреть файл

@ -1713,7 +1713,8 @@ nsGenericContainerElement::GetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
PRInt32 index; PRInt32 index;
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index); const nsGenericAttribute* attr = (const nsGenericAttribute*)mAttributes->ElementAt(index);
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) { if (((kNameSpaceID_Unknown == aNameSpaceID) || (attr->mNameSpaceID == aNameSpaceID)) &&
(attr->mName == aName)) {
aResult = attr->mValue; aResult = attr->mValue;
if (0 < aResult.Length()) { if (0 < aResult.Length()) {
rv = NS_CONTENT_ATTR_HAS_VALUE; rv = NS_CONTENT_ATTR_HAS_VALUE;
@ -1746,7 +1747,8 @@ nsGenericContainerElement::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName,
PRBool found = PR_FALSE; PRBool found = PR_FALSE;
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(index); nsGenericAttribute* attr = (nsGenericAttribute*)mAttributes->ElementAt(index);
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) { if (((kNameSpaceID_Unknown == aNameSpaceID) || (attr->mNameSpaceID == aNameSpaceID)) &&
(attr->mName == aName)) {
mAttributes->RemoveElementAt(index); mAttributes->RemoveElementAt(index);
delete attr; delete attr;
found = PR_TRUE; found = PR_TRUE;