Files
sanderling/internal/driver/chrome/testdata/shadow-focus.html
T
pj 071f9c7f52 fix(chrome): focus descends into the shadow root
document.activeElement names the host, not the node focused inside it, so
a Compose-for-wasm app that mounts its tree in a shadow root reported
focus on div#app forever. confirmFocus could never be satisfied and every
InputText step aborted the run after three tries.

selectAllScript already descends the boundary; the tree builder did not.
2026-08-17 23:44:21 +05:30

18 lines
646 B
HTML

<!doctype html>
<html id="page">
<head id="page-head">
<meta id="page-charset" charset="utf-8" />
<title id="page-title">shadow focus</title>
</head>
<body id="page-body">
<!-- Shaped like Compose for Web: the app mounts its accessibility tree
inside a shadow root on this element, so document.activeElement answers
with the host for every field the user is typing into. -->
<div id="app"></div>
<script id="page-script">
const root = document.getElementById("app").attachShadow({ mode: "open" });
root.innerHTML = `<input id="shadow-field" type="text" />`;
</script>
</body>
</html>