Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / paint / selection / resources / selection.js
blobb26f72a21b68402a5afd880620fbfa91a0d893d8
1 function selectRangeAfterLayoutAndPaint(startElement, startIndex, endElement, endIndex) {
2 runAfterLayoutAndPaint(function() {
3 selectRange(startElement, startIndex, endElement, endIndex);
4 }, true);
7 function selectRange(startElement, startIndex, endElement, endIndex) {
8 if (window.internals)
9 window.internals.setSelectionPaintingWithoutSelectionGapsEnabled(true);
10 var range = document.createRange();
11 range.setStart(startElement, startIndex);
12 range.setEnd(endElement, endIndex);
13 window.getSelection().addRange(range);