/** * Short hand for well-known HTML elements. * * @param elementName * @param node */ void setValues(ElementName elementName, T node // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * Setter for HTML formatting elements. * * @param elementName * @param node * @param attributes */ void setValues(ElementName elementName, T node, HtmlAttributes attributes // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = attributes; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Need to track creator for formatting elements in order to be able * to clone them. */ // CPPONLY: this.htmlCreator = elementName.getHtmlCreator(); // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * Setter for HTML formatting elements. * * @param elementName * @param node * @param attributes */ void setValues(ElementName elementName, T node, HtmlAttributes attributes // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = attributes; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Need to track creator for formatting elements in order to be able * to clone them. */ // CPPONLY: this.htmlCreator = elementName.getHtmlCreator(); // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * Short hand for well-known HTML elements. * * @param elementName * @param node */ void setValues(ElementName elementName, T node // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = elementName.getName(); this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; assert elementName.isInterned() : "Don't use this constructor for custom elements."; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * The common-case HTML setter. * * @param elementName * @param node * @param popName */ void setValues(ElementName elementName, T node, @Local String popName // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = popName; this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * The common-case HTML setter. * * @param elementName * @param node * @param popName */ void setValues(ElementName elementName, T node, @Local String popName // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { assert isUnused(); this.flags = elementName.getFlags(); this.name = elementName.getName(); this.popName = popName; this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; /* * Not used for formatting elements, so no need to track creator. */ // CPPONLY: this.htmlCreator = null; // [NOCPP[ this.locator = locator; // ]NOCPP] }
assert isUnused(); this.flags = prepareSvgFlags(elementName.getFlags()); this.name = elementName.getName(); this.popName = popName; this.ns = "http://www.w3.org/2000/svg";
private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes, T form) throws SAXException { // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); // ]NOCPP] // Can't be called for custom elements T elt; T formOwner = form == null || fragment || isTemplateContents() ? null : form; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", elementName.getName(), attributes, formOwner // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); } else { elt = createElement("http://www.w3.org/1999/xhtml", elementName.getName(), attributes, formOwner, current.node // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, current.node); } StackNode<T> node = createStackNode(elementName, elt // [NOCPP[ , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) // ]NOCPP] ); push(node); }
private void appendToCurrentNodeAndPushElement(ElementName elementName, HtmlAttributes attributes) throws SAXException { // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); // ]NOCPP] // This method can't be called for custom elements T currentNode = stack[currentPtr].node; T elt = createElement("http://www.w3.org/1999/xhtml", elementName.getName(), attributes, currentNode // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, currentNode); if (ElementName.TEMPLATE == elementName) { elt = getDocumentFragmentForTemplate(elt); } StackNode<T> node = createStackNode(elementName, elt // [NOCPP[ , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) // ]NOCPP] ); push(node); }
private void appendToCurrentNodeAndPushElement(ElementName elementName, HtmlAttributes attributes) throws SAXException { // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); // ]NOCPP] // This method can't be called for custom elements T currentNode = nodeFromStackWithBlinkCompat(currentPtr); T elt = createElement("http://www.w3.org/1999/xhtml", elementName.getName(), attributes, currentNode // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, currentNode); if (ElementName.TEMPLATE == elementName) { elt = getDocumentFragmentForTemplate(elt); } StackNode<T> node = createStackNode(elementName, elt // [NOCPP[ , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) // ]NOCPP] ); push(node); }
private void strBufToElementNameString() { if (containsHyphen) { // We've got a custom element or annotation-xml. @Local String annotationName = ElementName.ANNOTATION_XML.getName(); if (Portability.localEqualsBuffer(annotationName, strBuf, strBufLen)) { tagName = ElementName.ANNOTATION_XML; } else { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , true ); tagName = nonInternedTagName; } } else { tagName = ElementName.elementNameByBuffer(strBuf, strBufLen, interner); if (tagName == null) { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , false ); tagName = nonInternedTagName; } } containsHyphen = false; clearStrBufAfterUse(); }
private void strBufToElementNameString() { if (containsHyphen) { // We've got a custom element or annotation-xml. @Local String annotationName = ElementName.ANNOTATION_XML.getName(); if (Portability.localEqualsBuffer(annotationName, strBuf, strBufLen)) { tagName = ElementName.ANNOTATION_XML; } else { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , true ); tagName = nonInternedTagName; } } else { tagName = ElementName.elementNameByBuffer(strBuf, strBufLen, interner); if (tagName == null) { nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner) // CPPONLY: , false ); tagName = nonInternedTagName; } } containsHyphen = false; clearStrBufAfterUse(); }
private void appendVoidElementToCurrentMayFoster( ElementName elementName, HtmlAttributes attributes, T form) throws SAXException { @Local String name = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); // ]NOCPP] // Can't be called for custom elements T elt; T formOwner = form == null || fragment || isTemplateContents() ? null : form; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", name, attributes, formOwner // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); } else { elt = createElement("http://www.w3.org/1999/xhtml", name, attributes, formOwner, current.node // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, current.node); } elementPushed("http://www.w3.org/1999/xhtml", name, elt); elementPopped("http://www.w3.org/1999/xhtml", name, elt); }
private void appendVoidElementToCurrentMayFosterMathML( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1998/Math/MathML"); if (!elementName.isInterned()) { popName = checkPopName(popName); } // ]NOCPP] T elt; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1998/Math/MathML", popName, attributes // CPPONLY: , htmlCreator(null) ); } else { elt = createElement("http://www.w3.org/1998/Math/MathML", popName, attributes, current.node // CPPONLY: , htmlCreator(null) ); appendElement(elt, current.node); } elementPushed("http://www.w3.org/1998/Math/MathML", popName, elt); elementPopped("http://www.w3.org/1998/Math/MathML", popName, elt); }
private void appendVoidElementToCurrentMayFoster( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); if (!elementName.isInterned()) { popName = checkPopName(popName); } // ]NOCPP] T elt; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", popName, attributes // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); } else { elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes, current.node // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, current.node); } elementPushed("http://www.w3.org/1999/xhtml", popName, elt); elementPopped("http://www.w3.org/1999/xhtml", popName, elt); }
private void appendVoidElementToCurrentMayFoster( ElementName elementName, HtmlAttributes attributes, T form) throws SAXException { @Local String name = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); // ]NOCPP] // Can't be called for custom elements T elt; T formOwner = form == null || fragment || isTemplateContents() ? null : form; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", name, attributes, formOwner // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); } else { T currentNode = nodeFromStackWithBlinkCompat(currentPtr); elt = createElement("http://www.w3.org/1999/xhtml", name, attributes, formOwner, currentNode // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, currentNode); } elementPushed("http://www.w3.org/1999/xhtml", name, elt); elementPopped("http://www.w3.org/1999/xhtml", name, elt); }
private void appendVoidElementToCurrentMayFosterMathML( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1998/Math/MathML"); if (!elementName.isInterned()) { popName = checkPopName(popName); } // ]NOCPP] T elt; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1998/Math/MathML", popName, attributes // CPPONLY: , htmlCreator(null) ); } else { T currentNode = nodeFromStackWithBlinkCompat(currentPtr); elt = createElement("http://www.w3.org/1998/Math/MathML", popName, attributes, currentNode // CPPONLY: , htmlCreator(null) ); appendElement(elt, currentNode); } elementPushed("http://www.w3.org/1998/Math/MathML", popName, elt); elementPopped("http://www.w3.org/1998/Math/MathML", popName, elt); }
private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); if (!elementName.isInterned()) { popName = checkPopName(popName); } // ]NOCPP] T elt; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", popName, attributes // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); } else { elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes, current.node // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, current.node); } StackNode<T> node = createStackNode(elementName, elt, popName // [NOCPP[ , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) // ]NOCPP] ); push(node); }
private void appendVoidElementToCurrentMayFoster( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.getName(); // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); if (!elementName.isInterned()) { popName = checkPopName(popName); } // ]NOCPP] T elt; StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); elt = createAndInsertFosterParentedElement("http://www.w3.org/1999/xhtml", popName, attributes // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); } else { T currentNode = nodeFromStackWithBlinkCompat(currentPtr); elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes, currentNode // CPPONLY: , htmlCreator(elementName.getHtmlCreator()) ); appendElement(elt, currentNode); } elementPushed("http://www.w3.org/1999/xhtml", popName, elt); elementPopped("http://www.w3.org/1999/xhtml", popName, elt); }