2 <script src=
"../../resources/js-test.js"></script>
3 <body style=
"min-height: 5000px">
4 <span id=
"elt">text
</span>
7 description('Checks that bounds are handled properly when activating TextMatch markers.');
10 testRunner
.dumpAsText();
12 var range
= document
.createRange();
13 var elt
= document
.getElementById('elt').firstChild
;
14 range
.setStart(elt
, 1);
17 if (!window
.internals
) {
18 alert('This test requires window.interals to run!');
20 window
.internals
.addTextMatchMarker(range
, false);
22 window
.internals
.setMarkersActive(elt
, 0, 1, true);
23 shouldBe('window.internals.activeMarkerCountForNode(elt)', '0');
25 window
.internals
.setMarkersActive(elt
, 1, 2, true);
26 shouldBe('window.internals.activeMarkerCountForNode(elt)', '1');
28 window
.internals
.setMarkersActive(elt
, 2, 3, false);
29 shouldBe('window.internals.activeMarkerCountForNode(elt)', '0');
31 window
.internals
.setMarkersActive(elt
, 3, 4, true);
32 shouldBe('window.internals.activeMarkerCountForNode(elt)', '0');
35 var successfullyParsed
= true;