Changeset 18671 in webkit
- Timestamp:
- Jan 8, 2007 11:15:43 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r18670 r18671 1 2007-01-08 Darin Adler <darin@apple.com> 2 3 - added a W3C list style test that was cited in a bug 4 5 * fast/lists/w3-list-styles-expected.checksum: Added. 6 * fast/lists/w3-list-styles-expected.png: Added. 7 * fast/lists/w3-list-styles-expected.txt: Added. 8 * fast/lists/w3-list-styles.html: Added. 9 1 10 2007-01-08 Darin Adler <darin@apple.com> 2 11 -
trunk/WebCore/ChangeLog
r18670 r18671 1 2007-01-08 Darin Adler <darin@apple.com> 2 3 Reviewed by Maciej. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=3232 6 CSS2: Web Kit does not support all list style types 7 8 Test case showed problems in cjk-ideographic and hebrew 9 Test: fast/lists/w3-list-styles.html 10 11 * rendering/RenderListMarker.cpp: 12 (WebCore::toCJKIdeographic): Fix the algorithm so it doesn't include leading zeroes. 13 I had misread the part that says you start with the decimal form of the number. 14 Fix an assertion that was too stringent. Fix the code to collapse consecutive zeroes 15 so that it doesn't get confused by intervening "noChar" characters. 16 (WebCore::RenderListMarker::paint): Reverse the text before painting if the first character's 17 direction is right to left. 18 1 19 2007-01-08 Darin Adler <darin@apple.com> 2 20 -
trunk/WebCore/rendering/RenderListMarker.cpp
r18654 r18671 36 36 37 37 using namespace std; 38 namespace Unicode = WTF::Unicode; 38 39 39 40 namespace WebCore { … … 280 281 group[7] = static_cast<AbstractCJKChar>(secondGroupMarker - 1 + i); 281 282 282 // Put in the four digits .283 // Put in the four digits and digit markers for any non-zero digits. 283 284 group[0] = static_cast<AbstractCJKChar>(digit0 + (groupValue % 10)); 284 group[1] = static_cast<AbstractCJKChar>(digit0 + ((groupValue / 10) % 10)); 285 group[3] = static_cast<AbstractCJKChar>(digit0 + ((groupValue / 100) % 10)); 286 group[5] = static_cast<AbstractCJKChar>(digit0 + groupValue / 1000); 287 288 // Put in digit markers for any non-zero digits. 289 if (group[1] != digit0) 290 group[2] = secondDigitMarker; 291 if (group[3] != digit0) 292 group[4] = thirdDigitMarker; 293 if (group[5] != digit0) 294 group[6] = fourthDigitMarker; 285 if (number != 0 || groupValue > 9) { 286 int digitValue = ((groupValue / 10) % 10); 287 group[1] = static_cast<AbstractCJKChar>(digit0 + digitValue); 288 if (digitValue) 289 group[2] = secondDigitMarker; 290 } 291 if (number != 0 || groupValue > 99) { 292 int digitValue = ((groupValue / 100) % 10); 293 group[3] = static_cast<AbstractCJKChar>(digit0 + digitValue); 294 if (digitValue) 295 group[4] = thirdDigitMarker; 296 } 297 if (number != 0 || groupValue > 999) { 298 int digitValue = groupValue / 1000; 299 group[5] = static_cast<AbstractCJKChar>(digit0 + digitValue); 300 if (digitValue) 301 group[6] = fourthDigitMarker; 302 } 295 303 296 304 // Remove the tens digit, but leave the marker, for any group that has 297 305 // a value of less than 20. 298 306 if (groupValue < 20) { 299 ASSERT(group[1] == noChar || group[1] == digit 1);307 ASSERT(group[1] == noChar || group[1] == digit0 || group[1] == digit1); 300 308 group[1] = noChar; 301 309 } 310 311 if (number == 0) 312 break; 302 313 } 303 314 … … 308 319 for (int i = 0; i < bufferLength; ++i) { 309 320 AbstractCJKChar a = buffer[i]; 310 if (a != noChar && (a != digit0 || last != digit0)) 311 characters[length++] = table[a - 1]; 312 last = a; 321 if (a != noChar) { 322 if (a != digit0 || last != digit0) 323 characters[length++] = table[a - 1]; 324 last = a; 325 } 313 326 } 314 327 return String(characters, length); … … 601 614 if (m_text.isEmpty()) 602 615 return; 616 617 TextRun textRun(m_text.impl()); 618 619 // Text is not arbitrary. We can judge whether it's RTL from the first character, 620 // and we only need to handle the direction RightToLeft for now. 621 bool textNeedsReversing = Unicode::direction(m_text[0]) == Unicode::RightToLeft; 622 Vector<UChar> reversedText; 623 if (textNeedsReversing) { 624 int length = m_text.length(); 625 reversedText.resize(length); 626 for (int i = 0; i < length; ++i) 627 reversedText[length - i - 1] = m_text[i]; 628 textRun = TextRun(reversedText.data(), length); 629 } 630 603 631 const Font& font = style()->font(); 604 TextRun textRun(m_text.impl());605 632 if (style()->direction() == LTR) { 606 633 int width = font.width(textRun);
Note: See TracChangeset
for help on using the changeset viewer.