diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-11 09:43:24 +0200 |
| commit | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch) | |
| tree | 87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp | |
| parent | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff) | |
| download | qtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz | |
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp')
| -rw-r--r-- | Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp index b65babaee..1d4cbb9a5 100644 --- a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp @@ -955,14 +955,14 @@ void SelectionHandler::caretPositionChanged() // This function should only reach this point if input mode is active. ASSERT(m_webPage->m_inputHandler->isInputMode()); + WebCore::IntPoint frameOffset(m_webPage->frameOffset(m_webPage->focusedOrMainFrame())); + WebCore::IntRect clippingRectForContent(clippingRectForVisibleContent()); if (m_webPage->focusedOrMainFrame()->selection()->selectionType() == VisibleSelection::CaretSelection) { - WebCore::IntPoint frameOffset = m_webPage->frameOffset(m_webPage->focusedOrMainFrame()); - caretLocation = m_webPage->focusedOrMainFrame()->selection()->selection().visibleStart().absoluteCaretBounds(); caretLocation.move(frameOffset.x(), frameOffset.y()); // Clip against the containing frame and node boundaries. - caretLocation.intersect(clippingRectForVisibleContent()); + caretLocation.intersect(clippingRectForContent); } m_caretActive = !caretLocation.isEmpty(); @@ -976,6 +976,19 @@ void SelectionHandler::caretPositionChanged() bool singleLineInput = !m_webPage->m_inputHandler->isMultilineInputMode(); WebCore::IntRect nodeBoundingBox = singleLineInput ? m_webPage->m_inputHandler->boundingBoxForInputField() : WebCore::IntRect(); + if (!nodeBoundingBox.isEmpty()) { + nodeBoundingBox.move(frameOffset.x(), frameOffset.y()); + + // Clip against the containing frame and node boundaries. + nodeBoundingBox.intersect(clippingRectForContent); + + nodeBoundingBox = m_webPage->mapToTransformed(nodeBoundingBox); + m_webPage->clipToTransformedContentsRect(nodeBoundingBox); + } + + DEBUG_SELECTION(LogLevelInfo, "SelectionHandler::single line %s single line bounding box %d, %d, %dx%d", + singleLineInput ? "true" : "false", nodeBoundingBox.x(), nodeBoundingBox.y(), nodeBoundingBox.width(), nodeBoundingBox.height()); + m_webPage->m_client->notifyCaretChanged(caretLocation, m_webPage->m_touchEventHandler->lastFatFingersResult().isTextInput() /* userTouchTriggered */, singleLineInput, nodeBoundingBox); } |
