Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1299)

Side by Side Diff: Source/core/frame/LocalFrame.cpp

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node)); 671 visiblePos = VisiblePosition(firstPositionInOrBeforeNode(node));
672 return visiblePos; 672 return visiblePos;
673 } 673 }
674 674
675 Document* LocalFrame::documentAtPoint(const IntPoint& pointInRootFrame) 675 Document* LocalFrame::documentAtPoint(const IntPoint& pointInRootFrame)
676 { 676 {
677 if (!view()) 677 if (!view())
678 return nullptr; 678 return nullptr;
679 679
680 IntPoint pt = view()->rootFrameToContents(pointInRootFrame); 680 IntPoint pt = view()->rootFrameToContents(pointInRootFrame);
681 HitTestResult result = HitTestResult(pt); 681 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
682 HitTestResult result = HitTestResult(request, pt);
Rick Byers 2015/03/31 00:50:59 looks like you should be able to avoid creating th
ramya.v 2015/03/31 09:41:36 Done.
682 683
683 if (contentRenderer()) 684 if (contentRenderer())
684 result = eventHandler().hitTestResultAtPoint(pt, HitTestRequest::ReadOnl y | HitTestRequest::Active); 685 result = eventHandler().hitTestResultAtPoint(pt, HitTestRequest::ReadOnl y | HitTestRequest::Active);
685 return result.innerNode() ? &result.innerNode()->document() : nullptr; 686 return result.innerNode() ? &result.innerNode()->document() : nullptr;
686 } 687 }
687 688
688 PassRefPtrWillBeRawPtr<Range> LocalFrame::rangeForPoint(const IntPoint& framePoi nt) 689 PassRefPtrWillBeRawPtr<Range> LocalFrame::rangeForPoint(const IntPoint& framePoi nt)
689 { 690 {
690 VisiblePosition position = visiblePositionForPoint(framePoint); 691 VisiblePosition position = visiblePositionForPoint(framePoint);
691 if (position.isNull()) 692 if (position.isNull())
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 // We detach the FrameView's custom scroll bars as early as 798 // We detach the FrameView's custom scroll bars as early as
798 // possible to prevent m_doc->detach() from messing with the view 799 // possible to prevent m_doc->detach() from messing with the view
799 // such that its scroll bars won't be torn down. 800 // such that its scroll bars won't be torn down.
800 // 801 //
801 // FIXME: We should revisit this. 802 // FIXME: We should revisit this.
802 if (m_view) 803 if (m_view)
803 m_view->prepareForDetach(); 804 m_view->prepareForDetach();
804 } 805 }
805 806
806 } // namespace blink 807 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698