Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: Source/core/rendering/RenderText.cpp

Issue 25668008: Make Document::caretRangeFromPoint() to work with :first-letter style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-10-07T15:30:03 Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | Source/core/rendering/RenderTextFragment.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | Source/core/rendering/RenderTextFragment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698