void DatasetDOMStringMap::setItem(const String& name, const String& value, ExceptionCode& ec)
{
    if (!isValidPropertyName(name)) {
        ec = SYNTAX_ERR;
        return;
    }

    m_element->setAttribute(convertPropertyNameToAttributeName(name), value, ec);
}
void DatasetDOMStringMap::setItem(const String& name, const String& value, ExceptionState& exceptionState)
{
    if (!isValidPropertyName(name)) {
        exceptionState.throwDOMException(SyntaxError, "'" + name + "' is not a valid property name.");
        return;
    }

    m_element->setAttribute(convertPropertyNameToAttributeName(name), AtomicString(value), exceptionState);
}
Ejemplo n.º 3
0
void DatasetDOMStringMap::deleteItem(const String& name, ExceptionCode& ec)
{
    if (!isValidPropertyName(name)) {
        ec = SYNTAX_ERR;
        return;
    }

    m_element.removeAttribute(convertPropertyNameToAttributeName(name));
}
bool DatasetDOMStringMap::deleteItem(const String& name)
{
    if (isValidPropertyName(name)) {
        AtomicString attributeName = convertPropertyNameToAttributeName(name);
        if (m_element->hasAttribute(attributeName)) {
            m_element->removeAttribute(attributeName);
            return true;
        }
    }
    return false;
}