4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <body style=
"direction:rtl">
9 <P style=
"direction:ltr; text-align:right">Test rendering of
3 text runs -- TextRun1 TextRun2 TextRun3,
10 in which TextRun1 and TextRun2's bidi level are
2, and TextRun3's bidi level is
1.
11 TextRun2 and TextRun3 are siblings. But their ancestor (not their parent) is a sibling of TextRun1.
12 The visual order should be TextRun3 TextRun1 TextRun2, not TextRun3 TextRun2 TextRun1.
15 <P style=
"direction:ltr; text-align:right">Pure text. The following
3 lines should all display as
"שנב This is a Test"
16 <div contentEditable=
"true" style=
"background:red;">This is a
<span><span>Test
<span>שנב
</span></span></span></div>
17 <div contentEditable=
"true" style=
"background:red;">This is a
<span><span><span>Test
<span>שנב
</span></span></span></span></div>
18 <div>This is a
<span>Test
<span>שנב
</span></span></div>
21 <P style=
"direction:ltr; text-align:right">Text in
<em
>. The English text should be displayed as
"This is a Test".
22 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><em><span></span>Test
<span></span></em></span></div>
23 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><em>Test
<span></span></em></span></div>
24 <div contenteditable
style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><em>Test
<span contenteditable
>דמה
</span></em></span></div>
25 <div>This is a
<span style=
"text-decoration: underline;"><em><span></span>Test
</em></span></div>
26 <div>This is a
<span style=
"text-decoration: underline;"><em>Test
</em></span></div>
29 <P style=
"direction:ltr; text-align:right">Text in
<strong
>. The following lines should all display as
"This is a Test".
30 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><strong><span></span>Test
<span></span></strong></span></div>
31 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><strong>Test
<span></span></strong></span></div>
32 <div>This is a
<span style=
"text-decoration: underline;"><strong><span></span>Test
</strong></span></div>
33 <div>This is a
<span style=
"text-decoration: underline;"><strong>Test
</strong></span></div>
36 <P style=
"direction:ltr; text-align:right">Text in
<i
>. The following lines should all display as
"This is a Test".
37 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><i><span></span>Test
<span></span></i></span></div>
38 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><i>Test
<span></span></i></span></div>
39 <div>This is a
<span style=
"text-decoration: underline;"><i><span></span>Test
</i></span></div>
40 <div>This is a
<span style=
"text-decoration: underline;"><i>Test
</i></span></div>
43 <P style=
"direction:ltr; text-align:right">Text in
<b
>. The following lines should all display as
"This is a Test".
44 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><b><span></span>Test
<span></span></b></span></div>
45 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><b>Test
<span></span></b></span></div>
46 <div>This is a
<span style=
"text-decoration: underline;"><b><span></span>Test
</b></span></div>
47 <div>This is a
<span style=
"text-decoration: underline;"><b>Test
</strong></span></div>
50 <P style=
"direction:ltr; text-align:right">Text in
<img
>,
<href
>,
<em
>,
<tr
>. The following English text should all display as
"This is a Test".
51 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><a href
>Test
<span><img src= d:/tmp/p1.png
/></span></a></span></div>
52 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><a href
>Test
<span>שנב
</span></a></span></div>
53 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><em>Test
<a href
></a></em></span></div>
54 <div contentEditable=
"true" style=
"background:red;">This is a
<span style=
"text-decoration: underline;"><em>Test
<span><img src= d:/tmp/p1.png
/></span></em></span></div>
55 <div>This is a
<span style=
"text-decoration: underline;"><a href
>Test
<span>again
</span></a></span></div>
56 <div>This is a
<span style=
"text-decoration: underline;"><em>Test
<table><tr><td>a
</td></tr></td></tr></table></em></span></div>
58 <ul id=
"console" dir=ltr
></ul>
63 internals
.settings
.setEditingBehavior("mac");
67 var li
= document
.createElement("li");
68 li
.appendChild(document
.createTextNode(str
));
69 var console
= document
.getElementById("console");
70 console
.appendChild(li
);
73 function assertEqual(message
, actual
, expected
)
75 if (actual
!= expected
)
76 log("\n" + message
+ ": Failure, actual: " + actual
+ "; expected: " + expected
);
78 log("\n" + message
+ ": Success");
81 var tests
= document
.getElementsByTagName('div');
82 var sel
= getSelection();
83 for (var i
= 0; i
< tests
.length
; ++i
) {
84 sel
.collapse(tests
[i
],0);
85 sel
.modify("move", "backward", "lineboundary");
86 sel
.modify("extend", "forward", "word");
87 assertEqual("Test " + i
+ ": ", sel
.toString(), "This");