https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 57a82af3537d05ffe7b022c53939e6fb54895c6c authored by Stephen McGruer on 04 April 2018, 19:41:56 UTC
Web Animations: Fix bug with Document::getAnimations
Tip revision: 57a82af
addmodule-window.html
<!DOCTYPE html>
<html>
<head>
  <title>Worklet: Referrer</title>
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="worklet-test-utils.js"></script>
</head>
<body>
<script>
// Calls addModule() on a given worklet type with a script url.
//
// [Message Format]
//   - type: 'paint' (worklet types defined in get_worklet())
//   - script_url: 'worklet-script.js'
window.onmessage = e => {
  const worklet_type = e.data.type;
  const script_url = e.data.script_url;
  get_worklet(worklet_type).addModule(script_url)
      .then(() => window.opener.postMessage('RESOLVED', '*'))
      .catch(e => window.opener.postMessage('REJECTED', '*'));
};

window.opener.postMessage('LOADED', '*');
</script>
</body>
</html>
back to top