Index: third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
diff --git a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
index 2d7e195b4f11ef323288bce29fe11fcd1e3d3aa7..e4f6b57e5df96ac680c9c9e3326535070ed80d42 100644 |
--- a/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
+++ b/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp |
@@ -157,6 +157,8 @@ bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, |
r.setToShadowHostIfInRestrictedShadowRoot(); |
LocalFrame* selectedFrame = r.innerNodeFrame(); |
+ WebLocalFrameImpl* selectedWebFrame = |
+ WebLocalFrameImpl::fromFrame(selectedFrame); |
WebContextMenuData data; |
data.mousePosition = selectedFrame->view()->contentsToViewport( |
@@ -327,9 +329,9 @@ bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, |
Vector<String> suggestions; |
description.split('\n', suggestions); |
data.dictionarySuggestions = suggestions; |
- } else if (m_webView->textCheckClient()) { |
+ } else if (selectedWebFrame->textCheckClient()) { |
int misspelledOffset, misspelledLength; |
- m_webView->textCheckClient()->checkSpelling( |
+ selectedWebFrame->textCheckClient()->checkSpelling( |
data.misspelledWord, misspelledOffset, misspelledLength, |
&data.dictionarySuggestions); |
} |
@@ -389,8 +391,6 @@ bool ContextMenuClientImpl::showContextMenu(const ContextMenu* defaultMenu, |
if (fromTouch && !shouldShowContextMenuFromTouch(data)) |
return false; |
- WebLocalFrameImpl* selectedWebFrame = |
- WebLocalFrameImpl::fromFrame(selectedFrame); |
selectedWebFrame->setContextMenuNode(r.innerNodeOrImageMapImage()); |
if (!selectedWebFrame->client()) |
return false; |