| Differences between
and this patch
- a/LayoutTests/ChangeLog +19 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2009-06-17  Jeremy Moskovich  <jeremy@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        IE resets directionality on a hard line break if it was set by
6
        a Unicode control character.
7
8
        However, if directionality is set via CSS, a hard line break does
9
        not reset directionality.  This change makes WebKit conform to the
10
        latter behavior.
11
12
        https://bugs.webkit.org/show_bug.cgi?id=23124
13
14
        * fast/css/bidi-directional-reset-complex.html: Added.
15
        * fast/css/bidi-directional-reset.html: Added.
16
        * fast/text/international/bidi-layout-across-linebreak.txt: Added.
17
        * platform/mac/fast/css/bidi-directional-reset-complex-expected.txt: Added.
18
        * platform/mac/fast/css/bidi-directional-reset-expected.txt: Added.
19
1
2009-02-03  Eric Seidel  <eric@webkit.org>
20
2009-02-03  Eric Seidel  <eric@webkit.org>
2
21
3
        Reviewed by Justin Garcia.
22
        Reviewed by Justin Garcia.
- a/LayoutTests/fast/css/bidi-directional-reset-complex.html +23 lines
Line 0 a/LayoutTests/fast/css/bidi-directional-reset-complex.html_sec1
1
Test to verify that directionality is reset in the correct cases.
2
Directionality set by a Unicode control character should be reset when a hard linebreak is encountered.
3
If the current directionality was set by css a hard line break should have no effect.<br><br>
4
5
The left/right position of the '.'s in relation to the letters on each line should
6
match IE's rendering of the page.
7
8
<div>
9
&#x202e;
10
&#x05d0;.<br>&#x05D0;.<br>
11
<span dir="rtl">&#x05d0;.<br>&#x05d0;.</span><br>
12
&#x05d0;.<br>&#x05D0;.
13
&#x202c;
14
</div>
15
16
<hr>
17
<div>
18
&#x202e;
19
&#x05d0;.<br>&#x05D0;.<br>
20
<span dir="ltr">&#x05d0;.<br>&#x05d0;.</span><br>
21
&#x05d0;.<br>&#x05D0;.
22
&#x202c;
23
</div>
- a/LayoutTests/fast/css/bidi-directional-reset.html +19 lines
Line 0 a/LayoutTests/fast/css/bidi-directional-reset.html_sec1
1
Test to verify that directionality is reset in the correct cases.  Directionality set by a Unicode control character should be reset when a hard linebreak is encountered .  If the current directionality was set by css a hard line break should have no effect.
2
3
<h2>The following 2 examples should have all periods on the left:</h2>
4
dir=rtl specified in CSS:<br>
5
<span dir="rtl">&#x05d0;.<br>&#x05d0;.</span>
6
7
<hr>
8
dir=rtl wrapping unicode rlo (rlo has no effect):<br>
9
<span dir=rtl>&#x202e; &#x05d0;.<br>&#x05D0;. &#x202c;</span>
10
11
<h2>The following 2 examples should have the first periods on the left and the second on the right:</h2>
12
13
<hr>
14
Unicode bidi override:<br>
15
<span>&#x202e; &#x05d0;.<br>&#x05D0;. &#x202c;</span>
16
17
<hr>
18
dir=ltr wrapping Unicode rlo (rlo changes directionality set by css):<br><br>
19
<span dir=ltr>&#x202e; &#x05d0;.<br>&#x05D0;. &#x202c;</span><br><br>
- a/LayoutTests/fast/text/international/bidi-layout-across-linebreak.txt +247 lines
Line 0 a/LayoutTests/fast/text/international/bidi-layout-across-linebreak.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x492
4
  RenderBlock {HTML} at (0,0) size 800x492
5
    RenderBody {BODY} at (8,16) size 784x468
6
      RenderBlock {P} at (0,0) size 784x18
