mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
d0555f3176
This change makes `DOMTokenList::supports()` work as expected for `relList` attributes.
22 lines
891 B
HTML
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>
|