<html>
<head>
<script>

function write(str) {
    pre = document.getElementById('console');
    text = document.createTextNode(str + '\n');
    pre.appendChild(text);
}

function runTests() {
    if (window.layoutTestController)
        layoutTestController.dumpAsText();

    elem = document.createElement('test');
    elem.setAttribute('attr_name', 'attr_value');
    write("Add an attribute:");
    write("");
    write("    setAttribute(attr_name)");
    write("");
    write("The following should be non-empty, true, or non-null.");
    write("");
    write("    getAttribute(attr_name) = " + elem.getAttribute('attr_name'));
    write("    hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    write("    getAttributeNode(attr_name) = " + elem.getAttributeNode('attr_name'));
    write("    attributes.getNamedItem(attr_name) = " + elem.attributes.getNamedItem('attr_name'));
    write("");
    write("    getAttributeNS(attr_name) = " + elem.getAttributeNS(null, 'attr_name'));
    write("    hasAttributeNS(attr_name) = " + elem.hasAttributeNS(null, 'attr_name'));
    write("    getAttributeNodeNS(attr_name) = " + elem.getAttributeNodeNS(null, 'attr_name'));
    write("    attributes.getNamedItemNS(attr_name) = " + elem.attributes.getNamedItemNS(null, 'attr_name'));
    write("");
    write("    getAttribute(ATTR_NAME) = " + elem.getAttribute('ATTR_NAME'));
    write("    hasAttribute(ATTR_NAME) = " + elem.hasAttribute('ATTR_NAME'));
    write("    getAttributeNode(ATTR_NAME) = " + elem.getAttributeNode('ATTR_NAME'));
    write("    attributes.getNamedItem(ATTR_NAME) = " + elem.attributes.getNamedItem('ATTR_NAME'));
    write("");
    write("The following should be empty, false, or null.");
    write("");
    write("    getAttributeNS(ATTR_NAME) = " + elem.getAttributeNS(null, 'ATTR_NAME'));
    write("    hasAttributeNS(ATTR_NAME) = " + elem.hasAttributeNS(null, 'ATTR_NAME'));
    write("    getAttributeNodeNS(ATTR_NAME) = " + elem.getAttributeNodeNS(null, 'ATTR_NAME'));
    write("    attributes.getNamedItemNS(ATTR_NAME) = " + elem.attributes.getNamedItemNS(null, 'ATTR_NAME'));
    write("");
    write("The following should successfully remove the attribute.");
    write("");
    elem.setAttribute('attr_name', 'attr_value');
    elem.removeAttribute('attr_name');
    write("    setAttribute(attr_name); removeAttribute(attr_name)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    elem.setAttribute('attr_name', 'attr_value');
    elem.removeAttributeNS(null, 'attr_name');
    write("    setAttribute(attr_name); removeAttributeNS(attr_name)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    elem.setAttribute('attr_name', 'attr_value');
    elem.attributes.removeNamedItem('attr_name');
    write("    setAttribute(attr_name); attributes.removeNamedItem(attr_name)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    elem.setAttribute('attr_name', 'attr_value');
    elem.attributes.removeNamedItemNS(null, 'attr_name');
    write("    setAttribute(attr_name); attributes.removeNamedItemNS(null, attr_name)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    write("");
    elem.setAttribute('attr_name', 'attr_value');
    elem.removeAttribute('ATTR_NAME');
    write("    setAttribute(attr_name); removeAttribute(ATTR_NAME)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    elem.setAttribute('attr_name', 'attr_value');
    elem.attributes.removeNamedItem('ATTR_NAME');
    write("    setAttribute(attr_name); attributes.removeNamedItem(ATTR_NAME)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    write("");
    write("The following should fail to remove the attribute.");
    write("");
    elem.setAttribute('attr_name', 'attr_value');
    elem.removeAttributeNS(null, 'ATTR_NAME');
    write("    setAttribute(attr_name); removeAttributeNS(ATTR_NAME)")
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    write("");
    write("The following should fail to remove the attribute with an exception.");
    write("");
    elem.setAttribute('attr_name', 'attr_value');
    try {
        elem.attributes.removeNamedItemNS(null, 'ATTR_NAME');
        write("    attributes.removeNamedItemNS(ATTR_NAME) was expected to raise an exception but did not");
    } catch (e) {
        write("    attributes.removeNamedItemNS(ATTR_NAME) raised an exception as expected");
    }
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    write("");
    write("The following should set a lowercase attribute, so the result should be true.");
    write("");
    elem.setAttributeNS(null, 'attr_name', 'attr_value');
    write("    setAttributeNS(attr_name)");
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    elem.removeAttributeNS(null, 'attr_name');
    write("");
    write("The following should set an uppercase attribute, so the result should be false.");
    write("");
    elem.setAttributeNS(null, 'ATTR_NAME', 'attr_value');
    write("    setAttributeNS(ATTR_NAME)");
    write("        hasAttribute(attr_name) = " + elem.hasAttribute('attr_name'));
    elem.removeAttributeNS(null, 'ATTR_NAME');
}

</script>
</head>

<body onload="runTests();">
<pre id="console">This test checks whether attribute names with uppercase work properly in HTML documents.

</pre>
</body>

</html>
