tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / editing / selection / css-pseudo-element.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <style type="text/css"> /* pertinent to test cases */
6  .quote:before { content: "\""; }
7  .quote:after { content: "\""; }
8  
9  .bidi:before { content: "aפb"; }
10  .bidi:after { content: "aפb"; }
11 </style>
12 <script src="../../fast/js/resources/js-test-pre.js"></script>
13 <title></title>
14 </head>
15 <body>
16 <p>To manually test select text below by mouse and use right arrow key to navigate across the quotes. The caret should move to the right of quote.</p>
17
18 <div contenteditable="true" id="ltr">
19 preceding text
20 <span class="quote">content</span>
21 following text
22 </div>
23
24 <div contenteditable="true" id="rtl">
25 &#1575;&#1585;&#1583;&#1608; &#1608;&#1681;
26 <span class="quote">&#1662;&#1585;&#1608;&#1587;&#1740;&#1587;&#1585;&#1587; &#1662;&#1585;</span>
27 &#1578;&#1576;&#1589;&#1585;
28 </div>
29
30 <div contenteditable="true" id="ltr-bidi">
31 preceding text
32 <span class="bidi">content</span>
33 following text
34 </div>
35
36 <div contenteditable="true" id="rtl-bidi">
37 &#1575;&#1585;&#1583;&#1608; &#1608;&#1681;
38 <span class="bidi">&#1662;&#1585;&#1608;&#1587;&#1740;&#1587;&#1585;&#1587; &#1662;&#1585;</span>
39 &#1578;&#1576;&#1589;&#1585;
40 </div>
41 <div id="console"></div>
42 <script>
43
44 var edit = document.getElementById('ltr');
45 edit.focus();
46 window.getSelection().setPosition(edit, 1);
47 window.getSelection().modify('move', 'right', 'character');
48 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
49 window.getSelection().modify('move', 'left', 'character');
50 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 16);
51
52 window.getSelection().setPosition(edit, 2);
53 window.getSelection().modify('move', 'right', 'character');
54 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
55 window.getSelection().modify('move', 'left', 'character');
56 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 7);
57
58 var edit = document.getElementById('rtl');
59 edit.focus();
60 window.getSelection().setPosition(edit, 1);
61 window.getSelection().modify('move', 'left', 'character');
62 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
63 window.getSelection().modify('move', 'right', 'character');
64 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9);
65 window.getSelection().modify('move', 'right', 'character');
66 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 8);
67 window.getSelection().modify('move', 'left', 'character');
68 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9);
69
70 window.getSelection().setPosition(edit, 2);
71 window.getSelection().modify('move', 'left', 'character');
72 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
73 window.getSelection().modify('move', 'right', 'character');
74 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11);
75 window.getSelection().modify('move', 'right', 'character');
76 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 10);
77 window.getSelection().modify('move', 'left', 'character');
78 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11);
79
80 var edit = document.getElementById('ltr-bidi');
81 edit.focus();
82 window.getSelection().setPosition(edit, 1);
83 window.getSelection().modify('move', 'right', 'character');
84 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
85 window.getSelection().modify('move', 'left', 'character');
86 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 16);
87
88 window.getSelection().setPosition(edit, 2);
89 window.getSelection().modify('move', 'right', 'character');
90 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
91 window.getSelection().modify('move', 'left', 'character');
92 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 7);
93
94 var edit = document.getElementById('rtl-bidi');
95 edit.focus();
96 window.getSelection().setPosition(edit, 1);
97 window.getSelection().modify('move', 'right', 'character');
98 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 10);
99 window.getSelection().modify('move', 'left', 'character');
100 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9);
101 window.getSelection().modify('move', 'left', 'character');
102 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 8);
103 window.getSelection().modify('move', 'right', 'character');
104 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9);
105
106 window.getSelection().setPosition(edit, 2);
107 window.getSelection().modify('move', 'right', 'character');
108 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
109 window.getSelection().modify('move', 'left', 'character');
110 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11);
111 window.getSelection().modify('move', 'left', 'character');
112 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1);
113 window.getSelection().modify('move', 'right', 'character');
114 shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11);
115
116
117 </script>
118 <script src="../../fast/js/resources/js-test-post.js"></script>
119 </body>
120 </html>