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 5f62553..7e1bc08 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 fd14df7..697eb5f 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 77c7400..ac18536 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 aa62672..9b75878 100644 (file)
@@ -1,5 +1,19 @@
 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)
 
         Reviewed by rjw.
index e8fc933..29ae339 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 b9e8d1a..0b70d0d 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 b845fde..d99e1a9 100644 (file)
@@ -86,6 +86,7 @@
     BOOL dashboardBehaviorAlwaysAcceptsFirstMouse;
     
     BOOL shouldUseFontSmoothing;
+    BOOL selectWordBeforeMenuEvent;
 }
 @end
 
index 4a1da89..90cc935 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