[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:10:22 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 6d75daec35c53ef2a04f27289b2fab60b76069a9
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Nov 8 17:40:51 2003 +0000
Fixed: <rdar://problem/3240778>: add "save" menu item to contextual menu for text pages
Reviewed by darin.
* WebView.subproj/WebTextView.m:
(-[WebTextView menuForEvent:]): Made WebTextView's context menu behavior like WebHTMLView's context menu behavior with regards to selection. If the control-click was on a selection, show menu options for the selection like copy. If it was not on a selection, show menu options such as save and print. Don't select anything when control-clicking.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 11b94f7..0e8c6e7 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,12 @@
+2003-11-07 Chris Blumenberg <cblu at apple.com>
+
+ Fixed: <rdar://problem/3240778>: add "save" menu item to contextual menu for text pages
+
+ Reviewed by darin.
+
+ * WebView.subproj/WebTextView.m:
+ (-[WebTextView menuForEvent:]): Made WebTextView's context menu behavior like WebHTMLView's context menu behavior with regards to selection. If the control-click was on a selection, show menu options for the selection like copy. If it was not on a selection, show menu options such as save and print. Don't select anything when control-clicking.
+
2003-11-08 Chris Blumenberg <cblu at apple.com>
Fixed: <rdar://problem/3478022>: assertion failure while loading WMP content
diff --git a/WebKit/WebView.subproj/WebTextView.m b/WebKit/WebView.subproj/WebTextView.m
index 14182a5..28490fb 100644
--- a/WebKit/WebView.subproj/WebTextView.m
+++ b/WebKit/WebView.subproj/WebTextView.m
@@ -253,11 +253,8 @@
[[self nextResponder] keyUp:event];
}
-- (NSMenu *)menuForEvent:(NSEvent *)theEvent
-{
- // Calling super causes unselected clicked text to be selected.
- [super menuForEvent:theEvent];
-
+- (NSMenu *)menuForEvent:(NSEvent *)event
+{
WebFrameView *webFrameView = [self _web_parentWebFrameView];
WebView *webView = [webFrameView _webView];
WebFrame *frame = [webFrameView webFrame];
@@ -265,9 +262,11 @@
ASSERT(frame);
ASSERT(webView);
- BOOL hasSelection = ([self selectedRange].location != NSNotFound && [self selectedRange].length > 0);
+ NSPoint point = [[event window] convertBaseToScreen:[event locationInWindow]];
+ BOOL isPointSelected = NSLocationInRange([self characterIndexForPoint:point], [self selectedRange]);
+
NSDictionary *element = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:hasSelection], WebElementIsSelectedKey,
+ [NSNumber numberWithBool:isPointSelected], WebElementIsSelectedKey,
frame, WebElementFrameKey, nil];
return [webView _menuForElement:element];
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list