haikuwebkit/LayoutTests/fast/shadow-dom/blur-on-shadow-host-with-fo...

23 lines
635 B
HTML

<!DOCTYPE html>
<html>
<body>
<div id="host"></div>
<script src="../../resources/js-test.js"></script>
<script>
description('Test that calling blur() on a shadow host of a focused element clears the focus.');
let shadowHost = document.getElementById('host');
let shadowRoot = shadowHost.attachShadow({mode: 'closed'});
shadowRoot.innerHTML = `<input>`;
shouldBe('input = shadowRoot.querySelector("input"); input.focus(); shadowRoot.activeElement', 'input');
shouldBe('document.activeElement', 'shadowHost');
shouldBe('shadowHost.blur(); shadowRoot.activeElement', 'null');
var successfullyParsed = true;
</script>
</body>
</html>