OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r
eserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. All right r
eserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 template <> | 478 template <> |
479 inline int InlineBidiResolver::findFirstTrailingSpaceAtRun(BidiRun* run) | 479 inline int InlineBidiResolver::findFirstTrailingSpaceAtRun(BidiRun* run) |
480 { | 480 { |
481 ASSERT(run); | 481 ASSERT(run); |
482 RenderObject* lastObject = run->m_object; | 482 RenderObject* lastObject = run->m_object; |
483 if (!lastObject->isText()) | 483 if (!lastObject->isText()) |
484 return run->m_stop; | 484 return run->m_stop; |
485 | 485 |
486 RenderText* lastText = toRenderText(lastObject); | 486 RenderText* lastText = toRenderText(lastObject); |
| 487 |
| 488 // There can only be trailing space if the lastText node has two or more cod
e-points. |
| 489 if (lastText->textLength() <= 1) |
| 490 return run->stop(); |
| 491 |
487 int firstSpace; | 492 int firstSpace; |
488 if (lastText->is8Bit()) | 493 if (lastText->is8Bit()) |
489 firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), r
un->start(), run->stop()); | 494 firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), r
un->start(), run->stop()); |
490 else | 495 else |
491 firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(),
run->start(), run->stop()); | 496 firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(),
run->start(), run->stop()); |
492 return firstSpace; | 497 return firstSpace; |
493 } | 498 } |
494 | 499 |
495 template <> | 500 template <> |
496 inline BidiRun* InlineBidiResolver::addTrailingRun(BidiRunList<BidiRun>& runs, i
nt start, int stop, BidiRun* run, BidiContext* context, TextDirection direction)
const | 501 inline BidiRun* InlineBidiResolver::addTrailingRun(BidiRunList<BidiRun>& runs, i
nt start, int stop, BidiRun* run, BidiContext* context, TextDirection direction)
const |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 m_sor = m_eor; | 727 m_sor = m_eor; |
723 } | 728 } |
724 | 729 |
725 m_direction = WTF::Unicode::OtherNeutral; | 730 m_direction = WTF::Unicode::OtherNeutral; |
726 m_status.eor = WTF::Unicode::OtherNeutral; | 731 m_status.eor = WTF::Unicode::OtherNeutral; |
727 } | 732 } |
728 | 733 |
729 } | 734 } |
730 | 735 |
731 #endif // InlineIterator_h | 736 #endif // InlineIterator_h |
OLD | NEW |