[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:14:52 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 821d25e81e3c5e13ff1a00193a1de9ac31e9ed12
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 23 22:44:52 2002 +0000

    WebCore:
    	Fixes for the following (the first bug also requires WebKit and
    	WebBrowser changes):
    
    	Radar 2896391 - command-click should open link in new window
    	Radar 2935858 - two mails for each mailto:
    
    	* khtml/html/html_inlineimpl.cpp:
    	(HTMLAnchorElementImpl::defaultEventHandler): Set flag for Meta
    	key in addition to Control, Shift and Alt, since the Command key
    	is treated as Meta.
    	* kwq/KWQKHTMLPart.mm:
    	(KHTMLPart::urlSelected): Open a new window if the user
    	command-clicked.
    	(KHTMLPart::khtmlMouseMoveEvent): Clean up use of braces and ifdefs to
    	make prepare-ChangeLog happy.
    	(KHTMLPart::khtmlMouseReleaseEvent): Remove code that tried to
    	process link click events here. This made link clicks get
    	processed twice, now that mouse events are hooked up for real.
    	* kwq/external.h: prototype openNewWindowWithURL: method.
    
    WebKit:
    	WebKit part of the fix for:
    
    	Radar 2896391 - command-click should open link in new window
    
    	* WebView.subproj/IFBaseWebController.mm:
    	(-[IFBaseWebController openNewWindowWithURL:]): Default
    	implementation silently does nothing.
    	* WebView.subproj/IFWebController.h: Add openNewWindowWithURL:
    	method.
    	* WebView.subproj/IFWebView.mm:
    	(-[IFWebView _addModifiers:toState:]): Split out modifier key
    	handling to here. Treat Command as Meta.
    	(-[IFWebView mouseUp:]): Use new method to set key modifiers for
    	mouse events.
    	(-[IFWebView mouseDown:]): Use new method to set key modifiers for
    	mouse events.
    	(-[IFWebView keyDown:]): Use new shared code for key modifiers.
    	(-[IFWebView keyUp:]): Use new shared code for key modifiers.
    
    WebBrowser:
    	WebBrowser part of the fix for:
    
    	Radar 2896391 - command-click should open link in new window
    
    	* WebController.m:
    	(-[WebController openNewWindowWithURL:]): Implement this new
    	IFWebController method by opening a new browser window.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 9c06dc0..1dd3812 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,25 @@
+2002-05-23  Maciej Stachowiak  <mjs at apple.com>
+
+	Fixes for the following (the first bug also requires WebKit and
+	WebBrowser changes):
+	
+	Radar 2896391 - command-click should open link in new window
+	Radar 2935858 - two mails for each mailto:
+
+	* khtml/html/html_inlineimpl.cpp:
+	(HTMLAnchorElementImpl::defaultEventHandler): Set flag for Meta
+	key in addition to Control, Shift and Alt, since the Command key
+	is treated as Meta.
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::urlSelected): Open a new window if the user
+	command-clicked.
+	(KHTMLPart::khtmlMouseMoveEvent): Clean up use of braces and ifdefs to
+	make prepare-ChangeLog happy.
+	(KHTMLPart::khtmlMouseReleaseEvent): Remove code that tried to
+	process link click events here. This made link clicks get
+	processed twice, now that mouse events are hooked up for real.
+	* kwq/external.h: prototype openNewWindowWithURL: method.
+
 2002-05-23  Kenneth Kocienda  <kocienda at apple.com>
 
         More work to fix this bug:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 9c06dc0..1dd3812 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,25 @@
+2002-05-23  Maciej Stachowiak  <mjs at apple.com>
+
+	Fixes for the following (the first bug also requires WebKit and
+	WebBrowser changes):
+	
+	Radar 2896391 - command-click should open link in new window
+	Radar 2935858 - two mails for each mailto:
+
+	* khtml/html/html_inlineimpl.cpp:
+	(HTMLAnchorElementImpl::defaultEventHandler): Set flag for Meta
+	key in addition to Control, Shift and Alt, since the Command key
+	is treated as Meta.
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::urlSelected): Open a new window if the user
+	command-clicked.
+	(KHTMLPart::khtmlMouseMoveEvent): Clean up use of braces and ifdefs to
+	make prepare-ChangeLog happy.
+	(KHTMLPart::khtmlMouseReleaseEvent): Remove code that tried to
+	process link click events here. This made link clicks get
+	processed twice, now that mouse events are hooked up for real.
+	* kwq/external.h: prototype openNewWindowWithURL: method.
+
 2002-05-23  Kenneth Kocienda  <kocienda at apple.com>
 
         More work to fix this bug:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 9c06dc0..1dd3812 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,25 @@
