summaryrefslogtreecommitdiffstats
path: root/layout/reftests/bugs/386310-script.js
blob: 960fe6ab5a2e3b62011fb8aaa786ce7457848e35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function wrapNode() {
  var elm = document.getElementById("test");
  var span = document.createElement("span");
  span.setAttribute("style", "background: yellow");
  var range = document.createRange();
  var start = "first second third [".length;
  range.setStart(elm.lastChild, start);
  range.setEnd(elm.lastChild, start + "fourth".length);
  range.surroundContents(span);
}

window.addEventListener("load", wrapNode);