Browse Source

Merge commit 1170303 from the Enterprise branch


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1171389 283d02a7-25f6-0310-bc7c-ecb5cbfe19
tpearson 8 years ago
parent
commit
d0abc1a165

+ 1
- 1
LAST_ENTERPRISE_SYNC View File

@@ -1 +1 @@
1
-Revision 1170137
1
+Revision 1170313

+ 7
- 0
khtml/css/cssparser.cpp View File

@@ -1076,6 +1076,13 @@ bool CSSParser::parseValue( int propId, bool important )
1076 1076
                                     CSS_PROP_LIST_STYLE_IMAGE };
1077 1077
         return parseShortHand(propId, properties, 3, important);
1078 1078
     }
1079
+    case CSS_PROP_WORD_WRAP:
1080
+    {
1081
+        // normal | break-word
1082
+        if ( id == CSS_VAL_NORMAL || id == CSS_VAL_BREAK_WORD )
1083
+            valid_primitive = true;
1084
+        break;
1085
+    }
1079 1086
     default:
1080 1087
 // #ifdef CSS_DEBUG
1081 1088
 //         kdDebug( 6080 ) << "illegal or CSS2 Aural property: " << val << endl;

+ 193
- 194
khtml/css/cssproperties.c View File

@@ -1,4 +1,4 @@
1
-/* ANSI-C code produced by gperf version 3.0.1 */
1
+/* ANSI-C code produced by gperf version 3.0.2 */
2 2
 /* Command-line: gperf -a -L ANSI-C -E -C -c -o -t -k '*' -NfindProp -Hhash_prop -Wwordlist_prop -D -s 2 cssproperties.gperf  */
3 3
 
4 4
 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
@@ -40,7 +40,7 @@ struct props {
40 40
 };
41 41
 
42 42
 static const struct props * findProp (register const char *str, register unsigned int len);
43
-/* maximum key range = 508, duplicates = 0 */
43
+/* maximum key range = 469, duplicates = 0 */
44 44
 
45 45
 #ifdef __GNUC__
46 46
 __inline
