Files
ladybird/Tests/LibWeb/Text/input/html/activeElement-body.html
Tim Ledbetter 0035690977 LibWeb: Return body from activeElement() when nothing is focused
This matches the behavior of other browsers.
2026-01-19 13:08:30 +01:00

14 lines
561 B
HTML

<!DOCTYPE html>
<body>
<script src="../include.js"></script>
<div id="content">Test content</div>
<script>
test(() => {
// When nothing is explicitly focused, activeElement should return the body element
println("document.activeElement === document.body: " + (document.activeElement === document.body));
println("document.activeElement is null: " + (document.activeElement === null));
println("document.activeElement tagName: " + (document.activeElement ? document.activeElement.tagName : "null"));
});
</script>
</body>