<!DOCTYPE html>
<html>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="host" tabindex="0"></div>
<script>

const shadowRoot = host.attachShadow({mode: 'closed', delegatesFocus: true});
shadowRoot.innerHTML = `<input type="text" id="target" autofocus>`;

promise_test(async () => {
    await new Promise(requestAnimationFrame);
    assert_equals(document.activeElement, document.body);
    assert_equals(shadowRoot.activeElement, null);
}, 'an element with autofocus content attribute in a shadow tree should not automatically get focus');

</script>
</body>
</html>
