summaryrefslogtreecommitdiff
path: root/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp')
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
index fcd2e7e10..1b89071ac 100644
--- a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
@@ -253,14 +253,17 @@ void SelectionHandler::setCaretPosition(const WebCore::IntPoint &position)
VisiblePosition visibleCaretPosition(focusedFrame->visiblePositionForPoint(relativePoint));
- if (!DOMSupport::isPositionInNode(m_webPage->focusedOrMainFrame()->document()->focusedNode(), visibleCaretPosition.deepEquivalent())) {
- if (unsigned short character = directionOfPointRelativeToRect(relativePoint, currentCaretRect))
- m_webPage->m_inputHandler->handleKeyboardInput(Platform::KeyboardEvent(character));
-
- // Send the selection changed in case this does not trigger a selection change to
- // ensure the caret position is accurate. This may be a duplicate event.
- selectionPositionChanged(true /* forceUpdateWithoutChange */);
- return;
+ if (RenderObject* focusedRenderer = focusedFrame->document()->focusedNode()->renderer()) {
+ WebCore::IntRect nodeOutlineBounds(focusedRenderer->absoluteOutlineBounds());
+ if (!nodeOutlineBounds.contains(relativePoint)) {
+ if (unsigned short character = directionOfPointRelativeToRect(relativePoint, currentCaretRect))
+ m_webPage->m_inputHandler->handleKeyboardInput(Platform::KeyboardEvent(character));
+
+ // Send the selection changed in case this does not trigger a selection change to
+ // ensure the caret position is accurate. This may be a duplicate event.
+ selectionPositionChanged(true /* forceUpdateWithoutChange */);
+ return;
+ }
}
VisibleSelection newSelection(visibleCaretPosition);