Changeset 112361 in webkit
- Timestamp:
- Mar 27, 2012 8:47:00 PM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/ChangeLog
r112287 r112361 1 2012-03-27 Sean Wang <Xuewen.Wang@torchmobile.com.cn> 2 3 [BlackBerry] Text selection - selection gets broken in test.com/individuals.htm 4 https://bugs.webkit.org/show_bug.cgi?id=82292 5 6 Change to check and avoid text selection across frames. 7 8 Internal reviewed by Mike Fenton 9 10 Reviewed by Rob Buis. 11 12 * WebKitSupport/SelectionHandler.cpp: 13 (BlackBerry::WebKit::visiblePositionForPointIgnoringClipping): 14 support selection across frames, so check if the *framePoint* is in 15 the *frame*. 16 (BlackBerry::WebKit::SelectionHandler::setSelection): 17 function returns a null VisablePosition, it stands for a invalid position 18 or a position in the different frames, therefor we don't execute setting 19 handle's position. 20 1 21 2012-03-27 Andrew Lo <anlo@rim.com> 2 22 -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
r111259 r112361 139 139 140 140 Node* node = result.innerNode(); 141 if (!node )141 if (!node || node->document() != frame.document()) 142 142 return VisiblePosition(); 143 143 … … 451 451 controller->setSelection(VisibleSelection(controller->selection().start(), controller->selection().end(), true /* isDirectional */)); 452 452 453 // We don't return early in the following, so that we can do input field scrolling if the 454 // handle is outside the bounds of the field. This can be extended to handle sub-region 455 // scrolling as well 453 456 if (startIsValid) { 454 457 relativeStart = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), focusedFrame, start); 455 458 456 // Set the selection with validation. 457 newSelection.setBase(visiblePositionForPointIgnoringClipping(*focusedFrame, clipPointToVisibleContainer(start))); 458 459 // Reset the selection using the existing extent without validation. 460 newSelection.setWithoutValidation(newSelection.base(), controller->selection().end()); 459 VisiblePosition base = visiblePositionForPointIgnoringClipping(*focusedFrame, clipPointToVisibleContainer(start)); 460 if (base.isNotNull()) { 461 // The function setBase validates the "base" 462 newSelection.setBase(base); 463 newSelection.setWithoutValidation(newSelection.base(), controller->selection().end()); 464 // Don't return early. 465 } 461 466 } 462 467 … … 464 469 relativeEnd = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), focusedFrame, end); 465 470 466 // Set the selection with validation. 467 newSelection.setExtent(visiblePositionForPointIgnoringClipping(*focusedFrame, clipPointToVisibleContainer(end))); 468 469 // Reset the selection using the existing base without validation. 470 newSelection.setWithoutValidation(controller->selection().start(), newSelection.extent()); 471 VisiblePosition extent = visiblePositionForPointIgnoringClipping(*focusedFrame, clipPointToVisibleContainer(end)); 472 if (extent.isNotNull()) { 473 // The function setExtent validates the "extent" 474 newSelection.setExtent(extent); 475 newSelection.setWithoutValidation(controller->selection().start(), newSelection.extent()); 476 // Don't return early. 477 } 471 478 } 472 479
Note: See TracChangeset
for help on using the changeset viewer.