7
        RenderText {#text} at (0,0) size 571x18
8
          text run at (0,0) width 571: "The T column should match the R column. The H columns uses <br/> to force line breaks."
9
      RenderTable {TABLE} at (0,34) size 175x434 [border: none]
10
        RenderTableSection {TBODY} at (0,0) size 174x433
11
          RenderTableRow {TR} at (0,0) size 174x23
12
            RenderTableCell {TD} at (0,9) size 51x4 [r=0 c=0 rs=1 cs=1]
13
            RenderTableCell {TD} at (51,0) size 45x23 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
14
              RenderText {#text} at (3,3) size 12x18
15
                text run at (3,3) width 12: "H"
16
            RenderTableCell {TD} at (96,0) size 33x23 [border: (1px solid #008000)] [r=0 c=2 rs=1 cs=1]
17
              RenderText {#text} at (3,3) size 11x18
18
                text run at (3,3) width 11: "T"
19
            RenderTableCell {TD} at (129,0) size 45x23 [border: (1px solid #008000)] [r=0 c=3 rs=1 cs=1]
20
              RenderText {#text} at (3,3) size 11x18
21
                text run at (3,3) width 11: "R"
22
          RenderTableRow {TR} at (0,23) size 174x41
23
            RenderTableCell {TD} at (0,32) size 51x23 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
24
              RenderText {#text} at (3,3) size 11x18
25
                text run at (3,3) width 11: "1"
26
            RenderTableCell {TD} at (51,23) size 45x41 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
27
              RenderText {#text} at (3,3) size 17x18
28
                text run at (3,3) width 11 RTL: "\x{5D0}"
29
                text run at (14,3) width 6: "."
30
              RenderBR {BR} at (20,18) size 0x0
31
              RenderText {#text} at (3,21) size 11x18
32
                text run at (3,21) width 11: "b"
33
            RenderTableCell {TD} at (96,23) size 33x41 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
34
              RenderText {#text} at (3,3) size 17x36
35
                text run at (3,3) width 11 RTL: "\x{5D0}"
36
                text run at (14,3) width 6: "."
37
                text run at (3,21) width 11: "b"
38
            RenderTableCell {TD} at (129,23) size 45x41 [border: (1px solid #008000)] [r=1 c=3 rs=1 cs=1]
39
              RenderBlock {P} at (3,3) size 40x18
40
                RenderText {#text} at (0,0) size 16x18
41
                  text run at (0,0) width 16 LTR override: "\x{5D0}."
42
              RenderBlock {P} at (3,21) size 40x18
43
                RenderText {#text} at (0,0) size 11x18
44
                  text run at (0,0) width 11 LTR override: "b"
45
          RenderTableRow {TR} at (0,64) size 174x41
46
            RenderTableCell {TD} at (0,73) size 51x23 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
47
              RenderText {#text} at (3,3) size 11x18
48
                text run at (3,3) width 11: "2"
49
            RenderTableCell {TD} at (51,64) size 45x41 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
50
              RenderText {#text} at (3,3) size 17x18
51
                text run at (3,3) width 11 RTL: "\x{5D0}"
52
                text run at (14,3) width 6: "."
53
              RenderBR {BR} at (20,18) size 0x0
54
              RenderText {#text} at (3,21) size 10x18
55
                text run at (3,21) width 10 RTL: "\x{5D1}"
56
            RenderTableCell {TD} at (96,64) size 33x41 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
57
              RenderText {#text} at (3,3) size 16x36
58
                text run at (3,3) width 16 RTL: "\x{5D0}."
59
                text run at (3,21) width 10 RTL: "\x{5D1}"
60
            RenderTableCell {TD} at (129,64) size 45x41 [border: (1px solid #008000)] [r=2 c=3 rs=1 cs=1]
61
              RenderBlock {P} at (3,3) size 40x18
62
                RenderText {#text} at (0,0) size 16x18
63
                  text run at (0,0) width 16 LTR override: ".\x{5D0}"
64
              RenderBlock {P} at (3,21) size 40x18
65
                RenderText {#text} at (0,0) size 10x18
66
                  text run at (0,0) width 10 LTR override: "\x{5D1}"
67
          RenderTableRow {TR} at (0,105) size 174x41
68
            RenderTableCell {TD} at (0,114) size 51x23 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
69
              RenderText {#text} at (3,3) size 11x18
70
                text run at (3,3) width 11: "3"
71
            RenderTableCell {TD} at (51,105) size 45x41 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
72
              RenderText {#text} at (3,3) size 21x18
73
                text run at (3,3) width 21 RTL: "\x{5D0}\x{5D0}"
74
              RenderBR {BR} at (3,18) size 0x0
75
              RenderText {#text} at (3,21) size 27x18
76
                text run at (3,21) width 11: "b"
77
                text run at (14,21) width 5 RTL: " "
78
                text run at (19,21) width 11: "1"
79
            RenderTableCell {TD} at (96,105) size 33x41 [border: (1px solid #008000)] [r=3 c=2 rs=1 cs=1]
80
              RenderText {#text} at (3,3) size 27x36
81
                text run at (3,3) width 21 RTL: "\x{5D0}\x{5D0}"
82
                text run at (3,21) width 11: "b"
83
                text run at (14,21) width 5 RTL: " "
84
                text run at (19,21) width 11: "1"
85
            RenderTableCell {TD} at (129,105) size 45x41 [border: (1px solid #008000)] [r=3 c=3 rs=1 cs=1]
86
              RenderBlock {P} at (3,3) size 40x18
87
                RenderText {#text} at (0,0) size 21x18
88
                  text run at (0,0) width 21 LTR override: "\x{5D0}\x{5D0}"
89
              RenderBlock {P} at (3,21) size 40x18
90
                RenderText {#text} at (0,0) size 27x18
91
                  text run at (0,0) width 27 LTR override: "b 1"
92
          RenderTableRow {TR} at (0,146) size 174x41
93
            RenderTableCell {TD} at (0,155) size 51x23 [border: (1px solid #008000)] [r=4 c=0 rs=1 cs=1]
94
              RenderText {#text} at (3,3) size 11x18
95
                text run at (3,3) width 11: "4"
96
            RenderTableCell {TD} at (51,146) size 45x41 [border: (1px solid #008000)] [r=4 c=1 rs=1 cs=1]
97
              RenderText {#text} at (3,3) size 18x18
98
                text run at (3,3) width 18: "aa"
99
              RenderBR {BR} at (3,18) size 0x0
100
              RenderText {#text} at (3,21) size 27x18
101
                text run at (3,21) width 27: "1 b"
102
            RenderTableCell {TD} at (96,146) size 33x41 [border: (1px solid #008000)] [r=4 c=2 rs=1 cs=1]
103
              RenderText {#text} at (3,3) size 27x36
104
                text run at (3,3) width 18: "aa"
105
                text run at (3,21) width 27: "1 b"
106
            RenderTableCell {TD} at (129,146) size 45x41 [border: (1px solid #008000)] [r=4 c=3 rs=1 cs=1]
107
              RenderBlock {P} at (3,3) size 40x18
108
                RenderText {#text} at (0,0) size 18x18
109
                  text run at (0,0) width 18 LTR override: "aa"
110
              RenderBlock {P} at (3,21) size 40x18
111
                RenderText {#text} at (0,0) size 27x18
112
                  text run at (0,0) width 27 LTR override: "1 b"
113
          RenderTableRow {TR} at (0,187) size 174x41
114
            RenderTableCell {TD} at (0,196) size 51x23 [border: (1px solid #008000)] [r=5 c=0 rs=1 cs=1]
115
              RenderText {#text} at (3,3) size 11x18
116
                text run at (3,3) width 11: "5"
117
            RenderTableCell {TD} at (51,187) size 45x41 [border: (1px solid #008000)] [r=5 c=1 rs=1 cs=1]
118
              RenderText {#text} at (3,3) size 21x18
119
                text run at (3,3) width 21 RTL: "\x{5D0}\x{5D0}"
120
              RenderBR {BR} at (3,18) size 0x0
121
              RenderText {#text} at (3,21) size 26x18
122
                text run at (3,21) width 15 RTL: " \x{5D1}"
123
                text run at (18,21) width 11: "1"
124
            RenderTableCell {TD} at (96,187) size 33x41 [border: (1px solid #008000)] [r=5 c=2 rs=1 cs=1]
125
              RenderText {#text} at (3,3) size 26x36
126
                text run at (3,3) width 21 RTL: "\x{5D0}\x{5D0}"
127
                text run at (3,21) width 15 RTL: " \x{5D1}"
128
                text run at (18,21) width 11: "1"
129
            RenderTableCell {TD} at (129,187) size 45x41 [border: (1px solid #008000)] [r=5 c=3 rs=1 cs=1]
130
              RenderBlock {P} at (3,3) size 40x18
131
                RenderText {#text} at (0,0) size 21x18
132
                  text run at (0,0) width 21 LTR override: "\x{5D0}\x{5D0}"
133
              RenderBlock {P} at (3,21) size 40x18
134
                RenderText {#text} at (0,0) size 26x18
135
                  text run at (0,0) width 26 LTR override: "\x{5D1} 1"
136
          RenderTableRow {TR} at (0,228) size 174x41
137
            RenderTableCell {TD} at (0,237) size 51x23 [border: (1px solid #008000)] [r=6 c=0 rs=1 cs=1]
138
              RenderText {#text} at (3,3) size 11x18
139
                text run at (3,3) width 11: "6"
140
            RenderTableCell {TD} at (51,228) size 45x41 [border: (1px solid #008000)] [r=6 c=1 rs=1 cs=1]
141
              RenderText {#text} at (3,3) size 18x18
142
                text run at (3,3) width 18: "aa"
143
              RenderBR {BR} at (3,18) size 0x0
144
              RenderText {#text} at (3,21) size 26x18
145
                text run at (3,21) width 15 RTL: " \x{5D1}"
146
                text run at (18,21) width 11: "1"
147
            RenderTableCell {TD} at (96,228) size 33x41 [border: (1px solid #008000)] [r=6 c=2 rs=1 cs=1]
148
              RenderText {#text} at (3,3) size 26x36
149
                text run at (3,3) width 18: "aa"
150
                text run at (3,21) width 15 RTL: " \x{5D1}"
151
                text run at (18,21) width 11: "1"
152
            RenderTableCell {TD} at (129,228) size 45x41 [border: (1px solid #008000)] [r=6 c=3 rs=1 cs=1]
153
              RenderBlock {P} at (3,3) size 40x18
154
                RenderText {#text} at (0,0) size 18x18
155
                  text run at (0,0) width 18 LTR override: "aa"
156
              RenderBlock {P} at (3,21) size 40x18
157
                RenderText {#text} at (0,0) size 26x18
158
                  text run at (0,0) width 26 LTR override: "\x{5D1} 1"
159
          RenderTableRow {TR} at (0,269) size 174x41
160
            RenderTableCell {TD} at (0,278) size 51x23 [border: (1px solid #008000)] [r=7 c=0 rs=1 cs=1]
161
              RenderText {#text} at (3,3) size 11x18
162
                text run at (3,3) width 11: "7"
163
            RenderTableCell {TD} at (51,269) size 45x41 [border: (1px solid #008000)] [r=7 c=1 rs=1 cs=1]
164
              RenderText {#text} at (3,3) size 20x18
165
                text run at (3,3) width 20: "a ("
166
              RenderBR {BR} at (23,18) size 0x0
167
              RenderText {#text} at (3,21) size 22x18
168
                text run at (3,21) width 22: "] b"
169
            RenderTableCell {TD} at (96,269) size 33x41 [border: (1px solid #008000)] [r=7 c=2 rs=1 cs=1]
170
              RenderText {#text} at (3,3) size 22x36
171
                text run at (3,3) width 20: "a ("
172
                text run at (3,21) width 22: "] b"
173
            RenderTableCell {TD} at (129,269) size 45x41 [border: (1px solid #008000)] [r=7 c=3 rs=1 cs=1]
174
              RenderBlock {P} at (3,3) size 40x18
175
                RenderText {#text} at (0,0) size 20x18
176
                  text run at (0,0) width 20 LTR override: "a ("
177
              RenderBlock {P} at (3,21) size 40x18
178
                RenderText {#text} at (0,0) size 22x18
179
                  text run at (0,0) width 22 LTR override: "] b"
180
          RenderTableRow {TR} at (0,310) size 174x41
181
            RenderTableCell {TD} at (0,319) size 51x23 [border: (1px solid #008000)] [r=8 c=0 rs=1 cs=1]
182
              RenderText {#text} at (3,3) size 11x18
183
                text run at (3,3) width 11: "8"
184
            RenderTableCell {TD} at (51,310) size 45x41 [border: (1px solid #008000)] [r=8 c=1 rs=1 cs=1]
185
              RenderText {#text} at (3,3) size 22x18
186
                text run at (3,3) width 11 RTL: "\x{5D0}"
187
                text run at (14,3) width 11: " ("
188
              RenderBR {BR} at (25,18) size 0x0
189
              RenderText {#text} at (3,21) size 22x18
190
                text run at (3,21) width 22: "] b"
191
            RenderTableCell {TD} at (96,310) size 33x41 [border: (1px solid #008000)] [r=8 c=2 rs=1 cs=1]
192
              RenderText {#text} at (3,3) size 22x36
193
                text run at (3,3) width 11 RTL: "\x{5D0}"
194
                text run at (14,3) width 11: " ("
195
                text run at (3,21) width 22: "] b"
196
            RenderTableCell {TD} at (129,310) size 45x41 [border: (1px solid #008000)] [r=8 c=3 rs=1 cs=1]
197
              RenderBlock {P} at (3,3) size 40x18
198
                RenderText {#text} at (0,0) size 22x18
199
                  text run at (0,0) width 22 LTR override: "\x{5D0} ("
200
              RenderBlock {P} at (3,21) size 40x18
201
                RenderText {#text} at (0,0) size 22x18
202
                  text run at (0,0) width 22 LTR override: "] b"
203
          RenderTableRow {TR} at (0,351) size 174x41
204
            RenderTableCell {TD} at (0,360) size 51x23 [border: (1px solid #008000)] [r=9 c=0 rs=1 cs=1]
205
              RenderText {#text} at (3,3) size 11x18
206
                text run at (3,3) width 11: "9"
207
            RenderTableCell {TD} at (51,351) size 45x41 [border: (1px solid #008000)] [r=9 c=1 rs=1 cs=1]
208
              RenderText {#text} at (3,3) size 20x18
209
                text run at (3,3) width 20: "a ("
210
              RenderBR {BR} at (23,18) size 0x0
211
              RenderText {#text} at (3,21) size 21x18
212
                text run at (3,21) width 11: "] "
213
                text run at (14,21) width 10 RTL: "\x{5D1}"
214
            RenderTableCell {TD} at (96,351) size 33x41 [border: (1px solid #008000)] [r=9 c=2 rs=1 cs=1]
215
              RenderText {#text} at (3,3) size 21x36
216
                text run at (3,3) width 20: "a ("
217
                text run at (3,21) width 11: "] "
218
                text run at (14,21) width 10 RTL: "\x{5D1}"
219
            RenderTableCell {TD} at (129,351) size 45x41 [border: (1px solid #008000)] [r=9 c=3 rs=1 cs=1]
220
              RenderBlock {P} at (3,3) size 40x18
221
                RenderText {#text} at (0,0) size 20x18
222
                  text run at (0,0) width 20 LTR override: "a ("
223
              RenderBlock {P} at (3,21) size 40x18
224
                RenderText {#text} at (0,0) size 21x18
225
                  text run at (0,0) width 21 LTR override: "] \x{5D1}"
226
          RenderTableRow {TR} at (0,392) size 174x41
227
            RenderTableCell {TD} at (0,401) size 51x23 [border: (1px solid #008000)] [r=10 c=0 rs=1 cs=1]
228
              RenderText {#text} at (3,3) size 21x18
229
                text run at (3,3) width 21: "10"
230
            RenderTableCell {TD} at (51,392) size 45x41 [border: (1px solid #008000)] [r=10 c=1 rs=1 cs=1]
231
              RenderText {#text} at (3,3) size 22x18
232
                text run at (3,3) width 11 RTL: "\x{5D0}"
233
                text run at (14,3) width 11: " ("
234
              RenderBR {BR} at (25,18) size 0x0
235
              RenderText {#text} at (3,21) size 21x18
236
                text run at (3,21) width 21 RTL: "] \x{5D1}"
237
            RenderTableCell {TD} at (96,392) size 33x41 [border: (1px solid #008000)] [r=10 c=2 rs=1 cs=1]
238
              RenderText {#text} at (3,3) size 22x36
239
                text run at (3,3) width 22 RTL: "\x{5D0} ("
240
                text run at (3,21) width 21 RTL: "] \x{5D1}"
241
            RenderTableCell {TD} at (129,392) size 45x41 [border: (1px solid #008000)] [r=10 c=3 rs=1 cs=1]
242
              RenderBlock {P} at (3,3) size 40x18
243
                RenderText {#text} at (0,0) size 22x18
244
                  text run at (0,0) width 22 LTR override: ") \x{5D0}"
245
              RenderBlock {P} at (3,21) size 40x18
246
                RenderText {#text} at (0,0) size 21x18
247
                  text run at (0,0) width 21 LTR override: "\x{5D1} ["
- a/LayoutTests/platform/mac/fast/css/bidi-directional-reset-complex-expected.txt +59 lines
Line 0 a/LayoutTests/platform/mac/fast/css/bidi-directional-reset-complex-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x600
4
  RenderBlock {HTML} at (0,0) size 800x600
5
    RenderBody {BODY} at (8,8) size 784x584
6
      RenderBlock (anonymous) at (0,0) size 784x72
7
        RenderText {#text} at (0,0) size 778x36
8
          text run at (0,0) width 778: "Test to verify that directionality is reset in the correct cases. Directionality set by a Unicode control character should be reset"
9
          text run at (0,18) width 755: "when a hard linebreak is encountered. If the current directionality was set by css a hard line break should have no effect."
10
        RenderBR {BR} at (755,32) size 0x0
11
        RenderBR {BR} at (0,36) size 0x18
12
        RenderText {#text} at (0,54) size 681x18
13
          text run at (0,54) width 681: "The left/right position of the '.'s in relation to the letters on each line should match IE's rendering of the page."
14
      RenderBlock {DIV} at (0,72) size 784x114
15
        RenderText {#text} at (0,1) size 19x18
16
          text run at (0,1) width 19 RTL override: " \x{5D0}."
17
        RenderBR {BR} at (0,15) size 0x0
18
        RenderText {#text} at (0,20) size 15x18
19
          text run at (0,20) width 15 RTL: "\x{5D0}."
20
        RenderBR {BR} at (0,34) size 0x0
21
        RenderInline {SPAN} at (0,0) size 15x37
22
          RenderText {#text} at (0,39) size 15x18
23
            text run at (0,39) width 15 RTL: "\x{5D0}."
24
          RenderBR {BR} at (0,53) size 0x0
25
          RenderText {#text} at (0,58) size 15x18
26
            text run at (0,58) width 15 RTL: "\x{5D0}."
27
        RenderBR {BR} at (15,72) size 0x0
28
        RenderText {#text} at (0,77) size 15x18
29
          text run at (0,77) width 11 RTL: "\x{5D0}"
30
          text run at (11,77) width 4: "."
31
        RenderBR {BR} at (15,91) size 0x0
32
        RenderText {#text} at (0,96) size 19x18
33
          text run at (0,96) width 11 RTL: "\x{5D0}"
34
          text run at (11,96) width 8: ". \x{202C}"
35
      RenderBlock {HR} at (0,194) size 784x2 [border: (1px inset #000000)]
36
      RenderBlock {DIV} at (0,204) size 784x114
37
        RenderText {#text} at (0,1) size 19x18
38
          text run at (0,1) width 19 RTL override: " \x{5D0}."
39
        RenderBR {BR} at (0,15) size 0x0
40
        RenderText {#text} at (0,20) size 15x18
41
          text run at (0,20) width 11 RTL: "\x{5D0}"
42
          text run at (11,20) width 4: "."
43
        RenderBR {BR} at (15,34) size 0x0
44
        RenderInline {SPAN} at (0,0) size 15x37
45
          RenderText {#text} at (0,39) size 15x18
46
            text run at (0,39) width 11 RTL: "\x{5D0}"
47
            text run at (11,39) width 4: "."
48
          RenderBR {BR} at (15,53) size 0x0
49
          RenderText {#text} at (0,58) size 15x18
50
            text run at (0,58) width 11 RTL: "\x{5D0}"
51
            text run at (11,58) width 4: "."
52
        RenderBR {BR} at (15,72) size 0x0
53
        RenderText {#text} at (0,77) size 15x18
54
          text run at (0,77) width 11 RTL: "\x{5D0}"
55
          text run at (11,77) width 4: "."
56
        RenderBR {BR} at (15,91) size 0x0
57
        RenderText {#text} at (0,96) size 19x18
58
          text run at (0,96) width 11 RTL: "\x{5D0}"
59
          text run at (11,96) width 8: ". \x{202C}"
- a/LayoutTests/platform/mac/fast/css/bidi-directional-reset-expected.txt +69 lines
Line 0 a/LayoutTests/platform/mac/fast/css/bidi-directional-reset-expected.txt_sec1
1
layer at (0,0) size 800x600
2
  RenderView at (0,0) size 800x600
3
layer at (0,0) size 800x600
4
  RenderBlock {HTML} at (0,0) size 800x600
5
    RenderBody {BODY} at (8,8) size 784x584
6
      RenderBlock (anonymous) at (0,0) size 784x36
7
        RenderText {#text} at (0,0) size 778x36
8
          text run at (0,0) width 375: "Test to verify that directionality is reset in the correct cases. "
9
          text run at (375,0) width 403: "Directionality set by a Unicode control character should be reset"
10
          text run at (0,18) width 247: "when a hard linebreak is encountered . "
11
          text run at (247,18) width 512: "If the current directionality was set by css a hard line break should have no effect."
12
      RenderBlock {H2} at (0,55) size 784x28
13
        RenderText {#text} at (0,0) size 618x28
14
          text run at (0,0) width 618: "The following 2 examples should have all periods on the left:"
15
      RenderBlock (anonymous) at (0,102) size 784x56
16
        RenderText {#text} at (0,0) size 152x18
17
          text run at (0,0) width 152: "dir=rtl specified in CSS:"
18
        RenderBR {BR} at (152,14) size 0x0
19
        RenderInline {SPAN} at (0,0) size 15x37
20
          RenderText {#text} at (0,19) size 15x18
21
            text run at (0,19) width 15 RTL: "\x{5D0}."
22
          RenderBR {BR} at (0,33) size 0x0
23
          RenderText {#text} at (0,38) size 15x18
24
            text run at (0,38) width 15 RTL: "\x{5D0}."
25
        RenderText {#text} at (0,0) size 0x0
26
      RenderBlock {HR} at (0,166) size 784x2 [border: (1px inset #000000)]
27
      RenderBlock (anonymous) at (0,176) size 784x56
28
        RenderText {#text} at (0,0) size 297x18
29
          text run at (0,0) width 297: "dir=rtl wrapping unicode rlo (rlo has no effect):"
30
        RenderBR {BR} at (297,14) size 0x0
31
        RenderInline {SPAN} at (0,0) size 19x37
32
          RenderText {#text} at (0,19) size 19x18
33
            text run at (0,19) width 19 RTL override: " \x{5D0}."
34
          RenderBR {BR} at (0,33) size 0x0
35
          RenderText {#text} at (0,38) size 19x18
36
            text run at (0,38) width 19 RTL override: "\x{5D0}. "
37
        RenderText {#text} at (0,0) size 0x0
38
      RenderBlock {H2} at (0,251) size 784x56
39
        RenderText {#text} at (0,0) size 747x56
40
          text run at (0,0) width 747: "The following 2 examples should have the first periods on the left and the"
41
          text run at (0,28) width 203: "second on the right:"
42
      RenderBlock {HR} at (0,326) size 784x2 [border: (1px inset #000000)]
43
      RenderBlock (anonymous) at (0,336) size 784x56
44
        RenderText {#text} at (0,0) size 142x18
45
          text run at (0,0) width 142: "Unicode bidi override:"
46
        RenderBR {BR} at (142,14) size 0x0
47
        RenderInline {SPAN} at (0,0) size 19x37
48
          RenderText {#text} at (0,19) size 19x18
49
            text run at (0,19) width 19 RTL override: " \x{5D0}."
50
          RenderBR {BR} at (0,33) size 0x0
51
          RenderText {#text} at (0,38) size 19x18
52
            text run at (0,38) width 11 RTL: "\x{5D0}"
53
            text run at (11,38) width 8: ". \x{202C}"
54
        RenderText {#text} at (0,0) size 0x0
55
      RenderBlock {HR} at (0,400) size 784x2 [border: (1px inset #000000)]
56
      RenderBlock (anonymous) at (0,410) size 784x92
57
        RenderText {#text} at (0,0) size 422x18
58
          text run at (0,0) width 422: "dir=ltr wrapping Unicode rlo (rlo changes directionality set by css):"
59
        RenderBR {BR} at (422,14) size 0x0
60
        RenderBR {BR} at (0,18) size 0x18
61
        RenderInline {SPAN} at (0,0) size 19x37
62
          RenderText {#text} at (0,37) size 19x18
63
            text run at (0,37) width 19 RTL override: " \x{5D0}."
64
          RenderBR {BR} at (0,51) size 0x0
65
          RenderText {#text} at (0,56) size 19x18
66
            text run at (0,56) width 11 RTL: "\x{5D0}"
67
            text run at (11,56) width 8: ". \x{202C}"
68
        RenderBR {BR} at (19,70) size 0x0
69
        RenderBR {BR} at (0,74) size 0x18
- a/WebCore/ChangeLog +21 lines
Lines 1-3 a/WebCore/ChangeLog_sec1
1
2009-06-17  Jeremy Moskovich  <jeremy@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        IE resets directionality on a hard line break if it was set by
6
        a Unicode control character.
7
8
        However, if directionality is set via CSS, a hard line break does
9
        not reset directionality.  This change makes WebKit conform to the
10
        latter behavior.
11
12
        https://bugs.webkit.org/show_bug.cgi?id=23124
13
14
        Tests: fast/css/bidi-directional-reset-complex.html
15
               fast/css/bidi-directional-reset.html
16
17
        * platform/text/BidiResolver.h:
18
        (WebCore::::createBidiRunsForLine): Keep track of the cause of a
19
        direction change and separate behavior in case of a Unicode control
20
        character.
21
1
2009-06-04  Brent Fulgham  <bfulgham@webkit.org>
22
2009-06-04  Brent Fulgham  <bfulgham@webkit.org>
2
23
3
        Unreviewed Windows build correction.
24
        Unreviewed Windows build correction.
- a/WebCore/platform/text/BidiResolver.h -2 / +16 lines
Lines 502-507 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, boo a/WebCore/platform/text/BidiResolver.h_sec1
502
    bool pastEnd = false;
502
    bool pastEnd = false;
503
    BidiResolver<Iterator, Run> stateAtEnd;
503
    BidiResolver<Iterator, Run> stateAtEnd;
504
504
505
    bool unicodeCharChangedDirection = false;
506
507
    // Loop through all characters in the run until we hit |end|, and split the
508
    // line into BiDi runs.
509
    // Debugging note: current.current() yields the current UChar being examined.
505
    while (true) {
510
    while (true) {
506
        Direction dirCurrent;
511
        Direction dirCurrent;
507
        if (pastEnd && (hardLineBreak || current.atEnd())) {
512
        if (pastEnd && (hardLineBreak || current.atEnd())) {
Lines 509-521 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, boo a/WebCore/platform/text/BidiResolver.h_sec2
509
            while (c->parent())
514
            while (c->parent())
510
                c = c->parent();
515
                c = c->parent();
511
            dirCurrent = c->dir();
516
            dirCurrent = c->dir();
512
            if (hardLineBreak) {
517
            if (unicodeCharChangedDirection && hardLineBreak) {
513
                // A deviation from the Unicode Bidi Algorithm in order to match
518
                // A deviation from the Unicode Bidi Algorithm in order to match
514
                // Mac OS X text and WinIE: a hard line break resets bidi state.
519
                // Mac OS X text and WinIE: a hard line break resets bidi state
520
                // in the case of directionality set as the result of a Unicode
521
                // control character.
515
                stateAtEnd.setContext(c);
522
                stateAtEnd.setContext(c);
516
                stateAtEnd.setEorDir(dirCurrent);
523
                stateAtEnd.setEorDir(dirCurrent);
517
                stateAtEnd.setLastDir(dirCurrent);
524
                stateAtEnd.setLastDir(dirCurrent);
518
                stateAtEnd.setLastStrongDir(dirCurrent);
525
                stateAtEnd.setLastStrongDir(dirCurrent);
526
527
                unicodeCharChangedDirection = false;
519
            }
528
            }
520
        } else {
529
        } else {
521
            dirCurrent = current.direction();
530
            dirCurrent = current.direction();
Lines 531-536 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, boo a/WebCore/platform/text/BidiResolver.h_sec3
531
        }
540
        }
532
541
533
        ASSERT(m_status.eor != OtherNeutral || eor.atEnd());
542
        ASSERT(m_status.eor != OtherNeutral || eor.atEnd());
543
544
        // Needed to keep track of whether a Unicode control character
545
        // was responsible for the context changing direction.
546
        Direction currentContextDirection = context()->dir();
534
        switch (dirCurrent) {
547
        switch (dirCurrent) {
535
548
536
        // embedding and overrides (X1-X9 in the Bidi specs)
549
        // embedding and overrides (X1-X9 in the Bidi specs)
Lines 541-546 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, boo a/WebCore/platform/text/BidiResolver.h_sec4
541
        case PopDirectionalFormat:
554
        case PopDirectionalFormat:
542
            embed(dirCurrent);
555
            embed(dirCurrent);
543
            commitExplicitEmbedding();
556
            commitExplicitEmbedding();
557
            unicodeCharChangedDirection =  context()->dir() != currentContextDirection;
544
            break;
558
            break;
545
559
546
            // strong types
560
            // strong types

Return to Bug 23124