to place the "associated word" window.
If there is no marked text firstRectForCharacterRange: will
use the selected range to determine the returned rectangle,
ignoring the input range. This is the fix from
4029491 that I previously backed out.
Reviewed by Vicki.
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView firstRectForCharacterRange:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8967
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-03-23 Richard Williamson <rjw@apple.com>
+
+ Use Patti Yeh's hack to determine the appropriate rectangle
+ to place the "associated word" window.
+ If there is no marked text firstRectForCharacterRange: will
+ use the selected range to determine the returned rectangle,
+ ignoring the input range. This is the fix from
+ 4029491 that I previously backed out.
+
+ Reviewed by Vicki.
+
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView firstRectForCharacterRange:]):
+
2005-03-23 Richard Williamson <rjw@apple.com>
Fixed <rdar://problem/4062490> REGRESSION (WebKit-408): no subresources reported in Activity window after going back at hrweb.apple.com
{
WebBridge *bridge = [self _bridge];
- DOMRange *range = [bridge convertToObjCDOMRange:theRange];
+ DOMRange *range;
- NSRect resultRect = [self convertRect:[bridge firstRectForDOMRange:range] toView:nil];
- resultRect.origin = [[self window] convertBaseToScreen:resultRect.origin];
+ if ([self hasMarkedText]) {
+ range = [bridge convertToObjCDOMRange:theRange];
+ }
+ else {
+ range = [self _selectedRange];
+ }
+ NSRect resultRect;
+ if ([range startContainer]) {
+ resultRect = [self convertRect:[bridge firstRectForDOMRange:range] toView:nil];
+ resultRect.origin = [[self window] convertBaseToScreen:resultRect.origin];
+ }
+ else {
+ resultRect = NSMakeRect(0,0,0,0);
+ }
return resultRect;
}