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

Unified Diff: Source/core/page/ContextMenuController.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/Chrome.cpp ('k') | Source/core/page/DOMSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/ContextMenuController.cpp
diff --git a/Source/core/page/ContextMenuController.cpp b/Source/core/page/ContextMenuController.cpp
index 77797e389c8306b5f1ba0f11f8e20172d5b23e60..226e2108b2f1ad91d4961e33ba9ec3ae57d3a8c8 100644
--- a/Source/core/page/ContextMenuController.cpp
+++ b/Source/core/page/ContextMenuController.cpp
@@ -72,7 +72,7 @@ void ContextMenuController::documentDetached(Document* document)
{
if (Node* innerNode = m_hitTestResult.innerNode()) {
// Invalidate the context menu info if its target document is detached.
- if (innerNode->document() == document)
+ if (&innerNode->document() == document)
clearContextMenu();
}
}
@@ -110,7 +110,7 @@ PassOwnPtr<ContextMenu> ContextMenuController::createContextMenu(Event* event)
MouseEvent* mouseEvent = toMouseEvent(event);
HitTestResult result(mouseEvent->absoluteLocation());
- if (Frame* frame = event->target()->toNode()->document()->frame())
+ if (Frame* frame = event->target()->toNode()->document().frame())
result = frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
if (!result.innerNonSharedNode())
« no previous file with comments | « Source/core/page/Chrome.cpp ('k') | Source/core/page/DOMSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698