blob: 93c09d2973dd8cf6fd59e0d8e3d88fe3de64b713 [file] [log] [blame]
<!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>