void Element::setAttribute(const AtomicString& localName, const AtomicString& value, ExceptionState& exceptionState) { if (!Document::isValidName(localName)) { exceptionState.ThrowDOMException(InvalidCharacterError, "'" + localName + "' is not a valid attribute name."); return; } synchronizeAttribute(localName); if (!elementData()) { setAttributeInternal(kNotFound, QualifiedName(localName), value, NotInSynchronizationOfLazyAttribute); return; } AttributeCollection attributes = elementData()->attributes(); size_t index = attributes.findIndex(localName); const QualifiedName& qName = index != kNotFound ? attributes[index].name() : QualifiedName(localName); setAttributeInternal(index, qName, value, NotInSynchronizationOfLazyAttribute); }
void RCSResourceObject::setAttribute(std::string&& key, RCSResourceAttributes::Value&& value) { setAttributeInternal(std::move(key), std::move(value)); }
void RCSResourceObject::setAttribute(const std::string& key, const RCSResourceAttributes::Value& value) { setAttributeInternal(key, value); }
void Element::setSynchronizedLazyAttribute(const QualifiedName& name, const AtomicString& value) { size_t index = elementData() ? elementData()->attributes().findIndex(name) : kNotFound; setAttributeInternal(index, name, value, InSynchronizationOfLazyAttribute); }