summaryrefslogtreecommitdiffstats
path: root/parser/html/nsHtml5TreeBuilder.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-18 13:20:59 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:34 -0500
commit016a21c414f35e0d1af6ee2ffcc17224aab77637 (patch)
tree900b4fafbbd7d25bd9c605dcf934ad0b4009fdeb /parser/html/nsHtml5TreeBuilder.cpp
parente387308d9b996542565175c7895724c86e24e0dc (diff)
downloadUXP-016a21c414f35e0d1af6ee2ffcc17224aab77637.tar
UXP-016a21c414f35e0d1af6ee2ffcc17224aab77637.tar.gz
UXP-016a21c414f35e0d1af6ee2ffcc17224aab77637.tar.lz
UXP-016a21c414f35e0d1af6ee2ffcc17224aab77637.tar.xz
UXP-016a21c414f35e0d1af6ee2ffcc17224aab77637.zip
Bug 1355769 - Avoid malloc for nsHtml5ElementName when processing a non-interned element name.
HTML Regen. Tag UXP Issue #1344
Diffstat (limited to 'parser/html/nsHtml5TreeBuilder.cpp')
-rw-r--r--parser/html/nsHtml5TreeBuilder.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp
index cea78839c..23e874d96 100644
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -104,7 +104,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::desc == contextName || nsHtml5Atoms::foreignObject == contextName) {
elementName = nsHtml5ElementName::ELT_FOREIGNOBJECT;
}
- nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->camelCaseName, elt);
+ nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->getCamelCaseName(), elt);
currentPtr++;
stack[currentPtr] = node;
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
@@ -116,7 +116,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
} else if (nsHtml5Atoms::annotation_xml == contextName) {
elementName = nsHtml5ElementName::ELT_ANNOTATION_XML;
}
- nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->name, false);
+ nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->getName(), false);
currentPtr++;
stack[currentPtr] = node;
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
@@ -609,7 +609,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
needToDropLF = false;
starttagloop: for (; ; ) {
int32_t group = elementName->getGroup();
- nsIAtom* name = elementName->name;
+ nsIAtom* name = elementName->getName();
if (isInForeign()) {
nsHtml5StackNode* currentNode = stack[currentPtr];
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_FONT: {
reconstructTheActiveFormattingElements();
- maybeForgetEarlierDuplicateFormattingElement(elementName->name, attributes);
+ maybeForgetEarlierDuplicateFormattingElement(elementName->getName(), attributes);
appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
@@ -2220,7 +2220,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
needToDropLF = false;
int32_t eltPos;
int32_t group = elementName->getGroup();
- nsIAtom* name = elementName->name;
+ nsIAtom* name = elementName->getName();
for (; ; ) {
if (isInForeign()) {
if (stack[currentPtr]->name != name) {
@@ -3988,9 +3988,9 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {
- elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->name, attributes);
+ elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->getName(), attributes);
} else {
- elt = createElement(kNameSpaceID_XHTML, elementName->name, attributes, current->node);
+ elt = createElement(kNameSpaceID_XHTML, elementName->getName(), attributes, current->node);
appendElement(elt, current->node);
}
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, clone);
@@ -4003,7 +4003,7 @@ void
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
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);
if (nsHtml5ElementName::ELT_TEMPLATE == elementName) {
elt = getDocumentFragmentForTemplate(elt);
@@ -4015,7 +4015,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elemen
void
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
- nsIAtom* popName = elementName->name;
+ nsIAtom* popName = elementName->getName();
nsIContentHandle* elt;
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {
@@ -4032,7 +4032,7 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementNam
void
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
- nsIAtom* popName = elementName->name;
+ nsIAtom* popName = elementName->getName();
bool markAsHtmlIntegrationPoint = false;
if (nsHtml5ElementName::ELT_ANNOTATION_XML == elementName && annotationXmlEncodingPermitsHtml(attributes)) {
markAsHtmlIntegrationPoint = true;
@@ -4063,7 +4063,7 @@ nsHtml5TreeBuilder::annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attr
void
nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
- nsIAtom* popName = elementName->camelCaseName;
+ nsIAtom* popName = elementName->getCamelCaseName();
nsIContentHandle* elt;
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {
@@ -4085,9 +4085,9 @@ nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementNam
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {
- elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->name, attributes, formOwner);
+ elt = createAndInsertFosterParentedElement(kNameSpaceID_XHTML, elementName->getName(), attributes, formOwner);
} 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);
}
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt);
@@ -4114,7 +4114,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsIAtom* name, nsHtml5Ht
void
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
- nsIAtom* popName = elementName->name;
+ nsIAtom* popName = elementName->getName();
nsIContentHandle* elt;
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {
@@ -4131,7 +4131,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elem
void
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
- nsIAtom* popName = elementName->camelCaseName;
+ nsIAtom* popName = elementName->getCamelCaseName();
nsIContentHandle* elt;
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {
@@ -4148,7 +4148,7 @@ nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* e
void
nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
{
- nsIAtom* popName = elementName->name;
+ nsIAtom* popName = elementName->getName();
nsIContentHandle* elt;
nsHtml5StackNode* current = stack[currentPtr];
if (current->isFosterParenting()) {