+2002-05-23  Maciej Stachowiak  <mjs at apple.com>
+
+	Fixes for the following (the first bug also requires WebKit and
+	WebBrowser changes):
+	
+	Radar 2896391 - command-click should open link in new window
+	Radar 2935858 - two mails for each mailto:
+
+	* khtml/html/html_inlineimpl.cpp:
+	(HTMLAnchorElementImpl::defaultEventHandler): Set flag for Meta
+	key in addition to Control, Shift and Alt, since the Command key
+	is treated as Meta.
+	* kwq/KWQKHTMLPart.mm:
+	(KHTMLPart::urlSelected): Open a new window if the user
+	command-clicked.
+	(KHTMLPart::khtmlMouseMoveEvent): Clean up use of braces and ifdefs to
+	make prepare-ChangeLog happy.
+	(KHTMLPart::khtmlMouseReleaseEvent): Remove code that tried to
+	process link click events here. This made link clicks get
+	processed twice, now that mouse events are hooked up for real.
+	* kwq/external.h: prototype openNewWindowWithURL: method.
+
 2002-05-23  Kenneth Kocienda  <kocienda at apple.com>
 
         More work to fix this bug:
diff --git a/WebCore/khtml/html/html_inlineimpl.cpp b/WebCore/khtml/html/html_inlineimpl.cpp
index 4c40a7c..801a1a0 100644
--- a/WebCore/khtml/html/html_inlineimpl.cpp
+++ b/WebCore/khtml/html/html_inlineimpl.cpp
@@ -125,6 +125,10 @@ void HTMLAnchorElementImpl::defaultEventHandler(EventImpl *evt)
                     state |= Qt::ShiftButton;
                 if ( e->altKey() )
                     state |= Qt::AltButton;
+#ifdef APPLE_CHANGES
+                if ( e->metaKey() )
+                    state |= Qt::MetaButton;
+#endif
 
                 if ( e->button() == 0 )
                     button = Qt::LeftButton;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index a184d6e..d257de9 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -435,6 +435,12 @@ void KHTMLPart::urlSelected( const QString &url, int button, int state, const QS
         return;
     }
 
+    // Open new window on command-click
+    if (state & MetaButton) {
+        [[getDataSource() controller] openNewWindowWithURL:clickedURL.getNSURL()];
+        return;
+    }
+
 	m_url.setRef ("");
 	refLess.setRef ("");
 	if (refLess.url() == m_url.url()){
@@ -928,6 +934,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
             ->setSelection(d->m_selectionEnd.handle(),d->m_endOffset,
                            d->m_selectionStart.handle(),d->m_startOffset);
       }
+    }
 #else
       if ( d->m_doc && d->m_view ) {
         QPoint diff( _mouse->globalPos() - d->m_dragLastPos );
@@ -936,8 +943,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
           d->m_view->scrollBy( -diff.x(), -diff.y() );
           d->m_dragLastPos = _mouse->globalPos();
         }
-#endif
     }
+#endif
   }
 #endif
 }
@@ -954,11 +961,6 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
     // the mouse is pressed again.
     d->m_bMousePressed = false;
     
-    // HACK!  FIXME!
-    if (d->m_strSelectedURL != QString::null) {
-        urlSelected(d->m_strSelectedURL, 0,0, event->target().string());
-    }
-    
     #ifndef _KWQ_
     #define QT_NO_CLIPBOARD 1
     #ifndef QT_NO_CLIPBOARD
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index a184d6e..d257de9 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -435,6 +435,12 @@ void KHTMLPart::urlSelected( const QString &url, int button, int state, const QS
         return;
     }
 
+    // Open new window on command-click
+    if (state & MetaButton) {
+        [[getDataSource() controller] openNewWindowWithURL:clickedURL.getNSURL()];
+        return;
+    }
+
 	m_url.setRef ("");
 	refLess.setRef ("");
 	if (refLess.url() == m_url.url()){
@@ -928,6 +934,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
             ->setSelection(d->m_selectionEnd.handle(),d->m_endOffset,
                            d->m_selectionStart.handle(),d->m_startOffset);
       }
+    }
 #else
       if ( d->m_doc && d->m_view ) {
         QPoint diff( _mouse->globalPos() - d->m_dragLastPos );
@@ -936,8 +943,8 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
           d->m_view->scrollBy( -diff.x(), -diff.y() );
           d->m_dragLastPos = _mouse->globalPos();
         }
-#endif
     }
+#endif
   }
 #endif
 }
