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

Side by Side Diff: Source/core/dom/Document.cpp

Issue 1032823003: Refactor HitTestResult to store the HitTestRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 8 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
« no previous file with comments | « no previous file | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 3084 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 { 3095 {
3096 ASSERT(!layoutView() || layoutView()->isLayoutView()); 3096 ASSERT(!layoutView() || layoutView()->isLayoutView());
3097 3097
3098 // LayoutView::hitTest causes a layout, and we don't want to hit that until the first 3098 // LayoutView::hitTest causes a layout, and we don't want to hit that until the first
3099 // layout because until then, there is nothing shown on the screen - the use r can't 3099 // layout because until then, there is nothing shown on the screen - the use r can't
3100 // have intentionally clicked on something belonging to this page. Furthermo re, 3100 // have intentionally clicked on something belonging to this page. Furthermo re,
3101 // mousemove events before the first layout should not lead to a premature l ayout() 3101 // mousemove events before the first layout should not lead to a premature l ayout()
3102 // happening, which could show a flash of white. 3102 // happening, which could show a flash of white.
3103 // See also the similar code in EventHandler::hitTestResultAtPoint. 3103 // See also the similar code in EventHandler::hitTestResultAtPoint.
3104 if (!layoutView() || !view() || !view()->didFirstLayout()) 3104 if (!layoutView() || !view() || !view()->didFirstLayout())
3105 return MouseEventWithHitTestResults(event, HitTestResult(LayoutPoint())) ; 3105 return MouseEventWithHitTestResults(event, HitTestResult(request, Layout Point()));
3106 3106
3107 HitTestResult result(documentPoint); 3107 HitTestResult result(request, documentPoint);
3108 layoutView()->hitTest(request, result); 3108 layoutView()->hitTest(result);
3109 3109
3110 if (!request.readOnly()) 3110 if (!request.readOnly())
3111 updateHoverActiveState(request, result.innerElement(), &event); 3111 updateHoverActiveState(request, result.innerElement(), &event);
3112 3112
3113 return MouseEventWithHitTestResults(event, result); 3113 return MouseEventWithHitTestResults(event, result);
3114 } 3114 }
3115 3115
3116 // DOM Section 1.1.1 3116 // DOM Section 1.1.1
3117 bool Document::childTypeAllowed(NodeType type) const 3117 bool Document::childTypeAllowed(NodeType type) const
3118 { 3118 {
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after
5726 #ifndef NDEBUG 5726 #ifndef NDEBUG
5727 using namespace blink; 5727 using namespace blink;
5728 void showLiveDocumentInstances() 5728 void showLiveDocumentInstances()
5729 { 5729 {
5730 WeakDocumentSet& set = liveDocumentSet(); 5730 WeakDocumentSet& set = liveDocumentSet();
5731 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 5731 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
5732 for (Document* document : set) 5732 for (Document* document : set)
5733 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data()); 5733 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str ing().utf8().data());
5734 } 5734 }
5735 #endif 5735 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/TreeScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698