| Index: Source/core/editing/VisiblePosition.cpp
|
| diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp
|
| index 38ad01f70056c218645847be3c4aa3b6930f9e61..e2e108c543d0f2af69df2abfaa592aa14204b033 100644
|
| --- a/Source/core/editing/VisiblePosition.cpp
|
| +++ b/Source/core/editing/VisiblePosition.cpp
|
| @@ -38,6 +38,7 @@
|
| #include "core/html/HTMLHtmlElement.h"
|
| #include "core/platform/graphics/FloatQuad.h"
|
| #include "core/rendering/RenderBlock.h"
|
| +#include "core/rendering/RenderText.h"
|
| #include "core/rendering/RootInlineBox.h"
|
| #include "wtf/text/CString.h"
|
|
|
| @@ -247,6 +248,8 @@ Position VisiblePosition::leftVisuallyDistinctCandidate() const
|
| break;
|
| }
|
|
|
| + if (renderer->isText())
|
| + offset += toRenderText(renderer)->textStartOffset();
|
| p = createLegacyEditingPosition(renderer->node(), offset);
|
|
|
| if ((p.isCandidate() && p.downstream() != downstreamStart) || p.atStartOfTree() || p.atEndOfTree())
|
| @@ -415,6 +418,8 @@ Position VisiblePosition::rightVisuallyDistinctCandidate() const
|
| break;
|
| }
|
|
|
| + if (renderer->isText())
|
| + offset += toRenderText(renderer)->textStartOffset();
|
| p = createLegacyEditingPosition(renderer->node(), offset);
|
|
|
| if ((p.isCandidate() && p.downstream() != downstreamStart) || p.atStartOfTree() || p.atEndOfTree())
|
| @@ -602,9 +607,7 @@ LayoutRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
|
| renderer = 0;
|
| return IntRect();
|
| }
|
| - Node* node = m_deepPosition.anchorNode();
|
| -
|
| - renderer = node->renderer();
|
| + renderer = m_deepPosition.renderer();
|
| if (!renderer)
|
| return LayoutRect();
|
|
|
|
|