2 <script src=
"../../resources/ahem.js"></script>
3 <div id=
"target" style=
"
4 outline: dashed lightblue;
8 -webkit-writing-mode: horizontal-bt;
9 ">Lorem ipsum dolor sit amet
</div>
12 if (window
.testRunner
&& window
.internals
) {
13 testRunner
.dumpAsText();
14 internals
.settings
.setEditingBehavior("mac");
19 document
.getElementById("log").appendChild(document
.createTextNode(message
+ "\n"));
22 function test(x
, y
, expectedOffset
)
24 var actualOffset
= document
.caretRangeFromPoint(8 + x
, 8 + y
).startOffset
;
25 if (actualOffset
=== expectedOffset
)
26 log("PASS: offset at (" + x
+ "," + y
+ ") was " + actualOffset
+ ".");
28 log("FAIL: offset at (" + x
+ "," + y
+ ") was " + actualOffset
+ ". Expected " + expectedOffset
+ ".");