https://github.com/web-platform-tests/wpt
Raw File
Tip revision: beb53fc12894d91cb6ff2380ea0e87608044e64e authored by Philip Jägenstedt on 20 December 2018, 16:25:34 UTC
Remove "Uninstall Python packages" step
Tip revision: beb53fc
shadow-relatedTarget.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!--
  This test is adopted from Olli Pettay's test case at
  http://mozilla.pettay.fi/shadow_focus.html
-->
<div id="host"></div>
<input id="lightInput">
<script>
const root = host.attachShadow({ mode: "closed" });
root.innerHTML = "<input id='shadowInput'>";

async_test((test) => {
  root.getElementById("shadowInput").focus();
  window.addEventListener("focus", test.step_func_done((e) => {
    assert_equals(e.relatedTarget, host);
  }, "relatedTarget should be pointing to shadow host."), true);
  lightInput.focus();
}, "relatedTarget should not leak at capturing phase, at window object.");

async_test((test) => {
  root.getElementById("shadowInput").focus();
  lightInput.addEventListener("focus", test.step_func_done((e) => {
    assert_equals(e.relatedTarget, host);
  }, "relatedTarget should be pointing to shadow host."), true);
  lightInput.focus();
}, "relatedTarget should not leak at target.");

</script>
back to top