1 <div id=
"test-1" style=
"width: 200px; outline: dashed lightblue;">
2 <div style=
"height: 10px; background-color: silver;"></div>
3 <div style=
"width: 200px; height: 10px; background-color: silver; -webkit-writing-mode: vertical-lr;"></div>
4 <div class=
"target" style=
"margin-top: 40px; height: 20px; background-color: silver;"></div>
7 <div id=
"test-2" style=
"height: 200px; outline: dashed lightblue; -webkit-writing-mode: vertical-lr;">
8 <div style=
"width: 10px; background-color: silver;"></div>
9 <div class=
"target" style=
"margin-left: 40px; width: 10px; background-color: silver;"></div>
10 <div style=
"width: 20px; background-color: silver;"></div>
13 <pre id=
"console"></pre>
16 if (window
.testRunner
)
17 testRunner
.dumpAsText();
21 document
.getElementById("console").appendChild(document
.createTextNode(message
+ "\n"));
24 function test(index
, x
, y
)
26 var container
= document
.getElementById("test-" + index
);
27 var range
= document
.caretRangeFromPoint(container
.offsetLeft
+ x
, container
.offsetTop
+ y
);
28 log("Test " + index
+ " result: "
29 + (range
.startContainer
.className
=== "target" ? "PASS" : "FAIL"));