Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: Source/core/layout/LayoutListMarker.cpp

Issue 1184433004: Implement chinese counter styles (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSValueKeywords.in ('k') | Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com) 6 * Copyright (C) 2010 Daniel Bates (dbates@intudata.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 static const UChar georgianOnes[9] = { 310 static const UChar georgianOnes[9] = {
311 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10F1, 0x10 D7 311 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10F1, 0x10 D7
312 }; 312 };
313 letters[length++] = georgianOnes[ones - 1]; 313 letters[length++] = georgianOnes[ones - 1];
314 } 314 }
315 315
316 ASSERT(length <= lettersSize); 316 ASSERT(length <= lettersSize);
317 return String(letters, length); 317 return String(letters, length);
318 } 318 }
319 319
320 enum CJKLang {
321 Chinese = 1,
322 Korean,
323 Japanese
324 };
325
326 enum CJKStyle {
327 Formal,
328 Informal
329 };
330
320 // The table uses the order from the CSS3 specification: 331 // The table uses the order from the CSS3 specification:
321 // first 3 group markers, then 3 digit markers, then ten digits, then negative s ymbols. 332 // first 3 group markers, then 3 digit markers, then ten digits, then negative s ymbols.
322 static String toCJKIdeographic(int number, const UChar table[23]) 333 static String toCJKIdeographic(int number, const UChar table[26], CJKStyle cjkSt yle)
323 { 334 {
324 enum AbstractCJKChar { 335 enum AbstractCJKChar {
325 NoChar = 0, 336 NoChar = 0,
326 Lang = 0, 337 Lang = 0,
327 SecondGroupMarker, ThirdGroupMarker, FourthGroupMarker, 338 // FourthGroupMarker for simplified chinese has two codepoints, to simpl ify
328 SecondDigitMarker, ThirdDigitMarker, FourthDigitMarker, 339 // the main algorithm below use two codepoints for all group markers.
340 SecondGroupMarker = 1, ThirdGroupMarker = 3, FourthGroupMarker = 5,
341 SecondDigitMarker = 7, ThirdDigitMarker, FourthDigitMarker,
329 Digit0, Digit1, Digit2, Digit3, Digit4, 342 Digit0, Digit1, Digit2, Digit3, Digit4,
330 Digit5, Digit6, Digit7, Digit8, Digit9, 343 Digit5, Digit6, Digit7, Digit8, Digit9,
331 Neg1, Neg2, Neg3, Neg4, Neg5 344 Neg1, Neg2, Neg3, Neg4, Neg5
332 }; 345 };
333 346
334 enum CJKLang {
335 Chinese = 1,
336 Korean,
337 Japanese
338 };
339
340 if (number == 0) 347 if (number == 0)
341 return String(&table[Digit0], 1); 348 return String(&table[Digit0], 1);
342 349
343 const bool negative = number < 0; 350 const bool negative = number < 0;
344 if (negative) 351 if (negative)
345 number = -number; 352 number = -number;
346 353
347 const int groupLength = 8; // 4 digits, 3 digit markers, and a group marker 354 const int groupLength = 9; // 4 digits, 3 digit markers, group marker of siz e 2.
348 const int bufferLength = 4 * groupLength; 355 const int bufferLength = 4 * groupLength;
349 AbstractCJKChar buffer[bufferLength] = { NoChar }; 356 AbstractCJKChar buffer[bufferLength] = { NoChar };
350 357
351 for (int i = 0; i < 4; ++i) { 358 for (int i = 0; i < 4; ++i) {
352 int groupValue = number % 10000; 359 int groupValue = number % 10000;
353 number /= 10000; 360 number /= 10000;
354 361
355 // Process least-significant group first, but put it in the buffer last. 362 // Process least-significant group first, but put it in the buffer last.
356 AbstractCJKChar* group = &buffer[(3 - i) * groupLength]; 363 AbstractCJKChar* group = &buffer[(3 - i) * groupLength];
357 364
358 if (groupValue && i) 365 if (groupValue && i) {
366 group[8] = static_cast<AbstractCJKChar>(SecondGroupMarker + i);
359 group[7] = static_cast<AbstractCJKChar>(SecondGroupMarker - 1 + i); 367 group[7] = static_cast<AbstractCJKChar>(SecondGroupMarker - 1 + i);
368 }
360 369
361 // Put in the four digits and digit markers for any non-zero digits. 370 // Put in the four digits and digit markers for any non-zero digits.
362 int digitValue = (groupValue % 10); 371 int digitValue = (groupValue % 10);
363 bool trailingZero = table[Lang] == Chinese && !digitValue; 372 bool trailingZero = table[Lang] == Chinese && !digitValue;
364 if (digitValue) 373 if (digitValue)
365 group[6] = static_cast<AbstractCJKChar>(Digit0 + (groupValue % 10)); 374 group[6] = static_cast<AbstractCJKChar>(Digit0 + (groupValue % 10));
366 if (number != 0 || groupValue > 9) { 375 if (number != 0 || groupValue > 9) {
367 digitValue = ((groupValue / 10) % 10); 376 digitValue = ((groupValue / 10) % 10);
368 if (digitValue || !trailingZero) 377 if (digitValue || !trailingZero)
369 group[4] = static_cast<AbstractCJKChar>(Digit0 + digitValue); 378 group[4] = static_cast<AbstractCJKChar>(Digit0 + digitValue);
(...skipping 12 matching lines...) Expand all
382 if (number != 0 || groupValue > 999) { 391 if (number != 0 || groupValue > 999) {
383 digitValue = groupValue / 1000; 392 digitValue = groupValue / 1000;
384 if (digitValue || !trailingZero) 393 if (digitValue || !trailingZero)
385 group[0] = static_cast<AbstractCJKChar>(Digit0 + digitValue); 394 group[0] = static_cast<AbstractCJKChar>(Digit0 + digitValue);
386 if (digitValue) 395 if (digitValue)
387 group[1] = FourthDigitMarker; 396 group[1] = FourthDigitMarker;
388 } 397 }
389 398
390 if (trailingZero && i > 0) { 399 if (trailingZero && i > 0) {
391 group[6] = group[7]; 400 group[6] = group[7];
392 group[7] = Digit0; 401 group[7] = group[8];
402 group[8] = Digit0;
393 } 403 }
394 404
395 // Remove the tens digit, but leave the marker, for any group that has 405 // Remove the tens digit, but leave the marker, for any group that has
396 // a value of less than 20. 406 // a value of less than 20.
397 if (table[Lang] == Chinese && groupValue < 20) { 407 if (table[Lang] == Chinese && cjkStyle == Informal && groupValue < 20) {
398 ASSERT(group[4] == NoChar || group[4] == Digit0 || group[4] == Digit 1); 408 ASSERT(group[4] == NoChar || group[4] == Digit0 || group[4] == Digit 1);
399 group[4] = NoChar; 409 group[4] = NoChar;
400 } 410 }
401 411
402 if (number == 0) 412 if (number == 0)
403 break; 413 break;
404 } 414 }
405 415
406 // Convert into characters, omitting consecutive runs of Digit0 and 416 // Convert into characters, omitting consecutive runs of Digit0 and
407 // any trailing Digit0. 417 // any trailing Digit0.
408 int length = 0; 418 int length = 0;
409 const int maxLengthForNegativeSymbols = 5; 419 const int maxLengthForNegativeSymbols = 5;
410 UChar characters[bufferLength + maxLengthForNegativeSymbols]; 420 UChar characters[bufferLength + maxLengthForNegativeSymbols];
411 AbstractCJKChar last = NoChar; 421 AbstractCJKChar last = NoChar;
412 if (negative) { 422 if (negative) {
413 while (UChar a = table[Neg1 + length]) 423 while (UChar a = table[Neg1 + length])
414 characters[length++] = a; 424 characters[length++] = a;
415 } 425 }
416 for (int i = 0; i < bufferLength; ++i) { 426 for (int i = 0; i < bufferLength; ++i) {
417 AbstractCJKChar a = buffer[i]; 427 AbstractCJKChar a = buffer[i];
418 if (a != NoChar) { 428 if (a != NoChar) {
419 if (a != Digit0 || (table[Lang] == Chinese && last != Digit0)) { 429 if (a != Digit0 || (table[Lang] == Chinese && last != Digit0)) {
420 characters[length++] = table[a]; 430 UChar newChar = table[a];
421 if (table[Lang] == Korean && a >= SecondGroupMarker && a <= Four thGroupMarker) 431 if (newChar != NoChar) {
422 characters[length++] = ' '; 432 characters[length++] = table[a];
433 if (table[Lang] == Korean && (a == SecondGroupMarker || a == ThirdGroupMarker || a == FourthGroupMarker))
434 characters[length++] = ' ';
435 }
423 } 436 }
424 last = a; 437 last = a;
425 } 438 }
426 } 439 }
427 if ((table[Lang] == Chinese && last == Digit0) || characters[length - 1] == ' ') 440 if ((table[Lang] == Chinese && last == Digit0) || characters[length - 1] == ' ')
428 --length; 441 --length;
429 442
430 return String(characters, length); 443 return String(characters, length);
431 } 444 }
432 445
(...skipping 21 matching lines...) Expand all
454 case NoneListStyle: 467 case NoneListStyle:
455 case Oriya: 468 case Oriya:
456 case Persian: 469 case Persian:
457 case Square: 470 case Square:
458 case Telugu: 471 case Telugu:
459 case Thai: 472 case Thai:
460 case Tibetan: 473 case Tibetan:
461 case Urdu: 474 case Urdu:
462 case KoreanHangulFormal: 475 case KoreanHangulFormal:
463 case CJKIdeographic: 476 case CJKIdeographic:
477 case SimpChineseFormal:
478 case SimpChineseInformal:
479 case TradChineseFormal:
480 case TradChineseInformal:
464 return type; // Can represent all ordinals. 481 return type; // Can represent all ordinals.
465 case Armenian: 482 case Armenian:
466 case LowerArmenian: 483 case LowerArmenian:
467 case UpperArmenian: 484 case UpperArmenian:
468 return (value < 1 || value > 99999999) ? DecimalListStyle : type; 485 return (value < 1 || value > 99999999) ? DecimalListStyle : type;
469 case Georgian: 486 case Georgian:
470 return (value < 1 || value > 19999) ? DecimalListStyle : type; 487 return (value < 1 || value > 19999) ? DecimalListStyle : type;
471 case Hebrew: 488 case Hebrew:
472 return (value < 0 || value > 999999) ? DecimalListStyle : type; 489 return (value < 0 || value > 999999) ? DecimalListStyle : type;
473 case LowerRoman: 490 case LowerRoman:
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 case Persian: 568 case Persian:
552 case Telugu: 569 case Telugu:
553 case Thai: 570 case Thai:
554 case Tibetan: 571 case Tibetan:
555 case UpperAlpha: 572 case UpperAlpha:
556 case UpperArmenian: 573 case UpperArmenian:
557 case UpperLatin: 574 case UpperLatin:
558 case UpperRoman: 575 case UpperRoman:
559 case Urdu: 576 case Urdu:
560 return '.'; 577 return '.';
578 case SimpChineseFormal:
579 case SimpChineseInformal:
580 case TradChineseFormal:
581 case TradChineseInformal:
561 case KoreanHangulFormal: 582 case KoreanHangulFormal:
562 return ','; 583 return 0x3001;
563 } 584 }
564 585
565 ASSERT_NOT_REACHED(); 586 ASSERT_NOT_REACHED();
566 return '.'; 587 return '.';
567 } 588 }
568 589
569 String listMarkerText(EListStyleType type, int value) 590 String listMarkerText(EListStyleType type, int value)
570 { 591 {
571 // If the list-style-type, say hebrew, cannot represent |value| because it's outside 592 // If the list-style-type, say hebrew, cannot represent |value| because it's outside
572 // its ordinal range then we fallback to some list style that can represent |value|. 593 // its ordinal range then we fallback to some list style that can represent |value|.
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 case EthiopicHalehameTiEt: { 849 case EthiopicHalehameTiEt: {
829 static const UChar ethiopicHalehameTiEtAlphabet[34] = { 850 static const UChar ethiopicHalehameTiEtAlphabet[34] = {
830 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12 40, 851 0x1200, 0x1208, 0x1210, 0x1218, 0x1220, 0x1228, 0x1230, 0x1238, 0x12 40,
831 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12 A8, 852 0x1250, 0x1260, 0x1270, 0x1278, 0x1280, 0x1290, 0x1298, 0x12A0, 0x12 A8,
832 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x13 08, 853 0x12B8, 0x12C8, 0x12D0, 0x12D8, 0x12E0, 0x12E8, 0x12F0, 0x1300, 0x13 08,
833 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350 854 0x1320, 0x1328, 0x1330, 0x1338, 0x1340, 0x1348, 0x1350
834 }; 855 };
835 return toAlphabetic(value, ethiopicHalehameTiEtAlphabet); 856 return toAlphabetic(value, ethiopicHalehameTiEtAlphabet);
836 } 857 }
837 case KoreanHangulFormal: { 858 case KoreanHangulFormal: {
838 static const UChar koreanHangulFormalTable[23] = { 859 static const UChar koreanHangulFormalTable[26] = {
839 0x2, 860 Korean,
840 0xB9CC, 0xC5B5, 0xC870, 861 0xB9CC, 0x0000, 0xC5B5, 0x0000, 0xC870, 0x0000,
841 0xC2ED, 0xBC31, 0xCC9C, 862 0xC2ED, 0xBC31, 0xCC9C,
842 0xC601, 0xC77C, 0xC774, 0xC0BC, 0xC0AC, 863 0xC601, 0xC77C, 0xC774, 0xC0BC, 0xC0AC,
843 0xC624, 0xC721, 0xCE60, 0xD314, 0xAD6C, 864 0xC624, 0xC721, 0xCE60, 0xD314, 0xAD6C,
844 0xB9C8, 0xC774, 0xB108, 0xC2A4, 0x0020, 0x0000 865 0xB9C8, 0xC774, 0xB108, 0xC2A4, 0x0020, 0x0000
845 }; 866 };
846 return toCJKIdeographic(value, koreanHangulFormalTable); 867 return toCJKIdeographic(value, koreanHangulFormalTable, Formal);
847 } 868 }
848 case CJKIdeographic: { 869 case CJKIdeographic:
849 static const UChar traditionalChineseInformalTable[19] = { 870 case TradChineseInformal: {
850 0x1, 871 static const UChar traditionalChineseInformalTable[22] = {
851 0x842C, 0x5104, 0x5146, 872 Chinese,
873 0x842C, 0x0000, 0x5104, 0x0000, 0x5146, 0x0000,
852 0x5341, 0x767E, 0x5343, 874 0x5341, 0x767E, 0x5343,
853 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB, 875 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB,
854 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D, 876 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D,
855 0x8CA0, 0x0000 877 0x8CA0, 0x0000
856 }; 878 };
857 return toCJKIdeographic(value, traditionalChineseInformalTable); 879 return toCJKIdeographic(value, traditionalChineseInformalTable, Informal );
880 }
881 case SimpChineseInformal: {
882 static const UChar simpleChineseInformalTable[22] = {
883 Chinese,
884 0x4E07, 0x0000, 0x4EBF, 0x0000, 0x4E07, 0x4EBF,
885 0x5341, 0x767E, 0x5343,
886 0x96F6, 0x4E00, 0x4E8C, 0x4E09, 0x56DB,
887 0x4E94, 0x516D, 0x4E03, 0x516B, 0x4E5D,
888 0x8D1F, 0x0000
889 };
890 return toCJKIdeographic(value, simpleChineseInformalTable, Informal);
891 }
892 case TradChineseFormal: {
893 static const UChar traditionalChineseFormalTable[22] = {
894 Chinese,
895 0x842C, 0x0000, 0x5104, 0x0000, 0x5146, 0x0000,
896 0x62FE, 0x4F70, 0x4EDF,
897 0x96F6, 0x58F9, 0x8CB3, 0x53C3, 0x8086,
898 0x4F0D, 0x9678, 0x67D2, 0x634C, 0x7396,
899 0x8CA0, 0x0000
900 };
901 return toCJKIdeographic(value, traditionalChineseFormalTable, Formal);
902 }
903 case SimpChineseFormal: {
904 static const UChar simpleChineseFormalTable[22] = {
905 Chinese,
906 0x4E07, 0x0000, 0x4EBF, 0x0000, 0x4E07, 0x4EBF,
907 0x62FE, 0x4F70, 0x4EDF,
908 0x96F6, 0x58F9, 0x8D30, 0x53C1, 0x8086,
909 0x4F0D, 0x9646, 0x67D2, 0x634C, 0x7396,
910 0x8D1F, 0x0000
911 };
912 return toCJKIdeographic(value, simpleChineseFormalTable, Formal);
858 } 913 }
859 914
860 case LowerRoman: 915 case LowerRoman:
861 return toRoman(value, false); 916 return toRoman(value, false);
862 case UpperRoman: 917 case UpperRoman:
863 return toRoman(value, true); 918 return toRoman(value, true);
864 919
865 case Armenian: 920 case Armenian:
866 case UpperArmenian: 921 case UpperArmenian:
867 // CSS3 says "armenian" means "lower-armenian". 922 // CSS3 says "armenian" means "lower-armenian".
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1062 case LowerAlpha: 1117 case LowerAlpha:
1063 case LowerArmenian: 1118 case LowerArmenian:
1064 case LowerGreek: 1119 case LowerGreek:
1065 case LowerLatin: 1120 case LowerLatin:
1066 case LowerRoman: 1121 case LowerRoman:
1067 case Malayalam: 1122 case Malayalam:
1068 case Mongolian: 1123 case Mongolian:
1069 case Myanmar: 1124 case Myanmar:
1070 case Oriya: 1125 case Oriya:
1071 case Persian: 1126 case Persian:
1127 case SimpChineseFormal:
1128 case SimpChineseInformal:
1072 case Telugu: 1129 case Telugu:
1073 case Thai: 1130 case Thai:
1074 case Tibetan: 1131 case Tibetan:
1132 case TradChineseFormal:
1133 case TradChineseInformal:
1075 case UpperAlpha: 1134 case UpperAlpha:
1076 case UpperArmenian: 1135 case UpperArmenian:
1077 case UpperLatin: 1136 case UpperLatin:
1078 case UpperRoman: 1137 case UpperRoman:
1079 case Urdu: 1138 case Urdu:
1080 m_text = listMarkerText(type, m_listItem->value()); 1139 m_text = listMarkerText(type, m_listItem->value());
1081 break; 1140 break;
1082 } 1141 }
1083 } 1142 }
1084 1143
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 case LowerAlpha: 1197 case LowerAlpha:
1139 case LowerArmenian: 1198 case LowerArmenian:
1140 case LowerGreek: 1199 case LowerGreek:
1141 case LowerLatin: 1200 case LowerLatin:
1142 case LowerRoman: 1201 case LowerRoman:
1143 case Malayalam: 1202 case Malayalam:
1144 case Mongolian: 1203 case Mongolian:
1145 case Myanmar: 1204 case Myanmar:
1146 case Oriya: 1205 case Oriya:
1147 case Persian: 1206 case Persian:
1207 case SimpChineseFormal:
1208 case SimpChineseInformal:
1148 case Telugu: 1209 case Telugu:
1149 case Thai: 1210 case Thai:
1150 case Tibetan: 1211 case Tibetan:
1212 case TradChineseFormal:
1213 case TradChineseInformal:
1151 case UpperAlpha: 1214 case UpperAlpha:
1152 case UpperArmenian: 1215 case UpperArmenian:
1153 case UpperLatin: 1216 case UpperLatin:
1154 case UpperRoman: 1217 case UpperRoman:
1155 case Urdu: 1218 case Urdu:
1156 if (m_text.isEmpty()) { 1219 if (m_text.isEmpty()) {
1157 logicalWidth = 0; 1220 logicalWidth = 0;
1158 } else { 1221 } else {
1159 LayoutUnit itemWidth = font.width(m_text); 1222 LayoutUnit itemWidth = font.width(m_text);
1160 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()) , ' ' }; 1223 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()) , ' ' };
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 case LowerAlpha: 1373 case LowerAlpha:
1311 case LowerArmenian: 1374 case LowerArmenian:
1312 case LowerGreek: 1375 case LowerGreek:
1313 case LowerLatin: 1376 case LowerLatin:
1314 case LowerRoman: 1377 case LowerRoman:
1315 case Malayalam: 1378 case Malayalam:
1316 case Mongolian: 1379 case Mongolian:
1317 case Myanmar: 1380 case Myanmar:
1318 case Oriya: 1381 case Oriya:
1319 case Persian: 1382 case Persian:
1383 case SimpChineseFormal:
1384 case SimpChineseInformal:
1320 case Telugu: 1385 case Telugu:
1321 case Thai: 1386 case Thai:
1322 case Tibetan: 1387 case Tibetan:
1388 case TradChineseFormal:
1389 case TradChineseInformal:
1323 case UpperAlpha: 1390 case UpperAlpha:
1324 case UpperArmenian: 1391 case UpperArmenian:
1325 case UpperLatin: 1392 case UpperLatin:
1326 case UpperRoman: 1393 case UpperRoman:
1327 case Urdu: 1394 case Urdu:
1328 if (m_text.isEmpty()) 1395 if (m_text.isEmpty())
1329 return IntRect(); 1396 return IntRect();
1330 const Font& font = style()->font(); 1397 const Font& font = style()->font();
1331 int itemWidth = font.width(m_text); 1398 int itemWidth = font.width(m_text);
1332 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; 1399 UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' };
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 if (style()) { 1443 if (style()) {
1377 // Reuse the current margins. Otherwise resetting the margins to initial values 1444 // Reuse the current margins. Otherwise resetting the margins to initial values
1378 // would trigger unnecessary layout. 1445 // would trigger unnecessary layout.
1379 newStyle->setMarginStart(style()->marginStart()); 1446 newStyle->setMarginStart(style()->marginStart());
1380 newStyle->setMarginEnd(style()->marginRight()); 1447 newStyle->setMarginEnd(style()->marginRight());
1381 } 1448 }
1382 setStyle(newStyle.release()); 1449 setStyle(newStyle.release());
1383 } 1450 }
1384 1451
1385 } // namespace blink 1452 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSValueKeywords.in ('k') | Source/core/paint/ListMarkerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698