@@ -54,32 +54,32 @@ hash_prop (register const char *str, register unsigned int len)
54 54
 {
55 55
   static const unsigned short asso_values[] =
56 56
     {
57
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
58
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
59
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
60
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
61
-      511, 511, 511, 511, 511,   0, 511, 511, 511, 511,
62
-      511,   0, 511, 511, 511, 511, 511, 511, 511, 511,
63
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
64
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
65
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
66
-      511, 511, 511, 511, 511, 511, 511,  10,   0,   0,
67
-        5,   5, 160,   0,   0,   0, 511,  15,   5,   0,
68
-       25,   0,   0,  15,   0,  30,   0,  40,   5, 190,
69
-        5, 135, 120, 511, 511, 511, 511, 511, 511, 511,
70
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
71
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
72
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
73
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
74
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
75
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
76
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
77
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
78
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
79
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
80
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
81
-      511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
82
-      511, 511, 511, 511, 511, 511
57
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
58
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
59
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
60
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
61
+      472, 472, 472, 472, 472,   0, 472, 472, 472, 472,
62
+      472,   0, 472, 472, 472, 472, 472, 472, 472, 472,
63
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
64
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
65
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
66
+      472, 472, 472, 472, 472, 472, 472,  10,   0,   0,
67
+        5,   5, 120,   0,   0,   0, 472,  15,   5,   0,
68
+       25,   0,   0,  50,   0,  30,   0,  40,   0, 140,
69
+       35, 180,  80, 472, 472, 472, 472, 472, 472, 472,
70
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
71
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
72
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
73
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
74
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
75
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
76
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
77
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
78
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
79
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
80
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
81
+      472, 472, 472, 472, 472, 472, 472, 472, 472, 472,
82
+      472, 472, 472, 472, 472, 472
83 83
     };
84 84
   register int hval = len;
85 85
 
@@ -193,11 +193,11 @@ findProp (register const char *str, register unsigned int len)
193 193
 {
194 194
   enum
195 195
     {
196
-      TOTAL_KEYWORDS = 128,
196
+      TOTAL_KEYWORDS = 129,
197 197
       MIN_WORD_LENGTH = 3,
198 198
       MAX_WORD_LENGTH = 32,
199 199
       MIN_HASH_VALUE = 3,
200
-      MAX_HASH_VALUE = 510
200
+      MAX_HASH_VALUE = 471
201 201
     };
202 202
 
203 203
   static const struct props wordlist_prop[] =
@@ -214,20 +214,18 @@ findProp (register const char *str, register unsigned int len)
214 214
       {"color", CSS_PROP_COLOR},
215 215
 #line 58 "cssproperties.gperf"
216 216
       {"height", CSS_PROP_HEIGHT},
217
-#line 118 "cssproperties.gperf"
217
+#line 119 "cssproperties.gperf"
218 218
       {"border", CSS_PROP_BORDER},
219
-#line 121 "cssproperties.gperf"
220
-      {"border-top", CSS_PROP_BORDER_TOP},
221 219
 #line 122 "cssproperties.gperf"
222
-      {"border-right", CSS_PROP_BORDER_RIGHT},
220
+      {"border-top", CSS_PROP_BORDER_TOP},
223 221
 #line 123 "cssproperties.gperf"
222
+      {"border-right", CSS_PROP_BORDER_RIGHT},
223
+#line 124 "cssproperties.gperf"
224 224
       {"border-bottom", CSS_PROP_BORDER_BOTTOM},
225 225
 #line 42 "cssproperties.gperf"
226 226
       {"clear", CSS_PROP_CLEAR},
227
-#line 119 "cssproperties.gperf"
227
+#line 120 "cssproperties.gperf"
228 228
       {"border-color", CSS_PROP_BORDER_COLOR},
229
-#line 76 "cssproperties.gperf"
230
-      {"max-height", CSS_PROP_MAX_HEIGHT},
231 229
 #line 28 "cssproperties.gperf"
232 230
       {"border-top-color", CSS_PROP_BORDER_TOP_COLOR},
233 231
 #line 29 "cssproperties.gperf"
@@ -236,7 +234,7 @@ findProp (register const char *str, register unsigned int len)
236 234
       {"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR},
237 235
 #line 78 "cssproperties.gperf"
238 236
       {"min-height", CSS_PROP_MIN_HEIGHT},
239
-#line 129 "cssproperties.gperf"
237
+#line 130 "cssproperties.gperf"
240 238
       {"margin", CSS_PROP_MARGIN},
241 239
 #line 49 "cssproperties.gperf"
242 240
       {"direction", CSS_PROP_DIRECTION},
@@ -248,7 +246,7 @@ findProp (register const char *str, register unsigned int len)
248 246
       {"margin-bottom", CSS_PROP_MARGIN_BOTTOM},
249 247
 #line 61 "cssproperties.gperf"
250 248
       {"line-height", CSS_PROP_LINE_HEIGHT},
251
-#line 131 "cssproperties.gperf"
249
+#line 132 "cssproperties.gperf"
252 250
       {"padding", CSS_PROP_PADDING},
253 251
 #line 89 "cssproperties.gperf"
254 252
       {"padding-top", CSS_PROP_PADDING_TOP},
@@ -256,53 +254,53 @@ findProp (register const char *str, register unsigned int len)
256 254
       {"padding-right", CSS_PROP_PADDING_RIGHT},
257 255
 #line 91 "cssproperties.gperf"
258 256
       {"padding-bottom", CSS_PROP_PADDING_BOTTOM},
259
-#line 102 "cssproperties.gperf"
260
-      {"text-align", CSS_PROP_TEXT_ALIGN},
257
+#line 76 "cssproperties.gperf"
258
+      {"max-height", CSS_PROP_MAX_HEIGHT},
261 259
 #line 45 "cssproperties.gperf"
262 260
       {"content", CSS_PROP_CONTENT},
263 261
 #line 97 "cssproperties.gperf"
264 262
       {"position", CSS_PROP_POSITION},
265
-#line 103 "cssproperties.gperf"
266
-      {"text-decoration", CSS_PROP_TEXT_DECORATION},
267 263
 #line 80 "cssproperties.gperf"
268 264
       {"orphans", CSS_PROP_ORPHANS},
269
-#line 48 "cssproperties.gperf"
270
-      {"cursor", CSS_PROP_CURSOR},
271 265
 #line 110 "cssproperties.gperf"
272 266
       {"vertical-align", CSS_PROP_VERTICAL_ALIGN},
267
+#line 48 "cssproperties.gperf"
268
+      {"cursor", CSS_PROP_CURSOR},
273 269
 #line 24 "cssproperties.gperf"
274 270
       {"border-collapse", CSS_PROP_BORDER_COLLAPSE},
275
-#line 104 "cssproperties.gperf"
276
-      {"text-indent", CSS_PROP_TEXT_INDENT},
277
-#line 130 "cssproperties.gperf"
271
+#line 131 "cssproperties.gperf"
278 272
       {"outline", CSS_PROP_OUTLINE},
279
-#line 135 "cssproperties.gperf"
273
+#line 136 "cssproperties.gperf"
280 274
       {"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR},
281 275
 #line 41 "cssproperties.gperf"
282 276
       {"caption-side", CSS_PROP_CAPTION_SIDE},
283
-#line 136 "cssproperties.gperf"
277
+#line 137 "cssproperties.gperf"
284 278
       {"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR},
285 279
 #line 25 "cssproperties.gperf"
286 280
       {"border-spacing", CSS_PROP_BORDER_SPACING},
281
+#line 102 "cssproperties.gperf"
282
+      {"text-align", CSS_PROP_TEXT_ALIGN},
287 283
 #line 109 "cssproperties.gperf"
288 284
       {"unicode-bidi", CSS_PROP_UNICODE_BIDI},
289 285
 #line 82 "cssproperties.gperf"
290 286
       {"outline-color", CSS_PROP_OUTLINE_COLOR},
291 287
 #line 60 "cssproperties.gperf"
292 288
       {"letter-spacing", CSS_PROP_LETTER_SPACING},
293
-#line 98 "cssproperties.gperf"
294
-      {"quotes", CSS_PROP_QUOTES},
295
-#line 138 "cssproperties.gperf"
289
+#line 103 "cssproperties.gperf"
290
+      {"text-decoration", CSS_PROP_TEXT_DECORATION},
291
+#line 139 "cssproperties.gperf"
296 292
       {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR},
297
-#line 117 "cssproperties.gperf"
293
+#line 118 "cssproperties.gperf"
298 294
       {"background", CSS_PROP_BACKGROUND},
299
-#line 70 "cssproperties.gperf"
300
-      {"-khtml-marquee", CSS_PROP__KHTML_MARQUEE},
295
+#line 104 "cssproperties.gperf"
296
+      {"text-indent", CSS_PROP_TEXT_INDENT},
301 297
 #line 69 "cssproperties.gperf"
302 298
       {"-khtml-margin-start", CSS_PROP__KHTML_MARGIN_START},
303 299
 #line 14 "cssproperties.gperf"
304 300
       {"background-color", CSS_PROP_BACKGROUND_COLOR},
305
-#line 132 "cssproperties.gperf"
301
+#line 100 "cssproperties.gperf"
302
+      {"size", CSS_PROP_SIZE},
303
+#line 133 "cssproperties.gperf"
306 304
       {"scrollbar-base-color", CSS_PROP_SCROLLBAR_BASE_COLOR},
307 305
 #line 47 "cssproperties.gperf"
308 306
       {"counter-reset", CSS_PROP_COUNTER_RESET},
@@ -312,208 +310,208 @@ findProp (register const char *str, register unsigned int len)
312 310
       {"background-image", CSS_PROP_BACKGROUND_IMAGE},
313 311
 #line 96 "cssproperties.gperf"
314 312
       {"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE},
313
+#line 98 "cssproperties.gperf"
314
+      {"quotes", CSS_PROP_QUOTES},
315 315
 #line 16 "cssproperties.gperf"
316 316
       {"background-repeat", CSS_PROP_BACKGROUND_REPEAT},
317
-#line 21 "cssproperties.gperf"
318
-      {"-khtml-background-clip", CSS_PROP__KHTML_BACKGROUND_CLIP},
319
-#line 46 "cssproperties.gperf"
320
-      {"counter-increment", CSS_PROP_COUNTER_INCREMENT},
321
-#line 27 "cssproperties.gperf"
322
-      {"-khtml-border-vertical-spacing", CSS_PROP__KHTML_BORDER_VERTICAL_SPACING},
323
-#line 81 "cssproperties.gperf"
324
-      {"opacity", CSS_PROP_OPACITY},
325
-#line 71 "cssproperties.gperf"
326
-      {"-khtml-marquee-direction", CSS_PROP__KHTML_MARQUEE_DIRECTION},
327
-#line 73 "cssproperties.gperf"
328
-      {"-khtml-marquee-repetition", CSS_PROP__KHTML_MARQUEE_REPETITION},
329
-#line 100 "cssproperties.gperf"
330
-      {"size", CSS_PROP_SIZE},
331
-#line 74 "cssproperties.gperf"
332
-      {"-khtml-marquee-speed", CSS_PROP__KHTML_MARQUEE_SPEED},
333
-#line 22 "cssproperties.gperf"
334
-      {"-khtml-background-origin", CSS_PROP__KHTML_BACKGROUND_ORIGIN},
335
-#line 17 "cssproperties.gperf"
336
-      {"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
337
-#line 116 "cssproperties.gperf"
338
-      {"z-index", CSS_PROP_Z_INDEX},
339
-#line 18 "cssproperties.gperf"
340
-      {"background-position", CSS_PROP_BACKGROUND_POSITION},
341 317
 #line 59 "cssproperties.gperf"
342 318
       {"left", CSS_PROP_LEFT},
343
-#line 19 "cssproperties.gperf"
344
-      {"background-position-x", CSS_PROP_BACKGROUND_POSITION_X},
345
-#line 141 "cssproperties.gperf"
346
-      {"-khtml-user-input", CSS_PROP__KHTML_USER_INPUT},
347
-#line 72 "cssproperties.gperf"
348
-      {"-khtml-marquee-increment", CSS_PROP__KHTML_MARQUEE_INCREMENT},
349 319
 #line 52 "cssproperties.gperf"
350 320
       {"float", CSS_PROP_FLOAT},
351
-#line 111 "cssproperties.gperf"
352
-      {"visibility", CSS_PROP_VISIBILITY},
353
-#line 127 "cssproperties.gperf"
321
+#line 21 "cssproperties.gperf"
322
+      {"-khtml-background-clip", CSS_PROP__KHTML_BACKGROUND_CLIP},
323
+#line 70 "cssproperties.gperf"
324
+      {"-khtml-marquee", CSS_PROP__KHTML_MARQUEE},
325
+#line 27 "cssproperties.gperf"
326
+      {"-khtml-border-vertical-spacing", CSS_PROP__KHTML_BORDER_VERTICAL_SPACING},
327
+#line 46 "cssproperties.gperf"
328
+      {"counter-increment", CSS_PROP_COUNTER_INCREMENT},
329
+#line 128 "cssproperties.gperf"
354 330
       {"font", CSS_PROP_FONT},
355
-#line 126 "cssproperties.gperf"
356
-      {"box-sizing", CSS_PROP_BOX_SIZING},
357
-#line 124 "cssproperties.gperf"
358
-      {"border-left", CSS_PROP_BORDER_LEFT},
359
-#line 50 "cssproperties.gperf"
360
-      {"display", CSS_PROP_DISPLAY},
361
-#line 51 "cssproperties.gperf"
362
-      {"empty-cells", CSS_PROP_EMPTY_CELLS},
363
-#line 120 "cssproperties.gperf"
364
-      {"border-style", CSS_PROP_BORDER_STYLE},
365 331
 #line 114 "cssproperties.gperf"
366 332
       {"width", CSS_PROP_WIDTH},
367
-#line 32 "cssproperties.gperf"
368
-      {"border-top-style", CSS_PROP_BORDER_TOP_STYLE},
333
+#line 125 "cssproperties.gperf"
334
+      {"border-left", CSS_PROP_BORDER_LEFT},
335
+#line 117 "cssproperties.gperf"
336
+      {"z-index", CSS_PROP_Z_INDEX},
369 337
 #line 31 "cssproperties.gperf"
370 338
       {"border-left-color", CSS_PROP_BORDER_LEFT_COLOR},
371
-#line 33 "cssproperties.gperf"
372
-      {"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE},
373
-#line 34 "cssproperties.gperf"
374
-      {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE},
375
-#line 68 "cssproperties.gperf"
376
-      {"margin-left", CSS_PROP_MARGIN_LEFT},
377
-#line 125 "cssproperties.gperf"
339
+#line 22 "cssproperties.gperf"
340
+      {"-khtml-background-origin", CSS_PROP__KHTML_BACKGROUND_ORIGIN},
341
+#line 17 "cssproperties.gperf"
342
+      {"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
343
+#line 126 "cssproperties.gperf"
378 344
       {"border-width", CSS_PROP_BORDER_WIDTH},
379
-#line 77 "cssproperties.gperf"
380
-      {"max-width", CSS_PROP_MAX_WIDTH},
381
-#line 128 "cssproperties.gperf"
382
-      {"list-style", CSS_PROP_LIST_STYLE},
345
+#line 18 "cssproperties.gperf"
346
+      {"background-position", CSS_PROP_BACKGROUND_POSITION},
383 347
 #line 36 "cssproperties.gperf"
384 348
       {"border-top-width", CSS_PROP_BORDER_TOP_WIDTH},
385
-#line 101 "cssproperties.gperf"
386
-      {"table-layout", CSS_PROP_TABLE_LAYOUT},
387 349
 #line 37 "cssproperties.gperf"
388 350
       {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH},
389 351
 #line 38 "cssproperties.gperf"
390 352
       {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH},
391
-#line 92 "cssproperties.gperf"
392
-      {"padding-left", CSS_PROP_PADDING_LEFT},
353
+#line 68 "cssproperties.gperf"
354
+      {"margin-left", CSS_PROP_MARGIN_LEFT},
355
+#line 142 "cssproperties.gperf"
356
+      {"-khtml-user-input", CSS_PROP__KHTML_USER_INPUT},
393 357
 #line 79 "cssproperties.gperf"
394 358
       {"min-width", CSS_PROP_MIN_WIDTH},
359
+#line 127 "cssproperties.gperf"
360
+      {"box-sizing", CSS_PROP_BOX_SIZING},
361
+#line 92 "cssproperties.gperf"
362
+      {"padding-left", CSS_PROP_PADDING_LEFT},
363
+#line 71 "cssproperties.gperf"
364
+      {"-khtml-marquee-direction", CSS_PROP__KHTML_MARQUEE_DIRECTION},
365
+#line 73 "cssproperties.gperf"
366
+      {"-khtml-marquee-repetition", CSS_PROP__KHTML_MARQUEE_REPETITION},
395 367
 #line 95 "cssproperties.gperf"
396 368
       {"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE},
369
+#line 74 "cssproperties.gperf"
370
+      {"-khtml-marquee-speed", CSS_PROP__KHTML_MARQUEE_SPEED},
397 371
 #line 94 "cssproperties.gperf"
398 372
       {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER},
399
-#line 62 "cssproperties.gperf"
400
-      {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE},
373
+#line 81 "cssproperties.gperf"
374
+      {"opacity", CSS_PROP_OPACITY},
375
+#line 77 "cssproperties.gperf"
376
+      {"max-width", CSS_PROP_MAX_WIDTH},
377
+#line 112 "cssproperties.gperf"
378
+      {"white-space", CSS_PROP_WHITE_SPACE},
401 379
 #line 56 "cssproperties.gperf"
402 380
       {"font-variant", CSS_PROP_FONT_VARIANT},
403
-#line 107 "cssproperties.gperf"
404
-      {"text-transform", CSS_PROP_TEXT_TRANSFORM},
405
-#line 133 "cssproperties.gperf"
381
+#line 19 "cssproperties.gperf"
382
+      {"background-position-x", CSS_PROP_BACKGROUND_POSITION_X},
383
+#line 134 "cssproperties.gperf"
406 384
       {"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR},
407
-#line 112 "cssproperties.gperf"
408
-      {"white-space", CSS_PROP_WHITE_SPACE},
409
-#line 106 "cssproperties.gperf"
410
-      {"text-shadow", CSS_PROP_TEXT_SHADOW},
411
-#line 84 "cssproperties.gperf"
412
-      {"outline-style", CSS_PROP_OUTLINE_STYLE},
413
-#line 115 "cssproperties.gperf"
385
+#line 72 "cssproperties.gperf"
386
+      {"-khtml-marquee-increment", CSS_PROP__KHTML_MARQUEE_INCREMENT},
387
+#line 116 "cssproperties.gperf"
414 388
       {"word-spacing", CSS_PROP_WORD_SPACING},
415
-#line 139 "cssproperties.gperf"
389
+#line 111 "cssproperties.gperf"
390
+      {"visibility", CSS_PROP_VISIBILITY},
391
+#line 140 "cssproperties.gperf"
416 392
       {"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR},
417 393
 #line 85 "cssproperties.gperf"
418 394
       {"outline-width", CSS_PROP_OUTLINE_WIDTH},
419
-#line 63 "cssproperties.gperf"
420
-      {"list-style-position", CSS_PROP_LIST_STYLE_POSITION},
395
+#line 106 "cssproperties.gperf"
396
+      {"text-shadow", CSS_PROP_TEXT_SHADOW},
397
+#line 50 "cssproperties.gperf"
398
+      {"display", CSS_PROP_DISPLAY},
399
+#line 107 "cssproperties.gperf"
400
+      {"text-transform", CSS_PROP_TEXT_TRANSFORM},
401
+#line 51 "cssproperties.gperf"
402
+      {"empty-cells", CSS_PROP_EMPTY_CELLS},
403
+#line 121 "cssproperties.gperf"
404
+      {"border-style", CSS_PROP_BORDER_STYLE},
405
+#line 32 "cssproperties.gperf"
406
+      {"border-top-style", CSS_PROP_BORDER_TOP_STYLE},
421 407
 #line 26 "cssproperties.gperf"
422 408
       {"-khtml-border-horizontal-spacing", CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING},
423
-#line 75 "cssproperties.gperf"
424
-      {"-khtml-marquee-style", CSS_PROP__KHTML_MARQUEE_STYLE},
409
+#line 33 "cssproperties.gperf"
410
+      {"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE},
411
+#line 34 "cssproperties.gperf"
412
+      {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE},
425 413
 #line 23 "cssproperties.gperf"
426 414
       {"-khtml-background-size", CSS_PROP__KHTML_BACKGROUND_SIZE},
427
-#line 20 "cssproperties.gperf"
428
-      {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y},
429
-#line 134 "cssproperties.gperf"
415
+#line 135 "cssproperties.gperf"
430 416
       {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR},
431
-#line 137 "cssproperties.gperf"
432
-      {"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR},
417
+#line 129 "cssproperties.gperf"
418
+      {"list-style", CSS_PROP_LIST_STYLE},
419
+#line 101 "cssproperties.gperf"
420
+      {"table-layout", CSS_PROP_TABLE_LAYOUT},
433 421
 #line 54 "cssproperties.gperf"
434 422
       {"font-size", CSS_PROP_FONT_SIZE},
435
-#line 64 "cssproperties.gperf"
436
-      {"list-style-type", CSS_PROP_LIST_STYLE_TYPE},
437
-#line 55 "cssproperties.gperf"
438
-      {"font-style", CSS_PROP_FONT_STYLE},
439
-#line 35 "cssproperties.gperf"
440
-      {"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
441 423
 #line 86 "cssproperties.gperf"
442 424
       {"overflow", CSS_PROP_OVERFLOW},
443
-#line 87 "cssproperties.gperf"
444
-      {"overflow-x", CSS_PROP_OVERFLOW_X},
445
-#line 105 "cssproperties.gperf"
446
-      {"text-overflow", CSS_PROP_TEXT_OVERFLOW},
425
+#line 62 "cssproperties.gperf"
426
+      {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE},
427
+#line 138 "cssproperties.gperf"
428
+      {"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR},
447 429
 #line 57 "cssproperties.gperf"
448 430
       {"font-weight", CSS_PROP_FONT_WEIGHT},
449 431
 #line 39 "cssproperties.gperf"
450 432
       {"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH},
451
-#line 140 "cssproperties.gperf"
433
+#line 115 "cssproperties.gperf"
434
+      {"word-wrap", CSS_PROP_WORD_WRAP},
435
+#line 84 "cssproperties.gperf"
436
+      {"outline-style", CSS_PROP_OUTLINE_STYLE},
437
+#line 141 "cssproperties.gperf"
452 438
       {"-khtml-flow-mode", CSS_PROP__KHTML_FLOW_MODE},
439
+#line 87 "cssproperties.gperf"
440
+      {"overflow-x", CSS_PROP_OVERFLOW_X},
453 441
 #line 113 "cssproperties.gperf"
454 442
       {"widows", CSS_PROP_WIDOWS},
443
+#line 105 "cssproperties.gperf"
444
+      {"text-overflow", CSS_PROP_TEXT_OVERFLOW},
445
+#line 63 "cssproperties.gperf"
446
+      {"list-style-position", CSS_PROP_LIST_STYLE_POSITION},
447
+#line 20 "cssproperties.gperf"
448
+      {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y},
455 449
 #line 83 "cssproperties.gperf"
456 450
       {"outline-offset", CSS_PROP_OUTLINE_OFFSET},
457
-#line 53 "cssproperties.gperf"
458
-      {"font-family", CSS_PROP_FONT_FAMILY},
451
+#line 75 "cssproperties.gperf"
452
+      {"-khtml-marquee-style", CSS_PROP__KHTML_MARQUEE_STYLE},
453
+#line 55 "cssproperties.gperf"
454
+      {"font-style", CSS_PROP_FONT_STYLE},
455
+#line 35 "cssproperties.gperf"
456
+      {"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
457
+#line 64 "cssproperties.gperf"
458
+      {"list-style-type", CSS_PROP_LIST_STYLE_TYPE},
459 459
 #line 88 "cssproperties.gperf"
460
-      {"overflow-y", CSS_PROP_OVERFLOW_Y}
460
+      {"overflow-y", CSS_PROP_OVERFLOW_Y},
461
+#line 53 "cssproperties.gperf"
462
+      {"font-family", CSS_PROP_FONT_FAMILY}
461 463
     };
462 464
 
463
-  static const signed char lookup[] =
465
+  static const short lookup[] =
464 466
     {
465 467
        -1,  -1,  -1,   0,  -1,   1,   2,  -1,  -1,   3,
466 468
         4,   5,  -1,  -1,  -1,  -1,   6,  -1,  -1,  -1,
467 469
         7,  -1,   8,   9,  -1,  10,  -1,  11,  -1,  -1,
468
-       12,  13,  -1,  14,  15,  -1,  -1,  -1,  -1,  -1,
469
-       16,  17,  -1,  -1,  18,  19,  -1,  20,  21,  -1,
470
-       -1,  22,  23,  -1,  -1,  -1,  24,  -1,  25,  26,
471
-       27,  -1,  28,  29,  -1,  -1,  -1,  -1,  -1,  -1,
472
-       30,  -1,  31,  -1,  -1,  -1,  32,  -1,  -1,  33,
473
-       34,  35,  36,  -1,  -1,  37,  -1,  38,  39,  40,
474
-       -1,  -1,  41,  42,  43,  -1,  44,  -1,  -1,  -1,
475
-       -1,  45,  -1,  -1,  -1,  46,  -1,  -1,  -1,  47,
476
-       -1,  -1,  -1,  -1,  48,  -1,  49,  -1,  -1,  -1,
477
-       50,  -1,  -1,  51,  -1,  52,  53,  54,  -1,  -1,
478
-       -1,  -1,  55,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
479
-       -1,  -1,  56,  -1,  -1,  -1,  -1,  57,  -1,  -1,
480
-       58,  -1,  59,  -1,  60,  61,  -1,  -1,  -1,  62,
481
-       63,  -1,  -1,  -1,  64,  -1,  65,  66,  -1,  67,
482
-       -1,  -1,  -1,  -1,  68,  -1,  69,  70,  -1,  71,
483
-       72,  -1,  -1,  -1,  -1,  73,  -1,  -1,  -1,  74,
484
-       75,  76,  77,  -1,  -1,  -1,  78,  79,  -1,  -1,
485
-       80,  81,  82,  83,  84,  -1,  -1,  -1,  -1,  -1,
486
-       -1,  -1,  -1,  -1,  -1,  -1,  85,  86,  -1,  87,
487
-       88,  89,  90,  91,  92,  -1,  -1,  93,  -1,  94,
488
-       -1,  -1,  95,  -1,  -1,  -1,  96,  -1,  -1,  -1,
489
-       -1,  97,  -1,  -1,  -1,  -1,  -1,  98,  -1,  99,
490
-      100, 101,  -1,  -1,  -1,  -1, 102,  -1,  -1,  -1,
491
-       -1,  -1,  -1, 103,  -1,  -1,  -1,  -1,  -1,  -1,
492
-       -1,  -1, 104,  -1,  -1,  -1, 105,  -1,  -1,  -1,
493
-       -1,  -1,  -1, 106, 107,  -1,  -1, 108,  -1,  -1,
494
-      109,  -1, 110,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
470
+       -1,  12,  -1,  13,  14,  -1,  -1,  -1,  -1,  -1,
471
+       15,  16,  -1,  -1,  17,  18,  -1,  19,  20,  -1,
472
+       -1,  21,  22,  -1,  -1,  -1,  23,  -1,  24,  25,
473
+       26,  -1,  27,  28,  -1,  -1,  -1,  -1,  -1,  -1,
474
+       -1,  -1,  29,  -1,  30,  -1,  31,  -1,  -1,  -1,
475
+       32,  -1,  33,  -1,  -1,  34,  -1,  35,  36,  37,
476
+       38,  -1,  39,  40,  41,  -1,  -1,  -1,  -1,  -1,
477
+       42,  43,  -1,  -1,  -1,  44,  -1,  -1,  -1,  -1,
478
+       -1,  45,  -1,  -1,  46,  -1,  47,  -1,  -1,  48,
479
+       49,  -1,  -1,  50,  -1,  51,  52,  53,  -1,  -1,
480
+       -1,  54,  55,  -1,  56,  -1,  -1,  -1,  -1,  -1,
481
+       57,  -1,  58,  -1,  59,  60,  -1,  61,  -1,  62,
482
+       63,  64,  -1,  -1,  -1,  -1,  -1,  65,  -1,  -1,
483
+       -1,  -1,  66,  -1,  67,  -1,  68,  69,  -1,  70,
484
+       -1,  71,  -1,  72,  73,  -1,  74,  75,  -1,  76,
485
+       77,  -1,  -1,  -1,  -1,  -1,  -1,  78,  -1,  79,
486
+       80,  -1,  81,  -1,  -1,  82,  83,  84,  -1,  85,
487
+       -1,  86,  87,  -1,  -1,  -1,  88,  -1,  -1,  -1,
488
+       89,  -1,  -1,  -1,  90,  -1,  -1,  -1,  -1,  -1,
489
+       -1,  -1,  91,  -1,  -1,  92,  93,  -1,  -1,  -1,
490
+       -1,  -1,  -1,  94,  -1,  -1,  95,  96,  -1,  97,
491
+       -1,  98,  99,  -1,  -1,  -1, 100, 101, 102, 103,
492
+       -1,  -1, 104,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
493
+       -1,  -1, 105,  -1,  -1, 106,  -1, 107,  -1, 108,
494
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1, 109,  -1,
495
+       -1,  -1,  -1,  -1,  -1,  -1, 110,  -1,  -1,  -1,
495 496
        -1,  -1,  -1,  -1,  -1,  -1, 111,  -1,  -1,  -1,
496
-       -1,  -1, 112,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
497
-       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
497
+       -1, 112, 113,  -1, 114,  -1,  -1,  -1, 115,  -1,
498
+       -1, 116,  -1,  -1,  -1, 117,  -1,  -1,  -1,  -1,
499
+       -1, 118,  -1, 119,  -1,  -1,  -1,  -1,  -1, 120,
498 500
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
499
-       -1,  -1,  -1,  -1,  -1,  -1, 113,  -1,  -1, 114,
500 501
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
501
-       -1,  -1,  -1,  -1,  -1, 115,  -1,  -1,  -1,  -1,
502
-      116,  -1, 117, 118,  -1,  -1,  -1,  -1,  -1,  -1,
503
-      119,  -1,  -1,  -1,  -1,  -1,  -1,  -1, 120,  -1,
504
-       -1, 121, 122,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
505
-       -1, 123,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
502
+       -1, 121,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
503
+       -1,  -1,  -1,  -1, 122,  -1,  -1,  -1,  -1,  -1,
504
+      123,  -1,  -1,  -1,  -1, 124,  -1, 125,  -1,  -1,
506 505
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
507
-       -1, 124,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
508 506
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
509
-       -1,  -1,  -1,  -1, 125,  -1,  -1,  -1,  -1,  -1,
510 507
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
511 508
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
512 509
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
513 510
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
514 511
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
515
-       -1,  -1,  -1,  -1,  -1,  -1, 126,  -1,  -1,  -1,
516
-      127
512
+       -1,  -1,  -1,  -1,  -1, 126,  -1,  -1,  -1,  -1,
513
+      127,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
514
+       -1, 128
517 515
     };
518 516
 
519 517
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -535,7 +533,7 @@ findProp (register const char *str, register unsigned int len)
535 533
     }
536 534
   return 0;
537 535
 }
538
-#line 142 "cssproperties.gperf"
536
+#line 143 "cssproperties.gperf"
539 537
 
540 538
 static const char * const propertyList[] = {
541 539
 "",
@@ -640,6 +638,7 @@ static const char * const propertyList[] = {
640 638
 "white-space", 
641 639
 "widows", 
642 640
 "width", 
641
+"word-wrap", 
643 642
 "word-spacing", 
644 643
 "z-index", 
645 644
 "background", 

+ 29
- 28
khtml/css/cssproperties.h View File

@@ -109,35 +109,36 @@ DOM::DOMString getPropertyName(unsigned short id) KDE_NO_EXPORT;
109 109
 #define CSS_PROP_WHITE_SPACE 99
110 110
 #define CSS_PROP_WIDOWS 100
111 111
 #define CSS_PROP_WIDTH 101
112
-#define CSS_PROP_WORD_SPACING 102
113
-#define CSS_PROP_Z_INDEX 103
114
-#define CSS_PROP_BACKGROUND 104
115
-#define CSS_PROP_BORDER 105
116
-#define CSS_PROP_BORDER_COLOR 106
117
-#define CSS_PROP_BORDER_STYLE 107
118
-#define CSS_PROP_BORDER_TOP 108
119
-#define CSS_PROP_BORDER_RIGHT 109
120
-#define CSS_PROP_BORDER_BOTTOM 110
121
-#define CSS_PROP_BORDER_LEFT 111
122
-#define CSS_PROP_BORDER_WIDTH 112
123
-#define CSS_PROP_BOX_SIZING 113
124
-#define CSS_PROP_FONT 114
125
-#define CSS_PROP_LIST_STYLE 115
126
-#define CSS_PROP_MARGIN 116
127
-#define CSS_PROP_OUTLINE 117
128
-#define CSS_PROP_PADDING 118
129
-#define CSS_PROP_SCROLLBAR_BASE_COLOR 119
130
-#define CSS_PROP_SCROLLBAR_FACE_COLOR 120
131
-#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 121
132
-#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 122
133
-#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 123
134
-#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 124
135
-#define CSS_PROP_SCROLLBAR_TRACK_COLOR 125
136
-#define CSS_PROP_SCROLLBAR_ARROW_COLOR 126
137
-#define CSS_PROP__KHTML_FLOW_MODE 127
138
-#define CSS_PROP__KHTML_USER_INPUT 128
112
+#define CSS_PROP_WORD_WRAP 102
113
+#define CSS_PROP_WORD_SPACING 103
114
+#define CSS_PROP_Z_INDEX 104
115
+#define CSS_PROP_BACKGROUND 105
116
+#define CSS_PROP_BORDER 106
117
+#define CSS_PROP_BORDER_COLOR 107
118
+#define CSS_PROP_BORDER_STYLE 108
119
+#define CSS_PROP_BORDER_TOP 109
120
+#define CSS_PROP_BORDER_RIGHT 110
121
+#define CSS_PROP_BORDER_BOTTOM 111
122
+#define CSS_PROP_BORDER_LEFT 112
123
+#define CSS_PROP_BORDER_WIDTH 113
124
+#define CSS_PROP_BOX_SIZING 114
125
+#define CSS_PROP_FONT 115
126
+#define CSS_PROP_LIST_STYLE 116
127
+#define CSS_PROP_MARGIN 117
128
+#define CSS_PROP_OUTLINE 118
129
+#define CSS_PROP_PADDING 119
130
+#define CSS_PROP_SCROLLBAR_BASE_COLOR 120
131
+#define CSS_PROP_SCROLLBAR_FACE_COLOR 121
132
+#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 122
133
+#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 123
134
+#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 124
135
+#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 125
136
+#define CSS_PROP_SCROLLBAR_TRACK_COLOR 126
137
+#define CSS_PROP_SCROLLBAR_ARROW_COLOR 127
138
+#define CSS_PROP__KHTML_FLOW_MODE 128
139
+#define CSS_PROP__KHTML_USER_INPUT 129
139 140
 
140 141
 #define CSS_PROP_MAX CSS_PROP_Z_INDEX
141
-#define CSS_PROP_TOTAL 129
142
+#define CSS_PROP_TOTAL 130
142 143
 #endif
143 144
 

+ 1
- 0
khtml/css/cssproperties.in View File

@@ -116,6 +116,7 @@ visibility
116 116
 white-space
117 117
 widows
118 118
 width
119
+word-wrap
119 120
 word-spacing
120 121
 z-index
121 122
 background

+ 27
- 0
khtml/css/cssstyleselector.cpp View File

@@ -175,6 +175,26 @@ if (id == propID) \
175 175
     return;\
176 176
 }
177 177
 
178
+#define HANDLE_INHERIT_ON_INHERITED_PROPERTY(prop, Prop) \
179
+if (isInherit) \
180
+{\
181
+    style->set##Prop(parentStyle->prop());\
182
+    return;\
183
+}
184
+
185
+#define HANDLE_INITIAL(prop, Prop) \
186
+if (isInitial) \
187
+{\
188
+    style->set##Prop(RenderStyle::initial##Prop());\
189
+    return;\
190
+}
191
+
192
+#define HANDLE_INITIAL_AND_INHERIT_ON_INHERITED_PROPERTY(prop, Prop) \
193
+HANDLE_INITIAL(prop, Prop) \
194
+else \
195
+HANDLE_INHERIT_ON_INHERITED_PROPERTY(prop, Prop)
196
+
197
+
178 198
 namespace khtml {
179 199
 
180 200
 CSSStyleSelectorList *CSSStyleSelector::s_defaultStyle;
@@ -3953,6 +3973,13 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
3953 3973
         break;
3954 3974
     }
3955 3975
     }
3976
+    case CSS_PROP_WORD_WRAP: {
3977
+        HANDLE_INITIAL_AND_INHERIT_ON_INHERITED_PROPERTY(wordWrap, WordWrap)
3978
+        if (!primitiveValue)
3979
+            return;
3980
+        style->setWordWrap(primitiveValue->getIdent() == CSS_VAL_NORMAL ? WWNORMAL : WWBREAKWORD);
3981
+        break;
3982
+    }
3956 3983
     default:
3957 3984
         return;
3958 3985
     }

+ 368
- 383
khtml/css/cssvalues.c
File diff suppressed because it is too large
View File


+ 58
- 57
khtml/css/cssvalues.h View File

@@ -227,63 +227,64 @@ DOM::DOMString getValueName(unsigned short id) KDE_NO_EXPORT;
227 227
 #define CSS_VAL_PRE_WRAP 216
228 228
 #define CSS_VAL_PRE_LINE 217
229 229
 #define CSS_VAL__KHTML_NOWRAP 218
230
-#define CSS_VAL_ABOVE 219
231
-#define CSS_VAL_ABSOLUTE 220
232
-#define CSS_VAL_ALWAYS 221
233
-#define CSS_VAL_AVOID 222
234
-#define CSS_VAL_BELOW 223
235
-#define CSS_VAL_BIDI_OVERRIDE 224
236
-#define CSS_VAL_BLINK 225
237
-#define CSS_VAL_BOTH 226
238
-#define CSS_VAL_CROP 227
239
-#define CSS_VAL_CROSS 228
240
-#define CSS_VAL_EMBED 229
241
-#define CSS_VAL_FIXED 230
242
-#define CSS_VAL_HAND 231
243
-#define CSS_VAL_HIDE 232
244
-#define CSS_VAL_HIGHER 233
245
-#define CSS_VAL_INVERT 234
246
-#define CSS_VAL_LANDSCAPE 235
247
-#define CSS_VAL_LEVEL 236
248
-#define CSS_VAL_LINE_THROUGH 237
249
-#define CSS_VAL_LOUD 238
250
-#define CSS_VAL_LOWER 239
251
-#define CSS_VAL_MARQUEE 240
252
-#define CSS_VAL_MIX 241
253
-#define CSS_VAL_OVERLINE 242
254
-#define CSS_VAL_PORTRAIT 243
255
-#define CSS_VAL_RELATIVE 244
256
-#define CSS_VAL_SCROLL 245
257
-#define CSS_VAL_SEPARATE 246
258
-#define CSS_VAL_SHOW 247
259
-#define CSS_VAL_STATIC 248
260
-#define CSS_VAL_THICK 249
261
-#define CSS_VAL_THIN 250
262
-#define CSS_VAL_UNDERLINE 251
263
-#define CSS_VAL__KHTML_NORMAL 252
264
-#define CSS_VAL__KHTML_AROUND_FLOATS 253
265
-#define CSS_VAL_BORDER_BOX 254
266
-#define CSS_VAL_CONTENT_BOX 255
267
-#define CSS_VAL_ENABLED 256
268
-#define CSS_VAL_DISABLED 257
269
-#define CSS_VAL_FORWARDS 258
270
-#define CSS_VAL_BACKWARDS 259
271
-#define CSS_VAL_AHEAD 260
272
-#define CSS_VAL_REVERSE 261
273
-#define CSS_VAL_UP 262
274
-#define CSS_VAL_DOWN 263
275
-#define CSS_VAL_SLOW 264
276
-#define CSS_VAL_FAST 265
277
-#define CSS_VAL_INFINITE 266
278
-#define CSS_VAL_SLIDE 267
279
-#define CSS_VAL_ALTERNATE 268
280
-#define CSS_VAL_UNFURL 269
281
-#define CSS_VAL_CLIP 270
282
-#define CSS_VAL_ELLIPSIS 271
283
-#define CSS_VAL_BORDER 272
284
-#define CSS_VAL_CONTENT 273
285
-#define CSS_VAL_PADDING 274
230
+#define CSS_VAL_BREAK_WORD 219
231
+#define CSS_VAL_ABOVE 220
232
+#define CSS_VAL_ABSOLUTE 221
233
+#define CSS_VAL_ALWAYS 222
234
+#define CSS_VAL_AVOID 223
235
+#define CSS_VAL_BELOW 224
236
+#define CSS_VAL_BIDI_OVERRIDE 225
237
+#define CSS_VAL_BLINK 226
238
+#define CSS_VAL_BOTH 227
239
+#define CSS_VAL_CROP 228
240
+#define CSS_VAL_CROSS 229
241
+#define CSS_VAL_EMBED 230
242
+#define CSS_VAL_FIXED 231
243
+#define CSS_VAL_HAND 232
244
+#define CSS_VAL_HIDE 233
245
+#define CSS_VAL_HIGHER 234
246
+#define CSS_VAL_INVERT 235
247
+#define CSS_VAL_LANDSCAPE 236
248
+#define CSS_VAL_LEVEL 237
249
+#define CSS_VAL_LINE_THROUGH 238
250
+#define CSS_VAL_LOUD 239
251
+#define CSS_VAL_LOWER 240
252
+#define CSS_VAL_MARQUEE 241
253
+#define CSS_VAL_MIX 242
254
+#define CSS_VAL_OVERLINE 243
255
+#define CSS_VAL_PORTRAIT 244
256
+#define CSS_VAL_RELATIVE 245
257
+#define CSS_VAL_SCROLL 246
258
+#define CSS_VAL_SEPARATE 247
259
+#define CSS_VAL_SHOW 248
260
+#define CSS_VAL_STATIC 249
261
+#define CSS_VAL_THICK 250
262
+#define CSS_VAL_THIN 251
263
+#define CSS_VAL_UNDERLINE 252
264
+#define CSS_VAL__KHTML_NORMAL 253
265
+#define CSS_VAL__KHTML_AROUND_FLOATS 254
266
+#define CSS_VAL_BORDER_BOX 255
267
+#define CSS_VAL_CONTENT_BOX 256
268
+#define CSS_VAL_ENABLED 257
269
+#define CSS_VAL_DISABLED 258
270
+#define CSS_VAL_FORWARDS 259
271
+#define CSS_VAL_BACKWARDS 260
272
+#define CSS_VAL_AHEAD 261
273
+#define CSS_VAL_REVERSE 262
274
+#define CSS_VAL_UP 263
275
+#define CSS_VAL_DOWN 264
276
+#define CSS_VAL_SLOW 265
277
+#define CSS_VAL_FAST 266
278
+#define CSS_VAL_INFINITE 267
279
+#define CSS_VAL_SLIDE 268
280
+#define CSS_VAL_ALTERNATE 269
281
+#define CSS_VAL_UNFURL 270
282
+#define CSS_VAL_CLIP 271
283
+#define CSS_VAL_ELLIPSIS 272
284
+#define CSS_VAL_BORDER 273
285
+#define CSS_VAL_CONTENT 274
286
+#define CSS_VAL_PADDING 275
286 287
 
287
-#define CSS_VAL_TOTAL 275
288
+#define CSS_VAL_TOTAL 276
288 289
 #endif
289 290
 

+ 5
- 0
khtml/css/cssvalues.in View File

@@ -309,6 +309,11 @@ pre-wrap
309 309
 pre-line
310 310
 -khtml-nowrap
311 311
 #
312
+# CSS_PROP_WORD_WRAP
313
+#
314
+#normal
315
+break-word
316
+#
312 317
 # Unordered rest
313 318
 #
314 319
 above

+ 138
- 141
khtml/rendering/bidi.cpp View File

@@ -44,10 +44,10 @@ namespace khtml {
44 44
 // an iterator which goes through a BidiParagraph
45 45
 struct BidiIterator
46 46
 {
47
-    BidiIterator() : par(0), obj(0), pos(0) {}
48
-    BidiIterator(RenderBlock *_par, RenderObject *_obj, unsigned int _pos) : par(_par), obj(_obj), pos(_pos) {}
47
+    BidiIterator() : par(0), obj(0), pos(0), endOfInline(0) {}
48
+    BidiIterator(RenderBlock *_par, RenderObject *_obj, unsigned int _pos, bool eoi=false) : par(_par), obj(_obj), pos(_pos), endOfInline(eoi) {}
49 49
 
50
-    void increment( BidiState &bidi );
50
+    void increment( BidiState &bidi, bool skipInlines=true );
51 51
 
52 52
     bool atEnd() const;
53 53
 
@@ -57,6 +57,7 @@ struct BidiIterator
57 57
     RenderBlock *par;
58 58
     RenderObject *obj;
59 59
     unsigned int pos;
60
+    bool endOfInline;
60 61
 };
61 62
 
62 63
 
@@ -128,21 +129,6 @@ static int getBorderPaddingMargin(RenderObject* child, bool endOfInline)
128 129
     return result;
129 130
 }
130 131
 
131
-static int inlineWidth(RenderObject* child, bool start = true, bool end = true)
132
-{
133
-    int extraWidth = 0;
134
-    RenderObject* parent = child->parent();
135
-    while (parent->isInline() && !parent->isInlineBlockOrInlineTable()) {
136
-        if (start && parent->firstChild() == child)
137
-            extraWidth += getBorderPaddingMargin(parent, false);
138
-        if (end && parent->lastChild() == child)
139
-            extraWidth += getBorderPaddingMargin(parent, true);
140
-        child = parent;
141
-        parent = child->parent();
142
-    }
143
-    return extraWidth;
144
-}
145
-
146 132
 #ifndef NDEBUG
147 133
 static bool inBidiRunDetach;
148 134
 #endif
@@ -241,15 +227,19 @@ inline bool operator!=( const BidiIterator &it1, const BidiIterator &it2 )
241 227
     return false;
242 228
 }
243 229
 
230
+// when modifying this function, make sure you check InlineMinMaxIterator::next() as well.
244 231
 static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, BidiState &bidi,
245
-                                     bool skipInlines = true)
232
+                                     bool skipInlines = true, bool *endOfInline = 0 )
246 233
 {
247 234
     RenderObject *next = 0;
235
+    bool oldEndOfInline = endOfInline ? *endOfInline : false;
236
+    if (oldEndOfInline)
237
+        *endOfInline = false;
248 238
 
249 239
     while(current != 0)
250 240
     {
251 241
         //kdDebug( 6040 ) << "current = " << current << endl;
252
-        if (!current->isFloating() && !current->isReplaced() && !current->isPositioned()) {
242
+        if (!oldEndOfInline && !current->isFloating() && !current->isReplaced() && !current->isPositioned()) {
253 243
             next = current->firstChild();
254 244
             if ( next && adjustEmbedding ) {
255 245
                 EUnicodeBidi ub = next->style()->unicodeBidi();
@@ -262,6 +252,12 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B
262 252
             }
263 253
         }
264 254
         if (!next) {
255
+            if (!skipInlines && !oldEndOfInline && current->isInlineFlow() && endOfInline) {
256
+                next = current;
257
+                *endOfInline = true;
258
+                break;
259
+            }
260
+
265 261
             while (current && current != par) {
266 262
                 next = current->nextSibling();
267 263
                 if (next) break;
@@ -269,6 +265,11 @@ static inline RenderObject *Bidinext(RenderObject *par, RenderObject *current, B
269 265
                     embed( TQChar::DirPDF, bidi );
270 266
                 }
271 267
                 current = current->parent();
268
+                if (!skipInlines && current && current != par && current->isInlineFlow() && endOfInline) {
269
+                    next = current;
270
+                    *endOfInline = true;
271
+                    break;
272
+                }
272 273
             }
273 274
         }
274 275
 
@@ -300,17 +301,17 @@ static RenderObject *first( RenderObject *par, BidiState &bidi, bool skipInlines
300 301
     return o;
301 302
 }
302 303
 
303
-inline void BidiIterator::increment (BidiState &bidi)
304
+inline void BidiIterator::increment (BidiState &bidi, bool skipInlines)
304 305
 {
305 306
     if(!obj) return;
306 307
     if(obj->isText()) {
307 308
         pos++;
308 309
         if(pos >= static_cast<RenderText *>(obj)->stringLength()) {
309
-            obj = Bidinext( par, obj, bidi );
310
+            obj = Bidinext( par, obj, bidi, skipInlines );
310 311
             pos = 0;
311 312
         }
312 313
     } else {
313
-        obj = Bidinext( par, obj, bidi );
314
+        obj = Bidinext( par, obj, bidi, skipInlines, &endOfInline );
314 315
         pos = 0;
315 316
     }
316 317
 }
@@ -1322,45 +1323,6 @@ void RenderBlock::bidiReorderLine(const BidiIterator &start, const BidiIterator
1322 1323
 #endif
1323 1324
 }
1324 1325
 
1325
-#ifdef APPLE_CHANGES    // KDE handles compact blocks differently
1326
-static void buildCompactRuns(RenderObject* compactObj, BidiState &bidi)
1327
-{
1328
-    sBuildingCompactRuns = true;
1329
-    if (!compactObj->isRenderBlock()) {
1330
-        // Just append a run for our object.
1331
-        isLineEmpty = false;
1332
-        addRun(new (compactObj->renderArena()) BidiRun(0, compactObj->length(), compactObj, bidi.context, dir));
1333
-    }
1334
-    else {
1335
-        // Format the compact like it is its own single line.  We build up all the runs for
1336
-        // the little compact and then reorder them for bidi.
1337
-        RenderBlock* compactBlock = static_cast<RenderBlock*>(compactObj);
1338
-        adjustEmbedding = true;
1339
-        BidiIterator start(compactBlock, first(compactBlock, bidi), 0);
1340
-        adjustEmbedding = false;
1341
-        BidiIterator end = start;
1342
-
1343
-        betweenMidpoints = false;
1344
-        isLineEmpty = true;
1345
-        previousLineBrokeAtBR = true;
1346
-
1347
-        end = compactBlock->findNextLineBreak(start, bidi);
1348
-        if (!isLineEmpty)
1349
-            compactBlock->bidiReorderLine(start, end, bidi);
1350
-    }
1351
-
1352
-
1353
-    sCompactFirstBidiRun = sFirstBidiRun;
1354
-    sCompactLastBidiRun = sLastBidiRun;
1355
-    sCompactBidiRunCount = sBidiRunCount;
1356
-
1357
-    sNumMidpoints = 0;
1358
-    sCurrMidpoint = 0;
1359
-    betweenMidpoints = false;
1360
-    sBuildingCompactRuns = false;
1361
-}
1362
-#endif
1363
-
1364 1326
 void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLine)
1365 1327
 {
1366 1328
     BidiState bidi;
@@ -1470,13 +1432,6 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int breakBeforeLin
1470 1432
                 oldStart = start;
1471 1433
                 oldBidi = bidi;
1472 1434
             }
1473
-#ifdef APPLE_CHANGES    // KDE handles compact blocks differently
1474
-            if (m_firstLine && firstChild() && firstChild()->isCompact()) {
1475
-                buildCompactRuns(firstChild(), bidi);
1476
-                start.obj = firstChild()->nextSibling();
1477
-                end = start;
1478
-            }
1479
-#endif
1480 1435
             if (lineCount == breakBeforeLine) {
1481 1436
                 m_height = pageTopAfter(oldPos);
1482 1437
                 pagebreakHint = true;
@@ -1491,15 +1446,6 @@ redo_linebreak:
1491 1446
                 // At the same time we figure out where border/padding/margin should be applied for
1492 1447
                 // inline flow boxes.
1493 1448
 
1494
-#ifdef APPLE_CHANGES    // KDE handles compact blocks differently
1495
-                if (sCompactFirstBidiRun) {
1496
-                    // We have a compact line sharing this line.  Link the compact runs
1497
-                    // to our runs to create a single line of runs.
1498
-                    sCompactLastBidiRun->nextRun = sFirstBidiRun;
1499
-                    sFirstBidiRun = sCompactFirstBidiRun;
1500
-                    sBidiRunCount += sCompactBidiRunCount;
1501
-                }
1502
-#endif
1503 1449
                 if (sBidiRunCount) {
1504 1450
                     InlineFlowBox* lineBox = constructLine(start, end);
1505 1451
                     if (lineBox) {
@@ -1698,7 +1644,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1698 1644
             }
1699 1645
         }
1700 1646
         adjustEmbedding = true;
1701
-        start.increment(bidi);
1647
+        start.increment(bidi, false /*skipInlines*/);
1702 1648
         adjustEmbedding = false;
1703 1649
     }
1704 1650
 
@@ -1714,6 +1660,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1714 1660
         return start;
1715 1661
     }
1716 1662
 
1663
+    // This variable says we have encountered an object after which initial whitespace should be ignored (e.g. InlineFlows at the begining of a line).
1664
+    // Either we have nothing to do, if there is no whitespace after the object... or we have to enter the ignoringSpaces state.
1665
+    // This dilemma will be resolved when we have a peek at the next object.
1666
+    bool checkShouldIgnoreInitialWhitespace = false;
1667
+
1717 1668
     // This variable is used only if whitespace isn't set to PRE, and it tells us whether
1718 1669
     // or not we are currently ignoring whitespace.
1719 1670
     bool ignoringSpaces = false;
@@ -1727,13 +1678,14 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1727 1678
 
1728 1679
     BidiIterator lBreak = start;
1729 1680
 
1730
-    RenderObject *o = start.obj;
1731
-    RenderObject *last = o;
1681
+    InlineMinMaxIterator it(start.par, start.obj, start.endOfInline, false /*skipPositioned*/);
1682
+    InlineMinMaxIterator lastIt = it;
1732 1683
     int pos = start.pos;
1733 1684
 
1734 1685
     bool prevLineBrokeCleanly = previousLineBrokeAtBR;
1735 1686
     previousLineBrokeAtBR = false;
1736 1687
 
1688
+    RenderObject* o = it.current;
1737 1689
     while( o ) {
1738 1690
 #ifdef DEBUG_LINEBREAKS
1739 1691
         kdDebug(6041) << "new object "<< o <<" width = " << w <<" tmpw = " << tmpW << endl;
@@ -1742,6 +1694,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1742 1694
             if( w + tmpW <= width ) {
1743 1695
                 lBreak.obj = o;
1744 1696
                 lBreak.pos = 0;
1697
+                lBreak.endOfInline = it.endOfInline;
1745 1698
 
1746 1699
                 // A <br> always breaks a line, so don't let the line be collapsed
1747 1700
                 // away. Also, the space at the end of a line with a <br> does not
@@ -1792,13 +1745,22 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1792 1745
                 }
1793 1746
             }
1794 1747
         } else if (o->isInlineFlow()) {
1795
-            // Only empty inlines matter.  We treat those similarly to replaced elements.
1796
-            KHTMLAssert(!o->firstChild());
1797
-            tmpW += o->marginLeft()+o->borderLeft()+o->paddingLeft()+
1798
-                    o->marginRight()+o->borderRight()+o->paddingRight();
1748
+            tmpW += getBorderPaddingMargin(o, it.endOfInline);
1749
+            if (isLineEmpty) isLineEmpty = !tmpW;
1750
+            if (o->isWordBreak()) { // #### shouldn't be an InlineFlow!
1751
+                w += tmpW;
1752
+                tmpW = 0;
1753
+                lBreak.obj = o;
1754
+                lBreak.pos = 0;
1755
+                lBreak.endOfInline = it.endOfInline;
1756
+            } else if (!it.endOfInline) {
1757
+                // this is the beginning of the line (other non-initial inline flows are handled directly when
1758
+                // incrementing the iterator below). We want to skip initial whitespace as much as possible.
1759
+                checkShouldIgnoreInitialWhitespace = true;
1760
+            }
1799 1761
         } else if ( o->isReplaced() || o->isGlyph() ) {
1800 1762
             EWhiteSpace currWS = o->style()->whiteSpace();
1801
-            EWhiteSpace lastWS = last->style()->whiteSpace();
1763
+            EWhiteSpace lastWS = lastIt.current->style()->whiteSpace();
1802 1764
 
1803 1765
             // WinIE marquees have different whitespace characteristics by default when viewed from
1804 1766
             // the outside vs. the inside.  Text inside is NOWRAP, and so we altered the marquee's
@@ -1806,8 +1768,8 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1806 1768
             // for the marquee when checking for line breaking.
1807 1769
             if (o->isHTMLMarquee() && o->layer() && o->layer()->marquee())
1808 1770
                 currWS = o->layer()->marquee()->whiteSpace();
1809
-            if (last->isHTMLMarquee() && last->layer() && last->layer()->marquee())
1810
-                lastWS = last->layer()->marquee()->whiteSpace();
1771
+            if (lastIt.current->isHTMLMarquee() && lastIt.current->layer() && lastIt.current->layer()->marquee())
1772
+                lastWS = lastIt.current->layer()->marquee()->whiteSpace();
1811 1773
 
1812 1774
             // Break on replaced elements if either has normal white-space.
1813 1775
             if (currWS == NORMAL || lastWS == NORMAL) {
@@ -1815,9 +1777,10 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1815 1777
                 tmpW = 0;
1816 1778
                 lBreak.obj = o;
1817 1779
                 lBreak.pos = 0;
1780
+                lBreak.endOfInline = false;
1818 1781
             }
1819 1782
 
1820
-            tmpW += o->width()+o->marginLeft()+o->marginRight()+inlineWidth(o);
1783
+            tmpW += o->width()+o->marginLeft()+o->marginRight();
1821 1784
             if (ignoringSpaces) {
1822 1785
                 BidiIterator startMid( 0, o, 0 );
1823 1786
                 addMidpoint(startMid);
@@ -1828,21 +1791,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1828 1791
             trailingSpaceObject = 0;
1829 1792
 
1830 1793
             if (o->isListMarker() && o->style()->listStylePosition() == OUTSIDE) {
1831
-                // The marker must not have an effect on whitespace at the start
1832
-                // of the line.  We start ignoring spaces to make sure that any additional
1833
-                // spaces we see will be discarded.
1834
-                //
1835
-                // Optimize for a common case. If we can't find whitespace after the list
1836
-                // item, then this is all moot. -dwh
1837
-                RenderObject* next = Bidinext( start.par, o, bidi );
1838
-                if (!style()->preserveWS() && next && next->isText() && static_cast<RenderText*>(next)->stringLength() > 0 &&
1839
-                     (static_cast<RenderText*>(next)->text()[0].category() == TQChar::Separator_Space ||
1840
-                      static_cast<RenderText*>(next)->text()[0] == '\n')) {
1841
-                    currentCharacterIsSpace = true;
1842
-                    ignoringSpaces = true;
1843
-                    BidiIterator endMid( 0, o, 0 );
1844
-                    addMidpoint(endMid);
1845
-                }
1794
+                checkShouldIgnoreInitialWhitespace = true;
1846 1795
             }
1847 1796
         } else if ( o->isText() ) {
1848 1797
             RenderText *t = static_cast<RenderText *>(o);
@@ -1859,10 +1808,8 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1859 1808
 #ifdef APPLE_CHANGES
1860 1809
             int wordSpacing = o->style()->wordSpacing();
1861 1810
 #endif
1862
-            bool appliedStartWidth = pos > 0; // If the span originated on a previous line,
1863
-                                              // then assume the start width has been applied.
1864
-            bool appliedEndWidth = false;
1865 1811
             bool nextIsSoftBreakable = false;
1812
+            bool checkBreakWord = autoWrap && (o->style()->wordWrap() == WWBREAKWORD);
1866 1813
 
1867 1814
             while(len) {
1868 1815
                 bool previousCharacterIsSpace = currentCharacterIsSpace;
@@ -1870,6 +1817,8 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1870 1817
                 nextIsSoftBreakable = false;
1871 1818
                 const TQChar c = str[pos];
1872 1819
                 currentCharacterIsSpace = c == ' ';
1820
+                checkBreakWord &= !w; // only break words when no other breaking opportunity exists earlier
1821
+                                      // on the line (even within the text object we are currently processing)
1873 1822
 
1874 1823
                 if (preserveWS || !currentCharacterIsSpace)
1875 1824
                     isLineEmpty = false;
@@ -1921,13 +1870,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1921 1870
                     }
1922 1871
                 }
1923 1872
 
1924
-                if ( (preserveLF && c == '\n') || (autoWrap && (isBreakable( str, pos, strlen ) || isSoftBreakable)) ) {
1873
+                const bool isbreakablePosition = (preserveLF && c == '\n') || (autoWrap &&
1874
+                                                 (isBreakable( str, pos, strlen ) || isSoftBreakable));
1875
+                if ( isbreakablePosition || checkBreakWord ) {
1925 1876
 
1926 1877
                     tmpW += t->width(lastSpace, pos - lastSpace, f);
1927
-                    if (!appliedStartWidth) {
1928
-                        tmpW += inlineWidth(o, true, false);
1929
-                        appliedStartWidth = true;
1930
-                    }
1931 1878
 #ifdef APPLE_CHANGES
1932 1879
                     applyWordSpacing = (wordSpacing && currentCharacterIsSpace && !previousCharacterIsSpace &&
1933 1880
                         !t->containsOnlyWhitespace(pos+1, strlen-(pos+1)));
@@ -1957,9 +1904,14 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1957 1904
                     }
1958 1905
 
1959 1906
                     if (autoWrap) {
1960
-                        if (w+tmpW > width)
1907
+                        if (w+tmpW > width) {
1908
+                            if (checkBreakWord && pos) {
1909
+                                lBreak.obj = o;
1910
+                                lBreak.pos = pos-1;
1911
+                                lBreak.endOfInline = false;
1912
+                            }
1961 1913
                             goto end;
1962
-                        else if ( (pos > 1 && str[pos-1].unicode() == SOFT_HYPHEN) )
1914
+                        } else if ( (pos > 1 && str[pos-1].unicode() == SOFT_HYPHEN) )
1963 1915
                             // Subtract the width of the soft hyphen out since we fit on a line.
1964 1916
                             tmpW -= t->width(pos-1, 1, f);
1965 1917
                     }
@@ -1967,6 +1919,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1967 1919
                     if( preserveLF && *(str+pos) == '\n' ) {
1968 1920
                         lBreak.obj = o;
1969 1921
                         lBreak.pos = pos;
1922
+                        lBreak.endOfInline = false;
1970 1923
 
1971 1924
 #ifdef DEBUG_LINEBREAKS
1972 1925
                         kdDebug(6041) << "forced break sol: " << start.obj << " " << start.pos << "   end: " << lBreak.obj << " " << lBreak.pos << "   width=" << w << endl;
@@ -1974,11 +1927,12 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
1974 1927
                         return lBreak;
1975 1928
                     }
1976 1929
 
1977
-                    if ( autoWrap ) {
1930
+                    if ( autoWrap && isbreakablePosition ) {
1978 1931
                         w += tmpW;
1979 1932
                         tmpW = 0;
1980 1933
                         lBreak.obj = o;
1981 1934
                         lBreak.pos = pos;
1935
+                        lBreak.endOfInline = false;
1982 1936
                     }
1983 1937
 
1984 1938
                     lastSpace = pos;
@@ -2016,31 +1970,63 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2016 1970
                 len--;
2017 1971
             }
2018 1972
 
2019
-            // IMPORTANT: pos is > length here!
2020
-            if (!ignoringSpaces)
1973
+            if (!ignoringSpaces) {
1974
+                // We didn't find any space that would be beyond the line |width|.
1975
+                // Lets add to |tmpW| the remaining width since the last space we found.
1976
+                // Before we test this new |tmpW| however, we will have to look ahead to check
1977
+                // if the next object/position can serve as a line breaking opportunity.
2021 1978
                 tmpW += t->width(lastSpace, pos - lastSpace, f);
2022
-            if (!appliedStartWidth)
2023
-                tmpW += inlineWidth(o, true, false);
2024
-            if (!appliedEndWidth)
2025
-                tmpW += inlineWidth(o, false, true);
1979
+                if (checkBreakWord && !w && pos && tmpW > width) {
1980
+                    // Avoid doing the costly lookahead for break-word,
1981
+                    // since we know we are allowed to break.
1982
+                    lBreak.obj = o;
1983
+                    lBreak.pos = pos-1;
1984
+                    lBreak.endOfInline = false;
1985
+                    goto end;
1986
+                }
1987
+            }
2026 1988
         } else
2027 1989
             KHTMLAssert( false );
2028 1990
 
2029
-        RenderObject* next = Bidinext(start.par, o, bidi);
2030
-        bool autoWrap = o->style()->autoWrap();
1991
+        InlineMinMaxIterator savedIt = lastIt;
1992
+        lastIt = it;
1993
+        o = it.next();
1994
+
1995
+        // advance the iterator to the next non-inline-flow
1996
+        while (o && o->isInlineFlow() && !o->isWordBreak()) {
1997
+            tmpW += getBorderPaddingMargin(o, it.endOfInline);
1998
+            if (isLineEmpty) isLineEmpty = !tmpW;
1999
+            o = it.next();
2000
+        }
2001
+
2002
+        if (checkShouldIgnoreInitialWhitespace) {
2003
+            // Check if we should switch to ignoringSpaces state
2004
+            if (!style()->preserveWS() && it.current && it.current->isText()) {
2005
+                const RenderText* rt = static_cast<RenderText*>(it.current);
2006
+                if (rt->stringLength() > 0 && (rt->text()[0].category() == TQChar::Separator_Space || rt->text()[0] == '\n')) {
2007
+                    currentCharacterIsSpace = true;
2008
+                    ignoringSpaces = true;
2009
+                    BidiIterator endMid( 0, lastIt.current, 0 );
2010
+                    addMidpoint(endMid);
2011
+                }
2012
+            }
2013
+            checkShouldIgnoreInitialWhitespace = false;
2014
+        }
2015
+
2016
+        bool autoWrap = lastIt.current->style()->autoWrap();
2031 2017
         bool checkForBreak = autoWrap;
2032
-        if (w && w + tmpW > width && lBreak.obj && !o->style()->preserveLF() && !autoWrap)
2018
+        if (w && w + tmpW > width && lBreak.obj && !lastIt.current->style()->preserveLF() && !autoWrap)
2033 2019
             checkForBreak = true;
2034
-        else if (next && o->isText() && next->isText() && !next->isBR()) {
2035
-            if (autoWrap || next->style()->autoWrap()) {
2020
+        else if (it.current && lastIt.current->isText() && it.current->isText() && !it.current->isBR()) {
2021
+            if (autoWrap || it.current->style()->autoWrap()) {
2036 2022
                 if (currentCharacterIsSpace)
2037 2023
                     checkForBreak = true;
2038 2024
                 else {
2039 2025
                     checkForBreak = false;
2040
-                    RenderText* nextText = static_cast<RenderText*>(next);
2026
+                    RenderText* nextText = static_cast<RenderText*>(it.current);
2041 2027
                     if (nextText->stringLength() != 0) {
2042 2028
                         TQChar c = nextText->text()[0];
2043
-                        if (c == ' ' || c == '\t' || (c == '\n' && !next->style()->preserveLF())) {
2029
+                        if (c == ' ' || c == '\t' || (c == '\n' && !it.current->style()->preserveLF())) {
2044 2030
                             // If the next item on the line is text, and if we did not end with
2045 2031
                             // a space, then the next text run continues our word (and so it needs to
2046 2032
                             // keep adding to |tmpW|.  Just update and continue.
@@ -2052,8 +2038,9 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2052 2038
                     if (canPlaceOnLine && checkForBreak) {
2053 2039
                         w += tmpW;
2054 2040
                         tmpW = 0;
2055
-                        lBreak.obj = next;
2041
+                        lBreak.obj = it.current;
2056 2042
                         lBreak.pos = 0;
2043
+                        lBreak.endOfInline = it.endOfInline;
2057 2044
                     }
2058 2045
                 }
2059 2046
             }
@@ -2063,7 +2050,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2063 2050
             //kdDebug() << " too wide w=" << w << " tmpW = " << tmpW << " width = " << width << endl;
2064 2051
             //kdDebug() << "start=" << start.obj << " current=" << o << endl;
2065 2052
             // if we have floats, try to get below them.
2066
-            if (currentCharacterIsSpace && !ignoringSpaces && !o->style()->preserveWS())
2053
+            if (currentCharacterIsSpace && !ignoringSpaces && !lastIt.current->style()->preserveWS())
2067 2054
                 trailingSpaceObject = 0;
2068 2055
 
2069 2056
             int fb = nearestFloatBottom(m_height);
@@ -2087,24 +2074,26 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2087 2074
             // |width| may have been adjusted because we got shoved down past a float (thus
2088 2075
             // giving us more room), so we need to retest, and only jump to
2089 2076
             // the end label if we still don't fit on the line. -dwh
2090
-            if (w + tmpW > width)
2077
+            if (w + tmpW > width) {
2078
+                it = lastIt;
2079
+                lastIt = savedIt;
2080
+                o = it.current;
2091 2081
                 goto end;
2082
+            }
2092 2083
         }
2093 2084
 
2094
-        last = o;
2095
-        o = next;
2096
-
2097
-        if (!last->isFloatingOrPositioned() && last->isReplaced() && last->style()->autoWrap()) {
2085
+        if (!lastIt.current->isFloatingOrPositioned() && lastIt.current->isReplaced() && lastIt.current->style()->autoWrap()) {
2098 2086
             // Go ahead and add in tmpW.
2099 2087
             w += tmpW;
2100 2088
             tmpW = 0;
2101 2089
             lBreak.obj = o;
2102 2090
             lBreak.pos = 0;
2091
+            lBreak.endOfInline = it.endOfInline;
2103 2092
         }
2104 2093
 
2105 2094
         // Clear out our character space bool, since inline <pre>s don't collapse whitespace
2106 2095
         // with adjacent inline normal/nowrap spans.
2107
-        if (last->style()->preserveWS())
2096
+        if (lastIt.current->style()->preserveWS())
2108 2097
             currentCharacterIsSpace = false;
2109 2098
 
2110 2099
         pos = 0;
@@ -2113,9 +2102,10 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2113 2102
 #ifdef DEBUG_LINEBREAKS
2114 2103
     kdDebug( 6041 ) << "end of par, width = " << width << " linewidth = " << w + tmpW << endl;
2115 2104
 #endif
2116
-    if( w + tmpW <= width || (last && !last->style()->autoWrap())) {
2105
+    if( w + tmpW <= width || (lastIt.current && !lastIt.current->style()->autoWrap())) {
2117 2106
         lBreak.obj = 0;
2118 2107
         lBreak.pos = 0;
2108
+        lBreak.endOfInline = false;
2119 2109
     }
2120 2110
 
2121 2111
  end:
@@ -2127,21 +2117,25 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2127 2117
             if(pos != 0) {
2128 2118
                 lBreak.obj = o;
2129 2119
                 lBreak.pos = pos - 1;
2120
+                lBreak.endOfInline = it.endOfInline;
2130 2121
             } else {
2131
-                lBreak.obj = last;
2132
-                lBreak.pos = last->isText() ? last->length() : 0;
2122
+                lBreak.obj = lastIt.current;
2123
+                lBreak.pos = lastIt.current->isText() ? lastIt.current->length() : 0;
2124
+                lBreak.endOfInline = lastIt.endOfInline;
2133 2125
             }
2134 2126
         } else if( lBreak.obj ) {
2135
-            if( last != o ) {
2127
+            if( lastIt.current != o ) {
2136 2128
                 // better to break between object boundaries than in the middle of a word
2137 2129
                 lBreak.obj = o;
2138 2130
                 lBreak.pos = 0;
2131
+                lBreak.endOfInline = it.endOfInline;
2139 2132
             } else {
2140 2133
                 // Don't ever break in the middle of a word if we can help it.
2141 2134
                 // There's no room at all. We just have to be on this line,
2142 2135
                 // even though we'll spill out.
2143 2136
                 lBreak.obj = o;
2144 2137
                 lBreak.pos = pos;
2138
+                lBreak.endOfInline = it.endOfInline;
2145 2139
             }
2146 2140
         }
2147 2141
     }
@@ -2150,8 +2144,11 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start, BidiState &bidi
2150 2144
         start = posStart;
2151 2145
 
2152 2146
     // make sure we consume at least one char/object.
2153
-    if( lBreak == start )
2147
+    // and avoid returning an InlineFlow
2148
+    // (FIXME: turn those wordbreaks into empty text objects - they shouldn't be inline flows!)
2149
+    if( lBreak == start || (lBreak.obj && lBreak.obj->isInlineFlow() && !lBreak.obj->isWordBreak())) {
2154 2150
         lBreak.increment(bidi);
2151
+    }
2155 2152
 
2156 2153
 #ifdef DEBUG_LINEBREAKS
2157 2154
     kdDebug(6041) << "regular break sol: " << start.obj << " " << start.pos << "   end: " << lBreak.obj << " " << lBreak.pos << "   width=" << w << endl;

+ 66
- 0
khtml/rendering/bidi.h View File

@@ -24,6 +24,7 @@
24 24
 #define BIDI_H
25 25
 
26 26
 #include <tqstring.h>
27
+#include "rendering/render_object.h"
27 28
 
28 29
 namespace khtml {
29 30
     class RenderArena;
@@ -101,6 +102,71 @@ public:
101 102
     struct BidiIterator;
102 103
     struct BidiState;
103 104
 
105
+    struct InlineMinMaxIterator
106
+    {
107
+    /* InlineMinMaxIterator is a class that will iterate over all render objects that contribute to
108
+       inline min/max width calculations.  Note the following about the way it walks:
109
+       (1) Positioned content is skipped (since it does not contribute to min/max width of a block)
110
+       (2) We do not drill into the children of floats or replaced elements, since you can't break
111
+           in the middle of such an element.
112
+       (3) Inline flows (e.g., <a>, <span>, <i>) are walked twice, since each side can have
113
+           distinct borders/margin/padding that contribute to the min/max width.
114
+    */
115
+        RenderObject* parent;
116
+        RenderObject* current;
117
+        bool endOfInline;
118
+        bool skipPositioned;
119
+        InlineMinMaxIterator(RenderObject* p, RenderObject* o, bool eOI=false, bool skipPos=true)
120
+            :parent(p), current(o), endOfInline(eOI), skipPositioned(skipPos) {}
121
+        inline RenderObject* next();
122
+    };
123
+
124
+    inline RenderObject* InlineMinMaxIterator::next()
125
+    {
126
+        RenderObject* result = 0;
127
+        bool oldEndOfInline = endOfInline;
128
+        endOfInline = false;
129
+        while (current != 0 || (current == parent))
130
+        {
131
+            //kDebug( 6040 ) << "current = " << current;
132
+            if (!oldEndOfInline &&
133
+                (current == parent ||
134
+                (!current->isFloating() && !current->isReplaced() && !current->isPositioned())))
135
+                result = current->firstChild();
136
+            if (!result) {
137
+                // We hit the end of our inline. (It was empty, e.g., <span></span>.)
138
+                if (!oldEndOfInline && current->isInlineFlow()) {
139
+                    result = current;
140
+                    endOfInline = true;
141
+                    break;
142
+                }
143
+                while (current && current != parent) {
144
+                    result = current->nextSibling();
145
+                    if (result) break;
146
+                    current = current->parent();
147
+                    if (current && current != parent && current->isInlineFlow()) {
148
+                        result = current;
149
+                        endOfInline = true;
150
+                        break;
151
+                    }
152
+                }
153
+            }
154
+
155
+            if (!result) break;
156
+
157
+            if ((!skipPositioned || !result->isPositioned()) && (result->isText() || result->isBR() ||
158
+                result->isFloatingOrPositioned() || result->isReplaced() || result->isGlyph() || result->isInlineFlow()))
159
+                break;
160
+
161
+            current = result;
162
+            result = 0;
163
+        }
164
+
165
+        // Update our position.
166
+        current = result;
167
+        return current;
168
+    }
169
+
104 170
 }
105 171
 
106 172
 #endif

+ 0
- 68
khtml/rendering/render_block.cpp View File

@@ -2623,74 +2623,6 @@ void RenderBlock::calcMinMaxWidth()
2623 2623
     // ### compare with min/max width set in style sheet...
2624 2624
 }
2625 2625
 
2626
-struct InlineMinMaxIterator
2627
-{
2628
-/* InlineMinMaxIterator is a class that will iterate over all render objects that contribute to
2629
-   inline min/max width calculations.  Note the following about the way it walks:
2630
-   (1) Positioned content is skipped (since it does not contribute to min/max width of a block)
2631
-   (2) We do not drill into the children of floats or replaced elements, since you can't break
2632
-       in the middle of such an element.
2633
-   (3) Inline flows (e.g., <a>, <span>, <i>) are walked twice, since each side can have
2634
-       distinct borders/margin/padding that contribute to the min/max width.
2635
-*/
2636
-    RenderObject* parent;
2637
-    RenderObject* current;
2638
-    bool endOfInline;
2639
-
2640
-    InlineMinMaxIterator(RenderObject* p, RenderObject* o, bool end = false)
2641
-        :parent(p), current(o), endOfInline(end) {}
2642
-
2643
-    RenderObject* next();
2644
-};
2645
-
2646
-RenderObject* InlineMinMaxIterator::next()
2647
-{
2648
-    RenderObject* result = 0;
2649
-    bool oldEndOfInline = endOfInline;
2650
-    endOfInline = false;
2651
-    while (current != 0 || (current == parent))
2652
-    {
2653
-        //kdDebug( 6040 ) << "current = " << current << endl;
2654
-        if (!oldEndOfInline &&
2655
-            (current == parent ||
2656
-             (!current->isFloating() && !current->isReplaced() && !current->isPositioned())))
2657
-            result = current->firstChild();
2658
-        if (!result) {
2659
-            // We hit the end of our inline. (It was empty, e.g., <span></span>.)
2660
-            if (!oldEndOfInline && current->isInlineFlow()) {
2661
-                result = current;
2662
-                endOfInline = true;
2663
-                break;
2664
-            }
2665
-
2666
-            while (current && current != parent) {
2667
-                result = current->nextSibling();
2668
-                if (result) break;
2669
-                current = current->parent();
2670
-                if (current && current != parent && current->isInlineFlow()) {
2671
-                    result = current;
2672
-                    endOfInline = true;
2673
-                    break;
2674
-                }
2675
-            }
2676
-        }
2677
-
2678
-        if (!result) break;
2679
-
2680
-        if (!result->isPositioned() && (result->isText() || result->isBR() ||
2681
-            result->isFloating() || result->isReplaced() ||
2682
-            result->isInlineFlow()))
2683
-            break;
2684
-
2685
-        current = result;
2686
-        result = 0;
2687
-    }
2688
-
2689
-    // Update our position.
2690
-    current = result;
2691
-    return current;
2692
-}
2693
-
2694 2626
 // bidi.cpp defines the following functions too.
2695 2627
 // Maybe these should not be static, after all...
2696 2628
 

+ 2
- 2
khtml/rendering/render_line.cpp View File

@@ -271,8 +271,8 @@ bool InlineFlowBox::onEndChain(RenderObject* endObject)
271 271
 
272 272
     RenderObject* curr = endObject;
273 273
     RenderObject* parent = curr->parent();
274
-    while (parent && !parent->isRenderBlock() || parent == object()) {
275
-        if (parent->lastChild() != curr)
274
+    while (parent && !parent->isRenderBlock()) {
275
+        if (parent->lastChild() != curr || parent == object())
276 276
             return false;
277 277
 
278 278
         curr = parent;

+ 5
- 0
khtml/rendering/render_object.cpp View File

@@ -244,6 +244,11 @@ bool RenderObject::isHR() const
244 244
     return element() && element()->id() == ID_HR;
245 245
 }
246 246
 
247
+bool RenderObject::isWordBreak() const
248
+{
249
+    return element() && element()->id() == ID_WBR;
250
+}
251
+
247 252
 bool RenderObject::isHTMLMarquee() const
248 253
 {
249 254
     return element() && element()->renderer() == this && element()->id() == ID_MARQUEE;

+ 1
- 0
khtml/rendering/render_object.h View File

@@ -282,6 +282,7 @@ public:
282 282
     virtual bool isApplet() const { return false; }
283 283
 
284 284
     bool isHTMLMarquee() const;
285
+    bool isWordBreak() const;
285 286
 
286 287
     bool isAnonymous() const { return m_isAnonymous; }
287 288
     void setIsAnonymous(bool b) { m_isAnonymous = b; }

+ 3
- 2
khtml/rendering/render_style.cpp View File

@@ -429,7 +429,7 @@ bool StyleCSS3NonInheritedData::operator==(const StyleCSS3NonInheritedData& o) c
429 429
 }
430 430
 
431 431
 StyleCSS3InheritedData::StyleCSS3InheritedData()
432
-:Shared<StyleCSS3InheritedData>(), textShadow(0)
432
+:Shared<StyleCSS3InheritedData>(), textShadow(0), wordWrap(RenderStyle::initialWordWrap())
433 433
 #ifdef APPLE_CHANGES
434 434
 , userModify(READ_ONLY), textSizeAdjust(RenderStyle::initialTextSizeAdjust())
435 435
 #endif
@@ -441,6 +441,7 @@ StyleCSS3InheritedData::StyleCSS3InheritedData(const StyleCSS3InheritedData& o)
441 441
 :Shared<StyleCSS3InheritedData>()
442 442
 {
443 443
     textShadow = o.textShadow ? new ShadowData(*o.textShadow) : 0;
444
+    wordWrap = o.wordWrap;
444 445
 #ifdef APPLE_CHANGES
445 446
     userModify = o.userModify;
446 447
     textSizeAdjust = o.textSizeAdjust;
@@ -454,7 +455,7 @@ StyleCSS3InheritedData::~StyleCSS3InheritedData()
454 455
 
455 456
 bool StyleCSS3InheritedData::operator==(const StyleCSS3InheritedData& o) const
456 457
 {
457
-    return shadowDataEquivalent(o)
458
+    return shadowDataEquivalent(o) && (wordWrap == o.wordWrap)
458 459
 #ifdef APPLE_CHANGES
459 460
             && (userModify == o.userModify) && (textSizeAdjust == o.textSizeAdjust)
460 461
 #endif

+ 7
- 0
khtml/rendering/render_style.h View File

@@ -192,6 +192,9 @@ enum EFloat {
192 192
     FNONE = 0, FLEFT = 0x01, FRIGHT = 0x02, FLEFT_ALIGN = 0x05, FRIGHT_ALIGN = 0x06
193 193
 };
194 194
 
195
+enum EWordWrap {
196
+  WWNORMAL = 0, WWBREAKWORD = 0x01
197
+};
195 198
 
196 199
 //------------------------------------------------
197 200
 // Border attributes. Not inherited.
@@ -702,6 +705,7 @@ class StyleCSS3InheritedData : public Shared<StyleCSS3InheritedData>
702 705
         EUserModify userModify : 2; // Flag used for editing state
703 706
         bool textSizeAdjust : 1;    // An Apple extension.  Not really CSS3 but not worth making a new struct over.
704 707
 #endif
708
+        EWordWrap wordWrap : 1;
705 709
     private:
706 710
         StyleCSS3InheritedData &operator=(const StyleCSS3InheritedData &);
707 711
 };
@@ -1195,6 +1199,7 @@ public:
1195 1199
         return background->m_outline._offset;
1196 1200
     }
1197 1201
     ShadowData* textShadow() const { return css3InheritedData->textShadow; }
1202
+    EWordWrap wordWrap() const { return css3InheritedData->wordWrap; }
1198 1203
     float opacity() { return css3NonInheritedData->opacity; }
1199 1204
     EUserInput userInput() const { return inherited_flags.f._user_input; }
1200 1205
 
@@ -1346,6 +1351,7 @@ public:
1346 1351
     // CSS3 Setters
1347 1352
     void setBoxSizing( EBoxSizing b ) { SET_VAR(box,box_sizing,b); }
1348 1353
     void setOutlineOffset(unsigned short v) {  SET_VAR(background,m_outline._offset,v) }
1354
+    void setWordWrap(EWordWrap w) { SET_VAR(css3InheritedData, wordWrap, w); }
1349 1355
     void setTextShadow(ShadowData* val, bool add=false);
1350 1356
     void setOpacity(float f) { SET_VAR(css3NonInheritedData, opacity, f); }
1351 1357
     void setUserInput(EUserInput ui) { inherited_flags.f._user_input = ui; }
@@ -1424,6 +1430,7 @@ public:
1424 1430
     static EDisplay initialDisplay() { return INLINE; }
1425 1431
     static EEmptyCell initialEmptyCells() { return SHOW; }
1426 1432
     static EFloat initialFloating() { return FNONE; }
1433
+    static EWordWrap initialWordWrap() { return WWNORMAL; }
1427 1434
     static EListStylePosition initialListStylePosition() { return OUTSIDE; }
1428 1435
     static EListStyleType initialListStyleType() { return LDISC; }
1429 1436
     static EOverflow initialOverflowX() { return OVISIBLE; }

Loading…
Cancel
Save