public HtmlAttributes cloneAttributes() throws SAXException { assert (length == 0 && xmlnsLength == 0 ) || mode == 0 || mode == 3; HtmlAttributes clone = new HtmlAttributes(0); for (int i = 0; i < length; i++) { clone.addAttribute(names[i], values[i] , XmlViolationPolicy.ALLOW ); } for (int i = 0; i < xmlnsLength; i++) { clone.addAttribute(xmlnsNames[i], xmlnsValues[i], XmlViolationPolicy.ALLOW); } return clone; // XXX!!! }
/** * */ private void resetAttributes() { // [NOCPP[ if (newAttributesEachTime) { // ]NOCPP] attributes = null; // [NOCPP[ } else { attributes.clear(mappingLangToXmlLang); } // ]NOCPP] }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); if (!contains(name)) { addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); } } } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeName(i); if (!contains(name)) { addAttribute(name, attributes.getValue(i), XmlViolationPolicy.ALLOW); } } }
@IdType String id = attributes.getId(); if (id != null) { LocatorImpl oldLoc = idLocations.get(id); if (attributes.contains(AttributeName.COLOR) || attributes.contains(AttributeName.FACE) || attributes.contains(AttributeName.SIZE)) { errHtmlStartTagInForeignContext(name); while (!isSpecialParentInForeign(stack[currentPtr])) { attributes.adjustForSvg(); if (selfClosing) { appendVoidElementToCurrentMayFosterSVG( break starttagloop; } else { attributes.adjustForMath(); if (selfClosing) { appendVoidElementToCurrentMayFosterMathML( if (!Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( "hidden", attributes.getValue(AttributeName.TYPE))) { break intableloop; && !(group == INPUT && Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( "hidden", attributes.getValue(AttributeName.TYPE)))) { framesetOk = false;
@IdType String id = attributes.getId(); if (id != null) { LocatorImpl oldLoc = idLocations.get(id); if (!(group == FONT && !(attributes.contains(AttributeName.COLOR) || attributes.contains(AttributeName.FACE) || attributes.contains(AttributeName.SIZE)))) { errHtmlStartTagInForeignContext(name); if (!fragment) { attributes.adjustForSvg(); if (selfClosing) { appendVoidElementToCurrentMayFosterSVG( break starttagloop; } else { attributes.adjustForMath(); if (selfClosing) { appendVoidElementToCurrentMayFosterMathML( if (!Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( "hidden", attributes.getValue(AttributeName.TYPE))) { break intableloop; && !(group == INPUT && Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( "hidden", attributes.getValue(AttributeName.TYPE)))) { framesetOk = false; mode = IN_BODY;
attributes = null; } else { attributes = other.attributes.cloneAttributes();
private void attributeNameComplete() throws SAXException { // if (strBufOffset != -1) { // attributeName = AttributeName.nameByBuffer(buf, strBufOffset, // strBufLen, namePolicy != XmlViolationPolicy.ALLOW); // } else { attributeName = AttributeName.nameByBuffer(strBuf, 0, strBufLen // [NOCPP[ , namePolicy != XmlViolationPolicy.ALLOW // ]NOCPP] , interner); // } if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName.release(); attributeName = null; } }
if (attributeName.isBoolean()) { if (html4ModeCompatibleWithXhtml1Schemata) { attributes.addAttribute(attributeName, attributeName.getLocal(AttributeName.HTML), xmlnsPolicy); } else { attributes.addAttribute(attributeName, "", xmlnsPolicy); attributes.addAttribute(attributeName, "", xmlnsPolicy); attributes.addAttribute(attributeName, Portability.newEmptyString()
HtmlAttributes emptyAttributes() { // [NOCPP[ if (newAttributesEachTime) { return new HtmlAttributes(mappingLangToXmlLang); } else { // ]NOCPP] return HtmlAttributes.EMPTY_ATTRIBUTES; // [NOCPP[ } // ]NOCPP] }
private void maybeForgetEarlierDuplicateFormattingElement( @Local String name, HtmlAttributes attributes) throws SAXException { int candidate = -1; int count = 0; for (int i = listPtr; i >= 0; i--) { StackNode<T> node = listOfActiveFormattingElements[i]; if (node == null) { break; } if (node.name == name && node.attributes.equalsAnother(attributes)) { candidate = i; ++count; } } if (count >= 3) { removeFromListOfActiveFormattingElements(candidate); } }
@IdType String id = attributes.getId(); if (id != null) { LocatorImpl oldLoc = idLocations.get(id); if (!(group == FONT && !(attributes.contains(AttributeName.COLOR) || attributes.contains(AttributeName.FACE) || attributes.contains(AttributeName.SIZE)))) { errHtmlStartTagInForeignContext(name); if (!fragment) { attributes.adjustForSvg(); if (selfClosing) { appendVoidElementToCurrentMayFosterSVG( break starttagloop; } else { attributes.adjustForMath(); if (selfClosing) { appendVoidElementToCurrentMayFosterMathML( if (!Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( "hidden", attributes.getValue(AttributeName.TYPE))) { break intableloop; && !(group == INPUT && Portability.lowerCaseLiteralEqualsIgnoreAsciiCaseString( "hidden", attributes.getValue(AttributeName.TYPE)))) { framesetOk = false; mode = IN_BODY;
attributes = null; } else { attributes = other.attributes.cloneAttributes(interner);
private void attributeNameComplete() throws SAXException { attributeName = AttributeName.nameByBuffer(strBuf, strBufLen, interner); if (attributeName == null) { // [NOCPP[ attributeName = AttributeName.createAttributeName( Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner), namePolicy != XmlViolationPolicy.ALLOW); // ]NOCPP] // CPPONLY: nonInternedAttributeName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, strBufLen, interner)); // CPPONLY: attributeName = nonInternedAttributeName; } clearStrBufAfterUse(); if (attributes == null) { attributes = new HtmlAttributes(mappingLangToXmlLang); } /* * When the user agent leaves the attribute name state (and before * emitting the tag token, if appropriate), the complete attribute's * name must be compared to the other attributes on the same token; if * there is already an attribute on the token with the exact same name, * then this is a parse error and the new attribute must be dropped, * along with the value that gets associated with it (if any). */ if (attributes.contains(attributeName)) { errDuplicateAttribute(); attributeName = null; } }
private void addAttributeWithValue() throws SAXException { // [NOCPP[ if (metaBoundaryPassed && ElementName.META == tagName && AttributeName.CHARSET == attributeName) { err("A \u201Ccharset\u201D attribute on a \u201Cmeta\u201D element found after the first 1024 bytes."); } // ]NOCPP] if (attributeName != null) { String val = strBufToString(); // Ownership transferred to // HtmlAttributes // CPPONLY: if (mViewSource) { // CPPONLY: mViewSource.MaybeLinkifyAttributeValue(attributeName, val); // CPPONLY: } attributes.addAttribute(attributeName, val // [NOCPP[ , xmlnsPolicy // ]NOCPP] // CPPONLY: , attributeLine ); attributeName = null; } else { // We have a duplicate attribute. Explicitly discard its value. clearStrBufAfterUse(); } }
HtmlAttributes emptyAttributes() { // [NOCPP[ if (newAttributesEachTime) { return new HtmlAttributes(mappingLangToXmlLang); } else { // ]NOCPP] return HtmlAttributes.EMPTY_ATTRIBUTES; // [NOCPP[ } // ]NOCPP] }
private void maybeForgetEarlierDuplicateFormattingElement( @Local String name, HtmlAttributes attributes) throws SAXException { int candidate = -1; int count = 0; for (int i = listPtr; i >= 0; i--) { StackNode<T> node = listOfActiveFormattingElements[i]; if (node == null) { break; } if (node.name == name && node.attributes.equalsAnother(attributes)) { candidate = i; ++count; } } if (count >= 3) { removeFromListOfActiveFormattingElements(candidate); } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); if (!contains(name)) { addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); } } } }
attributes = null; } else { attributes = other.attributes.cloneAttributes(interner);
public HtmlAttributes cloneAttributes(Interner interner) throws SAXException { assert (length == 0 && xmlnsLength == 0 ) || mode == 0 || mode == 3; HtmlAttributes clone = new HtmlAttributes(0); for (int i = 0; i < length; i++) { clone.addAttribute(names[i], values[i] , XmlViolationPolicy.ALLOW ); } for (int i = 0; i < xmlnsLength; i++) { clone.addAttribute(xmlnsNames[i], xmlnsValues[i], XmlViolationPolicy.ALLOW); } return clone; // XXX!!! }