1 <html xmlns=
"http://www.w3.org/1999/xhtml">
2 <body style=
"margin: 0px; ">
3 <div style=
"width: 400px; height: 100px;">
4 <svg xmlns=
"http://www.w3.org/2000/svg">
5 <text x=
"20" y=
"30"><tspan>Sheriff Woody
</tspan></text>
6 <text x=
"20" y=
"50"><tspan>שדגש
</tspan></text>
11 function log(message
) {
12 document
.getElementById("log").innerText
= document
.getElementById("log").innerText
+ "\n" + message
;
14 function assert(found
, expected
) {
15 if (found
== expected
)
18 log("Failure. Was: " + found
+ ", expected: " + expected
);
20 if (window
.testRunner
) {
21 window
.testRunner
.dumpAsText();
22 // First offset, left edge, LTR text
23 assert(textInputController
.firstRectForCharacterRange(0, 0), "20,566,0,18");
24 // Last offset, right edge, RTL text
25 assert(textInputController
.firstRectForCharacterRange(13, 0), "114,566,0,18");
27 // FIXME: These edges are incorrect (although carets in the middle of RTL runs are correct).
28 // First offset, right edge, RTL text
29 assert(textInputController
.firstRectForCharacterRange(14, 0), "58,546,0,18");
30 // Last offset, left edge, RTL text
31 assert(textInputController
.firstRectForCharacterRange(18, 0), "20,546,0,18");