summaryrefslogtreecommitdiffstats
path: root/parser/html/nsHtml5TreeBuilder.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-01-18 17:17:17 -0500
committerGaming4JC <g4jc@hyperbola.info>2020-01-26 15:50:37 -0500
commit76a4af34064296177e11a0d3887a5763a6c3a572 (patch)
tree5dbda446420569acd00e120e34db8e4320ee4336 /parser/html/nsHtml5TreeBuilder.cpp
parent5d4200f56df55774dcc94df431cc67fe65b674ed (diff)
downloadUXP-76a4af34064296177e11a0d3887a5763a6c3a572.tar
UXP-76a4af34064296177e11a0d3887a5763a6c3a572.tar.gz
UXP-76a4af34064296177e11a0d3887a5763a6c3a572.tar.lz
UXP-76a4af34064296177e11a0d3887a5763a6c3a572.tar.xz
UXP-76a4af34064296177e11a0d3887a5763a6c3a572.zip
Bug 1358037 - Inline the methods of nsHtml5ElementName and nsHtml5AttributeName.
HTML Regen. Tag UXP Issue #1344
Diffstat (limited to 'parser/html/nsHtml5TreeBuilder.cpp')
-rw-r--r--parser/html/nsHtml5TreeBuilder.cpp1510
1 files changed, 755 insertions, 755 deletions
diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp
index d909c223c..03bff8a58 100644
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -58,10 +58,10 @@
#include "nsIContentHandle.h"
#include "nsHtml5OplessBuilder.h"
-#include "nsHtml5Tokenizer.h"
-#include "nsHtml5MetaScanner.h"
#include "nsHtml5AttributeName.h"
#include "nsHtml5ElementName.h"
+#include "nsHtml5Tokenizer.h"
+#include "nsHtml5MetaScanner.h"
#include "nsHtml5StackNode.h"
#include "nsHtml5UTF16Buffer.h"
#include "nsHtml5StateSnapshot.h"
@@ -80,7 +80,7 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
templateModeStack = jArray<int32_t,int32_t>::newJArray(64);
listOfActiveFormattingElements = jArray<nsHtml5StackNode*,int32_t>::newJArray(64);
needToDropLF = false;
- originalMode = NS_HTML5TREE_BUILDER_INITIAL;
+ originalMode = INITIAL;
templateModePtr = -1;
currentPtr = -1;
listPtr = -1;
@@ -106,8 +106,8 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elementName->getCamelCaseName(), elt);
currentPtr++;
stack[currentPtr] = node;
- tokenizer->setState(NS_HTML5TOKENIZER_DATA);
- mode = NS_HTML5TREE_BUILDER_FRAMESET_OK;
+ tokenizer->setState(nsHtml5Tokenizer::DATA);
+ mode = FRAMESET_OK;
} else if (contextNamespace == kNameSpaceID_MathML) {
nsHtml5ElementName* elementName = nsHtml5ElementName::ELT_MATH;
if (nsHtml5Atoms::mi == contextName || nsHtml5Atoms::mo == contextName || nsHtml5Atoms::mn == contextName || nsHtml5Atoms::ms == contextName || nsHtml5Atoms::mtext == contextName) {
@@ -118,33 +118,33 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
nsHtml5StackNode* node = new nsHtml5StackNode(elementName, elt, elementName->getName(), false);
currentPtr++;
stack[currentPtr] = node;
- tokenizer->setState(NS_HTML5TOKENIZER_DATA);
- mode = NS_HTML5TREE_BUILDER_FRAMESET_OK;
+ tokenizer->setState(nsHtml5Tokenizer::DATA);
+ mode = FRAMESET_OK;
} else {
nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_HTML, elt);
currentPtr++;
stack[currentPtr] = node;
if (nsHtml5Atoms::template_ == contextName) {
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_TEMPLATE);
+ pushTemplateMode(IN_TEMPLATE);
}
resetTheInsertionMode();
formPointer = getFormPointerForContext(contextNode);
if (nsHtml5Atoms::title == contextName || nsHtml5Atoms::textarea == contextName) {
- tokenizer->setState(NS_HTML5TOKENIZER_RCDATA);
+ tokenizer->setState(nsHtml5Tokenizer::RCDATA);
} else if (nsHtml5Atoms::style == contextName || nsHtml5Atoms::xmp == contextName || nsHtml5Atoms::iframe == contextName || nsHtml5Atoms::noembed == contextName || nsHtml5Atoms::noframes == contextName || (scriptingEnabled && nsHtml5Atoms::noscript == contextName)) {
- tokenizer->setState(NS_HTML5TOKENIZER_RAWTEXT);
+ tokenizer->setState(nsHtml5Tokenizer::RAWTEXT);
} else if (nsHtml5Atoms::plaintext == contextName) {
- tokenizer->setState(NS_HTML5TOKENIZER_PLAINTEXT);
+ tokenizer->setState(nsHtml5Tokenizer::PLAINTEXT);
} else if (nsHtml5Atoms::script == contextName) {
- tokenizer->setState(NS_HTML5TOKENIZER_SCRIPT_DATA);
+ tokenizer->setState(nsHtml5Tokenizer::SCRIPT_DATA);
} else {
- tokenizer->setState(NS_HTML5TOKENIZER_DATA);
+ tokenizer->setState(nsHtml5Tokenizer::DATA);
}
}
contextName = nullptr;
contextNode = nullptr;
} else {
- mode = NS_HTML5TREE_BUILDER_INITIAL;
+ mode = INITIAL;
if (tokenizer->isViewingXmlSource()) {
nsIContentHandle* elt = createElement(kNameSpaceID_SVG, nsHtml5Atoms::svg, tokenizer->emptyAttributes(), nullptr);
nsHtml5StackNode* node = new nsHtml5StackNode(nsHtml5ElementName::ELT_SVG, nsHtml5Atoms::svg, elt);
@@ -158,7 +158,7 @@ void
nsHtml5TreeBuilder::doctype(nsIAtom* name, nsHtml5String publicIdentifier, nsHtml5String systemIdentifier, bool forceQuirks)
{
needToDropLF = false;
- if (!isInForeign() && mode == NS_HTML5TREE_BUILDER_INITIAL) {
+ if (!isInForeign() && mode == INITIAL) {
nsHtml5String emptyString = nsHtml5Portability::newEmptyString();
appendDoctypeToDocument(!name ? nsHtml5Atoms::emptystring : name, !publicIdentifier ? emptyString : publicIdentifier, !systemIdentifier ? emptyString : systemIdentifier);
emptyString.Release();
@@ -171,7 +171,7 @@ nsHtml5TreeBuilder::doctype(nsIAtom* name, nsHtml5String publicIdentifier, nsHtm
} else {
documentModeInternal(STANDARDS_MODE, publicIdentifier, systemIdentifier, false);
}
- mode = NS_HTML5TREE_BUILDER_BEFORE_HTML;
+ mode = BEFORE_HTML;
return;
}
errStrayDoctype();
@@ -184,14 +184,14 @@ nsHtml5TreeBuilder::comment(char16_t* buf, int32_t start, int32_t length)
needToDropLF = false;
if (!isInForeign()) {
switch(mode) {
- case NS_HTML5TREE_BUILDER_INITIAL:
- case NS_HTML5TREE_BUILDER_BEFORE_HTML:
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY:
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET: {
+ case INITIAL:
+ case BEFORE_HTML:
+ case AFTER_AFTER_BODY:
+ case AFTER_AFTER_FRAMESET: {
appendCommentToDocument(buf, start, length);
return;
}
- case NS_HTML5TREE_BUILDER_AFTER_BODY: {
+ case AFTER_BODY: {
flushCharacters();
appendComment(stack[0]->node, buf, start, length);
return;
@@ -223,20 +223,20 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
}
}
switch(mode) {
- case NS_HTML5TREE_BUILDER_IN_BODY:
- case NS_HTML5TREE_BUILDER_IN_CELL:
- case NS_HTML5TREE_BUILDER_IN_CAPTION: {
+ case IN_BODY:
+ case IN_CELL:
+ case IN_CAPTION: {
if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
reconstructTheActiveFormattingElements();
}
}
- case NS_HTML5TREE_BUILDER_TEXT: {
+ case TEXT: {
accumulateCharacters(buf, start, length);
return;
}
- case NS_HTML5TREE_BUILDER_IN_TABLE:
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY:
- case NS_HTML5TREE_BUILDER_IN_ROW: {
+ case IN_TABLE:
+ case IN_TABLE_BODY:
+ case IN_ROW: {
accumulateCharactersForced(buf, start, length);
return;
}
@@ -250,25 +250,25 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
case '\r':
case '\f': {
switch(mode) {
- case NS_HTML5TREE_BUILDER_INITIAL:
- case NS_HTML5TREE_BUILDER_BEFORE_HTML:
- case NS_HTML5TREE_BUILDER_BEFORE_HEAD: {
+ case INITIAL:
+ case BEFORE_HTML:
+ case BEFORE_HEAD: {
start = i + 1;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD:
- case NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT:
- case NS_HTML5TREE_BUILDER_AFTER_HEAD:
- case NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP:
- case NS_HTML5TREE_BUILDER_IN_FRAMESET:
- case NS_HTML5TREE_BUILDER_AFTER_FRAMESET: {
+ case IN_HEAD:
+ case IN_HEAD_NOSCRIPT:
+ case AFTER_HEAD:
+ case IN_COLUMN_GROUP:
+ case IN_FRAMESET:
+ case AFTER_FRAMESET: {
continue;
}
- case NS_HTML5TREE_BUILDER_FRAMESET_OK:
- case NS_HTML5TREE_BUILDER_IN_TEMPLATE:
- case NS_HTML5TREE_BUILDER_IN_BODY:
- case NS_HTML5TREE_BUILDER_IN_CELL:
- case NS_HTML5TREE_BUILDER_IN_CAPTION: {
+ case FRAMESET_OK:
+ case IN_TEMPLATE:
+ case IN_BODY:
+ case IN_CELL:
+ case IN_CAPTION: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
@@ -279,20 +279,20 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
}
NS_HTML5_BREAK(charactersloop);
}
- case NS_HTML5TREE_BUILDER_IN_SELECT:
- case NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE: {
+ case IN_SELECT:
+ case IN_SELECT_IN_TABLE: {
NS_HTML5_BREAK(charactersloop);
}
- case NS_HTML5TREE_BUILDER_IN_TABLE:
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY:
- case NS_HTML5TREE_BUILDER_IN_ROW: {
+ case IN_TABLE:
+ case IN_TABLE_BODY:
+ case IN_ROW: {
accumulateCharactersForced(buf, i, 1);
start = i + 1;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_BODY:
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY:
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET: {
+ case AFTER_BODY:
+ case AFTER_AFTER_BODY:
+ case AFTER_AFTER_FRAMESET: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
@@ -305,41 +305,41 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
}
default: {
switch(mode) {
- case NS_HTML5TREE_BUILDER_INITIAL: {
+ case INITIAL: {
documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
- mode = NS_HTML5TREE_BUILDER_BEFORE_HTML;
+ mode = BEFORE_HTML;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_BEFORE_HTML: {
+ case BEFORE_HTML: {
appendHtmlElementToDocumentAndPush();
- mode = NS_HTML5TREE_BUILDER_BEFORE_HEAD;
+ mode = BEFORE_HEAD;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_BEFORE_HEAD: {
+ case BEFORE_HEAD: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
}
flushCharacters();
appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD: {
+ case IN_HEAD: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
}
flushCharacters();
pop();
- mode = NS_HTML5TREE_BUILDER_AFTER_HEAD;
+ mode = AFTER_HEAD;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT: {
+ case IN_HEAD_NOSCRIPT: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
@@ -347,31 +347,31 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
errNonSpaceInNoscriptInHead();
flushCharacters();
pop();
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_HEAD: {
+ case AFTER_HEAD: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
}
flushCharacters();
appendToCurrentNodeAndPushBodyElement();
- mode = NS_HTML5TREE_BUILDER_FRAMESET_OK;
+ mode = FRAMESET_OK;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_FRAMESET_OK: {
+ case FRAMESET_OK: {
framesetOk = false;
- mode = NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = IN_BODY;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_TEMPLATE:
- case NS_HTML5TREE_BUILDER_IN_BODY:
- case NS_HTML5TREE_BUILDER_IN_CELL:
- case NS_HTML5TREE_BUILDER_IN_CAPTION: {
+ case IN_TEMPLATE:
+ case IN_BODY:
+ case IN_CELL:
+ case IN_CAPTION: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
@@ -382,41 +382,41 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
}
NS_HTML5_BREAK(charactersloop);
}
- case NS_HTML5TREE_BUILDER_IN_TABLE:
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY:
- case NS_HTML5TREE_BUILDER_IN_ROW: {
+ case IN_TABLE:
+ case IN_TABLE_BODY:
+ case IN_ROW: {
accumulateCharactersForced(buf, i, 1);
start = i + 1;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP: {
+ case IN_COLUMN_GROUP: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
start = i;
}
- if (!currentPtr || stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ if (!currentPtr || stack[currentPtr]->getGroup() == nsHtml5TreeBuilder::TEMPLATE) {
errNonSpaceInColgroupInFragment();
start = i + 1;
continue;
}
flushCharacters();
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_SELECT:
- case NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE: {
+ case IN_SELECT:
+ case IN_SELECT_IN_TABLE: {
NS_HTML5_BREAK(charactersloop);
}
- case NS_HTML5TREE_BUILDER_AFTER_BODY: {
+ case AFTER_BODY: {
errNonSpaceAfterBody();
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_FRAMESET: {
+ case IN_FRAMESET: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
}
@@ -424,7 +424,7 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
start = i + 1;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_FRAMESET: {
+ case AFTER_FRAMESET: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
}
@@ -432,13 +432,13 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
start = i + 1;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY: {
+ case AFTER_AFTER_BODY: {
errNonSpaceInTrailer();
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
i--;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET: {
+ case AFTER_AFTER_FRAMESET: {
if (start < i) {
accumulateCharacters(buf, start, i - start);
}
@@ -461,7 +461,7 @@ nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t lengt
void
nsHtml5TreeBuilder::zeroOriginatingReplacementCharacter()
{
- if (mode == NS_HTML5TREE_BUILDER_TEXT) {
+ if (mode == TEXT) {
accumulateCharacters(REPLACEMENT_CHARACTER, 0, 1);
return;
}
@@ -479,57 +479,57 @@ nsHtml5TreeBuilder::eof()
flushCharacters();
for (; ; ) {
switch(mode) {
- case NS_HTML5TREE_BUILDER_INITIAL: {
+ case INITIAL: {
documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
- mode = NS_HTML5TREE_BUILDER_BEFORE_HTML;
+ mode = BEFORE_HTML;
continue;
}
- case NS_HTML5TREE_BUILDER_BEFORE_HTML: {
+ case BEFORE_HTML: {
appendHtmlElementToDocumentAndPush();
- mode = NS_HTML5TREE_BUILDER_BEFORE_HEAD;
+ mode = BEFORE_HEAD;
continue;
}
- case NS_HTML5TREE_BUILDER_BEFORE_HEAD: {
+ case BEFORE_HEAD: {
appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD: {
+ case IN_HEAD: {
while (currentPtr > 0) {
popOnEof();
}
- mode = NS_HTML5TREE_BUILDER_AFTER_HEAD;
+ mode = AFTER_HEAD;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT: {
+ case IN_HEAD_NOSCRIPT: {
while (currentPtr > 1) {
popOnEof();
}
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_HEAD: {
+ case AFTER_HEAD: {
appendToCurrentNodeAndPushBodyElement();
- mode = NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = IN_BODY;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY:
- case NS_HTML5TREE_BUILDER_IN_ROW:
- case NS_HTML5TREE_BUILDER_IN_TABLE:
- case NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE:
- case NS_HTML5TREE_BUILDER_IN_SELECT:
- case NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP:
- case NS_HTML5TREE_BUILDER_FRAMESET_OK:
- case NS_HTML5TREE_BUILDER_IN_CAPTION:
- case NS_HTML5TREE_BUILDER_IN_CELL:
- case NS_HTML5TREE_BUILDER_IN_BODY: {
+ case IN_TABLE_BODY:
+ case IN_ROW:
+ case IN_TABLE:
+ case IN_SELECT_IN_TABLE:
+ case IN_SELECT:
+ case IN_COLUMN_GROUP:
+ case FRAMESET_OK:
+ case IN_CAPTION:
+ case IN_CELL:
+ case IN_BODY: {
if (isTemplateModeStackEmpty()) {
NS_HTML5_BREAK(eofloop);
}
}
- case NS_HTML5TREE_BUILDER_IN_TEMPLATE: {
+ case IN_TEMPLATE: {
int32_t eltPos = findLast(nsHtml5Atoms::template_);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment);
NS_HTML5_BREAK(eofloop);
}
@@ -544,21 +544,21 @@ nsHtml5TreeBuilder::eof()
resetTheInsertionMode();
continue;
}
- case NS_HTML5TREE_BUILDER_TEXT: {
- if (originalMode == NS_HTML5TREE_BUILDER_AFTER_HEAD) {
+ case TEXT: {
+ if (originalMode == AFTER_HEAD) {
popOnEof();
}
popOnEof();
mode = originalMode;
continue;
}
- case NS_HTML5TREE_BUILDER_IN_FRAMESET: {
+ case IN_FRAMESET: {
NS_HTML5_BREAK(eofloop);
}
- case NS_HTML5TREE_BUILDER_AFTER_BODY:
- case NS_HTML5TREE_BUILDER_AFTER_FRAMESET:
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY:
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET:
+ case AFTER_BODY:
+ case AFTER_FRAMESET:
+ case AFTER_AFTER_BODY:
+ case AFTER_AFTER_FRAMESET:
default: {
NS_HTML5_BREAK(eofloop);
}
@@ -612,28 +612,28 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
if (isInForeign()) {
nsHtml5StackNode* currentNode = stack[currentPtr];
int32_t currNs = currentNode->ns;
- if (!(currentNode->isHtmlIntegrationPoint() || (currNs == kNameSpaceID_MathML && ((currentNode->getGroup() == NS_HTML5TREE_BUILDER_MI_MO_MN_MS_MTEXT && group != NS_HTML5TREE_BUILDER_MGLYPH_OR_MALIGNMARK) || (currentNode->getGroup() == NS_HTML5TREE_BUILDER_ANNOTATION_XML && group == NS_HTML5TREE_BUILDER_SVG))))) {
+ if (!(currentNode->isHtmlIntegrationPoint() || (currNs == kNameSpaceID_MathML && ((currentNode->getGroup() == MI_MO_MN_MS_MTEXT && group != MGLYPH_OR_MALIGNMARK) || (currentNode->getGroup() == ANNOTATION_XML && group == SVG))))) {
switch(group) {
- 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_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_BR:
- case NS_HTML5TREE_BUILDER_RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR:
- case NS_HTML5TREE_BUILDER_DD_OR_DT:
- case NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL:
- case NS_HTML5TREE_BUILDER_EMBED:
- case NS_HTML5TREE_BUILDER_IMG:
- case NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6:
- case NS_HTML5TREE_BUILDER_HEAD:
- case NS_HTML5TREE_BUILDER_HR:
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_META:
- case NS_HTML5TREE_BUILDER_NOBR:
- case NS_HTML5TREE_BUILDER_P:
- case NS_HTML5TREE_BUILDER_PRE_OR_LISTING:
- case NS_HTML5TREE_BUILDER_TABLE:
- case NS_HTML5TREE_BUILDER_FONT: {
- if (!(group == NS_HTML5TREE_BUILDER_FONT && !(attributes->contains(nsHtml5AttributeName::ATTR_COLOR) || attributes->contains(nsHtml5AttributeName::ATTR_FACE) || attributes->contains(nsHtml5AttributeName::ATTR_SIZE)))) {
+ case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
+ case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
+ case BODY:
+ case BR:
+ case RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR:
+ case DD_OR_DT:
+ case UL_OR_OL_OR_DL:
+ case EMBED:
+ case IMG:
+ case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6:
+ case HEAD:
+ case HR:
+ case LI:
+ case META:
+ case NOBR:
+ case P:
+ case PRE_OR_LISTING:
+ case TABLE:
+ case FONT: {
+ if (!(group == FONT && !(attributes->contains(nsHtml5AttributeName::ATTR_COLOR) || attributes->contains(nsHtml5AttributeName::ATTR_FACE) || attributes->contains(nsHtml5AttributeName::ATTR_SIZE)))) {
errHtmlStartTagInForeignContext(name);
if (!fragment) {
while (!isSpecialParentInForeign(stack[currentPtr])) {
@@ -670,93 +670,93 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
}
switch(mode) {
- case NS_HTML5TREE_BUILDER_IN_TEMPLATE: {
+ case IN_TEMPLATE: {
switch(group) {
- case NS_HTML5TREE_BUILDER_COL: {
+ case COL: {
popTemplateMode();
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP);
- mode = NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP;
+ pushTemplateMode(IN_COLUMN_GROUP);
+ mode = IN_COLUMN_GROUP;
continue;
}
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT: {
+ case CAPTION:
+ case COLGROUP:
+ case TBODY_OR_THEAD_OR_TFOOT: {
popTemplateMode();
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_TABLE);
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ pushTemplateMode(IN_TABLE);
+ mode = IN_TABLE;
continue;
}
- case NS_HTML5TREE_BUILDER_TR: {
+ case TR: {
popTemplateMode();
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_TABLE_BODY);
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ pushTemplateMode(IN_TABLE_BODY);
+ mode = IN_TABLE_BODY;
continue;
}
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case TD_OR_TH: {
popTemplateMode();
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_ROW);
- mode = NS_HTML5TREE_BUILDER_IN_ROW;
+ pushTemplateMode(IN_ROW);
+ mode = IN_ROW;
continue;
}
- case NS_HTML5TREE_BUILDER_META: {
+ case META: {
checkMetaCharset(attributes);
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TITLE: {
+ case TITLE: {
startTagTitleInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BASE:
- case NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND: {
+ case BASE:
+ case LINK_OR_BASEFONT_OR_BGSOUND: {
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SCRIPT: {
+ case SCRIPT: {
startTagScriptInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOFRAMES:
- case NS_HTML5TREE_BUILDER_STYLE: {
+ case NOFRAMES:
+ case STYLE: {
startTagGenericRawText(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
startTagTemplateInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
default: {
popTemplateMode();
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_BODY);
- mode = NS_HTML5TREE_BUILDER_IN_BODY;
+ pushTemplateMode(IN_BODY);
+ mode = IN_BODY;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_IN_ROW: {
+ case IN_ROW: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
- clearStackBackTo(findLastOrRoot(NS_HTML5TREE_BUILDER_TR));
+ case TD_OR_TH: {
+ clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TR));
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_CELL;
+ mode = IN_CELL;
insertMarker();
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR: {
- eltPos = findLastOrRoot(NS_HTML5TREE_BUILDER_TR);
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR: {
+ eltPos = findLastOrRoot(nsHtml5TreeBuilder::TR);
if (!eltPos) {
MOZ_ASSERT(fragment || isTemplateContents());
errNoTableRowToClose();
@@ -764,42 +764,42 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
continue;
}
default:
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY: {
+ case IN_TABLE_BODY: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TR: {
+ case TR: {
clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_ROW;
+ mode = IN_ROW;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case TD_OR_TH: {
errStartTagInTableBody(name);
clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_TR, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_ROW;
+ mode = IN_ROW;
continue;
}
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT: {
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case TBODY_OR_THEAD_OR_TFOOT: {
eltPos = findLastInTableScopeOrRootTemplateTbodyTheadTfoot();
- if (!eltPos || stack[eltPos]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ if (!eltPos || stack[eltPos]->getGroup() == TEMPLATE) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayStartTag(name);
NS_HTML5_BREAK(starttagloop);
} else {
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
continue;
}
}
@@ -807,51 +807,51 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_TABLE: {
+ case IN_TABLE: {
for (; ; ) {
switch(group) {
- case NS_HTML5TREE_BUILDER_CAPTION: {
- clearStackBackTo(findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE));
+ case CAPTION: {
+ clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
insertMarker();
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_CAPTION;
+ mode = IN_CAPTION;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_COLGROUP: {
- clearStackBackTo(findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE));
+ case COLGROUP: {
+ clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP;
+ mode = IN_COLUMN_GROUP;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_COL: {
- clearStackBackTo(findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE));
+ case COL: {
+ clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_COLGROUP, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP;
+ mode = IN_COLUMN_GROUP;
NS_HTML5_CONTINUE(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT: {
- clearStackBackTo(findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE));
+ case TBODY_OR_THEAD_OR_TFOOT: {
+ clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TR:
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
- clearStackBackTo(findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE));
+ case TR:
+ case TD_OR_TH: {
+ clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_TBODY, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
NS_HTML5_CONTINUE(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
NS_HTML5_BREAK(intableloop);
}
- case NS_HTML5TREE_BUILDER_TABLE: {
+ case TABLE: {
errTableSeenWhileTableOpen();
eltPos = findLastInTableScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment || isTemplateContents());
NS_HTML5_BREAK(starttagloop);
}
@@ -865,23 +865,23 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
resetTheInsertionMode();
NS_HTML5_CONTINUE(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SCRIPT: {
+ case SCRIPT: {
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_SCRIPT_DATA, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::SCRIPT_DATA, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_STYLE: {
+ case STYLE: {
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_INPUT: {
+ case INPUT: {
errStartTagInTable(name);
if (!nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("hidden", attributes->getValue(nsHtml5AttributeName::ATTR_TYPE))) {
NS_HTML5_BREAK(intableloop);
@@ -891,7 +891,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_FORM: {
+ case FORM: {
if (!!formPointer || isTemplateContents()) {
errFormWhenFormOpen();
NS_HTML5_BREAK(starttagloop);
@@ -910,17 +910,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
intableloop_end: ;
}
- case NS_HTML5TREE_BUILDER_IN_CAPTION: {
+ case IN_CAPTION: {
switch(group) {
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR:
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR:
+ case TD_OR_TH: {
errStrayStartTag(name);
eltPos = findLastInTableScope(nsHtml5Atoms::caption);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
NS_HTML5_BREAK(starttagloop);
}
generateImpliedEndTags();
@@ -931,23 +931,23 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
pop();
}
clearTheListOfActiveFormattingElementsUpToTheLastMarker();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
continue;
}
default:
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_CELL: {
+ case IN_CELL: {
switch(group) {
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR:
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR:
+ case TD_OR_TH: {
eltPos = findLastInTableScopeTdTh();
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errNoCellToClose();
NS_HTML5_BREAK(starttagloop);
} else {
@@ -959,11 +959,11 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_FRAMESET_OK: {
+ case FRAMESET_OK: {
switch(group) {
- case NS_HTML5TREE_BUILDER_FRAMESET: {
- if (mode == NS_HTML5TREE_BUILDER_FRAMESET_OK) {
- if (!currentPtr || stack[1]->getGroup() != NS_HTML5TREE_BUILDER_BODY) {
+ case FRAMESET: {
+ if (mode == FRAMESET_OK) {
+ if (!currentPtr || stack[1]->getGroup() != BODY) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayStartTag(name);
NS_HTML5_BREAK(starttagloop);
@@ -974,7 +974,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
pop();
}
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_FRAMESET;
+ mode = IN_FRAMESET;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
@@ -983,37 +983,37 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
NS_HTML5_BREAK(starttagloop);
}
}
- case NS_HTML5TREE_BUILDER_PRE_OR_LISTING:
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_DD_OR_DT:
- case NS_HTML5TREE_BUILDER_BUTTON:
- case NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET:
- case NS_HTML5TREE_BUILDER_OBJECT:
- case NS_HTML5TREE_BUILDER_TABLE:
- case NS_HTML5TREE_BUILDER_AREA_OR_WBR:
- case NS_HTML5TREE_BUILDER_BR:
- case NS_HTML5TREE_BUILDER_EMBED:
- case NS_HTML5TREE_BUILDER_IMG:
- case NS_HTML5TREE_BUILDER_INPUT:
- case NS_HTML5TREE_BUILDER_KEYGEN:
- case NS_HTML5TREE_BUILDER_HR:
- case NS_HTML5TREE_BUILDER_TEXTAREA:
- case NS_HTML5TREE_BUILDER_XMP:
- case NS_HTML5TREE_BUILDER_IFRAME:
- case NS_HTML5TREE_BUILDER_SELECT: {
- if (mode == NS_HTML5TREE_BUILDER_FRAMESET_OK && !(group == NS_HTML5TREE_BUILDER_INPUT && nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("hidden", attributes->getValue(nsHtml5AttributeName::ATTR_TYPE)))) {
+ case PRE_OR_LISTING:
+ case LI:
+ case DD_OR_DT:
+ case BUTTON:
+ case MARQUEE_OR_APPLET:
+ case OBJECT:
+ case TABLE:
+ case AREA_OR_WBR:
+ case BR:
+ case EMBED:
+ case IMG:
+ case INPUT:
+ case KEYGEN:
+ case HR:
+ case TEXTAREA:
+ case XMP:
+ case IFRAME:
+ case SELECT: {
+ if (mode == FRAMESET_OK && !(group == INPUT && nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("hidden", attributes->getValue(nsHtml5AttributeName::ATTR_TYPE)))) {
framesetOk = false;
- mode = NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = IN_BODY;
}
}
default:
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_BODY: {
+ case IN_BODY: {
for (; ; ) {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1021,43 +1021,43 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BASE:
- case NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND:
- case NS_HTML5TREE_BUILDER_META:
- case NS_HTML5TREE_BUILDER_STYLE:
- case NS_HTML5TREE_BUILDER_SCRIPT:
- case NS_HTML5TREE_BUILDER_TITLE:
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case BASE:
+ case LINK_OR_BASEFONT_OR_BGSOUND:
+ case META:
+ case STYLE:
+ case SCRIPT:
+ case TITLE:
+ case TEMPLATE: {
NS_HTML5_BREAK(inbodyloop);
}
- case NS_HTML5TREE_BUILDER_BODY: {
- if (!currentPtr || stack[1]->getGroup() != NS_HTML5TREE_BUILDER_BODY || isTemplateContents()) {
+ case BODY: {
+ if (!currentPtr || stack[1]->getGroup() != BODY || isTemplateContents()) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayStartTag(name);
NS_HTML5_BREAK(starttagloop);
}
errFooSeenWhenFooOpen(name);
framesetOk = false;
- if (mode == NS_HTML5TREE_BUILDER_FRAMESET_OK) {
- mode = NS_HTML5TREE_BUILDER_IN_BODY;
+ if (mode == FRAMESET_OK) {
+ mode = IN_BODY;
}
if (addAttributesToBody(attributes)) {
attributes = nullptr;
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_P:
- case NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
- case NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL:
- case NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
+ case P:
+ case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
+ case UL_OR_OL_OR_DL:
+ case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
implicitlyCloseP();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: {
+ case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: {
implicitlyCloseP();
- if (stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
+ if (stack[currentPtr]->getGroup() == H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
errHeadingWhenHeadingOpen();
pop();
}
@@ -1065,20 +1065,20 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_FIELDSET: {
+ case FIELDSET: {
implicitlyCloseP();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_PRE_OR_LISTING: {
+ case PRE_OR_LISTING: {
implicitlyCloseP();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
needToDropLF = true;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_FORM: {
+ case FORM: {
if (!!formPointer && !isTemplateContents()) {
errFormWhenFormOpen();
NS_HTML5_BREAK(starttagloop);
@@ -1089,8 +1089,8 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
NS_HTML5_BREAK(starttagloop);
}
}
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_DD_OR_DT: {
+ case LI:
+ case DD_OR_DT: {
eltPos = currentPtr;
for (; ; ) {
nsHtml5StackNode* node = stack[eltPos];
@@ -1113,14 +1113,14 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_PLAINTEXT: {
+ case PLAINTEXT: {
implicitlyCloseP();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_PLAINTEXT, elementName);
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::PLAINTEXT, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_A: {
+ case A: {
int32_t activeAPos = findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(nsHtml5Atoms::a);
if (activeAPos != -1) {
errFooSeenWhenFooOpen(name);
@@ -1139,17 +1139,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- 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 B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
+ case FONT: {
reconstructTheActiveFormattingElements();
maybeForgetEarlierDuplicateFormattingElement(elementName->getName(), attributes);
appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOBR: {
+ case NOBR: {
reconstructTheActiveFormattingElements();
- if (NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK != findLastInScope(nsHtml5Atoms::nobr)) {
+ if (nsHtml5TreeBuilder::NOT_FOUND_ON_STACK != findLastInScope(nsHtml5Atoms::nobr)) {
errFooSeenWhenFooOpen(name);
adoptionAgencyEndTag(nsHtml5Atoms::nobr);
reconstructTheActiveFormattingElements();
@@ -1158,9 +1158,9 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BUTTON: {
+ case BUTTON: {
eltPos = findLastInScope(name);
- if (eltPos != NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos != nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errFooSeenWhenFooOpen(name);
generateImpliedEndTags();
if (!!MOZ_UNLIKELY(mViewSource) && !isCurrent(name)) {
@@ -1177,65 +1177,65 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
NS_HTML5_BREAK(starttagloop);
}
}
- case NS_HTML5TREE_BUILDER_OBJECT: {
+ case OBJECT: {
reconstructTheActiveFormattingElements();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
insertMarker();
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET: {
+ case MARQUEE_OR_APPLET: {
reconstructTheActiveFormattingElements();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
insertMarker();
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TABLE: {
+ case TABLE: {
if (!quirks) {
implicitlyCloseP();
}
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BR:
- case NS_HTML5TREE_BUILDER_EMBED:
- case NS_HTML5TREE_BUILDER_AREA_OR_WBR: {
+ case BR:
+ case EMBED:
+ case AREA_OR_WBR: {
reconstructTheActiveFormattingElements();
}
#ifdef ENABLE_VOID_MENUITEM
- case NS_HTML5TREE_BUILDER_MENUITEM:
+ case MENUITEM:
#endif
- case NS_HTML5TREE_BUILDER_PARAM_OR_SOURCE_OR_TRACK: {
+ case PARAM_OR_SOURCE_OR_TRACK: {
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_HR: {
+ case HR: {
implicitlyCloseP();
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_IMAGE: {
+ case IMAGE: {
errImage();
elementName = nsHtml5ElementName::ELT_IMG;
NS_HTML5_CONTINUE(starttagloop);
}
- case NS_HTML5TREE_BUILDER_IMG:
- case NS_HTML5TREE_BUILDER_KEYGEN:
- case NS_HTML5TREE_BUILDER_INPUT: {
+ case IMG:
+ case KEYGEN:
+ case INPUT: {
reconstructTheActiveFormattingElements();
appendVoidElementToCurrentMayFoster(name, attributes, formPointer);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_ISINDEX: {
+ case ISINDEX: {
errIsindex();
if (!!formPointer && !isTemplateContents()) {
NS_HTML5_BREAK(starttagloop);
@@ -1277,26 +1277,26 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
selfClosing = false;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEXTAREA: {
+ case TEXTAREA: {
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RCDATA, elementName);
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RCDATA, elementName);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
+ mode = TEXT;
needToDropLF = true;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_XMP: {
+ case XMP: {
implicitlyCloseP();
reconstructTheActiveFormattingElements();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOSCRIPT: {
+ case NOSCRIPT: {
if (!scriptingEnabled) {
reconstructTheActiveFormattingElements();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
@@ -1305,36 +1305,36 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
} else {
}
}
- case NS_HTML5TREE_BUILDER_NOFRAMES:
- case NS_HTML5TREE_BUILDER_IFRAME:
- case NS_HTML5TREE_BUILDER_NOEMBED: {
+ case NOFRAMES:
+ case IFRAME:
+ case NOEMBED: {
startTagGenericRawText(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SELECT: {
+ case SELECT: {
reconstructTheActiveFormattingElements();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
switch(mode) {
- case NS_HTML5TREE_BUILDER_IN_TABLE:
- case NS_HTML5TREE_BUILDER_IN_CAPTION:
- case NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP:
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY:
- case NS_HTML5TREE_BUILDER_IN_ROW:
- case NS_HTML5TREE_BUILDER_IN_CELL: {
- mode = NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE;
+ case IN_TABLE:
+ case IN_CAPTION:
+ case IN_COLUMN_GROUP:
+ case IN_TABLE_BODY:
+ case IN_ROW:
+ case IN_CELL: {
+ mode = IN_SELECT_IN_TABLE;
break;
}
default: {
- mode = NS_HTML5TREE_BUILDER_IN_SELECT;
+ mode = IN_SELECT;
break;
}
}
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_OPTGROUP:
- case NS_HTML5TREE_BUILDER_OPTION: {
+ case OPTGROUP:
+ case OPTION: {
if (isCurrent(nsHtml5Atoms::option)) {
pop();
}
@@ -1343,13 +1343,13 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_RB_OR_RTC: {
+ case RB_OR_RTC: {
eltPos = findLastInScope(nsHtml5Atoms::ruby);
- if (eltPos != NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos != NOT_FOUND_ON_STACK) {
generateImpliedEndTags();
}
if (eltPos != currentPtr) {
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == NOT_FOUND_ON_STACK) {
errStartTagSeenWithoutRuby(name);
} else {
errUnclosedChildrenInRuby();
@@ -1359,14 +1359,14 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_RT_OR_RP: {
+ case RT_OR_RP: {
eltPos = findLastInScope(nsHtml5Atoms::ruby);
- if (eltPos != NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos != NOT_FOUND_ON_STACK) {
generateImpliedEndTagsExceptFor(nsHtml5Atoms::rtc);
}
if (eltPos != currentPtr) {
if (!isCurrent(nsHtml5Atoms::rtc)) {
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == NOT_FOUND_ON_STACK) {
errStartTagSeenWithoutRuby(name);
} else {
errUnclosedChildrenInRuby();
@@ -1377,7 +1377,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_MATH: {
+ case MATH: {
reconstructTheActiveFormattingElements();
attributes->adjustForMath();
if (selfClosing) {
@@ -1389,7 +1389,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SVG: {
+ case SVG: {
reconstructTheActiveFormattingElements();
attributes->adjustForSvg();
if (selfClosing) {
@@ -1401,19 +1401,19 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_FRAME:
- case NS_HTML5TREE_BUILDER_FRAMESET:
- case NS_HTML5TREE_BUILDER_HEAD: {
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR:
+ case TD_OR_TH:
+ case FRAME:
+ case FRAMESET:
+ case HEAD: {
errStrayStartTag(name);
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_OUTPUT: {
+ case OUTPUT: {
reconstructTheActiveFormattingElements();
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
attributes = nullptr;
@@ -1429,10 +1429,10 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
inbodyloop_end: ;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD: {
+ case IN_HEAD: {
for (; ; ) {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1440,66 +1440,66 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BASE:
- case NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND: {
+ case BASE:
+ case LINK_OR_BASEFONT_OR_BGSOUND: {
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_META: {
+ case META: {
NS_HTML5_BREAK(inheadloop);
}
- case NS_HTML5TREE_BUILDER_TITLE: {
+ case TITLE: {
startTagTitleInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOSCRIPT: {
+ case NOSCRIPT: {
if (scriptingEnabled) {
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
} else {
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT;
+ mode = IN_HEAD_NOSCRIPT;
}
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SCRIPT: {
+ case SCRIPT: {
startTagScriptInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_STYLE:
- case NS_HTML5TREE_BUILDER_NOFRAMES: {
+ case STYLE:
+ case NOFRAMES: {
startTagGenericRawText(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_HEAD: {
+ case HEAD: {
errFooSeenWhenFooOpen(name);
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
startTagTemplateInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
default: {
pop();
- mode = NS_HTML5TREE_BUILDER_AFTER_HEAD;
+ mode = AFTER_HEAD;
NS_HTML5_CONTINUE(starttagloop);
}
}
}
inheadloop_end: ;
}
- case NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT: {
+ case IN_HEAD_NOSCRIPT: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1507,47 +1507,47 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND: {
+ case LINK_OR_BASEFONT_OR_BGSOUND: {
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_META: {
+ case META: {
checkMetaCharset(attributes);
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_STYLE:
- case NS_HTML5TREE_BUILDER_NOFRAMES: {
+ case STYLE:
+ case NOFRAMES: {
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_HEAD: {
+ case HEAD: {
errFooSeenWhenFooOpen(name);
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOSCRIPT: {
+ case NOSCRIPT: {
errFooSeenWhenFooOpen(name);
NS_HTML5_BREAK(starttagloop);
}
default: {
errBadStartTagInHead(name);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP: {
+ case IN_COLUMN_GROUP: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1555,39 +1555,39 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_COL: {
+ case COL: {
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
startTagTemplateInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
default: {
- if (!currentPtr || stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ if (!currentPtr || stack[currentPtr]->getGroup() == TEMPLATE) {
MOZ_ASSERT(fragment || isTemplateContents());
errGarbageInColgroup();
NS_HTML5_BREAK(starttagloop);
}
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE: {
+ case IN_SELECT_IN_TABLE: {
switch(group) {
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_TABLE: {
+ case CAPTION:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR:
+ case TD_OR_TH:
+ case TABLE: {
errStartTagWithSelectOpen(name);
eltPos = findLastInTableScope(nsHtml5Atoms::select);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment);
NS_HTML5_BREAK(starttagloop);
}
@@ -1601,9 +1601,9 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_SELECT: {
+ case IN_SELECT: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment) {
addAttributesToHtml(attributes);
@@ -1611,7 +1611,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_OPTION: {
+ case OPTION: {
if (isCurrent(nsHtml5Atoms::option)) {
pop();
}
@@ -1619,7 +1619,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_OPTGROUP: {
+ case OPTGROUP: {
if (isCurrent(nsHtml5Atoms::option)) {
pop();
}
@@ -1630,10 +1630,10 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SELECT: {
+ case SELECT: {
errStartSelectWhereEndSelectExpected();
eltPos = findLastInTableScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment);
errNoSelectInTableScope();
NS_HTML5_BREAK(starttagloop);
@@ -1645,12 +1645,12 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
NS_HTML5_BREAK(starttagloop);
}
}
- case NS_HTML5TREE_BUILDER_INPUT:
- case NS_HTML5TREE_BUILDER_TEXTAREA:
- case NS_HTML5TREE_BUILDER_KEYGEN: {
+ case INPUT:
+ case TEXTAREA:
+ case KEYGEN: {
errStartTagWithSelectOpen(name);
eltPos = findLastInTableScope(nsHtml5Atoms::select);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment);
NS_HTML5_BREAK(starttagloop);
}
@@ -1660,12 +1660,12 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
resetTheInsertionMode();
continue;
}
- case NS_HTML5TREE_BUILDER_SCRIPT: {
+ case SCRIPT: {
startTagScriptInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
startTagTemplateInHead(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
@@ -1676,9 +1676,9 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_BODY: {
+ case AFTER_BODY: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1688,19 +1688,19 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
default: {
errStrayStartTag(name);
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_IN_FRAMESET: {
+ case IN_FRAMESET: {
switch(group) {
- case NS_HTML5TREE_BUILDER_FRAMESET: {
+ case FRAMESET: {
appendToCurrentNodeAndPushElement(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_FRAME: {
+ case FRAME: {
appendVoidElementToCurrentMayFoster(elementName, attributes);
selfClosing = false;
attributes = nullptr;
@@ -1710,9 +1710,9 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_AFTER_FRAMESET: {
+ case AFTER_FRAMESET: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1720,11 +1720,11 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOFRAMES: {
+ case NOFRAMES: {
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
@@ -1734,34 +1734,34 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
}
}
- case NS_HTML5TREE_BUILDER_INITIAL: {
+ case INITIAL: {
errStartTagWithoutDoctype();
documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
- mode = NS_HTML5TREE_BUILDER_BEFORE_HTML;
+ mode = BEFORE_HTML;
continue;
}
- case NS_HTML5TREE_BUILDER_BEFORE_HTML: {
+ case BEFORE_HTML: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
if (attributes == nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES) {
appendHtmlElementToDocumentAndPush();
} else {
appendHtmlElementToDocumentAndPush(attributes);
}
- mode = NS_HTML5TREE_BUILDER_BEFORE_HEAD;
+ mode = BEFORE_HEAD;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
default: {
appendHtmlElementToDocumentAndPush();
- mode = NS_HTML5TREE_BUILDER_BEFORE_HEAD;
+ mode = BEFORE_HEAD;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_BEFORE_HEAD: {
+ case BEFORE_HEAD: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1769,22 +1769,22 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_HEAD: {
+ case HEAD: {
appendToCurrentNodeAndPushHeadElement(attributes);
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
default: {
appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_HEAD: {
+ case AFTER_HEAD: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1792,24 +1792,24 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BODY: {
+ case BODY: {
if (!attributes->getLength()) {
appendToCurrentNodeAndPushBodyElement();
} else {
appendToCurrentNodeAndPushBodyElement(attributes);
}
framesetOk = false;
- mode = NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = IN_BODY;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_FRAMESET: {
+ case FRAMESET: {
appendToCurrentNodeAndPushElement(elementName, attributes);
- mode = NS_HTML5TREE_BUILDER_IN_FRAMESET;
+ mode = IN_FRAMESET;
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
errFooBetweenHeadAndBody(name);
pushHeadPointerOntoStack();
nsHtml5StackNode* headOnStack = stack[currentPtr];
@@ -1818,8 +1818,8 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_BASE:
- case NS_HTML5TREE_BUILDER_LINK_OR_BASEFONT_OR_BGSOUND: {
+ case BASE:
+ case LINK_OR_BASEFONT_OR_BGSOUND: {
errFooBetweenHeadAndBody(name);
pushHeadPointerOntoStack();
appendVoidElementToCurrentMayFoster(elementName, attributes);
@@ -1828,7 +1828,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_META: {
+ case META: {
errFooBetweenHeadAndBody(name);
checkMetaCharset(attributes);
pushHeadPointerOntoStack();
@@ -1838,51 +1838,51 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_SCRIPT: {
+ case SCRIPT: {
errFooBetweenHeadAndBody(name);
pushHeadPointerOntoStack();
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_SCRIPT_DATA, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::SCRIPT_DATA, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_STYLE:
- case NS_HTML5TREE_BUILDER_NOFRAMES: {
+ case STYLE:
+ case NOFRAMES: {
errFooBetweenHeadAndBody(name);
pushHeadPointerOntoStack();
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_TITLE: {
+ case TITLE: {
errFooBetweenHeadAndBody(name);
pushHeadPointerOntoStack();
appendToCurrentNodeAndPushElement(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RCDATA, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RCDATA, elementName);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_HEAD: {
+ case HEAD: {
errStrayStartTag(name);
NS_HTML5_BREAK(starttagloop);
}
default: {
appendToCurrentNodeAndPushBodyElement();
- mode = NS_HTML5TREE_BUILDER_FRAMESET_OK;
+ mode = FRAMESET_OK;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY: {
+ case AFTER_AFTER_BODY: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1893,14 +1893,14 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
default: {
errStrayStartTag(name);
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET: {
+ case AFTER_AFTER_FRAMESET: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
errStrayStartTag(name);
if (!fragment && !isTemplateContents()) {
addAttributesToHtml(attributes);
@@ -1908,7 +1908,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
NS_HTML5_BREAK(starttagloop);
}
- case NS_HTML5TREE_BUILDER_NOFRAMES: {
+ case NOFRAMES: {
startTagGenericRawText(elementName, attributes);
attributes = nullptr;
NS_HTML5_BREAK(starttagloop);
@@ -1919,7 +1919,7 @@ nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttribu
}
}
}
- case NS_HTML5TREE_BUILDER_TEXT: {
+ case TEXT: {
MOZ_ASSERT(false);
NS_HTML5_BREAK(starttagloop);
}
@@ -1939,8 +1939,8 @@ nsHtml5TreeBuilder::startTagTitleInHead(nsHtml5ElementName* elementName, nsHtml5
{
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RCDATA, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RCDATA, elementName);
}
void
@@ -1948,8 +1948,8 @@ nsHtml5TreeBuilder::startTagGenericRawText(nsHtml5ElementName* elementName, nsHt
{
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_RAWTEXT, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT, elementName);
}
void
@@ -1957,8 +1957,8 @@ nsHtml5TreeBuilder::startTagScriptInHead(nsHtml5ElementName* elementName, nsHtml
{
appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_TEXT;
- tokenizer->setStateAndEndTagExpectation(NS_HTML5TOKENIZER_SCRIPT_DATA, elementName);
+ mode = TEXT;
+ tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::SCRIPT_DATA, elementName);
}
void
@@ -1968,14 +1968,14 @@ nsHtml5TreeBuilder::startTagTemplateInHead(nsHtml5ElementName* elementName, nsHt
insertMarker();
framesetOk = false;
originalMode = mode;
- mode = NS_HTML5TREE_BUILDER_IN_TEMPLATE;
- pushTemplateMode(NS_HTML5TREE_BUILDER_IN_TEMPLATE);
+ mode = IN_TEMPLATE;
+ pushTemplateMode(IN_TEMPLATE);
}
bool
nsHtml5TreeBuilder::isTemplateContents()
{
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK != findLast(nsHtml5Atoms::template_);
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK != findLast(nsHtml5Atoms::template_);
}
bool
@@ -1988,24 +1988,24 @@ bool
nsHtml5TreeBuilder::isSpecialParentInForeign(nsHtml5StackNode* stackNode)
{
int32_t ns = stackNode->ns;
- return (kNameSpaceID_XHTML == ns) || (stackNode->isHtmlIntegrationPoint()) || ((kNameSpaceID_MathML == ns) && (stackNode->getGroup() == NS_HTML5TREE_BUILDER_MI_MO_MN_MS_MTEXT));
+ return (kNameSpaceID_XHTML == ns) || (stackNode->isHtmlIntegrationPoint()) || ((kNameSpaceID_MathML == ns) && (stackNode->getGroup() == MI_MO_MN_MS_MTEXT));
}
nsHtml5String
nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHtml5TreeBuilder* tb)
{
- int32_t charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ int32_t charsetState = CHARSET_INITIAL;
int32_t start = -1;
int32_t end = -1;
autoJArray<char16_t,int32_t> buffer = nsHtml5Portability::newCharArrayFromString(attributeValue);
for (int32_t i = 0; i < buffer.length; i++) {
char16_t c = buffer[i];
switch(charsetState) {
- case NS_HTML5TREE_BUILDER_CHARSET_INITIAL: {
+ case CHARSET_INITIAL: {
switch(c) {
case 'c':
case 'C': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_C;
+ charsetState = CHARSET_C;
continue;
}
default: {
@@ -2013,85 +2013,85 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHt
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_C: {
+ case CHARSET_C: {
switch(c) {
case 'h':
case 'H': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_H;
+ charsetState = CHARSET_H;
continue;
}
default: {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ charsetState = CHARSET_INITIAL;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_H: {
+ case CHARSET_H: {
switch(c) {
case 'a':
case 'A': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_A;
+ charsetState = CHARSET_A;
continue;
}
default: {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ charsetState = CHARSET_INITIAL;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_A: {
+ case CHARSET_A: {
switch(c) {
case 'r':
case 'R': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_R;
+ charsetState = CHARSET_R;
continue;
}
default: {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ charsetState = CHARSET_INITIAL;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_R: {
+ case CHARSET_R: {
switch(c) {
case 's':
case 'S': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_S;
+ charsetState = CHARSET_S;
continue;
}
default: {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ charsetState = CHARSET_INITIAL;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_S: {
+ case CHARSET_S: {
switch(c) {
case 'e':
case 'E': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_E;
+ charsetState = CHARSET_E;
continue;
}
default: {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ charsetState = CHARSET_INITIAL;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_E: {
+ case CHARSET_E: {
switch(c) {
case 't':
case 'T': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_T;
+ charsetState = CHARSET_T;
continue;
}
default: {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_INITIAL;
+ charsetState = CHARSET_INITIAL;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_T: {
+ case CHARSET_T: {
switch(c) {
case '\t':
case '\n':
@@ -2101,7 +2101,7 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHt
continue;
}
case '=': {
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_EQUALS;
+ charsetState = CHARSET_EQUALS;
continue;
}
default: {
@@ -2109,7 +2109,7 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHt
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_EQUALS: {
+ case CHARSET_EQUALS: {
switch(c) {
case '\t':
case '\n':
@@ -2120,22 +2120,22 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHt
}
case '\'': {
start = i + 1;
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_SINGLE_QUOTED;
+ charsetState = CHARSET_SINGLE_QUOTED;
continue;
}
case '\"': {
start = i + 1;
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_DOUBLE_QUOTED;
+ charsetState = CHARSET_DOUBLE_QUOTED;
continue;
}
default: {
start = i;
- charsetState = NS_HTML5TREE_BUILDER_CHARSET_UNQUOTED;
+ charsetState = CHARSET_UNQUOTED;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_SINGLE_QUOTED: {
+ case CHARSET_SINGLE_QUOTED: {
switch(c) {
case '\'': {
end = i;
@@ -2146,7 +2146,7 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHt
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_DOUBLE_QUOTED: {
+ case CHARSET_DOUBLE_QUOTED: {
switch(c) {
case '\"': {
end = i;
@@ -2157,7 +2157,7 @@ nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue, nsHt
}
}
}
- case NS_HTML5TREE_BUILDER_CHARSET_UNQUOTED: {
+ case CHARSET_UNQUOTED: {
switch(c) {
case '\t':
case '\n':
@@ -2247,9 +2247,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
switch(mode) {
- case NS_HTML5TREE_BUILDER_IN_TEMPLATE: {
+ case IN_TEMPLATE: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
break;
}
default: {
@@ -2258,10 +2258,10 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_IN_ROW: {
+ case IN_ROW: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TR: {
- eltPos = findLastOrRoot(NS_HTML5TREE_BUILDER_TR);
+ case TR: {
+ eltPos = findLastOrRoot(nsHtml5TreeBuilder::TR);
if (!eltPos) {
MOZ_ASSERT(fragment || isTemplateContents());
errNoTableRowToClose();
@@ -2269,11 +2269,11 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TABLE: {
- eltPos = findLastOrRoot(NS_HTML5TREE_BUILDER_TR);
+ case TABLE: {
+ eltPos = findLastOrRoot(nsHtml5TreeBuilder::TR);
if (!eltPos) {
MOZ_ASSERT(fragment || isTemplateContents());
errNoTableRowToClose();
@@ -2281,15 +2281,15 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
continue;
}
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT: {
- if (findLastInTableScope(name) == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ case TBODY_OR_THEAD_OR_TFOOT: {
+ if (findLastInTableScope(name) == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
- eltPos = findLastOrRoot(NS_HTML5TREE_BUILDER_TR);
+ eltPos = findLastOrRoot(nsHtml5TreeBuilder::TR);
if (!eltPos) {
MOZ_ASSERT(fragment || isTemplateContents());
errNoTableRowToClose();
@@ -2297,15 +2297,15 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
continue;
}
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case BODY:
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case HTML:
+ case TD_OR_TH: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2313,9 +2313,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_TABLE_BODY: {
+ case IN_TABLE_BODY: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT: {
+ case TBODY_OR_THEAD_OR_TFOOT: {
eltPos = findLastOrRoot(name);
if (!eltPos) {
errStrayEndTag(name);
@@ -2323,28 +2323,28 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TABLE: {
+ case TABLE: {
eltPos = findLastInTableScopeOrRootTemplateTbodyTheadTfoot();
- if (!eltPos || stack[eltPos]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ if (!eltPos || stack[eltPos]->getGroup() == TEMPLATE) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
clearStackBackTo(eltPos);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
continue;
}
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_TR: {
+ case BODY:
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case HTML:
+ case TD_OR_TH:
+ case TR: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2352,11 +2352,11 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_TABLE: {
+ case IN_TABLE: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TABLE: {
+ case TABLE: {
eltPos = findLast(nsHtml5Atoms::table);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
@@ -2367,18 +2367,18 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
resetTheInsertionMode();
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_TR: {
+ case BODY:
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case HTML:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TD_OR_TH:
+ case TR: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
break;
}
default: {
@@ -2386,11 +2386,11 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_IN_CAPTION: {
+ case IN_CAPTION: {
switch(group) {
- case NS_HTML5TREE_BUILDER_CAPTION: {
+ case CAPTION: {
eltPos = findLastInTableScope(nsHtml5Atoms::caption);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
NS_HTML5_BREAK(endtagloop);
}
generateImpliedEndTags();
@@ -2401,13 +2401,13 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
pop();
}
clearTheListOfActiveFormattingElementsUpToTheLastMarker();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TABLE: {
+ case TABLE: {
errTableClosedWhileCaptionOpen();
eltPos = findLastInTableScope(nsHtml5Atoms::caption);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
NS_HTML5_BREAK(endtagloop);
}
generateImpliedEndTags();
@@ -2418,16 +2418,16 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
pop();
}
clearTheListOfActiveFormattingElementsUpToTheLastMarker();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
continue;
}
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_TR: {
+ case BODY:
+ case COL:
+ case COLGROUP:
+ case HTML:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TD_OR_TH:
+ case TR: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2435,11 +2435,11 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_CELL: {
+ case IN_CELL: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case TD_OR_TH: {
eltPos = findLastInTableScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2451,13 +2451,13 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
pop();
}
clearTheListOfActiveFormattingElementsUpToTheLastMarker();
- mode = NS_HTML5TREE_BUILDER_IN_ROW;
+ mode = IN_ROW;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TABLE:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR: {
- if (findLastInTableScope(name) == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ case TABLE:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR: {
+ if (findLastInTableScope(name) == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(name == nsHtml5Atoms::tbody || name == nsHtml5Atoms::tfoot || name == nsHtml5Atoms::thead || fragment || isTemplateContents());
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
@@ -2465,11 +2465,11 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
closeTheCell(findLastInTableScopeTdTh());
continue;
}
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_COL:
- case NS_HTML5TREE_BUILDER_COLGROUP:
- case NS_HTML5TREE_BUILDER_HTML: {
+ case BODY:
+ case CAPTION:
+ case COL:
+ case COLGROUP:
+ case HTML: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2477,10 +2477,10 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_FRAMESET_OK:
- case NS_HTML5TREE_BUILDER_IN_BODY: {
+ case FRAMESET_OK:
+ case IN_BODY: {
switch(group) {
- case NS_HTML5TREE_BUILDER_BODY: {
+ case BODY: {
if (!isSecondOnStackBody()) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayEndTag(name);
@@ -2490,15 +2490,15 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
if (MOZ_UNLIKELY(mViewSource)) {
for (int32_t i = 2; i <= currentPtr; i++) {
switch(stack[i]->getGroup()) {
- case NS_HTML5TREE_BUILDER_DD_OR_DT:
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_OPTGROUP:
- case NS_HTML5TREE_BUILDER_OPTION:
- case NS_HTML5TREE_BUILDER_P:
- case NS_HTML5TREE_BUILDER_RB_OR_RTC:
- case NS_HTML5TREE_BUILDER_RT_OR_RP:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT: {
+ case DD_OR_DT:
+ case LI:
+ case OPTGROUP:
+ case OPTION:
+ case P:
+ case RB_OR_RTC:
+ case RT_OR_RP:
+ case TD_OR_TH:
+ case TBODY_OR_THEAD_OR_TFOOT: {
break;
}
default: {
@@ -2509,10 +2509,10 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
uncloseloop1_end: ;
}
- mode = NS_HTML5TREE_BUILDER_AFTER_BODY;
+ mode = AFTER_BODY;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
if (!isSecondOnStackBody()) {
MOZ_ASSERT(fragment || isTemplateContents());
errStrayEndTag(name);
@@ -2521,15 +2521,15 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
if (MOZ_UNLIKELY(mViewSource)) {
for (int32_t i = 0; i <= currentPtr; i++) {
switch(stack[i]->getGroup()) {
- case NS_HTML5TREE_BUILDER_DD_OR_DT:
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_P:
- case NS_HTML5TREE_BUILDER_RB_OR_RTC:
- case NS_HTML5TREE_BUILDER_RT_OR_RP:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TD_OR_TH:
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_HTML: {
+ case DD_OR_DT:
+ case LI:
+ case P:
+ case RB_OR_RTC:
+ case RT_OR_RP:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TD_OR_TH:
+ case BODY:
+ case HTML: {
break;
}
default: {
@@ -2540,17 +2540,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
uncloseloop2_end: ;
}
- mode = NS_HTML5TREE_BUILDER_AFTER_BODY;
+ mode = AFTER_BODY;
continue;
}
- case NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
- case NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL:
- case NS_HTML5TREE_BUILDER_PRE_OR_LISTING:
- case NS_HTML5TREE_BUILDER_FIELDSET:
- case NS_HTML5TREE_BUILDER_BUTTON:
- case NS_HTML5TREE_BUILDER_ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
+ case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
+ case UL_OR_OL_OR_DL:
+ case PRE_OR_LISTING:
+ case FIELDSET:
+ case BUTTON:
+ case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
eltPos = findLastInScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
} else {
generateImpliedEndTags();
@@ -2563,7 +2563,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_FORM: {
+ case FORM: {
if (!isTemplateContents()) {
if (!formPointer) {
errStrayEndTag(name);
@@ -2571,7 +2571,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
formPointer = nullptr;
eltPos = findLastInScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2583,7 +2583,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
NS_HTML5_BREAK(endtagloop);
} else {
eltPos = findLastInScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
@@ -2597,9 +2597,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
NS_HTML5_BREAK(endtagloop);
}
}
- case NS_HTML5TREE_BUILDER_P: {
+ case P: {
eltPos = findLastInButtonScope(nsHtml5Atoms::p);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errNoElementToCloseButEndTagSeen(nsHtml5Atoms::p);
if (isInForeign()) {
errHtmlStartTagInForeignContext(name);
@@ -2611,7 +2611,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
NS_HTML5_BREAK(endtagloop);
}
generateImpliedEndTagsExceptFor(nsHtml5Atoms::p);
- MOZ_ASSERT(eltPos != NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK);
+ MOZ_ASSERT(eltPos != nsHtml5TreeBuilder::NOT_FOUND_ON_STACK);
if (!!MOZ_UNLIKELY(mViewSource) && eltPos != currentPtr) {
errUnclosedElements(eltPos, name);
}
@@ -2620,9 +2620,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_LI: {
+ case LI: {
eltPos = findLastInListScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errNoElementToCloseButEndTagSeen(name);
} else {
generateImpliedEndTagsExceptFor(name);
@@ -2635,9 +2635,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_DD_OR_DT: {
+ case DD_OR_DT: {
eltPos = findLastInScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errNoElementToCloseButEndTagSeen(name);
} else {
generateImpliedEndTagsExceptFor(name);
@@ -2650,9 +2650,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: {
+ case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: {
eltPos = findLastInScopeHn();
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
} else {
generateImpliedEndTags();
@@ -2665,10 +2665,10 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_OBJECT:
- case NS_HTML5TREE_BUILDER_MARQUEE_OR_APPLET: {
+ case OBJECT:
+ case MARQUEE_OR_APPLET: {
eltPos = findLastInScope(name);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(name);
} else {
generateImpliedEndTags();
@@ -2682,7 +2682,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_BR: {
+ case BR: {
errEndTagBr();
if (isInForeign()) {
errHtmlStartTagInForeignContext(name);
@@ -2694,41 +2694,41 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
appendVoidElementToCurrentMayFoster(elementName, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
break;
}
- case NS_HTML5TREE_BUILDER_AREA_OR_WBR:
+ case AREA_OR_WBR:
#ifdef ENABLE_VOID_MENUITEM
- case NS_HTML5TREE_BUILDER_MENUITEM:
+ case MENUITEM:
#endif
- case NS_HTML5TREE_BUILDER_PARAM_OR_SOURCE_OR_TRACK:
- case NS_HTML5TREE_BUILDER_EMBED:
- case NS_HTML5TREE_BUILDER_IMG:
- case NS_HTML5TREE_BUILDER_IMAGE:
- case NS_HTML5TREE_BUILDER_INPUT:
- case NS_HTML5TREE_BUILDER_KEYGEN:
- case NS_HTML5TREE_BUILDER_HR:
- case NS_HTML5TREE_BUILDER_ISINDEX:
- case NS_HTML5TREE_BUILDER_IFRAME:
- case NS_HTML5TREE_BUILDER_NOEMBED:
- case NS_HTML5TREE_BUILDER_NOFRAMES:
- case NS_HTML5TREE_BUILDER_SELECT:
- case NS_HTML5TREE_BUILDER_TABLE:
- case NS_HTML5TREE_BUILDER_TEXTAREA: {
+ case PARAM_OR_SOURCE_OR_TRACK:
+ case EMBED:
+ case IMG:
+ case IMAGE:
+ case INPUT:
+ case KEYGEN:
+ case HR:
+ case ISINDEX:
+ case IFRAME:
+ case NOEMBED:
+ case NOFRAMES:
+ case SELECT:
+ case TABLE:
+ case TEXTAREA: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_NOSCRIPT: {
+ case NOSCRIPT: {
if (scriptingEnabled) {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
} else {
}
}
- case NS_HTML5TREE_BUILDER_A:
- 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_NOBR: {
+ case A:
+ case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
+ case FONT:
+ case NOBR: {
if (adoptionAgencyEndTag(name)) {
NS_HTML5_BREAK(endtagloop);
}
@@ -2759,21 +2759,21 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_IN_HEAD: {
+ case IN_HEAD: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HEAD: {
+ case HEAD: {
pop();
- mode = NS_HTML5TREE_BUILDER_AFTER_HEAD;
+ mode = AFTER_HEAD;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_BR:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_BODY: {
+ case BR:
+ case HTML:
+ case BODY: {
pop();
- mode = NS_HTML5TREE_BUILDER_AFTER_HEAD;
+ mode = AFTER_HEAD;
continue;
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
endTagTemplateInHead();
NS_HTML5_BREAK(endtagloop);
}
@@ -2783,17 +2783,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_IN_HEAD_NOSCRIPT: {
+ case IN_HEAD_NOSCRIPT: {
switch(group) {
- case NS_HTML5TREE_BUILDER_NOSCRIPT: {
+ case NOSCRIPT: {
pop();
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_BR: {
+ case BR: {
errStrayEndTag(name);
pop();
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
continue;
}
default: {
@@ -2802,49 +2802,49 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP: {
+ case IN_COLUMN_GROUP: {
switch(group) {
- case NS_HTML5TREE_BUILDER_COLGROUP: {
- if (!currentPtr || stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ case COLGROUP: {
+ if (!currentPtr || stack[currentPtr]->getGroup() == nsHtml5TreeBuilder::TEMPLATE) {
MOZ_ASSERT(fragment || isTemplateContents());
errGarbageInColgroup();
NS_HTML5_BREAK(endtagloop);
}
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_COL: {
+ case COL: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
endTagTemplateInHead();
NS_HTML5_BREAK(endtagloop);
}
default: {
- if (!currentPtr || stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ if (!currentPtr || stack[currentPtr]->getGroup() == nsHtml5TreeBuilder::TEMPLATE) {
MOZ_ASSERT(fragment || isTemplateContents());
errGarbageInColgroup();
NS_HTML5_BREAK(endtagloop);
}
pop();
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE: {
+ case IN_SELECT_IN_TABLE: {
switch(group) {
- case NS_HTML5TREE_BUILDER_CAPTION:
- case NS_HTML5TREE_BUILDER_TABLE:
- case NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT:
- case NS_HTML5TREE_BUILDER_TR:
- case NS_HTML5TREE_BUILDER_TD_OR_TH: {
+ case CAPTION:
+ case TABLE:
+ case TBODY_OR_THEAD_OR_TFOOT:
+ case TR:
+ case TD_OR_TH: {
errEndTagSeenWithSelectOpen(name);
- if (findLastInTableScope(name) != NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (findLastInTableScope(name) != nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
eltPos = findLastInTableScope(nsHtml5Atoms::select);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment);
NS_HTML5_BREAK(endtagloop);
}
@@ -2861,9 +2861,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
; // fall through
}
}
- case NS_HTML5TREE_BUILDER_IN_SELECT: {
+ case IN_SELECT: {
switch(group) {
- case NS_HTML5TREE_BUILDER_OPTION: {
+ case OPTION: {
if (isCurrent(nsHtml5Atoms::option)) {
pop();
NS_HTML5_BREAK(endtagloop);
@@ -2872,7 +2872,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
NS_HTML5_BREAK(endtagloop);
}
}
- case NS_HTML5TREE_BUILDER_OPTGROUP: {
+ case OPTGROUP: {
if (isCurrent(nsHtml5Atoms::option) && nsHtml5Atoms::optgroup == stack[currentPtr - 1]->name) {
pop();
}
@@ -2883,9 +2883,9 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_SELECT: {
+ case SELECT: {
eltPos = findLastInTableScope(nsHtml5Atoms::select);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
MOZ_ASSERT(fragment);
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
@@ -2896,7 +2896,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
resetTheInsertionMode();
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
endTagTemplateInHead();
NS_HTML5_BREAK(endtagloop);
}
@@ -2906,27 +2906,27 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_BODY: {
+ case AFTER_BODY: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
+ case HTML: {
if (fragment) {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
} else {
- mode = NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY;
+ mode = AFTER_AFTER_BODY;
NS_HTML5_BREAK(endtagloop);
}
}
default: {
errEndTagAfterBody();
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
continue;
}
}
}
- case NS_HTML5TREE_BUILDER_IN_FRAMESET: {
+ case IN_FRAMESET: {
switch(group) {
- case NS_HTML5TREE_BUILDER_FRAMESET: {
+ case FRAMESET: {
if (!currentPtr) {
MOZ_ASSERT(fragment);
errStrayEndTag(name);
@@ -2934,7 +2934,7 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
pop();
if ((!fragment) && !isCurrent(nsHtml5Atoms::frameset)) {
- mode = NS_HTML5TREE_BUILDER_AFTER_FRAMESET;
+ mode = AFTER_FRAMESET;
}
NS_HTML5_BREAK(endtagloop);
}
@@ -2944,10 +2944,10 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_FRAMESET: {
+ case AFTER_FRAMESET: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HTML: {
- mode = NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET;
+ case HTML: {
+ mode = AFTER_AFTER_FRAMESET;
NS_HTML5_BREAK(endtagloop);
}
default: {
@@ -2956,20 +2956,20 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_INITIAL: {
+ case INITIAL: {
errEndTagSeenWithoutDoctype();
documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
- mode = NS_HTML5TREE_BUILDER_BEFORE_HTML;
+ mode = BEFORE_HTML;
continue;
}
- case NS_HTML5TREE_BUILDER_BEFORE_HTML: {
+ case BEFORE_HTML: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HEAD:
- case NS_HTML5TREE_BUILDER_BR:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_BODY: {
+ case HEAD:
+ case BR:
+ case HTML:
+ case BODY: {
appendHtmlElementToDocumentAndPush();
- mode = NS_HTML5TREE_BUILDER_BEFORE_HEAD;
+ mode = BEFORE_HEAD;
continue;
}
default: {
@@ -2978,14 +2978,14 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_BEFORE_HEAD: {
+ case BEFORE_HEAD: {
switch(group) {
- case NS_HTML5TREE_BUILDER_HEAD:
- case NS_HTML5TREE_BUILDER_BR:
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_BODY: {
+ case HEAD:
+ case BR:
+ case HTML:
+ case BODY: {
appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
continue;
}
default: {
@@ -2994,17 +2994,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_HEAD: {
+ case AFTER_HEAD: {
switch(group) {
- case NS_HTML5TREE_BUILDER_TEMPLATE: {
+ case TEMPLATE: {
endTagTemplateInHead();
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_HTML:
- case NS_HTML5TREE_BUILDER_BODY:
- case NS_HTML5TREE_BUILDER_BR: {
+ case HTML:
+ case BODY:
+ case BR: {
appendToCurrentNodeAndPushBodyElement();
- mode = NS_HTML5TREE_BUILDER_FRAMESET_OK;
+ mode = FRAMESET_OK;
continue;
}
default: {
@@ -3013,18 +3013,18 @@ nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
}
}
}
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_BODY: {
+ case AFTER_AFTER_BODY: {
errStrayEndTag(name);
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
continue;
}
- case NS_HTML5TREE_BUILDER_AFTER_AFTER_FRAMESET: {
+ case AFTER_AFTER_FRAMESET: {
errStrayEndTag(name);
NS_HTML5_BREAK(endtagloop);
}
- case NS_HTML5TREE_BUILDER_TEXT: {
+ case TEXT: {
pop();
- if (originalMode == NS_HTML5TREE_BUILDER_AFTER_HEAD) {
+ if (originalMode == AFTER_HEAD) {
silentPop();
}
mode = originalMode;
@@ -3039,7 +3039,7 @@ void
nsHtml5TreeBuilder::endTagTemplateInHead()
{
int32_t eltPos = findLast(nsHtml5Atoms::template_);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
errStrayEndTag(nsHtml5Atoms::template_);
return;
}
@@ -3059,7 +3059,7 @@ int32_t
nsHtml5TreeBuilder::findLastInTableScopeOrRootTemplateTbodyTheadTfoot()
{
for (int32_t i = currentPtr; i > 0; i--) {
- if (stack[i]->getGroup() == NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT || stack[i]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE) {
+ if (stack[i]->getGroup() == nsHtml5TreeBuilder::TBODY_OR_THEAD_OR_TFOOT || stack[i]->getGroup() == nsHtml5TreeBuilder::TEMPLATE) {
return i;
}
}
@@ -3074,7 +3074,7 @@ nsHtml5TreeBuilder::findLast(nsIAtom* name)
return i;
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
int32_t
@@ -3085,11 +3085,11 @@ nsHtml5TreeBuilder::findLastInTableScope(nsIAtom* name)
if (stack[i]->name == name) {
return i;
} else if (stack[i]->name == nsHtml5Atoms::table || stack[i]->name == nsHtml5Atoms::template_) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
int32_t
@@ -3100,14 +3100,14 @@ nsHtml5TreeBuilder::findLastInButtonScope(nsIAtom* name)
if (stack[i]->name == name) {
return i;
} else if (stack[i]->name == nsHtml5Atoms::button) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
if (stack[i]->isScoping()) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
int32_t
@@ -3117,10 +3117,10 @@ nsHtml5TreeBuilder::findLastInScope(nsIAtom* name)
if (stack[i]->ns == kNameSpaceID_XHTML && stack[i]->name == name) {
return i;
} else if (stack[i]->isScoping()) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
int32_t
@@ -3131,27 +3131,27 @@ nsHtml5TreeBuilder::findLastInListScope(nsIAtom* name)
if (stack[i]->name == name) {
return i;
} else if (stack[i]->name == nsHtml5Atoms::ul || stack[i]->name == nsHtml5Atoms::ol) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
if (stack[i]->isScoping()) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
int32_t
nsHtml5TreeBuilder::findLastInScopeHn()
{
for (int32_t i = currentPtr; i > 0; i--) {
- if (stack[i]->getGroup() == NS_HTML5TREE_BUILDER_H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
+ if (stack[i]->getGroup() == nsHtml5TreeBuilder::H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
return i;
} else if (stack[i]->isScoping()) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
void
@@ -3160,13 +3160,13 @@ nsHtml5TreeBuilder::generateImpliedEndTagsExceptFor(nsIAtom* name)
for (; ; ) {
nsHtml5StackNode* node = stack[currentPtr];
switch(node->getGroup()) {
- case NS_HTML5TREE_BUILDER_P:
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_DD_OR_DT:
- case NS_HTML5TREE_BUILDER_OPTION:
- case NS_HTML5TREE_BUILDER_OPTGROUP:
- case NS_HTML5TREE_BUILDER_RB_OR_RTC:
- case NS_HTML5TREE_BUILDER_RT_OR_RP: {
+ case P:
+ case LI:
+ case DD_OR_DT:
+ case OPTION:
+ case OPTGROUP:
+ case RB_OR_RTC:
+ case RT_OR_RP: {
if (node->ns == kNameSpaceID_XHTML && node->name == name) {
return;
}
@@ -3185,13 +3185,13 @@ nsHtml5TreeBuilder::generateImpliedEndTags()
{
for (; ; ) {
switch(stack[currentPtr]->getGroup()) {
- case NS_HTML5TREE_BUILDER_P:
- case NS_HTML5TREE_BUILDER_LI:
- case NS_HTML5TREE_BUILDER_DD_OR_DT:
- case NS_HTML5TREE_BUILDER_OPTION:
- case NS_HTML5TREE_BUILDER_OPTGROUP:
- case NS_HTML5TREE_BUILDER_RB_OR_RTC:
- case NS_HTML5TREE_BUILDER_RT_OR_RP: {
+ case P:
+ case LI:
+ case DD_OR_DT:
+ case OPTION:
+ case OPTGROUP:
+ case RB_OR_RTC:
+ case RT_OR_RP: {
pop();
continue;
}
@@ -3205,7 +3205,7 @@ nsHtml5TreeBuilder::generateImpliedEndTags()
bool
nsHtml5TreeBuilder::isSecondOnStackBody()
{
- return currentPtr >= 1 && stack[1]->getGroup() == NS_HTML5TREE_BUILDER_BODY;
+ return currentPtr >= 1 && stack[1]->getGroup() == nsHtml5TreeBuilder::BODY;
}
void
@@ -3282,7 +3282,7 @@ nsHtml5TreeBuilder::closeTheCell(int32_t eltPos)
pop();
}
clearTheListOfActiveFormattingElementsUpToTheLastMarker();
- mode = NS_HTML5TREE_BUILDER_IN_ROW;
+ mode = IN_ROW;
return;
}
@@ -3295,11 +3295,11 @@ nsHtml5TreeBuilder::findLastInTableScopeTdTh()
if (nsHtml5Atoms::td == name || nsHtml5Atoms::th == name) {
return i;
} else if (name == nsHtml5Atoms::table || name == nsHtml5Atoms::template_) {
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
}
}
- return NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK;
+ return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
}
void
@@ -3307,7 +3307,7 @@ nsHtml5TreeBuilder::clearStackBackTo(int32_t eltPos)
{
int32_t eltGroup = stack[eltPos]->getGroup();
while (currentPtr > eltPos) {
- if (stack[currentPtr]->ns == kNameSpaceID_XHTML && stack[currentPtr]->getGroup() == NS_HTML5TREE_BUILDER_TEMPLATE && (eltGroup == NS_HTML5TREE_BUILDER_TABLE || eltGroup == NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT || eltGroup == NS_HTML5TREE_BUILDER_TR || !eltPos)) {
+ if (stack[currentPtr]->ns == kNameSpaceID_XHTML && stack[currentPtr]->getGroup() == TEMPLATE && (eltGroup == TABLE || eltGroup == TBODY_OR_THEAD_OR_TFOOT || eltGroup == TR || !eltPos)) {
return;
}
pop();
@@ -3331,7 +3331,7 @@ nsHtml5TreeBuilder::resetTheInsertionMode()
ns = contextNamespace;
}
} else {
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
return;
}
}
@@ -3344,33 +3344,33 @@ nsHtml5TreeBuilder::resetTheInsertionMode()
break;
}
if (nsHtml5Atoms::table == ancestor->name) {
- mode = NS_HTML5TREE_BUILDER_IN_SELECT_IN_TABLE;
+ mode = IN_SELECT_IN_TABLE;
return;
}
}
}
- mode = NS_HTML5TREE_BUILDER_IN_SELECT;
+ mode = IN_SELECT;
return;
} else if (nsHtml5Atoms::td == name || nsHtml5Atoms::th == name) {
- mode = NS_HTML5TREE_BUILDER_IN_CELL;
+ mode = IN_CELL;
return;
} else if (nsHtml5Atoms::tr == name) {
- mode = NS_HTML5TREE_BUILDER_IN_ROW;
+ mode = IN_ROW;
return;
} else if (nsHtml5Atoms::tbody == name || nsHtml5Atoms::thead == name || nsHtml5Atoms::tfoot == name) {
- mode = NS_HTML5TREE_BUILDER_IN_TABLE_BODY;
+ mode = IN_TABLE_BODY;
return;
} else if (nsHtml5Atoms::caption == name) {
- mode = NS_HTML5TREE_BUILDER_IN_CAPTION;
+ mode = IN_CAPTION;
return;
} else if (nsHtml5Atoms::colgroup == name) {
- mode = NS_HTML5TREE_BUILDER_IN_COLUMN_GROUP;
+ mode = IN_COLUMN_GROUP;
return;
} else if (nsHtml5Atoms::table == name) {
- mode = NS_HTML5TREE_BUILDER_IN_TABLE;
+ mode = IN_TABLE;
return;
} else if (kNameSpaceID_XHTML != ns) {
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
return;
} else if (nsHtml5Atoms::template_ == name) {
MOZ_ASSERT(templateModePtr >= 0);
@@ -3378,26 +3378,26 @@ nsHtml5TreeBuilder::resetTheInsertionMode()
return;
} else if (nsHtml5Atoms::head == name) {
if (name == contextName) {
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
} else {
- mode = NS_HTML5TREE_BUILDER_IN_HEAD;
+ mode = IN_HEAD;
}
return;
} else if (nsHtml5Atoms::body == name) {
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
return;
} else if (nsHtml5Atoms::frameset == name) {
- mode = NS_HTML5TREE_BUILDER_IN_FRAMESET;
+ mode = IN_FRAMESET;
return;
} else if (nsHtml5Atoms::html == name) {
if (!headPointer) {
- mode = NS_HTML5TREE_BUILDER_BEFORE_HEAD;
+ mode = BEFORE_HEAD;
} else {
- mode = NS_HTML5TREE_BUILDER_AFTER_HEAD;
+ mode = AFTER_HEAD;
}
return;
} else if (!i) {
- mode = framesetOk ? NS_HTML5TREE_BUILDER_FRAMESET_OK : NS_HTML5TREE_BUILDER_IN_BODY;
+ mode = framesetOk ? FRAMESET_OK : IN_BODY;
return;
}
}
@@ -3407,7 +3407,7 @@ void
nsHtml5TreeBuilder::implicitlyCloseP()
{
int32_t eltPos = findLastInButtonScope(nsHtml5Atoms::p);
- if (eltPos == NS_HTML5TREE_BUILDER_NOT_FOUND_ON_STACK) {
+ if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
return;
}
generateImpliedEndTagsExceptFor(nsHtml5Atoms::p);
@@ -3777,7 +3777,7 @@ nsHtml5TreeBuilder::addAttributesToBody(nsHtml5HtmlAttributes* attributes)
{
if (currentPtr >= 1) {
nsHtml5StackNode* body = stack[1];
- if (body->getGroup() == NS_HTML5TREE_BUILDER_BODY) {
+ if (body->getGroup() == nsHtml5TreeBuilder::BODY) {
addAttributesToElement(body->node, attributes);
return true;
}
@@ -3795,7 +3795,7 @@ void
nsHtml5TreeBuilder::pushHeadPointerOntoStack()
{
MOZ_ASSERT(!!headPointer);
- MOZ_ASSERT(mode == NS_HTML5TREE_BUILDER_AFTER_HEAD);
+ MOZ_ASSERT(mode == AFTER_HEAD);
silentPush(new nsHtml5StackNode(nsHtml5ElementName::ELT_HEAD, headPointer));
}
@@ -3846,8 +3846,8 @@ nsHtml5TreeBuilder::reconstructTheActiveFormattingElements()
void
nsHtml5TreeBuilder::insertIntoFosterParent(nsIContentHandle* child)
{
- int32_t tablePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE);
- int32_t templatePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TEMPLATE);
+ int32_t tablePos = findLastOrRoot(nsHtml5TreeBuilder::TABLE);
+ int32_t templatePos = findLastOrRoot(nsHtml5TreeBuilder::TEMPLATE);
if (templatePos >= tablePos) {
appendElement(child, stack[templatePos]->node);
return;
@@ -3865,8 +3865,8 @@ nsHtml5TreeBuilder::createAndInsertFosterParentedElement(int32_t ns, nsIAtom* na
nsIContentHandle*
nsHtml5TreeBuilder::createAndInsertFosterParentedElement(int32_t ns, nsIAtom* name, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form)
{
- int32_t tablePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE);
- int32_t templatePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TEMPLATE);
+ int32_t tablePos = findLastOrRoot(nsHtml5TreeBuilder::TABLE);
+ int32_t templatePos = findLastOrRoot(nsHtml5TreeBuilder::TEMPLATE);
if (templatePos >= tablePos) {
nsIContentHandle* child = createElement(ns, name, attributes, form, stack[templatePos]->node);
appendElement(child, stack[templatePos]->node);
@@ -4241,7 +4241,7 @@ void
nsHtml5TreeBuilder::flushCharacters()
{
if (charBufferLen > 0) {
- if ((mode == NS_HTML5TREE_BUILDER_IN_TABLE || mode == NS_HTML5TREE_BUILDER_IN_TABLE_BODY || mode == NS_HTML5TREE_BUILDER_IN_ROW) && charBufferContainsNonWhitespace()) {
+ if ((mode == IN_TABLE || mode == IN_TABLE_BODY || mode == IN_ROW) && charBufferContainsNonWhitespace()) {
errNonSpaceInTable();
reconstructTheActiveFormattingElements();
if (!stack[currentPtr]->isFosterParenting()) {
@@ -4249,8 +4249,8 @@ nsHtml5TreeBuilder::flushCharacters()
charBufferLen = 0;
return;
}
- int32_t tablePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TABLE);
- int32_t templatePos = findLastOrRoot(NS_HTML5TREE_BUILDER_TEMPLATE);
+ int32_t tablePos = findLastOrRoot(nsHtml5TreeBuilder::TABLE);
+ int32_t templatePos = findLastOrRoot(nsHtml5TreeBuilder::TEMPLATE);
if (templatePos >= tablePos) {
appendCharacters(stack[templatePos]->node, charBuffer, 0, charBufferLen);
charBufferLen = 0;