  }
</style>
<body><span>One </span><span>two </span><span>threeâ€¦</span>
<script>
  let r = new Range();
  r.setStart(document.body, 0);
  r.setEnd(document.body, 2);
  let h = new Highlight();
  CSS.highlights.set("example-highlight", h);

  // Force frame paint before modifying the Highlight.
  runAfterLayoutAndPaint(()=>{
    h.add(r);
    document.documentElement.removeAttribute("class");
  });
</script>
</html>