@@ -954,11 +961,6 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
     // the mouse is pressed again.
     d->m_bMousePressed = false;
     
-    // HACK!  FIXME!
-    if (d->m_strSelectedURL != QString::null) {
-        urlSelected(d->m_strSelectedURL, 0,0, event->target().string());
-    }
-    
     #ifndef _KWQ_
     #define QT_NO_CLIPBOARD 1
     #ifndef QT_NO_CLIPBOARD
diff --git a/WebCore/kwq/external.h b/WebCore/kwq/external.h
index dd3350e..7e580f1 100644
--- a/WebCore/kwq/external.h
+++ b/WebCore/kwq/external.h
@@ -39,6 +39,7 @@
 @protocol IFWebController
 - (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource inScrollView: (BOOL)inScrollView;
 - (IFWebFrame *)frameNamed: (NSString *)name;
+- (void)openNewWindowWithURL: (NSURL *)url;
 @end
 
 @interface IFBaseWebController
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d6775eb..2842d28 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2002-05-23  Maciej Stachowiak  <mjs at apple.com>
+
+	WebKit part of the fix for:
+
+	Radar 2896391 - command-click should open link in new window
+	
+	* WebView.subproj/IFBaseWebController.mm:
+	(-[IFBaseWebController openNewWindowWithURL:]): Default
+	implementation silently does nothing.
+	* WebView.subproj/IFWebController.h: Add openNewWindowWithURL:
+	method.
+	* WebView.subproj/IFWebView.mm:
+	(-[IFWebView _addModifiers:toState:]): Split out modifier key
+	handling to here. Treat Command as Meta.
+	(-[IFWebView mouseUp:]): Use new method to set key modifiers for
+	mouse events.
+	(-[IFWebView mouseDown:]): Use new method to set key modifiers for
+	mouse events.
+	(-[IFWebView keyDown:]): Use new shared code for key modifiers.
+	(-[IFWebView keyUp:]): Use new shared code for key modifiers.
+
 2002-05-23  Kenneth Kocienda  <kocienda at apple.com>
 
         Fixes for these bugs:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index d6775eb..2842d28 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,24 @@
+2002-05-23  Maciej Stachowiak  <mjs at apple.com>
+
+	WebKit part of the fix for:
+
+	Radar 2896391 - command-click should open link in new window
+	
+	* WebView.subproj/IFBaseWebController.mm:
+	(-[IFBaseWebController openNewWindowWithURL:]): Default
+	implementation silently does nothing.
+	* WebView.subproj/IFWebController.h: Add openNewWindowWithURL:
+	method.
+	* WebView.subproj/IFWebView.mm:
+	(-[IFWebView _addModifiers:toState:]): Split out modifier key
+	handling to here. Treat Command as Meta.
+	(-[IFWebView mouseUp:]): Use new method to set key modifiers for
+	mouse events.
+	(-[IFWebView mouseDown:]): Use new method to set key modifiers for
+	mouse events.
+	(-[IFWebView keyDown:]): Use new shared code for key modifiers.
+	(-[IFWebView keyUp:]): Use new shared code for key modifiers.
+
 2002-05-23  Kenneth Kocienda  <kocienda at apple.com>
 
         Fixes for these bugs:
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index bdf7f91..060de35 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -92,6 +92,11 @@
 }
 
 
+- (void)openNewWindowWithURL:(NSURL *)url
+{
+    // Default implementation does nothing
+}
+
 
 // ---------------------------------------------------------------------
 // IFLoadHandler
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index 92436e9..1314dfb 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -78,6 +78,8 @@
 // screen goemetry.  Essentially all the 'view' items that are
 // accessible from Javascript.
 
