WebCore:
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Feb 2005 22:01:43 +0000 (22:01 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Feb 2005 22:01:43 +0000 (22:01 +0000)
Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)

        Reviewed by rjw.

        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
        * kwq/WebCoreBridge.h:

WebKit:

Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)

        Reviewed by rjw.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge selectWordBeforeMenuEvent]): new
        * WebView.subproj/WebView.m:
        (-[WebView _selectWordBeforeMenuEvent]): new SPI
        (-[WebView _setSelectWordBeforeMenuEvent:]): new SPI
        * WebView.subproj/WebViewInternal.h:
        * WebView.subproj/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8506 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.h
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebView.m
WebKit/WebView.subproj/WebViewInternal.h
WebKit/WebView.subproj/WebViewPrivate.h

index 5f625536788eed9bddb6e1b99857ed8ef71730c8..7e1bc08578cbd4b827bd4e19e78755a99128a21c 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-02  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
+
+        Reviewed by rjw.
+
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::sendContextMenuEvent): check if SPI to always enable selecting closest word is enabled
+        * kwq/WebCoreBridge.h:
+
 2005-02-02  Ken Kocienda  <kocienda@apple.com>
 
         Reviewed by me
index fd14df70883fe7836754252ad979b393f6d09b61..697eb5fce104e2e5a35a50c46e5e181e69b3c225 100644 (file)
@@ -2779,7 +2779,8 @@ bool KWQKHTMLPart::sendContextMenuEvent(NSEvent *event)
 
     bool swallowEvent = v->dispatchMouseEvent(EventImpl::CONTEXTMENU_EVENT,
         mev.innerNode.handle(), true, 0, &qev, true, NodeImpl::MousePress);
-    if (!swallowEvent && ([_bridge isEditable] || mev.innerNode.handle()->isContentEditable()) && !isPointInsideSelection(xm, ym)) {
+    if (!swallowEvent && !isPointInsideSelection(xm, ym) &&
+        ([_bridge selectWordBeforeMenuEvent] || [_bridge isEditable] || mev.innerNode.handle()->isContentEditable())) {
         selectClosestWordFromMouseEvent(&qev, mev.innerNode, xm, ym);
     }
 
index 77c740064597d159fad3b75d6921f2c23f8473a4..ac18536cc5a87600e4639ff9a9b234b52b7e022f 100644 (file)
@@ -538,6 +538,8 @@ typedef enum {
 - (void)handleAutoscrollForMouseDragged:(NSEvent *)event;
 - (BOOL)mayStartDragAtEventLocation:(NSPoint)location;
 
+- (BOOL)selectWordBeforeMenuEvent;
+
 - (int)historyLength;
 - (void)goBackOrForward:(int)distance;
 - (BOOL)canGoBackOrForward:(int)distance;
index aa626726fb92a0fd8c92a207b4c70d515b967940..9b75878fcf0c9c30d0e140862ca1593154fa69b3 100644 (file)
@@ -1,3 +1,17 @@
+2005-02-02  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3983628> control-click on WebView is not selecting the word under the cursor (Mail, non-editable WebView)
+
+        Reviewed by rjw.
+
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge selectWordBeforeMenuEvent]): new
+        * WebView.subproj/WebView.m:
+        (-[WebView _selectWordBeforeMenuEvent]): new SPI
+        (-[WebView _setSelectWordBeforeMenuEvent:]): new SPI
+        * WebView.subproj/WebViewInternal.h:
+        * WebView.subproj/WebViewPrivate.h:
+
 2005-02-02  Chris Blumenberg  <cblu@apple.com>
 
        Fixed: <rdar://problem/3986013> Assertion failure going back after page load error (no apparent problem in nondebug build)
index e8fc933fbf7f9e5dac8e879379c22d6546ca962f..29ae33915a8cc88a3fd01d9df390bc8116496dc1 100644 (file)
@@ -1076,6 +1076,11 @@ static BOOL loggedObjectCacheSize = NO;
     return [docView _mayStartDragAtEventLocation:location];
 }
 
+- (BOOL)selectWordBeforeMenuEvent
+{
+    return [[_frame webView] _selectWordBeforeMenuEvent];
+}
+
 - (int)historyLength
 {
     return [[[_frame webView] backForwardList] backListCount] + 1;
index b9e8d1a470ade8d8738c0ed958a7b3e361bccff0..0b70d0d867837dc363e2d1a61b8cae984c6b3ac9 100644 (file)
@@ -2883,6 +2883,16 @@ FORWARD(yankAndSelect)
     [[self _bridgeForCurrentSelection] insertParagraphSeparatorInQuotedContent];
 }
 
+- (BOOL)_selectWordBeforeMenuEvent
+{
+    return _private->selectWordBeforeMenuEvent;
+}
+
+- (void)_setSelectWordBeforeMenuEvent:(BOOL)flag
+{
+    _private->selectWordBeforeMenuEvent = flag;
+}
+
 @end
 
 @implementation WebView (WebFileInternal)
index b845fde2797dc698f3073dd42ce84c7340092e2f..d99e1a9acda16c277246e710d4c4819d47a80e07 100644 (file)
@@ -86,6 +86,7 @@
     BOOL dashboardBehaviorAlwaysAcceptsFirstMouse;
     
     BOOL shouldUseFontSmoothing;
+    BOOL selectWordBeforeMenuEvent;
 }
 @end
 
index 4a1da899c3a72b6a1ebd5d0a95b67b0410e1efeb..90cc9359980123f0cf7a75f4343087347f554753 100644 (file)
@@ -256,6 +256,8 @@ Could be worth adding to the API.
 
 @interface WebView (WebViewEditingInMail)
 - (void)_insertNewlineInQuotedContent;
+- (BOOL)_selectWordBeforeMenuEvent;
+- (void)_setSelectWordBeforeMenuEvent:(BOOL)flag;
 @end
 
 @interface _WebSafeForwarder : NSObject