ladybird/Tests/LibWeb/Text/input/HTML/loading-attribute.html
2024-06-08 08:01:42 +02:00

22 lines
1.1 KiB
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
for (const elementName of ["img", "iframe"]) {
const element = document.createElement(elementName);
println(`${elementName} loading initial value: ${element.loading}`);
element.loading = "invalid";
println(`${elementName} loading value after setting to "invalid": ${element.loading}`);
element.loading = "lazy";
println(`${elementName} loading value after setting to "lazy": ${element.loading}`);
element.loading = null;
println(`${elementName} loading value after setting to null: ${element.loading}`);
element.loading = "LAZY";
println(`${elementName} loading value after setting to "LAZY": ${element.loading}`);
element.loading = "";
println(`${elementName} loading value after setting to "": ${element.loading}`);
element.removeAttribute("loading");
println(`${elementName} loading value after calling removeAttribute: ${element.loading}`);
}
});
</script>