зеркало из https://github.com/mozilla/pjs.git
bug 157142, transformiix standalone should use XPCOM atoms. r=sicking, sr=peterv
This commit is contained in:
Родитель
cd7c032cb0
Коммит
fc92c2aac6
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче