| Index: Source/core/editing/VisiblePosition.cpp
|
| diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp
|
| index e8635680c5efedba69ff8650128238e2029362de..b15441f85b9df4873c9a00fbee9e997f2d808677 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"
|
|
|
| @@ -259,6 +260,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())
|
| @@ -427,6 +430,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())
|
| @@ -654,9 +659,7 @@ LayoutRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
|
| renderer = 0;
|
| return IntRect();
|
| }
|
| - Node* node = m_deepPosition.anchorNode();
|
| -
|
| - renderer = node->renderer();
|
| + renderer = m_deepPosition.rendererOfAnchorNode();
|
| if (!renderer)
|
| return LayoutRect();
|
|
|
|
|