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

Side by Side Diff: Source/web/mac/WebSubstringUtil.mm

Issue 476303002: Remove obsolete HitTestResult.targetNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge with trunk Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | 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) 2005, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 position += numCharacters; 107 position += numCharacters;
108 } 108 }
109 return [string autorelease]; 109 return [string autorelease];
110 } 110 }
111 111
112 namespace blink { 112 namespace blink {
113 113
114 NSAttributedString* WebSubstringUtil::attributedWordAtPoint(WebView* view, WebPo int point, WebPoint& baselinePoint) 114 NSAttributedString* WebSubstringUtil::attributedWordAtPoint(WebView* view, WebPo int point, WebPoint& baselinePoint)
115 { 115 {
116 HitTestResult result = static_cast<WebViewImpl*>(view)->coreHitTestResultAt( point); 116 HitTestResult result = static_cast<WebViewImpl*>(view)->coreHitTestResultAt( point);
117 if (!result.targetNode()) 117 if (!result.innerNode())
118 return nil; 118 return nil;
119 LocalFrame* frame = result.targetNode()->document().frame(); 119 LocalFrame* frame = result.innerNode()->document().frame();
120 FrameView* frameView = frame->view(); 120 FrameView* frameView = frame->view();
121 121
122 RefPtrWillBeRawPtr<Range> range = frame->rangeForPoint(result.roundedPointIn InnerNodeFrame()); 122 RefPtrWillBeRawPtr<Range> range = frame->rangeForPoint(result.roundedPointIn InnerNodeFrame());
123 if (!range) 123 if (!range)
124 return nil; 124 return nil;
125 125
126 // Expand to word under point. 126 // Expand to word under point.
127 VisibleSelection selection(range.get()); 127 VisibleSelection selection(range.get());
128 selection.expandUsingGranularity(WordGranularity); 128 selection.expandUsingGranularity(WordGranularity);
129 RefPtrWillBeRawPtr<Range> wordRange = selection.toNormalizedRange(); 129 RefPtrWillBeRawPtr<Range> wordRange = selection.toNormalizedRange();
(...skipping 28 matching lines...) Expand all
158 if (!editable) 158 if (!editable)
159 return nil; 159 return nil;
160 RefPtrWillBeRawPtr<Range> range(PlainTextRange(location, location + length). createRange(*editable)); 160 RefPtrWillBeRawPtr<Range> range(PlainTextRange(location, location + length). createRange(*editable));
161 if (!range) 161 if (!range)
162 return nil; 162 return nil;
163 163
164 return attributedSubstringFromRange(range.get()); 164 return attributedSubstringFromRange(range.get());
165 } 165 }
166 166
167 } // namespace blink 167 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698