mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-11 17:37:00 +02:00
This resolves a test in https://wpt.live/dom/nodes/attributes.html. (cherry picked from commit f774d75f890e89a8483e5c7459de4fd96ce1b479)
25 lines
637 B
HTML
25 lines
637 B
HTML
<!DOCTYPE html>
|
|
<script src="include.js"></script>
|
|
<div id="test"></div>
|
|
<script>
|
|
test(() => {
|
|
const element = document.getElementById("test");
|
|
|
|
// toggleAttribute should throw an exception if the name isn't a valid
|
|
// XML Name (e.g. "", or "0").
|
|
try {
|
|
element.toggleAttribute("");
|
|
println("FAIL ('')");
|
|
} catch (err) {
|
|
println("PASS (''): " + err.name);
|
|
}
|
|
|
|
try {
|
|
element.toggleAttribute("0");
|
|
println("FAIL ('0')");
|
|
} catch (err) {
|
|
println("PASS ('0'): " + err.name);
|
|
}
|
|
});
|
|
</script>
|