/* * Copyright (c) 2007 Henri Sivonen * Copyright (c) 2007-2017 Mozilla Foundation * Portions of comments Copyright 2004-2008 Apple Computer, Inc., Mozilla * Foundation, and Opera Software ASA. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE.
*/
@Literal privatefinalstatic String[] QUIRKY_PUBLIC_IDS = { "+//silmaril//dtd html pro v0r11 19970101//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//as//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//" };
privatefinal Map<String, LocatorImpl> idLocations = new HashMap<String, LocatorImpl>();
// ]NOCPP]
protected TreeBuilder() {
fragment = false;
}
/** * Reports an condition that would make the infoset incompatible with XML * 1.0 as fatal. * * @throws SAXException * @throws SAXParseException
*/ protectedvoid fatal() throws SAXException {
}
@SuppressWarnings("unchecked") publicfinalvoid startTokenization(Tokenizer self) throws SAXException {
tokenizer = self;
stackNodes = new StackNode[64];
stack = new StackNode[64];
templateModeStack = newint[64];
listOfActiveFormattingElements = new StackNode[64];
needToDropLF = false;
originalMode = INITIAL;
templateModePtr = -1;
stackNodesIdx = 0;
numStackNodes = 0;
currentPtr = -1;
listPtr = -1;
formPointer = null;
headPointer = null; // [NOCPP[
idLocations.clear();
wantingComments = wantsComments(); // ]NOCPP]
start(fragment);
charBufferLen = 0; if (!keepBuffer) {
charBuffer = null;
}
framesetOk = true; if (fragment) {
T elt; if (contextNode != null) {
elt = contextNode;
} else {
elt = createHtmlElementSetAsRoot(tokenizer.emptyAttributes());
} // When the context node is not in the HTML namespace, contrary // to the spec, the first node on the stack is not set to "html" // in the HTML namespace. Instead, it is set to a node that has // the characteristics of the appropriate "adjusted current node". // This way, there is no need to perform "adjusted current node" // checks during tree construction. Instead, it's sufficient to // just look at the current node. However, this also means that it // is not safe to treat "html" in the HTML namespace as a sentinel // that ends stack popping. Instead, stack popping loops that are // meant not to pop the first element on the stack need to check // for currentPos becoming zero. if (contextNamespace == "http://www.w3.org/2000/svg") {
ElementName elementName = ElementName.SVG; if ("title" == contextName || "desc" == contextName
|| "foreignObject" == contextName) { // These elements are all alike and we don't care about // the exact name.
elementName = ElementName.FOREIGNOBJECT;
} // This is the SVG variant of the StackNode constructor.
StackNode<T> node = createStackNode(elementName,
elementName.getCamelCaseName(), elt // [NOCPP[
, errorHandler == null ? null
: new TaintableLocatorImpl(tokenizer) // ]NOCPP]
);
currentPtr++;
stack[currentPtr] = node;
tokenizer.setState(Tokenizer.DATA); // The frameset-ok flag is set even though <frameset> never // ends up being allowed as HTML frameset in the fragment case.
mode = FRAMESET_OK;
} elseif (contextNamespace == "http://www.w3.org/1998/Math/MathML") {
ElementName elementName = ElementName.MATH; if ("mi" == contextName || "mo" == contextName
|| "mn" == contextName || "ms" == contextName
|| "mtext" == contextName) { // These elements are all alike and we don't care about // the exact name.
elementName = ElementName.MTEXT;
} elseif ("annotation-xml" == contextName) {
elementName = ElementName.ANNOTATION_XML; // Blink does not check the encoding attribute of the // annotation-xml element innerHTML is being set on. // Let's do the same at least until // https://www.w3.org/Bugs/Public/show_bug.cgi?id=26783 // is resolved.
} // This is the MathML variant of the StackNode constructor.
StackNode<T> node = createStackNode(elementName, elt,
elementName.getName(), false // [NOCPP[
, errorHandler == null ? null
: new TaintableLocatorImpl(tokenizer) // ]NOCPP]
);
currentPtr++;
stack[currentPtr] = node;
tokenizer.setState(Tokenizer.DATA); // The frameset-ok flag is set even though <frameset> never // ends up being allowed as HTML frameset in the fragment case.
mode = FRAMESET_OK;
} else { // html
StackNode<T> node = createStackNode(ElementName.HTML, elt // [NOCPP[
, errorHandler == null ? null
: new TaintableLocatorImpl(tokenizer) // ]NOCPP]
);
currentPtr++;
stack[currentPtr] = node; if ("template" == contextName) {
pushTemplateMode(IN_TEMPLATE);
}
resetTheInsertionMode();
formPointer = getFormPointerForContext(contextNode); if ("title" == contextName || "textarea" == contextName) {
tokenizer.setState(Tokenizer.RCDATA);
} elseif ("style" == contextName || "xmp" == contextName
|| "iframe" == contextName || "noembed" == contextName
|| "noframes" == contextName
|| (scriptingEnabled && "noscript" == contextName)) {
tokenizer.setState(Tokenizer.RAWTEXT);
} elseif ("plaintext" == contextName) {
tokenizer.setState(Tokenizer.PLAINTEXT);
} elseif ("script" == contextName) {
tokenizer.setState(Tokenizer.SCRIPT_DATA);
} else {
tokenizer.setState(Tokenizer.DATA);
}
}
} else {
mode = INITIAL; // If we are viewing XML source, put a foreign element permanently // on the stack so that cdataSectionAllowed() returns true. // CPPONLY: if (tokenizer.isViewingXmlSource()) { // CPPONLY: T elt = createElement("http://www.w3.org/2000/svg", // CPPONLY: "svg", // CPPONLY: tokenizer.emptyAttributes(), null, // CPPONLY: svgCreator(NS_NewSVGSVGElement)); // CPPONLY: StackNode<T> node = createStackNode(ElementName.SVG, // CPPONLY: "svg", // CPPONLY: elt); // CPPONLY: currentPtr++; // CPPONLY: stack[currentPtr] = node; // CPPONLY: }
}
}
/* * * Then, switch to the root element mode of the tree construction * stage.
*/
mode = BEFORE_HTML; return;
} /* * A DOCTYPE token Parse error.
*/
errStrayDoctype(); /* * Ignore the token.
*/ return;
}
publicfinalvoid comment(@NoLength char[] buf, int start, int length) throws SAXException {
needToDropLF = false; // [NOCPP[ if (!wantingComments) { return;
} // ]NOCPP] if (!isInForeign()) { switch (mode) { case INITIAL: case BEFORE_HTML: case AFTER_AFTER_BODY: case AFTER_AFTER_FRAMESET: /* * A comment token Append a Comment node to the Document * object with the data attribute set to the data given in * the comment token.
*/
appendCommentToDocument(buf, start, length); return; case AFTER_BODY: /* * A comment token Append a Comment node to the first * element in the stack of open elements (the html element), * with the data attribute set to the data given in the * comment token.
*/
flushCharacters();
appendComment(stack[0].node, buf, start, length); return; default: break;
}
} /* * A comment token Append a Comment node to the current node with the * data attribute set to the data given in the comment token.
*/
flushCharacters();
appendComment(stack[currentPtr].node, buf, start, length); return;
}
/** * @see nu.validator.htmlparser.common.TokenHandler#characters(char[], int, * int)
*/ publicfinalvoid characters(@Const @NoLength char[] buf, int start, int length) throws SAXException { // Note: Can't attach error messages to EOF in C++ yet
// CPPONLY: if (tokenizer.isViewingXmlSource()) { // CPPONLY: return; // CPPONLY: } if (needToDropLF) {
needToDropLF = false; if (buf[start] == '\n') {
start++;
length--; if (length == 0) { return;
}
}
}
// optimize the most common case switch (mode) { case IN_BODY: case IN_CELL: case IN_CAPTION: if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
reconstructTheActiveFormattingElements();
} // CPPONLY: MOZ_FALLTHROUGH; case TEXT:
accumulateCharacters(buf, start, length); return; case IN_TABLE: case IN_TABLE_BODY: case IN_ROW:
accumulateCharactersForced(buf, start, length); return; default: int end = start + length;
charactersloop: for (int i = start; i < end; i++) { switch (buf[i]) { case' ': case'\t': case'\n': case'\r': case'\u000C': /* * A character token that is one of one of U+0009 * CHARACTER TABULATION, U+000A LINE FEED (LF), * U+000C FORM FEED (FF), or U+0020 SPACE
*/ switch (mode) { case INITIAL: case BEFORE_HTML: case BEFORE_HEAD: /* * Ignore the token.
*/
start = i + 1; continue; case IN_HEAD: case IN_HEAD_NOSCRIPT: case AFTER_HEAD: case IN_COLUMN_GROUP: case IN_FRAMESET: case AFTER_FRAMESET: /* * Append the character to the current node.
*/ continue; 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;
}
/* * Reconstruct the active formatting * elements, if any.
*/ if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
flushCharacters();
reconstructTheActiveFormattingElements();
} /* * Append the token's character to the * current node.
*/ break charactersloop; case IN_SELECT: case IN_SELECT_IN_TABLE: break charactersloop; case IN_TABLE: case IN_TABLE_BODY: case IN_ROW:
accumulateCharactersForced(buf, i, 1);
start = i + 1; continue; case AFTER_BODY: case AFTER_AFTER_BODY: case AFTER_AFTER_FRAMESET: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * Reconstruct the active formatting * elements, if any.
*/
flushCharacters();
reconstructTheActiveFormattingElements(); /* * Append the token's character to the * current node.
*/ continue;
} // CPPONLY: MOZ_FALLTHROUGH_ASSERT(); default: /* * A character token that is not one of one of * U+0009 CHARACTER TABULATION, U+000A LINE FEED * (LF), U+000C FORM FEED (FF), or U+0020 SPACE
*/ switch (mode) { case INITIAL: /* * Parse error.
*/ // [NOCPP[ // XXX figure out a way to report this in the Gecko View Source case
err("Non-space characters found without seeing a doctype first. Expected \u201C\u201D."); // ]NOCPP] /* * * Set the document to quirks mode.
*/
documentModeInternal(
DocumentMode.QUIRKS_MODE, null, null); /* * Then, switch to the root element mode of * the tree construction stage
*/
mode = BEFORE_HTML; /* * and reprocess the current token.
*/
i--; continue; case BEFORE_HTML: /* * Create an HTMLElement node with the tag * name html, in the HTML namespace. Append * it to the Document object.
*/ // No need to flush characters here, // because there's nothing to flush.
appendHtmlElementToDocumentAndPush(); /* Switch to the main mode */
mode = BEFORE_HEAD; /* * reprocess the current token.
*/
i--; continue; case BEFORE_HEAD: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * /Act as if a start tag token with the tag * name "head" and no attributes had been * seen,
*/
flushCharacters();
appendToCurrentNodeAndPushHeadElement(HtmlAttributes.EMPTY_ATTRIBUTES);
mode = IN_HEAD; /* * then reprocess the current token. * * This will result in an empty head element * being generated, with the current token * being reprocessed in the "after head" * insertion mode.
*/
i--; continue; case IN_HEAD: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * Act as if an end tag token with the tag * name "head" had been seen,
*/
flushCharacters();
pop();
mode = AFTER_HEAD; /* * and reprocess the current token.
*/
i--; continue; case IN_HEAD_NOSCRIPT: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * Parse error. Act as if an end tag with * the tag name "noscript" had been seen
*/
errNonSpaceInNoscriptInHead();
flushCharacters();
pop();
mode = IN_HEAD; /* * and reprocess the current token.
*/
i--; continue; case AFTER_HEAD: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * Act as if a start tag token with the tag * name "body" and no attributes had been * seen,
*/
flushCharacters();
appendToCurrentNodeAndPushBodyElement();
mode = FRAMESET_OK; /* * and then reprocess the current token.
*/
i--; continue; case FRAMESET_OK:
framesetOk = false;
mode = IN_BODY;
i--; continue; case IN_TEMPLATE: case IN_BODY: case IN_CELL: case IN_CAPTION: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * Reconstruct the active formatting * elements, if any.
*/ if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
flushCharacters();
reconstructTheActiveFormattingElements();
} /* * Append the token's character to the * current node.
*/ break charactersloop; case IN_TABLE: case IN_TABLE_BODY: case IN_ROW:
accumulateCharactersForced(buf, i, 1);
start = i + 1; continue; case IN_COLUMN_GROUP: if (start < i) {
accumulateCharacters(buf, start, i
- start);
start = i;
} /* * Act as if an end tag with the tag name * "colgroup" had been seen, and then, if * that token wasn't ignored, reprocess the * current token.
*/ if (currentPtr == 0 || stack[currentPtr].getGroup() ==
TreeBuilder.TEMPLATE) {
errNonSpaceInColgroupInFragment();
start = i + 1; continue;
}
flushCharacters();
pop();
mode = IN_TABLE;
i--; continue; case IN_SELECT: case IN_SELECT_IN_TABLE: break charactersloop; case AFTER_BODY:
errNonSpaceAfterBody();
fatal();
mode = framesetOk ? FRAMESET_OK : IN_BODY;
i--; continue; case IN_FRAMESET: if (start < i) {
accumulateCharacters(buf, start, i
- start); // start index is adjusted below.
} /* * Parse error.
*/
errNonSpaceInFrameset(); /* * Ignore the token.
*/
start = i + 1; continue; case AFTER_FRAMESET: if (start < i) {
accumulateCharacters(buf, start, i
- start); // start index is adjusted below.
} /* * Parse error.
*/
errNonSpaceAfterFrameset(); /* * Ignore the token.
*/
start = i + 1; continue; case AFTER_AFTER_BODY: /* * Parse error.
*/
errNonSpaceInTrailer(); /* * Switch back to the main mode and * reprocess the token.
*/
mode = framesetOk ? FRAMESET_OK : IN_BODY;
i--; continue; case AFTER_AFTER_FRAMESET: if (start < i) {
accumulateCharacters(buf, start, i
- start); // start index is adjusted below.
} /* * Parse error.
*/
errNonSpaceInTrailer(); /* * Ignore the token.
*/
start = i + 1; continue;
}
}
} if (start < end) {
accumulateCharacters(buf, start, end - start);
}
}
}
publicfinalvoid eof() throws SAXException {
flushCharacters(); // Note: Can't attach error messages to EOF in C++ yet
eofloop: for (;;) { switch (mode) { case INITIAL: /* * Parse error.
*/ // [NOCPP[
err("End of file seen without seeing a doctype first. Expected \u201C\u201D."); // ]NOCPP] /* * * Set the document to quirks mode.
*/
documentModeInternal(DocumentMode.QUIRKS_MODE, null, null); /* * Then, switch to the root element mode of the tree * construction stage
*/
mode = BEFORE_HTML; /* * and reprocess the current token.
*/ continue; case BEFORE_HTML: /* * Create an HTMLElement node with the tag name html, in the * HTML namespace. Append it to the Document object.
*/
appendHtmlElementToDocumentAndPush(); // XXX application cache manifest /* Switch to the main mode */
mode = BEFORE_HEAD; /* * reprocess the current token.
*/ continue; case BEFORE_HEAD:
appendToCurrentNodeAndPushHeadElement(HtmlAttributes.EMPTY_ATTRIBUTES);
mode = IN_HEAD; continue; case IN_HEAD: // [NOCPP[ if (errorHandler != null && currentPtr > 1) {
errEofWithUnclosedElements();
} // ]NOCPP] while (currentPtr > 0) {
popOnEof();
}
mode = AFTER_HEAD; continue; case IN_HEAD_NOSCRIPT: // [NOCPP[
errEofWithUnclosedElements(); // ]NOCPP] while (currentPtr > 1) {
popOnEof();
}
mode = IN_HEAD; continue; case AFTER_HEAD:
appendToCurrentNodeAndPushBodyElement();
mode = IN_BODY; continue; 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: // [NOCPP[ // i > 0 to stop in time in the foreign fragment case.
openelementloop: for (int i = currentPtr; i > 0; i--) { int group = stack[i].getGroup(); switch (group) { case DD_OR_DT: case LI: case P: case TBODY_OR_THEAD_OR_TFOOT: case TD_OR_TH: case BODY: case HTML: break; default:
errEofWithUnclosedElements(); break openelementloop;
}
} // ]NOCPP]
if (isTemplateModeStackEmpty()) { break eofloop;
}
// fall through to IN_TEMPLATE // CPPONLY: MOZ_FALLTHROUGH; case IN_TEMPLATE: int eltPos = findLast("template"); if (eltPos == TreeBuilder.NOT_FOUND_ON_STACK) { assert fragment; break eofloop;
} if (errorHandler != null) {
errListUnclosedStartTags(0);
} while (currentPtr >= eltPos) {
pop();
}
clearTheListOfActiveFormattingElementsUpToTheLastMarker();
popTemplateMode();
resetTheInsertionMode();
// Reprocess token. continue; case TEXT: // [NOCPP[ if (errorHandler != null) {
errNoCheck("End of file seen when expecting text or an end tag.");
errListUnclosedStartTags(0);
} // ]NOCPP] // XXX mark script as already executed if (originalMode == AFTER_HEAD) {
popOnEof();
}
popOnEof();
mode = originalMode; continue; case IN_FRAMESET: // [NOCPP[ if (errorHandler != null && currentPtr > 0) {
errEofWithUnclosedElements();
} // ]NOCPP] break eofloop; case AFTER_BODY: case AFTER_FRAMESET: case AFTER_AFTER_BODY: case AFTER_AFTER_FRAMESET: default: // [NOCPP[ if (currentPtr == 0) { // This silliness is here to poison // buggy compiler optimizations in // GWT
System.currentTimeMillis();
} // ]NOCPP] break eofloop;
}
} while (currentPtr > 0) {
popOnEof();
} if (!fragment) {
popOnEof();
} /* Stop parsing. */
}
// [NOCPP[ boolean wasSelfClosing = selfClosing; boolean voidElement = false; if (errorHandler != null) { // ID uniqueness
@IdType String id = attributes.getId(); if (id != null && !isTemplateContents()) {
LocatorImpl oldLoc = idLocations.get(id); if (oldLoc != null) {
err("Duplicate ID \u201C" + id + "\u201D.");
errorHandler.warning(new SAXParseException( "The first occurrence of ID \u201C" + id
+ "\u201D was here.", oldLoc));
} else {
idLocations.put(id, new LocatorImpl(tokenizer));
}
}
} // ]NOCPP]
int eltPos;
needToDropLF = false;
starttagloop: for (;;) { int group = elementName.getGroup();
@Local String name = elementName.getName(); if (isInForeign()) {
StackNode<T> currentNode = stack[currentPtr];
@NsUri String currNs = currentNode.ns; if (!(currentNode.isHtmlIntegrationPoint() || (currNs == "http://www.w3.org/1998/Math/MathML" && ((currentNode.getGroup() == MI_MO_MN_MS_MTEXT && group != MGLYPH_OR_MALIGNMARK) || (currentNode.getGroup() == ANNOTATION_XML && group == SVG))))) { switch (group) { 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: // re-check FONT to deal with the special case if (!(group == FONT && !(attributes.contains(AttributeName.COLOR)
|| attributes.contains(AttributeName.FACE) || attributes.contains(AttributeName.SIZE)))) {
errHtmlStartTagInForeignContext(name); if (!fragment) { while (!isSpecialParentInForeign(stack[currentPtr])) {
popForeign(-1, -1);
} continue starttagloop;
} // else fall thru
} // CPPONLY: MOZ_FALLTHROUGH; default: if ("http://www.w3.org/2000/svg" == currNs) {
attributes.adjustForSvg(); if (selfClosing) {
appendVoidElementToCurrentMayFosterSVG(
elementName, attributes);
selfClosing = false;
} else {
appendToCurrentNodeAndPushElementMayFosterSVG(
elementName, attributes);
}
attributes = null; // CPP break starttagloop;
} else {
attributes.adjustForMath(); if (selfClosing) {
appendVoidElementToCurrentMayFosterMathML(
elementName, attributes);
selfClosing = false;
} else {
appendToCurrentNodeAndPushElementMayFosterMathML(
elementName, attributes);
}
attributes = null; // CPP break starttagloop;
}
} // switch
} // foreignObject / annotation-xml
} switch (mode) { case IN_TEMPLATE: switch (group) { case COL:
popTemplateMode();
pushTemplateMode(IN_COLUMN_GROUP);
mode = IN_COLUMN_GROUP; // Reprocess token. continue; case CAPTION: case COLGROUP: case TBODY_OR_THEAD_OR_TFOOT:
popTemplateMode();
pushTemplateMode(IN_TABLE);
mode = IN_TABLE; // Reprocess token. continue; case TR:
popTemplateMode();
pushTemplateMode(IN_TABLE_BODY);
mode = IN_TABLE_BODY; // Reprocess token. continue; case TD_OR_TH:
popTemplateMode();
pushTemplateMode(IN_ROW);
mode = IN_ROW; // Reprocess token. continue; case META:
checkMetaCharset(attributes);
appendVoidElementToCurrentMayFoster(
elementName,
attributes);
selfClosing = false; // [NOCPP[
voidElement = true; // ]NOCPP]
attributes = null; // CPP break starttagloop; case TITLE:
startTagTitleInHead(elementName, attributes);
attributes = null; // CPP break starttagloop; case BASE: case LINK_OR_BASEFONT_OR_BGSOUND:
appendVoidElementToCurrentMayFoster(
elementName,
attributes);
selfClosing = false; // [NOCPP[
voidElement = true; // ]NOCPP]
attributes = null; // CPP break starttagloop; case SCRIPT:
startTagScriptInHead(elementName, attributes);
attributes = null; // CPP break starttagloop; case NOFRAMES: case STYLE:
startTagGenericRawText(elementName, attributes);
attributes = null; // CPP break starttagloop; case TEMPLATE:
startTagTemplateInHead(elementName, attributes);
attributes = null; // CPP break starttagloop; default:
popTemplateMode();
pushTemplateMode(IN_BODY);
mode = IN_BODY; // Reprocess token. continue;
} case IN_ROW: switch (group) { case TD_OR_TH:
clearStackBackTo(findLastOrRoot(TreeBuilder.TR));
appendToCurrentNodeAndPushElement(
elementName,
attributes);
mode = IN_CELL;
insertMarker();
attributes = null; // CPP break starttagloop; case CAPTION:
--> --------------------
--> maximum size reached
--> --------------------
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.39Bemerkung:
(vorverarbeitet)
¤