+// FIXME: not strictly a scripting issue
+- (void)openNewWindowWithURL:(NSURL *)url;
 @end
 
 /*
diff --git a/WebKit/WebView.subproj/IFWebView.mm b/WebKit/WebView.subproj/IFWebView.mm
index 0b8ad91..1325d45 100644
--- a/WebKit/WebView.subproj/IFWebView.mm
+++ b/WebKit/WebView.subproj/IFWebView.mm
@@ -468,6 +468,18 @@
         [self setNeedsLayout: YES];
 }
 
+- (void)_addModifiers:(unsigned)modifiers toState:(int *)state
+{
+    if (modifiers & NSControlKeyMask)
+        *state |= Qt::ControlButton;
+    if (modifiers & NSShiftKeyMask)
+        *state |= Qt::ShiftButton;
+    if (modifiers & NSAlternateKeyMask)
+        *state |= Qt::AltButton;
+    // Mapping command to meta is slightly questionable
+    if (modifiers & NSCommandKeyMask)
+        *state |= Qt::MetaButton;
+}
 
 - (void)mouseUp: (NSEvent *)event
 {
@@ -491,6 +503,8 @@
     }
     NSPoint p = [event locationInWindow];
     
+    [self _addModifiers:[event modifierFlags] toState:&state];
+
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
     if (widget != 0l) {
@@ -520,6 +534,8 @@
     }
     NSPoint p = [event locationInWindow];
     
+    [self _addModifiers:[event modifierFlags] toState:&state];
+
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
     if (widget != 0l) {
@@ -550,12 +566,7 @@
     NSLog (@"keyDown: %@\n", event);
     int state = 0;
     
-    if ([event modifierFlags] & NSControlKeyMask)
-        state |= Qt::ControlButton;
-    if ([event modifierFlags] & NSShiftKeyMask)
-        state |= Qt::ShiftButton;
-    if ([event modifierFlags] & NSAlternateKeyMask)
-        state |= Qt::AltButton;
+    [self _addModifiers:[event modifierFlags] toState:&state];
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
 
     
@@ -570,12 +581,7 @@
     NSLog (@"keyUp: %@\n", event);
     int state = 0;
     
-    if ([event modifierFlags] & NSControlKeyMask)
-        state |= Qt::ControlButton;
-    if ([event modifierFlags] & NSShiftKeyMask)
-        state |= Qt::ShiftButton;
-    if ([event modifierFlags] & NSAlternateKeyMask)
-        state |= Qt::AltButton;
+    [self _addModifiers:[event modifierFlags] toState:&state];
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
 
     
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 92436e9..1314dfb 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -78,6 +78,8 @@
 // screen goemetry.  Essentially all the 'view' items that are
 // accessible from Javascript.
 
+// FIXME: not strictly a scripting issue
+- (void)openNewWindowWithURL:(NSURL *)url;
 @end
 
 /*
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 0b8ad91..1325d45 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -468,6 +468,18 @@
         [self setNeedsLayout: YES];
 }
 
+- (void)_addModifiers:(unsigned)modifiers toState:(int *)state
+{
+    if (modifiers & NSControlKeyMask)
+        *state |= Qt::ControlButton;
+    if (modifiers & NSShiftKeyMask)
+        *state |= Qt::ShiftButton;
+    if (modifiers & NSAlternateKeyMask)
+        *state |= Qt::AltButton;
+    // Mapping command to meta is slightly questionable
+    if (modifiers & NSCommandKeyMask)
+        *state |= Qt::MetaButton;
+}
 
 - (void)mouseUp: (NSEvent *)event
 {
@@ -491,6 +503,8 @@
     }
     NSPoint p = [event locationInWindow];
     
+    [self _addModifiers:[event modifierFlags] toState:&state];
+
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
     if (widget != 0l) {
@@ -520,6 +534,8 @@
     }
     NSPoint p = [event locationInWindow];
     
+    [self _addModifiers:[event modifierFlags] toState:&state];
+
     QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint((int)p.x, (int)p.y), button, state);
     KHTMLView *widget = _private->widget;
     if (widget != 0l) {
@@ -550,12 +566,7 @@
     NSLog (@"keyDown: %@\n", event);
     int state = 0;
     
-    if ([event modifierFlags] & NSControlKeyMask)
-        state |= Qt::ControlButton;
-    if ([event modifierFlags] & NSShiftKeyMask)
-        state |= Qt::ShiftButton;
-    if ([event modifierFlags] & NSAlternateKeyMask)
-        state |= Qt::AltButton;
+    [self _addModifiers:[event modifierFlags] toState:&state];
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
 
     
@@ -570,12 +581,7 @@
     NSLog (@"keyUp: %@\n", event);
     int state = 0;
     
-    if ([event modifierFlags] & NSControlKeyMask)
-        state |= Qt::ControlButton;
-    if ([event modifierFlags] & NSShiftKeyMask)
-        state |= Qt::ShiftButton;
-    if ([event modifierFlags] & NSAlternateKeyMask)
-        state |= Qt::AltButton;
+    [self _addModifiers:[event modifierFlags] toState:&state];
     QKeyEvent kEvent(QEvent::KeyPress, 0, 0, state, NSSTRING_TO_QSTRING([event characters]), [event isARepeat], 1);
 
     
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 92436e9..1314dfb 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -78,6 +78,8 @@
 // screen goemetry.  Essentially all the 'view' items that are
 // accessible from Javascript.
 
+// FIXME: not strictly a scripting issue
+- (void)openNewWindowWithURL:(NSURL *)url;
 @end
 
 /*

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list