Chromium Code Reviews| 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 return box->renderer()->createPositionWithAffinity(offset + toRenderText(box ->renderer())->textStartOffset(), affinity); |
|
tkent
2013/08/02 02:22:19
Is it safe to assume box->renderer() is RenderText
yosin_UTC9
2013/08/02 05:01:55
No. Good catch!
| |
| 532 } | 532 } |
| 533 | 533 |
| 534 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA ffinityBeDownstream) | 534 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA ffinityBeDownstream) |
| 535 { | 535 { |
| 536 ASSERT(box); | 536 ASSERT(box); |
| 537 ASSERT(box->renderer()); | 537 ASSERT(box->renderer()); |
| 538 ASSERT(offset >= 0); | 538 ASSERT(offset >= 0); |
| 539 | 539 |
| 540 if (offset && static_cast<unsigned>(offset) < box->len()) | 540 if (offset && static_cast<unsigned>(offset) < box->len()) |
| 541 return createPositionWithAffinityForBox(box, box->start() + offset, shou ldAffinityBeDownstream); | 541 return createPositionWithAffinityForBox(box, box->start() + offset, shou ldAffinityBeDownstream); |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1853 | 1853 |
| 1854 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); | 1854 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); |
| 1855 if (!secureTextTimer) { | 1855 if (!secureTextTimer) { |
| 1856 secureTextTimer = new SecureTextTimer(this); | 1856 secureTextTimer = new SecureTextTimer(this); |
| 1857 gSecureTextTimers->add(this, secureTextTimer); | 1857 gSecureTextTimers->add(this, secureTextTimer); |
| 1858 } | 1858 } |
| 1859 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1859 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
| 1860 } | 1860 } |
| 1861 | 1861 |
| 1862 } // namespace WebCore | 1862 } // namespace WebCore |
| OLD | NEW |