ladybird/Tests/LibWeb/Text/input/DOMTokenList-supports.html
Tim Ledbetter d0555f3176 LibWeb: Flesh out DOMTokenList::supports() implementation
This change makes `DOMTokenList::supports()` work as expected for
`relList` attributes.
2024-05-16 20:31:23 +02:00

22 lines
891 B
HTML

<!DOCTYPE html>
<script src="include.js"></script>
<script>
test(() => {
for (const tagName of ["a", "area", "form", "link"]) {
const element = document.createElement(tagName);
const relList = element.relList;
for (const propertyValue of ["alternate", "stylesheet", "preload", "dns-prefetch", "preconnect", "icon", "STYLESHEET", "never-supported"]) {
println(`${tagName}.relList.supports("${propertyValue}"): ${relList.supports(propertyValue)}`);
}
}
const documentElement = document.documentElement
const classList = documentElement.classList;
try {
classList.supports("foo");
println("FAIL");
} catch (e) {
println(`${documentElement.tagName.toLowerCase()}.classList.supports("foo") throws: ${e.name}`);
}
});
</script>