https://github.com/web-platform-tests/wpt
Raw File
Tip revision: ce1ce6065b70a59939b184582587b7578da06b72 authored by Chris Nardi on 07 April 2018, 03:56:07 UTC
Update serialization of timing functions
Tip revision: ce1ce60
Range-prototype-insertNode.html
<!DOCTYPE html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
  var range = document.createRange();
  var rangeContainer = document.createElement('div');
  range.setStart(rangeContainer, 0);
  range.setEnd(rangeContainer, 0);
  var shadowRoot = document.createElement('span').attachShadow({mode: "open"});
  var h1 = shadowRoot.appendChild(document.createElement('h1'));

  range.insertNode(shadowRoot);
  assert_equals(rangeContainer.firstChild, h1);
}, 'Test if Range.prototype.insertNode() should accept ShadowRoot input.');
</script>
</body>
back to top