Changeset 83414 in webkit
- Timestamp:
- Apr 10, 2011 7:21:40 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83412 r83414 1 2011-04-10 Alice Boxhall <aboxhall@chromium.org> 2 3 Reviewed by Ryosuke Niwa. 4 5 Change EventHandler::updateSelectionForMouseDrag to take a HitTestResult only. 6 https://bugs.webkit.org/show_bug.cgi?id=57923 7 8 Change EventHandler::updateSelectionForMouseDrag to take a HitTestResult 9 rather than a Node* and an IntPoint&, as the selection may actually not 10 extend into the Node found by the HitTest. 11 12 No new tests. Refactoring only. 13 14 * page/EventHandler.cpp: 15 (WebCore::EventHandler::handleMouseDraggedEvent): 16 (WebCore::EventHandler::updateSelectionForMouseDrag): 17 * page/EventHandler.h: 18 1 19 2011-04-10 Kent Tamura <tkent@chromium.org> 2 20 -
trunk/Source/WebCore/page/EventHandler.cpp
r83312 r83414 567 567 HitTestResult result(m_mouseDownPos); 568 568 m_frame->document()->renderView()->layer()->hitTest(request, result); 569 updateSelectionForMouseDrag(result.innerNode(), result.localPoint()); 570 } 571 updateSelectionForMouseDrag(targetNode, event.localPoint()); 569 570 updateSelectionForMouseDrag(result); 571 } 572 updateSelectionForMouseDrag(event.hitTestResult()); 572 573 return true; 573 574 } … … 619 620 HitTestResult result(view->windowToContents(m_currentMousePosition)); 620 621 layer->hitTest(request, result); 621 updateSelectionForMouseDrag(result .innerNode(), result.localPoint());622 } 623 624 void EventHandler::updateSelectionForMouseDrag( Node* targetNode, const IntPoint& localPoint)622 updateSelectionForMouseDrag(result); 623 } 624 625 void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResult) 625 626 { 626 627 if (!m_mouseDownMayStartSelect) 627 628 return; 628 629 629 if (!targetNode) 630 Node* target = targetNode(hitTestResult); 631 if (!target) 630 632 return; 631 633 632 if (!canMouseDragExtendSelect(target Node))634 if (!canMouseDragExtendSelect(target)) 633 635 return; 634 636 635 RenderObject* targetRenderer = target Node->renderer();637 RenderObject* targetRenderer = target->renderer(); 636 638 if (!targetRenderer) 637 639 return; 638 640 639 VisiblePosition targetPosition (targetRenderer->positionForPoint(localPoint));641 VisiblePosition targetPosition = targetRenderer->positionForPoint(hitTestResult.localPoint()); 640 642 641 643 // Don't modify the selection if we're not on a node. … … 653 655 if (RenderObject* selectionBaseRenderer = selectionBaseNode->renderer()) 654 656 if (selectionBaseRenderer->isSVGText()) 655 if (target Node->renderer()->containingBlock() != selectionBaseRenderer->containingBlock())657 if (target->renderer()->containingBlock() != selectionBaseRenderer->containingBlock()) 656 658 return; 657 659 #endif -
trunk/Source/WebCore/page/EventHandler.h
r83153 r83414 361 361 362 362 #if ENABLE(DRAG_SUPPORT) 363 void updateSelectionForMouseDrag( Node* targetNode, const IntPoint& localPoint);363 void updateSelectionForMouseDrag(const HitTestResult&); 364 364 #endif 365 365
Note: See TracChangeset
for help on using the changeset viewer.