OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 case AlwaysDownstream: | 521 case AlwaysDownstream: |
522 affinity = DOWNSTREAM; | 522 affinity = DOWNSTREAM; |
523 break; | 523 break; |
524 case AlwaysUpstream: | 524 case AlwaysUpstream: |
525 affinity = VP_UPSTREAM_IF_POSSIBLE; | 525 affinity = VP_UPSTREAM_IF_POSSIBLE; |
526 break; | 526 break; |
527 case UpstreamIfPositionIsNotAtStart: | 527 case UpstreamIfPositionIsNotAtStart: |
528 affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DO
WNSTREAM; | 528 affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DO
WNSTREAM; |
529 break; | 529 break; |
530 } | 530 } |
531 return box->renderer()->createPositionWithAffinity(offset, affinity); | 531 int textStartOffset = box->renderer()->isText() ? toRenderText(box->renderer
())->textStartOffset() : 0; |
| 532 return box->renderer()->createPositionWithAffinity(offset + textStartOffset,
affinity); |
532 } | 533 } |
533 | 534 |
534 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA
ffinityBeDownstream) | 535 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA
ffinityBeDownstream) |
535 { | 536 { |
536 ASSERT(box); | 537 ASSERT(box); |
537 ASSERT(box->renderer()); | 538 ASSERT(box->renderer()); |
538 ASSERT(offset >= 0); | 539 ASSERT(offset >= 0); |
539 | 540 |
540 if (offset && static_cast<unsigned>(offset) < box->len()) | 541 if (offset && static_cast<unsigned>(offset) < box->len()) |
541 return createPositionWithAffinityForBox(box, box->start() + offset, shou
ldAffinityBeDownstream); | 542 return createPositionWithAffinityForBox(box, box->start() + offset, shou
ldAffinityBeDownstream); |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1853 | 1854 |
1854 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); | 1855 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); |
1855 if (!secureTextTimer) { | 1856 if (!secureTextTimer) { |
1856 secureTextTimer = new SecureTextTimer(this); | 1857 secureTextTimer = new SecureTextTimer(this); |
1857 gSecureTextTimers->add(this, secureTextTimer); | 1858 gSecureTextTimers->add(this, secureTextTimer); |
1858 } | 1859 } |
1859 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1860 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
1860 } | 1861 } |
1861 | 1862 |
1862 } // namespace WebCore | 1863 } // namespace WebCore |
OLD | NEW |