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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 case AlwaysDownstream: | 525 case AlwaysDownstream: |
526 affinity = DOWNSTREAM; | 526 affinity = DOWNSTREAM; |
527 break; | 527 break; |
528 case AlwaysUpstream: | 528 case AlwaysUpstream: |
529 affinity = VP_UPSTREAM_IF_POSSIBLE; | 529 affinity = VP_UPSTREAM_IF_POSSIBLE; |
530 break; | 530 break; |
531 case UpstreamIfPositionIsNotAtStart: | 531 case UpstreamIfPositionIsNotAtStart: |
532 affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DO
WNSTREAM; | 532 affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DO
WNSTREAM; |
533 break; | 533 break; |
534 } | 534 } |
535 return box->renderer()->createPositionWithAffinity(offset, affinity); | 535 int textStartOffset = box->renderer()->isText() ? toRenderText(box->renderer
())->textStartOffset() : 0; |
| 536 return box->renderer()->createPositionWithAffinity(offset + textStartOffset,
affinity); |
536 } | 537 } |
537 | 538 |
538 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA
ffinityBeDownstream) | 539 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA
ffinityBeDownstream) |
539 { | 540 { |
540 ASSERT(box); | 541 ASSERT(box); |
541 ASSERT(box->renderer()); | 542 ASSERT(box->renderer()); |
542 ASSERT(offset >= 0); | 543 ASSERT(offset >= 0); |
543 | 544 |
544 if (offset && static_cast<unsigned>(offset) < box->len()) | 545 if (offset && static_cast<unsigned>(offset) < box->len()) |
545 return createPositionWithAffinityForBox(box, box->start() + offset, shou
ldAffinityBeDownstream); | 546 return createPositionWithAffinityForBox(box, box->start() + offset, shou
ldAffinityBeDownstream); |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 | 1858 |
1858 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); | 1859 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); |
1859 if (!secureTextTimer) { | 1860 if (!secureTextTimer) { |
1860 secureTextTimer = new SecureTextTimer(this); | 1861 secureTextTimer = new SecureTextTimer(this); |
1861 gSecureTextTimers->add(this, secureTextTimer); | 1862 gSecureTextTimers->add(this, secureTextTimer); |
1862 } | 1863 } |
1863 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1864 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
1864 } | 1865 } |
1865 | 1866 |
1866 } // namespace WebCore | 1867 } // namespace WebCore |
OLD | NEW |