| Index: Source/core/dom/Document.cpp
|
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
|
| index 34fc9120c11f49ef13ae9e164b9b14c1a2accf62..236af2283e9f987e8136d9b61c1507322bede4ab 100644
|
| --- a/Source/core/dom/Document.cpp
|
| +++ b/Source/core/dom/Document.cpp
|
| @@ -1207,10 +1207,11 @@ PassRefPtr<Range> Document::caretRangeFromPoint(int x, int y)
|
| if (!renderer())
|
| return 0;
|
| LayoutPoint localPoint;
|
| - Node* node = nodeFromPoint(this, x, y, &localPoint);
|
| - if (!node)
|
| + RenderObject* renderer = rendererFromPoint(this, x, y, &localPoint);
|
| + if (!renderer)
|
| return 0;
|
|
|
| + Node* node = renderer->node();
|
| Node* shadowAncestorNode = ancestorInThisScope(node);
|
| if (shadowAncestorNode != node) {
|
| unsigned offset = shadowAncestorNode->nodeIndex();
|
| @@ -1218,9 +1219,6 @@ PassRefPtr<Range> Document::caretRangeFromPoint(int x, int y)
|
| return Range::create(*this, container, offset, container, offset);
|
| }
|
|
|
| - RenderObject* renderer = node->renderer();
|
| - if (!renderer)
|
| - return 0;
|
| PositionWithAffinity positionWithAffinity = renderer->positionForPoint(localPoint);
|
| if (positionWithAffinity.position().isNull())
|
| return 0;
|
|
|