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!!! }
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!!! }
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].cloneAttributeName(interner), Portability.newStringFromString(values[i]) // [NOCPP[ , XmlViolationPolicy.ALLOW // ]NOCPP] ); } // [NOCPP[ for (int i = 0; i < xmlnsLength; i++) { clone.addAttribute(xmlnsNames[i], xmlnsValues[i], XmlViolationPolicy.ALLOW); } // ]NOCPP] return clone; // XXX!!! }
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()
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); } } }
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); } } } }
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(); } }
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); } } } }
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(); } }
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 512 bytes."); } // ]NOCPP] if (attributeName != null) { String val = longStrBufToString(); // Ownership transferred to // HtmlAttributes // CPPONLY: if (mViewSource) { // CPPONLY: mViewSource.MaybeLinkifyAttributeValue(attributeName, val); // CPPONLY: } // [NOCPP[ if (!endTag && html4 && html4ModeCompatibleWithXhtml1Schemata && attributeName.isCaseFolded()) { val = newAsciiLowerCaseStringFromString(val); } // ]NOCPP] attributes.addAttribute(attributeName, val // [NOCPP[ , xmlnsPolicy // ]NOCPP] ); attributeName = null; // attributeName has been adopted by the // |attributes| object } }
private void addAttributeWithoutValue() throws SAXException { noteAttributeWithoutValue(); // [NOCPP[ if (metaBoundaryPassed && AttributeName.CHARSET == attributeName && ElementName.META == tagName) { err("A \u201Ccharset\u201D attribute on a \u201Cmeta\u201D element found after the first 1024 bytes."); } // ]NOCPP] if (attributeName != null) { // [NOCPP[ if (AttributeName.SRC == attributeName || AttributeName.HREF == attributeName) { warn("Attribute \u201C" + attributeName.getLocal(AttributeName.HTML) + "\u201D without an explicit value seen. The attribute may be dropped by IE7."); } // ]NOCPP] attributes.addAttribute(attributeName, Portability.newEmptyString() // [NOCPP[ , xmlnsPolicy // ]NOCPP] // CPPONLY: , attributeLine ); attributeName = null; } else { clearStrBufAfterUse(); } }
private void addAttributeWithoutValue() throws SAXException { noteAttributeWithoutValue(); // [NOCPP[ if (metaBoundaryPassed && AttributeName.CHARSET == attributeName && ElementName.META == tagName) { err("A \u201Ccharset\u201D attribute on a \u201Cmeta\u201D element found after the first 1024 bytes."); } // ]NOCPP] if (attributeName != null) { // [NOCPP[ if (AttributeName.SRC == attributeName || AttributeName.HREF == attributeName) { warn("Attribute \u201C" + attributeName.getLocal(AttributeName.HTML) + "\u201D without an explicit value seen. The attribute may be dropped by IE7."); } // ]NOCPP] attributes.addAttribute(attributeName, Portability.newEmptyString() // [NOCPP[ , xmlnsPolicy // ]NOCPP] // CPPONLY: , attributeLine ); attributeName = null; } else { clearStrBufAfterUse(); } }
int actionIndex = attributes.getIndex(AttributeName.ACTION); if (actionIndex > -1) { formAttrs.addAttribute( AttributeName.ACTION, attributes.getValue(actionIndex) inputAttributes.addAttribute( AttributeName.NAME, Portability.newStringFromLiteral("isindex") attributes.releaseValue(i); } else if (AttributeName.ACTION != attributeQName) { inputAttributes.addAttribute( attributeQName, attributes.getValue(i)