| Index: Source/core/editing/VisiblePosition.cpp
|
| diff --git a/Source/core/editing/VisiblePosition.cpp b/Source/core/editing/VisiblePosition.cpp
|
| index bad9886291a766668c6a5ba85bd1c0d968dfcafa..aa614ea9a91a48e037d43e0cccdfee4861e5421a 100644
|
| --- a/Source/core/editing/VisiblePosition.cpp
|
| +++ b/Source/core/editing/VisiblePosition.cpp
|
| @@ -39,6 +39,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"
|
|
|
| @@ -248,6 +249,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())
|
| @@ -416,6 +419,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())
|
| @@ -603,9 +608,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();
|
|
|
|
|