/** * Short hand for well-known HTML elements. * * @param elementName * @param node */ StackNode(ElementName elementName, T node // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { this.flags = elementName.getFlags(); this.name = elementName.name; this.popName = elementName.name; this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = null; this.refcount = 1; assert !elementName.isCustom() : "Don't use this constructor for custom elements."; // [NOCPP[ this.locator = locator; // ]NOCPP] }
/** * Constructor for HTML formatting elements. * * @param elementName * @param node * @param attributes */ StackNode(ElementName elementName, T node, HtmlAttributes attributes // [NOCPP[ , TaintableLocatorImpl locator // ]NOCPP] ) { this.flags = elementName.getFlags(); this.name = elementName.name; this.popName = elementName.name; this.ns = "http://www.w3.org/1999/xhtml"; this.node = node; this.attributes = attributes; this.refcount = 1; assert !elementName.isCustom() : "Don't use this constructor for custom elements."; // [NOCPP[ this.locator = locator; // ]NOCPP] }
private void appendVoidElementToCurrentMayFoster( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.name; // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); if (elementName.isCustom()) { popName = checkPopName(popName); } // ]NOCPP] T elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes); StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); insertIntoFosterParent(elt); } else { appendElement(elt, current.node); } elementPushed("http://www.w3.org/1999/xhtml", popName, elt); elementPopped("http://www.w3.org/1999/xhtml", popName, elt); }
private void appendVoidElementToCurrentMayFosterSVG( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.camelCaseName; // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/2000/svg"); if (elementName.isCustom()) { popName = checkPopName(popName); } // ]NOCPP] T elt = createElement("http://www.w3.org/2000/svg", popName, attributes); StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); insertIntoFosterParent(elt); } else { appendElement(elt, current.node); } elementPushed("http://www.w3.org/2000/svg", popName, elt); elementPopped("http://www.w3.org/2000/svg", popName, elt); }
private void appendVoidElementToCurrentMayFosterMathML( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.name; // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1998/Math/MathML"); if (elementName.isCustom()) { popName = checkPopName(popName); } // ]NOCPP] T elt = createElement("http://www.w3.org/1998/Math/MathML", popName, attributes); StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); insertIntoFosterParent(elt); } else { 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 appendToCurrentNodeAndPushElementMayFosterSVG( ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.camelCaseName; // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/2000/svg"); if (elementName.isCustom()) { popName = checkPopName(popName); } // ]NOCPP] T elt = createElement("http://www.w3.org/2000/svg", popName, attributes); StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); insertIntoFosterParent(elt); } else { appendElement(elt, current.node); } StackNode<T> node = new StackNode<T>(elementName, popName, elt // [NOCPP[ , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) // ]NOCPP] ); push(node); }
private void appendToCurrentNodeAndPushElementMayFoster(ElementName elementName, HtmlAttributes attributes) throws SAXException { @Local String popName = elementName.name; // [NOCPP[ checkAttributes(attributes, "http://www.w3.org/1999/xhtml"); if (elementName.isCustom()) { popName = checkPopName(popName); } // ]NOCPP] T elt = createElement("http://www.w3.org/1999/xhtml", popName, attributes); StackNode<T> current = stack[currentPtr]; if (current.isFosterParenting()) { fatal(); insertIntoFosterParent(elt); } else { appendElement(elt, current.node); } StackNode<T> node = new StackNode<T>(elementName, elt, popName // [NOCPP[ , errorHandler == null ? null : new TaintableLocatorImpl(tokenizer) // ]NOCPP] ); push(node); }
if (elementName.isCustom()) { popName = checkPopName(popName);