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:
parent
a75c02b0f1
commit
a0783a4a5a
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user