mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-02 21:37:32 +09:00
Bug 1355769 - Avoid malloc for nsHtml5ElementName when processing a non-interned element name.
HTML Regen. Tag UXP Issue #1344
This commit is contained in:
parent
4f93df8cbf
commit
c37e7b2047
6 changed files with 69 additions and 64 deletions
|
|
@ -55,9 +55,7 @@
|
||||||
#include "nsHtml5Portability.h"
|
#include "nsHtml5Portability.h"
|
||||||
|
|
||||||
#include "nsHtml5ElementName.h"
|
#include "nsHtml5ElementName.h"
|
||||||
#include "nsHtml5ReleasableElementName.h"
|
|
||||||
|
|
||||||
nsHtml5ElementName* nsHtml5ElementName::ELT_NULL_ELEMENT_NAME = nullptr;
|
|
||||||
int32_t
|
int32_t
|
||||||
nsHtml5ElementName::getGroup()
|
nsHtml5ElementName::getGroup()
|
||||||
{
|
{
|
||||||
|
|
@ -65,9 +63,9 @@ nsHtml5ElementName::getGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
nsHtml5ElementName::isCustom()
|
nsHtml5ElementName::isInterned()
|
||||||
{
|
{
|
||||||
return (flags & NS_HTML5ELEMENT_NAME_CUSTOM);
|
return !(flags & NS_HTML5ELEMENT_NAME_NOT_INTERNED);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHtml5ElementName*
|
nsHtml5ElementName*
|
||||||
|
|
@ -76,12 +74,12 @@ nsHtml5ElementName::elementNameByBuffer(char16_t* buf, int32_t offset, int32_t l
|
||||||
uint32_t hash = nsHtml5ElementName::bufToHash(buf, length);
|
uint32_t hash = nsHtml5ElementName::bufToHash(buf, length);
|
||||||
int32_t index = nsHtml5ElementName::ELEMENT_HASHES.binarySearch(hash);
|
int32_t index = nsHtml5ElementName::ELEMENT_HASHES.binarySearch(hash);
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
return new nsHtml5ReleasableElementName(nsHtml5Portability::newLocalNameFromBuffer(buf, offset, length, interner));
|
return nullptr;
|
||||||
} else {
|
} else {
|
||||||
nsHtml5ElementName* elementName = nsHtml5ElementName::ELEMENT_NAMES[index];
|
nsHtml5ElementName* elementName = nsHtml5ElementName::ELEMENT_NAMES[index];
|
||||||
nsIAtom* name = elementName->name;
|
nsIAtom* name = elementName->name;
|
||||||
if (!nsHtml5Portability::localEqualsBuffer(name, buf, offset, length)) {
|
if (!nsHtml5Portability::localEqualsBuffer(name, buf, offset, length)) {
|
||||||
return new nsHtml5ReleasableElementName(nsHtml5Portability::newLocalNameFromBuffer(buf, offset, length, interner));
|
return nullptr;
|
||||||
}
|
}
|
||||||
return elementName;
|
return elementName;
|
||||||
}
|
}
|
||||||
|
|
@ -97,29 +95,26 @@ nsHtml5ElementName::nsHtml5ElementName(nsIAtom* name, nsIAtom* camelCaseName, in
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsHtml5ElementName::nsHtml5ElementName(nsIAtom* name)
|
nsHtml5ElementName::nsHtml5ElementName()
|
||||||
: name(name),
|
: name(nullptr),
|
||||||
camelCaseName(name),
|
camelCaseName(nullptr),
|
||||||
flags(NS_HTML5TREE_BUILDER_OTHER | NS_HTML5ELEMENT_NAME_CUSTOM)
|
flags(NS_HTML5TREE_BUILDER_OTHER | NS_HTML5ELEMENT_NAME_NOT_INTERNED)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsHtml5ElementName);
|
MOZ_COUNT_CTOR(nsHtml5ElementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
nsHtml5ElementName::release()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
nsHtml5ElementName::~nsHtml5ElementName()
|
nsHtml5ElementName::~nsHtml5ElementName()
|
||||||
{
|
{
|
||||||
MOZ_COUNT_DTOR(nsHtml5ElementName);
|
MOZ_COUNT_DTOR(nsHtml5ElementName);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHtml5ElementName*
|
void
|
||||||
nsHtml5ElementName::cloneElementName(nsHtml5AtomTable* interner)
|
nsHtml5ElementName::setNameForNonInterned(nsIAtom* name)
|
||||||
{
|
{
|
||||||
return this;
|
this->name = name;
|
||||||
|
this->camelCaseName = name;
|
||||||
|
MOZ_ASSERT(this->flags == (NS_HTML5TREE_BUILDER_OTHER | NS_HTML5ELEMENT_NAME_NOT_INTERNED));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHtml5ElementName* nsHtml5ElementName::ELT_AND = nullptr;
|
nsHtml5ElementName* nsHtml5ElementName::ELT_AND = nullptr;
|
||||||
|
|
@ -526,7 +521,6 @@ staticJArray<int32_t,int32_t> nsHtml5ElementName::ELEMENT_HASHES = { ELEMENT_HAS
|
||||||
void
|
void
|
||||||
nsHtml5ElementName::initializeStatics()
|
nsHtml5ElementName::initializeStatics()
|
||||||
{
|
{
|
||||||
ELT_NULL_ELEMENT_NAME = new nsHtml5ElementName(nullptr);
|
|
||||||
ELT_AND = new nsHtml5ElementName(nsHtml5Atoms::and_, nsHtml5Atoms::and_, NS_HTML5TREE_BUILDER_OTHER);
|
ELT_AND = new nsHtml5ElementName(nsHtml5Atoms::and_, nsHtml5Atoms::and_, NS_HTML5TREE_BUILDER_OTHER);
|
||||||
ELT_ARG = new nsHtml5ElementName(nsHtml5Atoms::arg, nsHtml5Atoms::arg, NS_HTML5TREE_BUILDER_OTHER);
|
ELT_ARG = new nsHtml5ElementName(nsHtml5Atoms::arg, nsHtml5Atoms::arg, NS_HTML5TREE_BUILDER_OTHER);
|
||||||
ELT_ABS = new nsHtml5ElementName(nsHtml5Atoms::abs, nsHtml5Atoms::abs, NS_HTML5TREE_BUILDER_OTHER);
|
ELT_ABS = new nsHtml5ElementName(nsHtml5Atoms::abs, nsHtml5Atoms::abs, NS_HTML5TREE_BUILDER_OTHER);
|
||||||
|
|
@ -1329,7 +1323,6 @@ nsHtml5ElementName::initializeStatics()
|
||||||
void
|
void
|
||||||
nsHtml5ElementName::releaseStatics()
|
nsHtml5ElementName::releaseStatics()
|
||||||
{
|
{
|
||||||
delete ELT_NULL_ELEMENT_NAME;
|
|
||||||
delete ELT_AND;
|
delete ELT_AND;
|
||||||
delete ELT_ARG;
|
delete ELT_ARG;
|
||||||
delete ELT_ABS;
|
delete ELT_ABS;
|
||||||
|
|
|
||||||
|
|
@ -59,18 +59,28 @@ class nsHtml5Portability;
|
||||||
|
|
||||||
class nsHtml5ElementName
|
class nsHtml5ElementName
|
||||||
{
|
{
|
||||||
public:
|
private:
|
||||||
static nsHtml5ElementName* ELT_NULL_ELEMENT_NAME;
|
|
||||||
nsIAtom* name;
|
nsIAtom* name;
|
||||||
nsIAtom* camelCaseName;
|
nsIAtom* camelCaseName;
|
||||||
|
public:
|
||||||
int32_t flags;
|
int32_t flags;
|
||||||
|
inline nsIAtom* getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline nsIAtom* getCamelCaseName()
|
||||||
|
{
|
||||||
|
return camelCaseName;
|
||||||
|
}
|
||||||
|
|
||||||
inline int32_t getFlags()
|
inline int32_t getFlags()
|
||||||
{
|
{
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t getGroup();
|
int32_t getGroup();
|
||||||
bool isCustom();
|
bool isInterned();
|
||||||
static nsHtml5ElementName* elementNameByBuffer(char16_t* buf, int32_t offset, int32_t length, nsHtml5AtomTable* interner);
|
static nsHtml5ElementName* elementNameByBuffer(char16_t* buf, int32_t offset, int32_t length, nsHtml5AtomTable* interner);
|
||||||
private:
|
private:
|
||||||
inline static uint32_t bufToHash(char16_t* buf, int32_t length)
|
inline static uint32_t bufToHash(char16_t* buf, int32_t length)
|
||||||
|
|
@ -104,12 +114,10 @@ class nsHtml5ElementName
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHtml5ElementName(nsIAtom* name, nsIAtom* camelCaseName, int32_t flags);
|
nsHtml5ElementName(nsIAtom* name, nsIAtom* camelCaseName, int32_t flags);
|
||||||
protected:
|
|
||||||
explicit nsHtml5ElementName(nsIAtom* name);
|
|
||||||
public:
|
public:
|
||||||
virtual void release();
|
nsHtml5ElementName();
|
||||||
virtual ~nsHtml5ElementName();
|
~nsHtml5ElementName();
|
||||||
virtual nsHtml5ElementName* cloneElementName(nsHtml5AtomTable* interner);
|
void setNameForNonInterned(nsIAtom* name);
|
||||||
static nsHtml5ElementName* ELT_AND;
|
static nsHtml5ElementName* ELT_AND;
|
||||||
static nsHtml5ElementName* ELT_ARG;
|
static nsHtml5ElementName* ELT_ARG;
|
||||||
static nsHtml5ElementName* ELT_ABS;
|
static nsHtml5ElementName* ELT_ABS;
|
||||||
|
|
@ -517,7 +525,7 @@ class nsHtml5ElementName
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NS_HTML5ELEMENT_NAME_GROUP_MASK 127
|
#define NS_HTML5ELEMENT_NAME_GROUP_MASK 127
|
||||||
#define NS_HTML5ELEMENT_NAME_CUSTOM (1 << 30)
|
#define NS_HTML5ELEMENT_NAME_NOT_INTERNED (1 << 30)
|
||||||
#define NS_HTML5ELEMENT_NAME_SPECIAL (1 << 29)
|
#define NS_HTML5ELEMENT_NAME_SPECIAL (1 << 29)
|
||||||
#define NS_HTML5ELEMENT_NAME_FOSTER_PARENTING (1 << 28)
|
#define NS_HTML5ELEMENT_NAME_FOSTER_PARENTING (1 << 28)
|
||||||
#define NS_HTML5ELEMENT_NAME_SCOPING (1 << 27)
|
#define NS_HTML5ELEMENT_NAME_SCOPING (1 << 27)
|
||||||
|
|
|
||||||
|
|
@ -103,35 +103,35 @@ nsHtml5StackNode::nsHtml5StackNode(int32_t flags, int32_t ns, nsIAtom* name, nsI
|
||||||
|
|
||||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node)
|
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node)
|
||||||
: flags(elementName->getFlags()),
|
: flags(elementName->getFlags()),
|
||||||
name(elementName->name),
|
name(elementName->getName()),
|
||||||
popName(elementName->name),
|
popName(elementName->getName()),
|
||||||
ns(kNameSpaceID_XHTML),
|
ns(kNameSpaceID_XHTML),
|
||||||
node(node),
|
node(node),
|
||||||
attributes(nullptr),
|
attributes(nullptr),
|
||||||
refcount(1)
|
refcount(1)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsHtml5StackNode);
|
MOZ_COUNT_CTOR(nsHtml5StackNode);
|
||||||
MOZ_ASSERT(!elementName->isCustom(), "Don't use this constructor for custom elements.");
|
MOZ_ASSERT(elementName->isInterned(), "Don't use this constructor for custom elements.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsHtml5HtmlAttributes* attributes)
|
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsHtml5HtmlAttributes* attributes)
|
||||||
: flags(elementName->getFlags()),
|
: flags(elementName->getFlags()),
|
||||||
name(elementName->name),
|
name(elementName->getName()),
|
||||||
popName(elementName->name),
|
popName(elementName->getName()),
|
||||||
ns(kNameSpaceID_XHTML),
|
ns(kNameSpaceID_XHTML),
|
||||||
node(node),
|
node(node),
|
||||||
attributes(attributes),
|
attributes(attributes),
|
||||||
refcount(1)
|
refcount(1)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsHtml5StackNode);
|
MOZ_COUNT_CTOR(nsHtml5StackNode);
|
||||||
MOZ_ASSERT(!elementName->isCustom(), "Don't use this constructor for custom elements.");
|
MOZ_ASSERT(elementName->isInterned(), "Don't use this constructor for custom elements.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName)
|
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName)
|
||||||
: flags(elementName->getFlags()),
|
: flags(elementName->getFlags()),
|
||||||
name(elementName->name),
|
name(elementName->getName()),
|
||||||
popName(popName),
|
popName(popName),
|
||||||
ns(kNameSpaceID_XHTML),
|
ns(kNameSpaceID_XHTML),
|
||||||
node(node),
|
node(node),
|
||||||
|
|
@ -144,7 +144,7 @@ nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHa
|
||||||
|
|
||||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* popName, nsIContentHandle* node)
|
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* popName, nsIContentHandle* node)
|
||||||
: flags(prepareSvgFlags(elementName->getFlags())),
|
: flags(prepareSvgFlags(elementName->getFlags())),
|
||||||
name(elementName->name),
|
name(elementName->getName()),
|
||||||
popName(popName),
|
popName(popName),
|
||||||
ns(kNameSpaceID_SVG),
|
ns(kNameSpaceID_SVG),
|
||||||
node(node),
|
node(node),
|
||||||
|
|
@ -157,7 +157,7 @@ nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIAtom* pop
|
||||||
|
|
||||||
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName, bool markAsIntegrationPoint)
|
nsHtml5StackNode::nsHtml5StackNode(nsHtml5ElementName* elementName, nsIContentHandle* node, nsIAtom* popName, bool markAsIntegrationPoint)
|
||||||
: flags(prepareMathFlags(elementName->getFlags(), markAsIntegrationPoint)),
|
: flags(prepareMathFlags(elementName->getFlags(), markAsIntegrationPoint)),
|
||||||
name(elementName->name),
|
name(elementName->getName()),
|
||||||
popName(popName),
|
popName(popName),
|
||||||
ns(kNameSpaceID_MathML),
|
ns(kNameSpaceID_MathML),
|
||||||
node(node),
|
node(node),
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ nsHtml5Tokenizer::nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler, bool viewin
|
||||||
bmpChar(jArray<char16_t,int32_t>::newJArray(1)),
|
bmpChar(jArray<char16_t,int32_t>::newJArray(1)),
|
||||||
astralChar(jArray<char16_t,int32_t>::newJArray(2)),
|
astralChar(jArray<char16_t,int32_t>::newJArray(2)),
|
||||||
tagName(nullptr),
|
tagName(nullptr),
|
||||||
|
nonInternedTagName(new nsHtml5ElementName()),
|
||||||
attributeName(nullptr),
|
attributeName(nullptr),
|
||||||
doctypeName(nullptr),
|
doctypeName(nullptr),
|
||||||
publicIdentifier(nullptr),
|
publicIdentifier(nullptr),
|
||||||
|
|
@ -279,6 +280,10 @@ void
|
||||||
nsHtml5Tokenizer::strBufToElementNameString()
|
nsHtml5Tokenizer::strBufToElementNameString()
|
||||||
{
|
{
|
||||||
tagName = nsHtml5ElementName::elementNameByBuffer(strBuf, 0, strBufLen, interner);
|
tagName = nsHtml5ElementName::elementNameByBuffer(strBuf, 0, strBufLen, interner);
|
||||||
|
if (!tagName) {
|
||||||
|
nonInternedTagName->setNameForNonInterned(nsHtml5Portability::newLocalNameFromBuffer(strBuf, 0, strBufLen, interner));
|
||||||
|
tagName = nonInternedTagName;
|
||||||
|
}
|
||||||
clearStrBufAfterUse();
|
clearStrBufAfterUse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -307,7 +312,6 @@ nsHtml5Tokenizer::emitCurrentTagToken(bool selfClosing, int32_t pos)
|
||||||
tokenHandler->startTag(tagName, attrs, selfClosing);
|
tokenHandler->startTag(tagName, attrs, selfClosing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tagName->release();
|
|
||||||
tagName = nullptr;
|
tagName = nullptr;
|
||||||
if (newAttributesEachTime) {
|
if (newAttributesEachTime) {
|
||||||
attributes = nullptr;
|
attributes = nullptr;
|
||||||
|
|
@ -3935,10 +3939,8 @@ nsHtml5Tokenizer::end()
|
||||||
publicIdentifier.Release();
|
publicIdentifier.Release();
|
||||||
publicIdentifier = nullptr;
|
publicIdentifier = nullptr;
|
||||||
}
|
}
|
||||||
if (tagName) {
|
tagName = nullptr;
|
||||||
tagName->release();
|
nonInternedTagName->setNameForNonInterned(nullptr);
|
||||||
tagName = nullptr;
|
|
||||||
}
|
|
||||||
if (attributeName) {
|
if (attributeName) {
|
||||||
attributeName->release();
|
attributeName->release();
|
||||||
attributeName = nullptr;
|
attributeName = nullptr;
|
||||||
|
|
@ -3983,7 +3985,6 @@ nsHtml5Tokenizer::resetToDataState()
|
||||||
shouldSuspend = false;
|
shouldSuspend = false;
|
||||||
initDoctypeFields();
|
initDoctypeFields();
|
||||||
if (tagName) {
|
if (tagName) {
|
||||||
tagName->release();
|
|
||||||
tagName = nullptr;
|
tagName = nullptr;
|
||||||
}
|
}
|
||||||
if (attributeName) {
|
if (attributeName) {
|
||||||
|
|
@ -4043,13 +4044,13 @@ nsHtml5Tokenizer::loadState(nsHtml5Tokenizer* other)
|
||||||
} else {
|
} else {
|
||||||
publicIdentifier = nsHtml5Portability::newStringFromString(other->publicIdentifier);
|
publicIdentifier = nsHtml5Portability::newStringFromString(other->publicIdentifier);
|
||||||
}
|
}
|
||||||
if (tagName) {
|
|
||||||
tagName->release();
|
|
||||||
}
|
|
||||||
if (!other->tagName) {
|
if (!other->tagName) {
|
||||||
tagName = nullptr;
|
tagName = nullptr;
|
||||||
|
} else if (other->tagName->isInterned()) {
|
||||||
|
tagName = other->tagName;
|
||||||
} else {
|
} else {
|
||||||
tagName = other->tagName->cloneElementName(interner);
|
nonInternedTagName->setNameForNonInterned(nsHtml5Portability::newLocalFromLocal(other->tagName->getName(), interner));
|
||||||
|
tagName = nonInternedTagName;
|
||||||
}
|
}
|
||||||
if (attributeName) {
|
if (attributeName) {
|
||||||
attributeName->release();
|
attributeName->release();
|
||||||
|
|
@ -4087,6 +4088,8 @@ nsHtml5Tokenizer::setEncodingDeclarationHandler(nsHtml5StreamParser* encodingDec
|
||||||
nsHtml5Tokenizer::~nsHtml5Tokenizer()
|
nsHtml5Tokenizer::~nsHtml5Tokenizer()
|
||||||
{
|
{
|
||||||
MOZ_COUNT_DTOR(nsHtml5Tokenizer);
|
MOZ_COUNT_DTOR(nsHtml5Tokenizer);
|
||||||
|
delete nonInternedTagName;
|
||||||
|
nonInternedTagName = nullptr;
|
||||||
delete attributes;
|
delete attributes;
|
||||||
attributes = nullptr;
|
attributes = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ class nsHtml5Tokenizer
|
||||||
bool endTag;
|
bool endTag;
|
||||||
private:
|
private:
|
||||||
nsHtml5ElementName* tagName;
|
nsHtml5ElementName* tagName;
|
||||||
|
nsHtml5ElementName* nonInternedTagName;
|
||||||
protected:
|
protected:
|
||||||
nsHtml5AttributeName* attributeName;
|
nsHtml5AttributeName* attributeName;
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
|
||||||
if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::desc == contextName || nsHtml5Atoms::foreignObject == contextName) {
|
if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::desc == contextName || nsHtml5Atoms::foreignObject == contextName) {
|
||||||
elementName = nsHtml5ElementName::ELT_FOREIGNOBJECT;
|
elementName = nsHtml5ElementName::ELT_FOREIGNOBJECT;
|
||||||
}
|
}
|
||||||
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->camelCaseName, elt);
|
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->getCamelCaseName(), elt);
|
||||||
currentPtr++;
|
currentPtr++;
|
||||||
stack[currentPtr] = node;
|
stack[currentPtr] = node;
|
||||||
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
|
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
|
||||||
|
|
@ -116,7 +116,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
|
||||||
} else if (nsHtml5Atoms::annotation_xml == contextName) {
|
} else if (nsHtml5Atoms::annotation_xml == contextName) {
|
||||||
elementName = nsHtml5ElementName::ELT_ANNOTATION_XML;
|
elementName = nsHtml5ElementName::ELT_ANNOTATION_XML;
|
||||||
}
|
}
|
||||||
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->name, false);
|
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->getName(), false);
|
||||||
currentPtr++;
|
currentPtr++;
|
||||||
stack[currentPtr] = node;
|
stack[currentPtr] = node;
|
||||||
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
|
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
|
||||||
|
|
@ -609,7 +609,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
|
||||||
needToDropLF = false;
|
needToDropLF = false;
|
||||||
starttagloop: for (; ; ) {
|
starttagloop: for (; ; ) {
|
||||||
int32_t group = elementName->getGroup();
|
int32_t group = elementName->getGroup();
|
||||||
nsIAtom* name = elementName->name;
|
nsIAtom* name = elementName->getName();
|
||||||
if (isInForeign()) {
|
if (isInForeign()) {
|
||||||
nsHtml5StackNode* currentNode = stack[currentPtr];
|
nsHtml5StackNode* currentNode = stack[currentPtr];
|
||||||
int32_t currNs = currentNode->ns;
|
int32_t currNs = currentNode->ns;
|
||||||
|
|
@ -1143,7 +1143,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
|
||||||
case NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
|
case NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
|
||||||
case NS_HTML5TREE_BUILDER_FONT: {
|
case NS_HTML5TREE_BUILDER_FONT: {
|
||||||
reconstructTheActiveFormattingElements();
|
reconstructTheActiveFormattingElements();
|
||||||
maybeForgetEarlierDuplicateFormattingElement(elementName->name, attributes);
|
maybeForgetEarlierDuplicateFormattingElement(elementName->getName(), attributes);
|
||||||
appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
|
appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
|
||||||
attributes = nullptr;
|
attributes = nullptr;
|
||||||
NS_HTML5_BREAK(starttagloop);
|
NS_HTML5_BREAK(starttagloop);
|
||||||
|
|
@ -2220,7 +2220,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
|
||||||
needToDropLF = false;
|
needToDropLF = false;
|
||||||
int32_t eltPos;
|
int32_t eltPos;
|
||||||
int32_t group = elementName->getGroup();
|
int32_t group = elementName->getGroup();
|
||||||
nsIAtom* name = elementName->name;
|
nsIAtom* name = elementName->getName();
|
||||||
for (; ; ) {
|
for (; ; ) {
|
||||||
if (isInForeign()) {
|
if (isInForeign()) {
|
||||||
if (stack[currentPtr]->name != name) {
|
if (stack[currentPtr]->name != name) {
|
||||||
|
|
@ -3988,9 +3988,9 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
||||||
elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->name, attributes);
|
elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->getName(), attributes);
|
||||||
} else {
|
} else {
|
||||||
elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes, current->node);
|
elt = createElement(kNameSpaceID_XHTML, elementName->getName(), attributes, current->node);
|
||||||
appendElement(elt, current->node);
|
appendElement(elt, current->node);
|
||||||
}
|
}
|
||||||
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, clone);
|
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, clone);
|
||||||
|
|
@ -4003,7 +4003,7 @@ void
|
||||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIContentHandle* currentNode = stack[currentPtr]->node;
|
nsIContentHandle* currentNode = stack[currentPtr]->node;
|
||||||
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes, currentNode);
|
nsIContentHandle* elt = createElement(kNameSpaceID_XHTML, elementName->getName(), attributes, currentNode);
|
||||||
appendElement(elt, currentNode);
|
appendElement(elt, currentNode);
|
||||||
if (nsHtml5ElementName::ELT_TEMPLATE == elementName) {
|
if (nsHtml5ElementName::ELT_TEMPLATE == elementName) {
|
||||||
elt = getDocumentFragmentForTemplate(elt);
|
elt = getDocumentFragmentForTemplate(elt);
|
||||||
|
|
@ -4015,7 +4015,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elemen
|
||||||
void
|
void
|
||||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIAtom* popName = elementName->name;
|
nsIAtom* popName = elementName->getName();
|
||||||
nsIContentHandle* elt;
|
nsIContentHandle* elt;
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
@ -4032,7 +4032,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementNam
|
||||||
void
|
void
|
||||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIAtom* popName = elementName->name;
|
nsIAtom* popName = elementName->getName();
|
||||||
bool markAsHtmlIntegrationPoint = false;
|
bool markAsHtmlIntegrationPoint = false;
|
||||||
if (nsHtml5ElementName::ELT_ANNOTATION_XML == elementName && annotationXmlEncodingPermitsHtml(attributes)) {
|
if (nsHtml5ElementName::ELT_ANNOTATION_XML == elementName && annotationXmlEncodingPermitsHtml(attributes)) {
|
||||||
markAsHtmlIntegrationPoint = true;
|
markAsHtmlIntegrationPoint = true;
|
||||||
|
|
@ -4063,7 +4063,7 @@ nsHtml5TreeBuilder::annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attr
|
||||||
void
|
void
|
||||||
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIAtom* popName = elementName->camelCaseName;
|
nsIAtom* popName = elementName->getCamelCaseName();
|
||||||
nsIContentHandle* elt;
|
nsIContentHandle* elt;
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
@ -4085,9 +4085,9 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementNam
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
||||||
elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->name, attributes, formOwner);
|
elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->getName(), attributes, formOwner);
|
||||||
} else {
|
} else {
|
||||||
elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes, formOwner, current->node);
|
elt = createElement(kNameSpaceID_XHTML, elementName->getName(), attributes, formOwner, current->node);
|
||||||
appendElement(elt, current->node);
|
appendElement(elt, current->node);
|
||||||
}
|
}
|
||||||
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt);
|
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt);
|
||||||
|
|
@ -4114,7 +4114,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5Ht
|
||||||
void
|
void
|
||||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIAtom* popName = elementName->name;
|
nsIAtom* popName = elementName->getName();
|
||||||
nsIContentHandle* elt;
|
nsIContentHandle* elt;
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
@ -4131,7 +4131,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elem
|
||||||
void
|
void
|
||||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIAtom* popName = elementName->camelCaseName;
|
nsIAtom* popName = elementName->getCamelCaseName();
|
||||||
nsIContentHandle* elt;
|
nsIContentHandle* elt;
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
@ -4148,7 +4148,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* e
|
||||||
void
|
void
|
||||||
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
|
||||||
{
|
{
|
||||||
nsIAtom* popName = elementName->name;
|
nsIAtom* popName = elementName->getName();
|
||||||
nsIContentHandle* elt;
|
nsIContentHandle* elt;
|
||||||
nsHtml5StackNode* current = stack[currentPtr];
|
nsHtml5StackNode* current = stack[currentPtr];
|
||||||
if (current->isFosterParenting()) {
|
if (current->isFosterParenting()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue