chromium/third_party/blink/web_tests/svg/text/selection-partial-gradient.html

<!DOCTYPE html>
<style>
text::selection {
  background-color: transparent;
  fill: url(#green);
}
</style>
<svg>
  <linearGradient id="green">
    <stop stop-color="green"/>
  </linearGradient>
  <linearGradient id="white">
    <stop stop-color="white"/>
  </linearGradient>
  <text x="10" y="20" font-size="20" font-family="monospace" fill="url(#white)">PASS FAIL</text>
</svg>
<script>
var textNode = document.querySelector('text').firstChild;
var range = new Range();
range.setStart(textNode, 0);
range.setEnd(textNode, 4);
document.getSelection().addRange(range);
</script>