Fixed SetAttribute where the leaf classes StringToAttribute wasn't being called

git-svn-id: svn://10.0.0.236/trunk@9175 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com 1998-09-03 00:03:58 +00:00
parent a75c02b0f1
commit a0783a4a5a
2 changed files with 12 additions and 24 deletions

View File

@ -1135,20 +1135,14 @@ nsHTMLGenericContent::SetAttribute(nsIAtom* aAttribute,
NS_RELEASE(css);
}
else {
if (nsnull != mDocument) { // set attr via style sheet
nsIHTMLStyleSheet* sheet = GetAttrStyleSheet(mDocument);
result = sheet->SetAttributeFor(aAttribute, aValue, mTag, mAttributes);
nsHTMLValue val;
if (NS_CONTENT_ATTR_NOT_THERE !=
mContent->StringToAttribute(aAttribute, aValue, val)) {
}
else { // manage this ourselves and re-sync when we connect to doc
result = EnsureWritableAttributes(mAttributes, PR_TRUE);
if (nsnull != mAttributes) {
PRInt32 count;
result = mAttributes->SetAttribute(aAttribute, aValue, count);
if (0 == count) {
ReleaseAttributes(mAttributes);
}
}
else {
val.SetStringValue(aValue);
}
result = SetAttribute(aAttribute, val, aNotify);
}
return result;
}

View File

@ -1135,20 +1135,14 @@ nsHTMLGenericContent::SetAttribute(nsIAtom* aAttribute,
NS_RELEASE(css);
}
else {
if (nsnull != mDocument) { // set attr via style sheet
nsIHTMLStyleSheet* sheet = GetAttrStyleSheet(mDocument);
result = sheet->SetAttributeFor(aAttribute, aValue, mTag, mAttributes);
nsHTMLValue val;
if (NS_CONTENT_ATTR_NOT_THERE !=
mContent->StringToAttribute(aAttribute, aValue, val)) {
}
else { // manage this ourselves and re-sync when we connect to doc
result = EnsureWritableAttributes(mAttributes, PR_TRUE);
if (nsnull != mAttributes) {
PRInt32 count;
result = mAttributes->SetAttribute(aAttribute, aValue, count);
if (0 == count) {
ReleaseAttributes(mAttributes);
}
}
else {
val.SetStringValue(aValue);
}
result = SetAttribute(aAttribute, val, aNotify);
}
return result;
}