Changeset 147467 in webkit
- Timestamp:
- Apr 2, 2013 11:17:10 AM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/ChangeLog
r147386 r147467 1 2013-04-02 Nima Ghanavatian <nghanavatian@blackberry.com> 2 3 [BlackBerry] Create a selection from two points irregardless of the caret position. 4 https://bugs.webkit.org/show_bug.cgi?id=113795 5 6 Reviewed by Rob Buis. 7 8 Internally reviewed by Mike Fenton. 9 10 PR276577 11 If we are to set both the base and extent of a selection, we should maintain the base upon setting the extent. 12 This prevents us from overwriting the previous calculation when setting extent. 13 Further, instead of setting and manipulating the selection, simply set up start and end VisiblePositions and 14 create a new directional selection so as to set the base and extent simultaneously. 15 16 * WebKitSupport/SelectionHandler.cpp: 17 (BlackBerry::WebKit::SelectionHandler::setSelection): 18 1 19 2013-04-01 Konrad Piascik <kpiascik@blackberry.com> 2 20 -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
r147189 r147467 508 508 WebCore::IntPoint relativeEnd = end; 509 509 510 VisibleSelection newSelection(controller->selection()); 511 512 // We need the selection to be ordered base then extent. 513 if (!controller->selection().isBaseFirst()) 514 controller->setSelection(VisibleSelection(controller->selection().start(), controller->selection().end(), true /* isDirectional */)); 510 // Initialize the new start and end of our selection at the current positions. 511 VisiblePosition newStart = controller->selection().visibleStart(); 512 VisiblePosition newEnd = controller->selection().visibleEnd(); 515 513 516 514 // We don't return early in the following, so that we can do input field scrolling if the … … 519 517 if (startIsValid) { 520 518 relativeStart = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), focusedFrame, start); 521 522 519 VisiblePosition base = visiblePositionForPointIgnoringClipping(*focusedFrame, clipPointToVisibleContainer(start)); 523 if (base.isNotNull()) { 524 // The function setBase validates the "base" 525 newSelection.setBase(base); 526 newSelection.setWithoutValidation(newSelection.base(), controller->selection().end()); 527 // Don't return early. 528 } 520 if (base.isNotNull()) 521 newStart = base; 529 522 } 530 523 531 524 if (m_lastUpdatedEndPointIsValid) { 532 525 relativeEnd = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), focusedFrame, end); 533 534 526 VisiblePosition extent = visiblePositionForPointIgnoringClipping(*focusedFrame, clipPointToVisibleContainer(end)); 535 if (extent.isNotNull()) { 536 // The function setExtent validates the "extent" 537 newSelection.setExtent(extent); 538 newSelection.setWithoutValidation(controller->selection().start(), newSelection.extent()); 539 // Don't return early. 540 } 541 } 527 if (extent.isNotNull()) 528 newEnd = extent; 529 } 530 531 VisibleSelection newSelection(newStart, newEnd, true /* isDirectional */); 542 532 543 533 if (!controller->selection().isRange()) 544 534 m_webPage->updateSelectionScrollView(newSelection.visibleEnd().deepEquivalent().anchorNode()); 545 546 newSelection.setIsDirectional(true);547 535 548 536 if (m_webPage->m_inputHandler->isInputMode()) {
Note: See TracChangeset
for help on using the changeset viewer.