2 <p>Test compareBoundaryPoints results in a particular case, see
3 <a href=
"https://bugs.webkit.org/show_bug.cgi?id=20738">bug
20738</a>.
</p>
4 <div id='text'
>Some text.
</div>
6 <div id='output'
></div>
7 <script type=
"text/javascript">
9 var $out
= document
.getElementById("output");
10 $out
.innerHTML
+= "<br />" + text
;
13 if (window
.testRunner
)
14 window
.testRunner
.dumpAsText();
17 var text
= document
.getElementById("text");
19 sourceRange
= document
.createRange();
20 sourceRange
.selectNode(text
);
22 range
= document
.createRange();
23 range
.setStart(text
.firstChild
, 1);
24 range
.setEnd(text
.firstChild
, 2);
28 "<li>START_TO_START = " + range
.compareBoundaryPoints(Range
.START_TO_START
, sourceRange
) +
29 "</li><li>START_TO_END = " + range
.compareBoundaryPoints(Range
.START_TO_END
, sourceRange
) +
30 "</li><li>END_TO_START = " + range
.compareBoundaryPoints(Range
.END_TO_START
, sourceRange
) +
31 "</li><li>END_TO_END = " + range
.compareBoundaryPoints(Range
.END_TO_END
, sourceRange
) +
34 log((range
.compareBoundaryPoints(Range
.START_TO_START
, sourceRange
) == 1
35 && range
.compareBoundaryPoints(Range
.START_TO_END
, sourceRange
) == 1
36 && range
.compareBoundaryPoints(Range
.END_TO_START
, sourceRange
) == -1
37 && range
.compareBoundaryPoints(Range
.END_TO_END
, sourceRange
) == -1) ? "PASS" : "FAIL");