bug 157142, transformiix standalone should use XPCOM atoms. r=sicking, sr=peterv

This commit is contained in:
axel%pike.org 2005-11-02 07:38:51 +00:00
Родитель 2ede343f63
Коммит 2c744b8cc7
3 изменённых файлов: 15 добавлений и 6 удалений

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

@ -286,9 +286,7 @@ MBool txHTMLOutput::isShorthandAttribute(const String& aLocalName)
if (mHTMLEmptyAttributes[k].mElementList.IndexOf(currentElement->mLocalName) > -1) {
return MB_TRUE;
}
else {
return MB_FALSE;
}
return MB_FALSE;
}
}
return MB_FALSE;

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

@ -42,6 +42,10 @@
#include "txXMLOutput.h"
#include "Map.h"
#include "Stack.h"
#include "nsCOMArray.h"
#define SHORTHAND_ATTR_COUNT 12
#define EMPTY_ELEMENTS_COUNT 13
class txHTMLOutput : public txXMLOutput
{
@ -104,8 +108,12 @@ private:
MBool isShorthandElement(const String& aName);
MBool isShorthandAttribute(const String& aLocalName);
Map mHTMLEmptyTags;
Map mHTMLEmptyAttributes;
nsCOMArray<nsIAtom> mHTMLEmptyTags;
struct EmptyAttrBag {
nsCOMPtr<nsIAtom> mAttrName;
nsCOMArray<nsIAtom> mElementList;
};
EmptyAttrBag mHTMLEmptyAttributes[SHORTHAND_ATTR_COUNT];
Stack mCurrentElements;
};

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

@ -263,7 +263,10 @@ void txXMLOutput::closeStartTag(MBool aUseEmptyElementShorthand)
txAttribute* att;
while ((att = (txAttribute*)iter.next())) {
*mOut << SPACE;
*mOut << *(att->mName.mLocalName);
const PRUnichar* attrVal;
att->mName.mLocalName->GetUnicode(&attrVal);
// XXX consult the XML spec what we really wanna do here
*mOut << NS_ConvertUCS2toUTF8(nsDependentString(attrVal)).get();
if (!att->mShorthand) {
*mOut << EQUALS << DOUBLE_QUOTE;
printWithXMLEntities(att->mValue, MB_TRUE);