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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderText.h ('k') | Source/core/rendering/RenderTextFragment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 60aaa2fd9497367c51f408306ff5d6b42c0b8d72..f58c8106a0358b232be6c0d0eff54e6017383f8f 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -532,7 +532,8 @@ static PositionWithAffinity createPositionWithAffinityForBox(const InlineBox* bo
affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM;
break;
}
- return box->renderer()->createPositionWithAffinity(offset, affinity);
+ int textStartOffset = box->renderer()->isText() ? toRenderText(box->renderer())->textStartOffset() : 0;
+ return box->renderer()->createPositionWithAffinity(offset + textStartOffset, affinity);
}
static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffsetForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldAffinityBeDownstream)
« 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