Fix dataloss bug 134298: SaveAs leaves private -moz attributes in the output; patch=heikki, r=rbs, sr=jst, a=asa

This commit is contained in:
rbs%maths.uq.edu.au 2002-04-09 04:12:01 +00:00
Родитель 2c6fb85dda
Коммит 6b0d922643
1 изменённых файлов: 8 добавлений и 1 удалений

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

@ -485,6 +485,7 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
namespaceID, namespaceID,
*getter_AddRefs(attrName), *getter_AddRefs(attrName),
*getter_AddRefs(attrPrefix)); *getter_AddRefs(attrPrefix));
if (attrPrefix) { if (attrPrefix) {
attrPrefix->ToString(prefixStr); attrPrefix->ToString(prefixStr);
} }
@ -500,7 +501,13 @@ nsXMLContentSerializer::AppendElementStart(nsIDOMElement *aElement,
content->GetAttr(namespaceID, attrName, valueStr); content->GetAttr(namespaceID, attrName, valueStr);
attrName->ToString(nameStr); attrName->ToString(nameStr);
// XXX Hack to get around the fact that MathML can add
// attributes starting with '-', which makes them
// invalid XML.
if (!nameStr.IsEmpty() && nameStr.First() == '-')
continue;
SerializeAttr(prefixStr, nameStr, valueStr, aStr, PR_TRUE); SerializeAttr(prefixStr, nameStr, valueStr, aStr, PR_TRUE);
if (addNSAttr) { if (addNSAttr) {