4 <meta http-equiv=
"Content-Type" content=
"text/html;charset=utf-8" >
8 var li
= document
.createElement("li");
9 li
.appendChild(document
.createTextNode(str
));
10 var console
= document
.getElementById("console");
11 console
.appendChild(li
);
16 var div
= document
.getElementById("div");
17 var pre
= document
.getElementById("pre");
18 var rightOfClientBox
= div
.clientWidth
+ div
.offsetLeft
- 20; // 20 for right padding in 'div' and 'pre'.
19 if (window
.textInputController
) {
20 var caretRect
= textInputController
.firstRectForCharacterRange(0, 0);
21 var xOfRightmostCharacter
= caretRect
[0];
22 if (xOfRightmostCharacter
> rightOfClientBox
)
23 log("FAILED: rightmost character (at " + xOfRightmostCharacter
+ ") is beyond the right edge (" + rightOfClientBox
+ ") of client box");
26 caretRect
= textInputController
.firstRectForCharacterRange(1, 0);
27 if (caretRect
[0] >= xOfRightmostCharacter
)
28 log("FAILED: second rightmost character (at " + caretRect
[0] + ") is on or beyond the right edge (" + rightOfClientBox
+ ") of client box");
32 if (window
.testRunner
)
33 div
.style
.display
= "none";
36 if (window
.testRunner
)
37 testRunner
.dumpAsText();
42 <div contenteditable
id=
"div" dir=
"rtl" style=
"padding-right: 10px; border-width: 10px; width: 40ex;border: solid 1px;"><pre style=
"padding-right: 10px; border-width: 10px" id=
"pre">פורסם:
24.04.09,
21:
14</pre></div>
43 <ul id=
"console"></ul>