Changeset 58191 in webkit
- Timestamp:
- Apr 23, 2010 3:07:46 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58187 r58191 1 2010-04-23 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by Dan Bernstein and Darin Adler 4 5 Fix issue "caret does not paint after type in characters in right 6 aligned div or after delete all characters in RTL div or 7 0px right padding RTL textarea" 8 https://bugs.webkit.org/show_bug.cgi?id=25319 9 10 * editing/inserting/caret-position-expected.txt: Added. 11 * editing/inserting/caret-position.html: Added. 12 * platform/mac/editing/input/caret-primary-bidi-expected.txt: 13 1 14 2010-04-23 MORITA Hajime <morrita@google.com> 2 15 -
trunk/LayoutTests/platform/mac/editing/input/caret-primary-bidi-expected.txt
r32508 r58191 42 42 41: 97,478,0,28 43 43 42: 126,478,0,28 44 43: 79 2,450,0,2844 43: 791,450,0,28 45 45 44: 764,450,0,28 46 46 45: 779,450,0,28 … … 58 58 57: 618,450,0,28 59 59 58: 590,450,0,28 60 59: 79 2,422,0,2860 59: 791,422,0,28 61 61 60: 777,422,0,28 62 62 61: 763,422,0,28 … … 68 68 67: 677,422,0,28 69 69 68: 669,422,0,28 70 69: 79 2,394,0,2870 69: 791,394,0,28 71 71 70: 777,394,0,28 72 72 71: 763,394,0,28 … … 75 75 74: 643,394,0,28 76 76 75: 635,394,0,28 77 76: 79 2,364,0,2877 76: 791,364,0,28 78 78 77: 764,364,0,28 79 79 78: 779,364,0,28 -
trunk/WebCore/ChangeLog
r58190 r58191 1 2010-04-23 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by Dan Bernstein and Darin Adler 4 5 Fix issue "caret does not paint after type in characters in right 6 aligned div or after delete all characters in RTL div or 7 0px right padding RTL textarea" 8 https://bugs.webkit.org/show_bug.cgi?id=25319 9 10 Test: editing/inserting/caret-position.html 11 12 * rendering/RenderText.cpp: 13 (WebCore::RenderText::localCaretRect): 14 1 15 2010-04-23 No'am Rosenthal <noam.rosenthal@nokia.com> 2 16 -
trunk/WebCore/rendering/RenderText.cpp
r57940 r58191 456 456 457 457 RenderBlock* cb = containingBlock(); 458 RenderStyle* cbStyle = cb->style(); 459 int leftEdge; 460 int rightEdge; 458 461 if (style()->autoWrap()) { 459 int availableWidth = cb->lineWidth(top, false); 460 if (box->direction() == LTR) 461 left = min(left, rootLeft + availableWidth - caretWidthRightOfOffset); 462 else 463 left = max(left, cb->x()); 462 leftEdge = cb->x(); 463 rightEdge = cb->frameRect().right(); 464 464 } else { 465 // If there is no wrapping, the caret can leave its containing block, but not its root line box. 466 if (cb->style()->direction() == LTR) { 467 int rightEdge = max(cb->width(), rootRight); 468 left = min(left, rightEdge - caretWidthRightOfOffset); 469 left = max(left, rootLeft); 470 } else { 471 int leftEdge = min(cb->x(), rootLeft); 472 left = max(left, leftEdge); 473 left = min(left, rootRight - caretWidth); 474 } 465 leftEdge = min(cb->x(), rootLeft); 466 rightEdge = max(cb->frameRect().right(), rootRight); 467 } 468 469 bool rightAligned = false; 470 switch (cbStyle->textAlign()) { 471 case TAAUTO: 472 case JUSTIFY: 473 rightAligned = cbStyle->direction() == RTL; 474 break; 475 case RIGHT: 476 case WEBKIT_RIGHT: 477 rightAligned = true; 478 break; 479 case LEFT: 480 case WEBKIT_LEFT: 481 case CENTER: 482 case WEBKIT_CENTER: 483 break; 484 } 485 486 if (rightAligned) { 487 left = max(left, leftEdge); 488 left = min(left, rootRight - caretWidth); 489 } else { 490 left = min(left, rightEdge - caretWidthRightOfOffset); 491 left = max(left, rootLeft); 475 492 } 476 493
Note: See TracChangeset
for help on using the changeset viewer.