Changeset 149826 in webkit
- Timestamp:
- May 9, 2013 11:32:48 AM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/ChangeLog
r149820 r149826 1 2013-05-09 Mike Fenton <mifenton@rim.com> 2 3 [BlackBerry] Style updates required based on new check-webkit-style 4 https://bugs.webkit.org/show_bug.cgi?id=115857 5 6 Reviewed by Rob Buis. 7 8 Update SelectionHandler to match check-webkit-style updates. 9 10 * WebKitSupport/SelectionHandler.cpp: 11 (BlackBerry::WebKit::shouldExtendSelectionInDirection): 12 (BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary): 13 (BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection): 14 (BlackBerry::WebKit::adjustCaretRects): 15 (BlackBerry::WebKit::SelectionHandler::clipPointToVisibleContainer): 16 (BlackBerry::WebKit::regionRectListContainsPoint): 17 * WebKitSupport/SelectionHandler.h: 18 (SelectionHandler): 19 1 20 2013-05-09 Mike Fenton <mifenton@rim.com> 2 21 -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
r149816 r149826 318 318 if ((character == KEYCODE_LEFT || character == KEYCODE_RIGHT) 319 319 && (!inSameLine(selection.visibleStart(), tempSelection.selection().visibleStart()) 320 || !inSameLine(selection.visibleEnd(), tempSelection.selection().visibleEnd())))320 || !inSameLine(selection.visibleEnd(), tempSelection.selection().visibleEnd()))) 321 321 return false; 322 322 … … 373 373 return 0; 374 374 375 FrameSelection* controller = focusedFrame->selection(); 376 377 WebCore::IntRect caretRect = isStartHandle ? controller->selection().visibleStart().absoluteCaretBounds() 378 : controller->selection().visibleEnd().absoluteCaretBounds(); 375 VisibleSelection activeSelection = focusedFrame->selection()->selection(); 376 377 WebCore::IntRect caretRect = isStartHandle ? activeSelection.visibleStart().absoluteCaretBounds() : activeSelection.visibleEnd().absoluteCaretBounds(); 379 378 380 379 WebCore::IntRect nodeBoundingBox = focusedFrame->document()->focusedNode()->renderer()->absoluteBoundingBoxRect(); … … 391 390 character = 0; 392 391 393 VisiblePosition newVisiblePosition = isStartHandle ? controller->selection().extent() : controller->selection().base();392 VisiblePosition newVisiblePosition = isStartHandle ? activeSelection.extent() : activeSelection.base(); 394 393 // Extend the selection to the bounds of the box before doing incremental scroll if the point is outside the node. 395 394 // Don't extend selection and handle the character at the same time. … … 403 402 404 403 // If no selection will be changed, return the character to extend using navigation. 405 if ( controller->selection()== newSelection)404 if (activeSelection == newSelection) 406 405 return character; 407 406 … … 411 410 412 411 // Returns true if handled. 413 bool SelectionHandler::updateOrHandleInputSelection(VisibleSelection& newSelection, const WebCore::IntPoint& relativeStart 414 , const WebCore::IntPoint& relativeEnd) 412 bool SelectionHandler::updateOrHandleInputSelection(VisibleSelection& newSelection, const WebCore::IntPoint& relativeStart, const WebCore::IntPoint& relativeEnd) 415 413 { 416 414 ASSERT(m_webPage->m_inputHandler->isInputMode()); … … 1009 1007 } 1010 1008 1011 static void adjustCaretRects(WebCore::IntRect& startCaret, bool isStartCaretClippedOut, 1012 WebCore::IntRect& endCaret, bool isEndCaretClippedOut, 1013 const std::vector<Platform::IntRect> rectList, 1014 const WebCore::IntPoint& startReferencePoint, 1015 const WebCore::IntPoint& endReferencePoint, 1016 bool isRTL) 1009 static void adjustCaretRects(WebCore::IntRect& startCaret, bool isStartCaretClippedOut, WebCore::IntRect& endCaret, bool isEndCaretClippedOut, 1010 const std::vector<Platform::IntRect> rectList, const WebCore::IntPoint& startReferencePoint, const WebCore::IntPoint& endReferencePoint, bool isRTL) 1017 1011 { 1018 1012 // startReferencePoint is the best guess at the top left of the selection; endReferencePoint is the best guess at the bottom right. … … 1043 1037 // Compare and update the start and end carets with their respective reference points. 1044 1038 if (!isStartCaretClippedOut && comparePointsToReferencePoint( 1045 1046 1047 1048 startCaret.setLocation(caretLocationForRect(currentRect, true, isRTL));1049 startCaret.setHeight(currentRect.height());1039 caretComparisonPointForRect(currentRect, true, isRTL), 1040 caretComparisonPointForRect(startCaret, true, isRTL), 1041 startReferencePoint, isRTL) > 0) { 1042 startCaret.setLocation(caretLocationForRect(currentRect, true, isRTL)); 1043 startCaret.setHeight(currentRect.height()); 1050 1044 } 1051 1045 1052 1046 if (!isEndCaretClippedOut && comparePointsToReferencePoint( 1053 1054 1055 1056 endCaret.setLocation(caretLocationForRect(currentRect, false, isRTL));1057 endCaret.setHeight(currentRect.height());1047 caretComparisonPointForRect(currentRect, false, isRTL), 1048 caretComparisonPointForRect(endCaret, false, isRTL), 1049 endReferencePoint, !isRTL) > 0) { 1050 endCaret.setLocation(caretLocationForRect(currentRect, false, isRTL)); 1051 endCaret.setHeight(currentRect.height()); 1058 1052 } 1059 1053 } … … 1068 1062 1069 1063 if (m_webPage->m_inputHandler->isInputMode() 1070 1071 1072 WebCore::IntRect boundingBox(frame->document()->focusedNode()->renderer()->absoluteBoundingBoxRect());1073 boundingBox.inflate(-1);1074 clippedPoint = WebCore::IntPoint(clamp(boundingBox.x(), clippedPoint.x(), boundingBox.maxX()), clamp(boundingBox.y(), clippedPoint.y(), boundingBox.maxY()));1064 && frame->document()->focusedNode() 1065 && frame->document()->focusedNode()->renderer()) { 1066 WebCore::IntRect boundingBox(frame->document()->focusedNode()->renderer()->absoluteBoundingBoxRect()); 1067 boundingBox.inflate(-1); 1068 clippedPoint = WebCore::IntPoint(clamp(boundingBox.x(), clippedPoint.x(), boundingBox.maxX()), clamp(boundingBox.y(), clippedPoint.y(), boundingBox.maxY())); 1075 1069 } 1076 1070 … … 1100 1094 1101 1095 std::vector<Platform::IntRect> rectList = region.rects(); 1102 for (unsigned i nt i= 0; i < rectList.size(); i++) {1096 for (unsigned i = 0; i < rectList.size(); i++) { 1103 1097 if (rectList[i].contains(point)) 1104 1098 return true; -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h
r149685 r149826 90 90 void regionForTextQuads(WTF::Vector<WebCore::FloatQuad>&, BlackBerry::Platform::IntRectRegion&, bool shouldClipToVisibleContent = true) const; 91 91 WebCore::IntRect clippingRectForVisibleContent() const; 92 bool updateOrHandleInputSelection(WebCore::VisibleSelection& newSelection, const WebCore::IntPoint& relativeStart 93 , const WebCore::IntPoint& relativeEnd); 92 bool updateOrHandleInputSelection(WebCore::VisibleSelection& newSelection, const WebCore::IntPoint& relativeStart, const WebCore::IntPoint& relativeEnd); 94 93 WebCore::Node* DOMContainerNodeForVisiblePosition(const WebCore::VisiblePosition&) const; 95 94 bool shouldUpdateSelectionOrCaretForPoint(const WebCore::IntPoint&, const WebCore::IntRect&, bool startCaret = true) const;
Note: See TracChangeset
for help on using the changeset viewer.