Title: [116684] trunk/Source/WebKit/blackberry
- Revision
- 116684
- Author
- [email protected]
- Date
- 2012-05-10 14:01:07 -0700 (Thu, 10 May 2012)
Log Message
Caret node boundary should be adjusted to account for the visible region.
https://bugs.webkit.org/show_bug.cgi?id=86116
Reviewed by Antonio Gomes.
PR 138988.
Update the node bounding box to be clipped and adjusted
for the visible region of the frame.
Reviewed Internally by Gen Mak.
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::caretPositionChanged):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/ChangeLog (116683 => 116684)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-05-10 20:50:43 UTC (rev 116683)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-05-10 21:01:07 UTC (rev 116684)
@@ -1,3 +1,20 @@
+2012-05-10 Mike Fenton <[email protected]>
+
+ Caret node boundary should be adjusted to account for the visible region.
+ https://bugs.webkit.org/show_bug.cgi?id=86116
+
+ Reviewed by Antonio Gomes.
+
+ PR 138988.
+
+ Update the node bounding box to be clipped and adjusted
+ for the visible region of the frame.
+
+ Reviewed Internally by Gen Mak.
+
+ * WebKitSupport/SelectionHandler.cpp:
+ (BlackBerry::WebKit::SelectionHandler::caretPositionChanged):
+
2012-05-10 Antonio Gomes <[email protected]>
[BlackBerry] Assertions and assumptions in BackingStoreClient around m_frame and m_frame->view() are invalid
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp (116683 => 116684)
--- trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp 2012-05-10 20:50:43 UTC (rev 116683)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp 2012-05-10 21:01:07 UTC (rev 116684)
@@ -955,14 +955,14 @@
// 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 @@
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);
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes