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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:46:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7638f30cdbc60bfb1b4aa8c76eed79d8373db1ac
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 2 23:52:57 2002 +0000

    WebCore:
    
    	Moved "overURL" handling out of WebCore into WebKit and Alex.
    	Also separated the two levels of the "element dictionary" so they
    	don't rely on having the same keys.
    
            * khtml/khtml_part.h: Revert the APPLE_CHANGES to overURL.
            * khtml/khtml_part.cpp:
            (KHTMLPart::overURL): Removed the APPLE_CHANGES and just ifdef'd out
    	the whole thing for our version.
            (KHTMLPart::khtmlMouseMoveEvent): Get rid of the APPLE_CHANGES and
    	don't do any of the status bar setup.
    
            * kwq/KWQKHTMLPartImpl.h: Remove overURL.
            * kwq/KWQKHTMLPartImpl.mm: Ditto.
    
            * kwq/WebCoreBridge.h: Change keys so they don't match the WebKit ones so
    	we don't accidentally rely on that. Add WebCoreElementLinkTarget.
    
            * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Add code to
    	set up WebCoreElementLinkTarget.
    
    WebKit:
    
    	Machinery so we can handle mouseover feedback at the browser level.
    
            * WebView.subproj/WebWindowOperationsDelegate.h: Added mouseDidMoveOverElement:modifierFlags:.
    
            * WebKit.exp: Export WebElementLinkTargetFrameKey.
            * WebView.subproj/WebController.h: Add WebElementLinkTargetFrameKey.
            * WebView.subproj/WebController.m: Ditto.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView removeMouseMovedObserver]): Send a callback when we
    	stop tracking the mouse altogether.
            (-[WebHTMLView viewDidMoveToWindow]): Only set up the mouse moved
    	observer if we are the top-level HTML view.
            (-[WebHTMLView windowDidBecomeMain:]): Ditto.
            (-[WebHTMLView mouseMovedNotification:]): Handle mouse over if we are
    	over any subview of the HTML view. Also send the callback.
    
            * WebView.subproj/WebHTMLViewPrivate.h: Added lastMouseOverElementWasNotNil,
    	_mouseOverElement:modifierFlags: and _insideAnotherHTMLView.
            * WebView.subproj/WebHTMLViewPrivate.m:
            (-[WebHTMLView _elementAtPoint:]): Copy over each element separately so
    	we don't rely on keys matching. Find the target frame given the target string,
    	and include it in the dictionary.
            (-[WebHTMLView _mouseOverElement:modifierFlags]): Added. Calls the window
    	operations delegate method, but doesn't call it over and over again if the
    	information is still "nil".
            (-[WebHTMLView _insideAnotherHTMLView]): Added.
            (-[NSMutableDictionary _web_setObjectIfNotNil:forKey:]): Added. Helper for
    	the _elementAtPoint method which could be moved to WebNSDictionaryExtras some day.
    
    WebBrowser:
    
    	- fixed 2935687 -- cmd-shift-click should open new window behind
    	- fixed 3050456 -- Click modifier actions are decided by WebBrowser,
    	but status messages come from WebCore
    
            * BrowserWebController.m:
            (-[BrowserWebController mouseDidMoveOverElement:modifierFlags:]): Added.
    	Contains the same logic that used to be in WebCore for mouseover messages,
    	but translated into WebKit-ese as opposed to WebCore-ese.
    
            * WebBrowser.pbproj/project.pbxproj: Change encoding of BrowserWebController.m
    	to UTF-8. Be careful if you open this file without having the project open in
    	Project Builder.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2232 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 0fe61e7..9647abb 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,25 @@
+2002-10-02  Darin Adler  <darin at apple.com>
+
+	Moved "overURL" handling out of WebCore into WebKit and Alex.
+	Also separated the two levels of the "element dictionary" so they
+	don't rely on having the same keys.
+
+        * khtml/khtml_part.h: Revert the APPLE_CHANGES to overURL.
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::overURL): Removed the APPLE_CHANGES and just ifdef'd out
+	the whole thing for our version.
+        (KHTMLPart::khtmlMouseMoveEvent): Get rid of the APPLE_CHANGES and
+	don't do any of the status bar setup.
+
+        * kwq/KWQKHTMLPartImpl.h: Remove overURL.
+        * kwq/KWQKHTMLPartImpl.mm: Ditto.
+
+        * kwq/WebCoreBridge.h: Change keys so they don't match the WebKit ones so
+	we don't accidentally rely on that. Add WebCoreElementLinkTarget.
+
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Add code to
+	set up WebCoreElementLinkTarget.
+
 2002-10-01  Darin Adler  <darin at apple.com>
 
 	- fixed 3055076 -- window.scroll does a window.scrollby, not a window.scrollto
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 0fe61e7..9647abb 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,25 @@
+2002-10-02  Darin Adler  <darin at apple.com>
+
+	Moved "overURL" handling out of WebCore into WebKit and Alex.
+	Also separated the two levels of the "element dictionary" so they
+	don't rely on having the same keys.
+
+        * khtml/khtml_part.h: Revert the APPLE_CHANGES to overURL.
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::overURL): Removed the APPLE_CHANGES and just ifdef'd out
+	the whole thing for our version.
+        (KHTMLPart::khtmlMouseMoveEvent): Get rid of the APPLE_CHANGES and
+	don't do any of the status bar setup.
+
+        * kwq/KWQKHTMLPartImpl.h: Remove overURL.
+        * kwq/KWQKHTMLPartImpl.mm: Ditto.
+
+        * kwq/WebCoreBridge.h: Change keys so they don't match the WebKit ones so
+	we don't accidentally rely on that. Add WebCoreElementLinkTarget.
+
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Add code to
+	set up WebCoreElementLinkTarget.
+
 2002-10-01  Darin Adler  <darin at apple.com>
 
 	- fixed 3055076 -- window.scroll does a window.scrollby, not a window.scrollto
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 0fe61e7..9647abb 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,25 @@
+2002-10-02  Darin Adler  <darin at apple.com>
+
+	Moved "overURL" handling out of WebCore into WebKit and Alex.
+	Also separated the two levels of the "element dictionary" so they
+	don't rely on having the same keys.
+
+        * khtml/khtml_part.h: Revert the APPLE_CHANGES to overURL.
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::overURL): Removed the APPLE_CHANGES and just ifdef'd out
+	the whole thing for our version.
+        (KHTMLPart::khtmlMouseMoveEvent): Get rid of the APPLE_CHANGES and
+	don't do any of the status bar setup.
+
+        * kwq/KWQKHTMLPartImpl.h: Remove overURL.
+        * kwq/KWQKHTMLPartImpl.mm: Ditto.
+
+        * kwq/WebCoreBridge.h: Change keys so they don't match the WebKit ones so
+	we don't accidentally rely on that. Add WebCoreElementLinkTarget.
+
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): Add code to
+	set up WebCoreElementLinkTarget.
+
 2002-10-01  Darin Adler  <darin at apple.com>
 
 	- fixed 3055076 -- window.scroll does a window.scrollby, not a window.scrollto
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 02a3c9c..629b766 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -2126,14 +2126,7 @@ void KHTMLPart::slotClearSelection()
     emitSelectionChanged();
 }
 
-#ifdef APPLE_CHANGES
-
-void KHTMLPart::overURL( const QString &url, const QString &target, int modifierState )
-{
-  impl->overURL(url, target, modifierState);
-}
-
-#else
+#if !APPLE_CHANGES
 
 void KHTMLPart::overURL( const QString &url, const QString &target, bool shiftPressed )
 {
@@ -4266,12 +4259,11 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
   // Not clicked -> mouse over stuff
   if ( !d->m_bMousePressed )
   {
+#if !APPLE_CHANGES
     // The mouse is over something
     if ( url.length() )
     {
-#ifndef APPLE_CHANGES
       bool shiftPressed = ( _mouse->state() & ShiftButton );
-#endif
 
       // Image map
       if ( !innerNode.isNull() && innerNode.elementId() == ID_IMG )
@@ -4290,28 +4282,18 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
 
             d->m_overURL = url.string() + QString("?%1,%2").arg(x).arg(y);
             d->m_overURLTarget = target.string();
-#ifdef APPLE_CHANGES
-            overURL( d->m_overURL, target.string(), _mouse->state() );
-#else
             overURL( d->m_overURL, target.string(), shiftPressed );
-#endif
             return;
           }
         }
       }
 
       // normal link
-#ifndef APPLE_CHANGES
       if ( d->m_overURL.isEmpty() || d->m_overURL != url || d->m_overURLTarget != target )
-#endif
       {
         d->m_overURL = url.string();
         d->m_overURLTarget = target.string();
-#ifdef APPLE_CHANGES
-	overURL( d->m_overURL, target.string(), _mouse->state() );
-#else
         overURL( d->m_overURL, target.string(), shiftPressed );
-#endif
       }
     }
     else  // Not over a link...
@@ -4324,6 +4306,7 @@ void KHTMLPart::khtmlMouseMoveEvent( khtml::MouseMoveEvent *event )
         emit setStatusBarText( d->m_kjsDefaultStatusBarText );
       }
     }
+#endif // APPLE_CHANGES
   }
   else {
 #ifndef KHTML_NO_SELECTION
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 9265672..2e1171b 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -1010,11 +1010,7 @@ private:
 
   void startAutoScroll();
   void stopAutoScroll();
-#ifdef APPLE_CHANGES
-  void overURL( const QString &url, const QString &target, int modifierState = 0);
-#else
   void overURL( const QString &url, const QString &target, bool shiftPressed = false );
-#endif
 
   /**
    * @internal
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 7b66a15..76f73b4 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -99,8 +99,6 @@ public:
 
     void jumpToSelection();
 
-    void overURL(const QString &url, const QString &target, int modifierState);
-    
     void layout();
     
     QString userAgent() const;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index d37b16c..7fea63b 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -274,77 +274,6 @@ void KWQKHTMLPartImpl::unfocusWindow()
     [_bridge unfocusWindow];
 }
 
-void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int modifierState)
-{
-    // FIXME: The rules about what string does what should not be separate from the code that
-    // actually implements these rules. It's particularly bad with strings.
-
-    if (url.isEmpty()) {
-        [_bridge setStatusText:@""];
-        return;
-    }
-
-    int position = url.find("javascript:", 0, false);
-    if (position == 0) {
-        // FIXME: Is it worthwhile to special-case scripts that do a window.open and nothing else?
-        const QString scriptName = url.mid(strlen("javascript:"));
-        [_bridge setStatusText:[NSString stringWithFormat:@"Run script \"%@\"", scriptName.getNSString()]];
-        return;
-    }
-    
-    KURL u = part->completeURL(url);
-    
-    if (u.protocol() == "mailto") {
-        // FIXME: Add address book integration so we show the real name instead?
-        const QString address = KURL::decode_string(u.path());
-        [_bridge setStatusText:[NSString stringWithFormat:@"Send email to %@", address.getNSString()]];
-        return;
-    }
-    
-    NSString *format;
-    
-    QString target = _target;
-    if (target.isEmpty() && d->m_doc) {
-        target = d->m_doc->baseTarget();
-    }
-    
-    if (target == "_blank") {
-        format = @"Open \"%@\" in a new window";
-    } else {
-        WebCoreBridge *targetFrame;
-        if (target.isEmpty() || target != "_self" || target == "_top" || target != "_parent") {
-            targetFrame = _bridge;
-        } else {
-            targetFrame = [_bridge frameNamed:target.getNSString()];
-        }
-        if (targetFrame == _bridge) {
-            format = @"Go to \"%@\"";
-        } else if (targetFrame == nil) {
-            format = @"Open \"%@\" in a new window";
-        } else if ([targetFrame mainFrame] == [_bridge mainFrame]) {
-            format = @"Go to \"%@\" in another frame";
-        } else {
-            format = @"Go to \"%@\" in another window";
-        }
-    }
-    
-    if ([_bridge modifierTrackingEnabled]) {
-        if (modifierState & MetaButton) {
-            // FIXME 2935687: We are waffling about support for command-shift for open-behind,
-            // so I'm commenting out this message until this is addressed.
-            if (modifierState & ShiftButton && NO) {
-                format = @"Open \"%@\" in a new window, behind the current window";
-            } else {
-                format = @"Open \"%@\" in a new window";
-            }
-        } else if (modifierState & AltButton) {
-            format = @"Download \"%@\"";
-        }
-    }
-    
-    [_bridge setStatusText:[NSString stringWithFormat:format, u.url().getNSString()]];
-}
-
 void KWQKHTMLPartImpl::jumpToSelection()
 {
     // Assumes that selection will only ever be text nodes. This is currently
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 7b66a15..76f73b4 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -99,8 +99,6 @@ public:
 
     void jumpToSelection();
 
-    void overURL(const QString &url, const QString &target, int modifierState);
-    
     void layout();
     
     QString userAgent() const;
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index d37b16c..7fea63b 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -274,77 +274,6 @@ void KWQKHTMLPartImpl::unfocusWindow()
     [_bridge unfocusWindow];
 }
 
-void KWQKHTMLPartImpl::overURL(const QString &url, const QString &_target, int modifierState)
-{
-    // FIXME: The rules about what string does what should not be separate from the code that
-    // actually implements these rules. It's particularly bad with strings.
-
-    if (url.isEmpty()) {
-        [_bridge setStatusText:@""];
-        return;
-    }
-
-    int position = url.find("javascript:", 0, false);
-    if (position == 0) {
-        // FIXME: Is it worthwhile to special-case scripts that do a window.open and nothing else?
-        const QString scriptName = url.mid(strlen("javascript:"));
-        [_bridge setStatusText:[NSString stringWithFormat:@"Run script \"%@\"", scriptName.getNSString()]];
-        return;
-    }
-    
-    KURL u = part->completeURL(url);
-    
-    if (u.protocol() == "mailto") {
-        // FIXME: Add address book integration so we show the real name instead?
-        const QString address = KURL::decode_string(u.path());
-        [_bridge setStatusText:[NSString stringWithFormat:@"Send email to %@", address.getNSString()]];
-        return;
-    }
-    
-    NSString *format;
-    
-    QString target = _target;
-    if (target.isEmpty() && d->m_doc) {
-        target = d->m_doc->baseTarget();
-    }
-    
-    if (target == "_blank") {
-        format = @"Open \"%@\" in a new window";
-    } else {
-        WebCoreBridge *targetFrame;
-        if (target.isEmpty() || target != "_self" || target == "_top" || target != "_parent") {
-            targetFrame = _bridge;
-        } else {
-            targetFrame = [_bridge frameNamed:target.getNSString()];
-        }
-        if (targetFrame == _bridge) {
-            format = @"Go to \"%@\"";
-        } else if (targetFrame == nil) {
-            format = @"Open \"%@\" in a new window";
-        } else if ([targetFrame mainFrame] == [_bridge mainFrame]) {
-            format = @"Go to \"%@\" in another frame";
-        } else {
-            format = @"Go to \"%@\" in another window";
-        }
-    }
-    
-    if ([_bridge modifierTrackingEnabled]) {
-        if (modifierState & MetaButton) {
-            // FIXME 2935687: We are waffling about support for command-shift for open-behind,
-            // so I'm commenting out this message until this is addressed.
-            if (modifierState & ShiftButton && NO) {
-                format = @"Open \"%@\" in a new window, behind the current window";
-            } else {
-                format = @"Open \"%@\" in a new window";
-            }
-        } else if (modifierState & AltButton) {
-            format = @"Download \"%@\"";
-        }
-    }
-    
-    [_bridge setStatusText:[NSString stringWithFormat:format, u.url().getNSString()]];
-}
-
 void KWQKHTMLPartImpl::jumpToSelection()
 {
     // Assumes that selection will only ever be text nodes. This is currently
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 630cc92..0203e72 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -53,12 +53,13 @@ typedef khtml::RenderPart KHTMLRenderPart;
 @protocol WebCoreResourceHandle;
 @protocol WebCoreResourceLoader;
 
-#define WebCoreElementLinkURL  		@"WebElementLinkURL"
-#define WebCoreElementLinkLabel  	@"WebElementLinkLabel"
-#define WebCoreElementImageURL 		@"WebElementImageURL"
-#define WebCoreElementString   		@"WebElementString"
-#define WebCoreElementImage    		@"WebElementImage"
-#define WebCoreElementImageLocation	@"WebElementImageLocation"
+#define WebCoreElementLinkURL  		@"WebCoreElementLinkURL"
+#define WebCoreElementLinkTarget  	@"WebCoreElementLinkTarget"
+#define WebCoreElementLinkLabel  	@"WebCoreElementLinkLabel"
+#define WebCoreElementImageURL 		@"WebCoreElementImageURL"
+#define WebCoreElementString   		@"WebCoreElementString"
+#define WebCoreElementImage    		@"WebCoreElementImage"
+#define WebCoreElementImageLocation	@"WebCoreElementImageLocation"
 
 // WebCoreBridge objects are used by WebCore to abstract away operations that need
 // to be implemented by library clients, for example WebKit. The objects are also
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 747e6d4..b136c6c 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -429,7 +429,8 @@ using khtml::RenderPart;
 
     NodeImpl *URLNode = nodeInfo.URLElement();
     if (URLNode) {
-        ElementImpl* e =  static_cast<ElementImpl*>(URLNode);
+        ElementImpl* e = static_cast<ElementImpl*>(URLNode);
+        
         NSURL *URL = [self completeURLForDOMString:parseURL(e->getAttribute(ATTR_HREF))];
         if (URL) {
             // Look for the first #text node to use as a label.
@@ -449,6 +450,14 @@ using khtml::RenderPart;
             }
             [elementInfo setObject:URL forKey:WebCoreElementLinkURL];
         }
+        
+        DOMString target = e->getAttribute(ATTR_TARGET);
+        if (target.isEmpty() && part->impl->document()) {
+            target = part->impl->document()->baseTarget();
+        }
+        if (!target.isEmpty()) {
+            [elementInfo setObject:target.string().getNSString() forKey:WebCoreElementLinkTarget];
+        }
     }
 
     NodeImpl *node = nodeInfo.innerNode();
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index ef38d0f..363cbb2 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,35 @@
+2002-10-02  Darin Adler  <darin at apple.com>
+
+	Machinery so we can handle mouseover feedback at the browser level.
+
+        * WebView.subproj/WebWindowOperationsDelegate.h: Added mouseDidMoveOverElement:modifierFlags:.
+
+        * WebKit.exp: Export WebElementLinkTargetFrameKey.
+        * WebView.subproj/WebController.h: Add WebElementLinkTargetFrameKey.
+        * WebView.subproj/WebController.m: Ditto.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView removeMouseMovedObserver]): Send a callback when we
+	stop tracking the mouse altogether.
+        (-[WebHTMLView viewDidMoveToWindow]): Only set up the mouse moved
+	observer if we are the top-level HTML view.
+        (-[WebHTMLView windowDidBecomeMain:]): Ditto.
+        (-[WebHTMLView mouseMovedNotification:]): Handle mouse over if we are
+	over any subview of the HTML view. Also send the callback.
+
+        * WebView.subproj/WebHTMLViewPrivate.h: Added lastMouseOverElementWasNotNil,
+	_mouseOverElement:modifierFlags: and _insideAnotherHTMLView.
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _elementAtPoint:]): Copy over each element separately so
+	we don't rely on keys matching. Find the target frame given the target string,
+	and include it in the dictionary.
+        (-[WebHTMLView _mouseOverElement:modifierFlags]): Added. Calls the window
+	operations delegate method, but doesn't call it over and over again if the
+	information is still "nil".
+        (-[WebHTMLView _insideAnotherHTMLView]): Added.
+        (-[NSMutableDictionary _web_setObjectIfNotNil:forKey:]): Added. Helper for
+	the _elementAtPoint method which could be moved to WebNSDictionaryExtras some day.
+
 2002-10-02  Ken Kocienda  <kocienda at apple.com>
 
 	Implemented HTTP-specific subclass for WebResourceResponse.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index ef38d0f..363cbb2 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,35 @@
+2002-10-02  Darin Adler  <darin at apple.com>
+
+	Machinery so we can handle mouseover feedback at the browser level.
+
+        * WebView.subproj/WebWindowOperationsDelegate.h: Added mouseDidMoveOverElement:modifierFlags:.
+
+        * WebKit.exp: Export WebElementLinkTargetFrameKey.
+        * WebView.subproj/WebController.h: Add WebElementLinkTargetFrameKey.
+        * WebView.subproj/WebController.m: Ditto.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView removeMouseMovedObserver]): Send a callback when we
+	stop tracking the mouse altogether.
+        (-[WebHTMLView viewDidMoveToWindow]): Only set up the mouse moved
+	observer if we are the top-level HTML view.
+        (-[WebHTMLView windowDidBecomeMain:]): Ditto.
+        (-[WebHTMLView mouseMovedNotification:]): Handle mouse over if we are
+	over any subview of the HTML view. Also send the callback.
+
+        * WebView.subproj/WebHTMLViewPrivate.h: Added lastMouseOverElementWasNotNil,
+	_mouseOverElement:modifierFlags: and _insideAnotherHTMLView.
+        * WebView.subproj/WebHTMLViewPrivate.m:
+        (-[WebHTMLView _elementAtPoint:]): Copy over each element separately so
+	we don't rely on keys matching. Find the target frame given the target string,
+	and include it in the dictionary.
+        (-[WebHTMLView _mouseOverElement:modifierFlags]): Added. Calls the window
+	operations delegate method, but doesn't call it over and over again if the
+	information is still "nil".
+        (-[WebHTMLView _insideAnotherHTMLView]): Added.
+        (-[NSMutableDictionary _web_setObjectIfNotNil:forKey:]): Added. Helper for
+	the _elementAtPoint method which could be moved to WebNSDictionaryExtras some day.
+
 2002-10-02  Ken Kocienda  <kocienda at apple.com>
 
 	Implemented HTTP-specific subclass for WebResourceResponse.
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 398359f..7798bdb 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -13,8 +13,8 @@
 .objc_class_name_WebHTMLView
 .objc_class_name_WebHistory
 .objc_class_name_WebHistoryItem
-.objc_class_name_WebIconLoader
 .objc_class_name_WebIconDatabase
+.objc_class_name_WebIconLoader
 .objc_class_name_WebKitStatistics
 .objc_class_name_WebLoadProgress
 .objc_class_name_WebPreferences
@@ -23,22 +23,21 @@
 .objc_class_name_WebStringTruncator
 .objc_class_name_WebTestController
 .objc_class_name_WebTextRendererFactory
+.objc_class_name_WebTextView
 .objc_class_name_WebURLsWithTitles
 .objc_class_name_WebView
-.objc_class_name_WebTextView
+_WebElementFrameKey
+_WebElementImageKey
+_WebElementImageURLKey
 _WebElementLinkLabelKey
+_WebElementLinkTargetFrameKey
 _WebElementLinkURLKey
-_WebElementImageURLKey
 _WebElementStringKey
-_WebElementImageKey
-_WebElementFrameKey
 _WebHistoryEntriesChangedNotification
 _WebIconDidChangeNotification
-_WebIconSmallSize
-_WebIconMediumSize
 _WebIconLargeSize
+_WebIconMediumSize
 _WebIconNotificationUserInfoSiteURLKey
-_WebURLPboardType
+_WebIconSmallSize
 _WebURLNamePboardType
-
-
+_WebURLPboardType
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 2b5a847..018a653 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -27,6 +27,7 @@
 // These strings are keys into the element dictionary provided in
 // the WebContextMenuDelegate's contextMenuItemsForElement and the WebControllerPolicyDelegate's clickPolicyForElement.
 extern NSString *WebElementLinkURLKey;
+extern NSString *WebElementLinkTargetFrameKey;
 extern NSString *WebElementLinkLabelKey;
 extern NSString *WebElementImageURLKey;
 extern NSString *WebElementStringKey;
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index d3bf636..ea00b30 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -29,13 +29,14 @@
 #import <WebFoundation/WebAssertions.h>
 #import <WebFoundation/WebResourceHandle.h>
 
-NSString * WebElementLinkURLKey = @"WebElementLinkURL";
-NSString * WebElementLinkLabelKey = @"WebElementLinkLabel";
-NSString * WebElementImageURLKey = @"WebElementImageURL";
-NSString * WebElementStringKey = @"WebElementString";
-NSString * WebElementImageKey = @"WebElementImage";
-NSString * WebElementImageLocationKey = @"WebElementImageLocation";
-NSString * WebElementFrameKey = @"WebElementFrame";
+NSString *WebElementLinkURLKey = @"WebElementLinkURL";
+NSString *WebElementLinkTargetFrameKey = @"WebElementTargetFrame";
+NSString *WebElementLinkLabelKey = @"WebElementLinkLabel";
+NSString *WebElementImageURLKey = @"WebElementImageURL";
+NSString *WebElementStringKey = @"WebElementString";
+NSString *WebElementImageKey = @"WebElementImage";
+NSString *WebElementImageLocationKey = @"WebElementImageLocation";
+NSString *WebElementFrameKey = @"WebElementFrame";
 
 @implementation WebController
 
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index c651f33..9b12951 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -144,6 +144,7 @@
 
 - (void)removeMouseMovedObserver
 {
+    [self _mouseOverElement:nil modifierFlags:0];
     [[NSNotificationCenter defaultCenter] removeObserver: self name: NSMouseMovedNotification object: nil];
 }
 
@@ -156,15 +157,13 @@
 
 - (void)viewWillMoveToWindow:(NSWindow *)window
 {
-    if ([[self window] isMainWindow]) {
-	[self removeMouseMovedObserver];
-    }
+    [self removeMouseMovedObserver];
 }
 
 - (void)viewDidMoveToWindow
 {
     if ([self window]) {
-        if ([[self window] isMainWindow]) {
+        if ([[self window] isMainWindow] && ![self _insideAnotherHTMLView]) {
             [self addMouseMovedObserver];
         }
         _private->inWindow = YES;
@@ -431,16 +430,14 @@
 
 - (void)windowDidBecomeMain: (NSNotification *)notification
 {
-    if ([notification object] == [self window]) {
+    if ([notification object] == [self window] && ![self _insideAnotherHTMLView]) {
         [self addMouseMovedObserver];
     }
 }
 
 - (void)windowDidResignMain: (NSNotification *)notification
 {
-    if ([notification object] == [self window]) {
-        [self removeMouseMovedObserver];
-    }
+    [self removeMouseMovedObserver];
 }
 
 - (void)mouseDown: (NSEvent *)event
@@ -687,11 +684,29 @@
 
 - (void)mouseMovedNotification:(NSNotification *)notification
 {
-    // Only act on the mouse move event if it's inside this view (and not inside a subview).
+    ASSERT(![self _insideAnotherHTMLView]);
+    ASSERT([[self window] isMainWindow]);
+    
     NSEvent *event = [[notification userInfo] objectForKey:@"NSEvent"];
-    if ([event window] == [self window] && [[self window] isMainWindow]
-            && [[[self window] contentView] hitTest:[event locationInWindow]] == self) {
-        [[self _bridge] mouseMoved:event];
+
+    WebHTMLView *view = nil;
+    if ([event window] == [self window]) {
+        NSView *hitView = [[[self window] contentView] hitTest:[event locationInWindow]];
+        while (hitView) {
+            if ([hitView isKindOfClass:[WebHTMLView class]]) {
+                view = (WebHTMLView *)hitView;
+                break;
+            }
+            hitView = [hitView superview];
+        }
+    }
+    
+    if (view == nil) {
+        [self _mouseOverElement:nil modifierFlags:0];
+    } else {
+        [[view _bridge] mouseMoved:event];
+        NSPoint point = [view convertPoint:[event locationInWindow] fromView:nil];
+        [self _mouseOverElement:[view _elementAtPoint:point] modifierFlags:[event modifierFlags]];
     }
 }
 
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 800b1bd..824d728 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -28,10 +28,13 @@
     BOOL subviewsSetAside;
 
     NSDictionary *draggingImageElement;
+    
+    BOOL lastMouseOverElementWasNotNil;
 }
 @end
 
 @interface WebHTMLView (WebPrivate)
+
 - (void)_reset;
 - (WebController *)_controller;
 - (WebFrame *)_frame;
@@ -44,8 +47,11 @@
 + (void)_postFlagsChangedEvent:(NSEvent *)flagsChangedEvent;
 - (NSDictionary *)_elementAtPoint:(NSPoint)point;
 - (BOOL)_continueAfterClickPolicyForEvent: (NSEvent *)event;
+- (void)_mouseOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned)modifierFlags;
 
 - (void)_setAsideSubviews;
 - (void)_restoreSubviews;
 
+- (BOOL)_insideAnotherHTMLView;
+
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index bc01a1e..4db7a88 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -48,6 +48,10 @@
 }
 @end
 
+ at interface NSMutableDictionary (WebHTMLViewExtras)
+- (void)_web_setObjectIfNotNil:(id)object forKey:(id)key;
+ at end
+
 @implementation WebHTMLViewPrivate
 
 - (void)dealloc
@@ -126,12 +130,25 @@ BOOL _modifierTrackingEnabled = FALSE;
     NSDictionary *elementInfoWC = [[self _bridge] elementAtPoint:point];
     NSMutableDictionary *elementInfo = [NSMutableDictionary dictionary];
 
-    [elementInfo addEntriesFromDictionary: elementInfoWC];
-
+    [elementInfo _web_setObjectIfNotNil:[elementInfoWC objectForKey:WebCoreElementLinkURL] forKey:WebElementLinkURLKey];
+    [elementInfo _web_setObjectIfNotNil:[elementInfoWC objectForKey:WebCoreElementLinkLabel] forKey:WebElementLinkLabelKey];
+    [elementInfo _web_setObjectIfNotNil:[elementInfoWC objectForKey:WebCoreElementImageURL] forKey:WebElementImageURLKey];
+    [elementInfo _web_setObjectIfNotNil:[elementInfoWC objectForKey:WebCoreElementString] forKey:WebElementStringKey];
+    [elementInfo _web_setObjectIfNotNil:[elementInfoWC objectForKey:WebCoreElementImage] forKey:WebElementImageKey];
+    [elementInfo _web_setObjectIfNotNil:[elementInfoWC objectForKey:WebCoreElementImageLocation] forKey:WebElementImageLocationKey];
+    
     WebView *webView = [self _web_parentWebView];
     WebFrame *webFrame = [[webView controller] frameForView:webView];
+
+    NSString *frameName = [elementInfoWC objectForKey:WebCoreElementLinkTarget];
+    if ([frameName length] == 0) {
+        [elementInfo setObject:webFrame forKey:WebElementLinkTargetFrameKey];
+    } else if (![frameName isEqualToString:@"_blank"]) {
+        [elementInfo setObject:[webFrame frameNamed:frameName] forKey:WebElementLinkTargetFrameKey];
+    }
+
     [elementInfo setObject:webFrame forKey:WebElementFrameKey];
-       
+    
     return elementInfo;
 }
 
@@ -215,6 +232,26 @@ BOOL _modifierTrackingEnabled = FALSE;
     }
 }
 
+- (void)_mouseOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned)modifierFlags;
+{
+    if (elementInformation != nil || _private->lastMouseOverElementWasNotNil) {
+        [[[self _controller] windowOperationsDelegate]
+            mouseDidMoveOverElement:elementInformation modifierFlags:modifierFlags];
+    }
+    _private->lastMouseOverElementWasNotNil = elementInformation != nil;
+}
+
+- (BOOL)_insideAnotherHTMLView
+{
+    NSView *view = self;
+    while ((view = [view superview])) {
+        if ([view isKindOfClass:[WebHTMLView class]]) {
+            return YES;
+        }
+    }
+    return NO;
+}
+
 @end
 
 @implementation NSView (WebHTMLViewPrivate)
@@ -322,3 +359,15 @@ static BOOL inNSTextViewDrawRect;
 }
 
 @end
+
+ at implementation NSMutableDictionary (WebHTMLViewExtras)
+
+- (void)_web_setObjectIfNotNil:(id)object forKey:(id)key
+{
+    if (object == nil) {
+        return;
+    }
+    [self setObject:object forKey:key];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebUIDelegate.h b/WebKit/WebView.subproj/WebUIDelegate.h
index b94e6f8..7b15d41 100644
--- a/WebKit/WebView.subproj/WebUIDelegate.h
+++ b/WebKit/WebView.subproj/WebUIDelegate.h
@@ -42,6 +42,15 @@
 - (NSString *)statusText;
 
 /*!
+    @method mouseDidMoveOverElement:modifierFlags:
+    @abstract Update the window's feedback for mousing over links to reflect a new item the mouse is over
+    or new modifier flags.
+    @param elementInformation Dictionary that describes the clicked element the mouse is over, or nil.
+    @param modifierFlags The modifier flags as in NSEvent.
+*/
+- (void)mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned int)modifierFlags;
+
+/*!
     @method areToolbarsVisible
     @abstract Determine whether the window's toolbars are currently visible
     @discussion This method should return true if the window has any
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 2b5a847..018a653 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -27,6 +27,7 @@
 // These strings are keys into the element dictionary provided in
 // the WebContextMenuDelegate's contextMenuItemsForElement and the WebControllerPolicyDelegate's clickPolicyForElement.
 extern NSString *WebElementLinkURLKey;
+extern NSString *WebElementLinkTargetFrameKey;
 extern NSString *WebElementLinkLabelKey;
 extern NSString *WebElementImageURLKey;
 extern NSString *WebElementStringKey;
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index d3bf636..ea00b30 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -29,13 +29,14 @@
 #import <WebFoundation/WebAssertions.h>
 #import <WebFoundation/WebResourceHandle.h>
 
-NSString * WebElementLinkURLKey = @"WebElementLinkURL";
-NSString * WebElementLinkLabelKey = @"WebElementLinkLabel";
-NSString * WebElementImageURLKey = @"WebElementImageURL";
-NSString * WebElementStringKey = @"WebElementString";
-NSString * WebElementImageKey = @"WebElementImage";
-NSString * WebElementImageLocationKey = @"WebElementImageLocation";
-NSString * WebElementFrameKey = @"WebElementFrame";
+NSString *WebElementLinkURLKey = @"WebElementLinkURL";
+NSString *WebElementLinkTargetFrameKey = @"WebElementTargetFrame";
+NSString *WebElementLinkLabelKey = @"WebElementLinkLabel";
+NSString *WebElementImageURLKey = @"WebElementImageURL";
+NSString *WebElementStringKey = @"WebElementString";
+NSString *WebElementImageKey = @"WebElementImage";
+NSString *WebElementImageLocationKey = @"WebElementImageLocation";
+NSString *WebElementFrameKey = @"WebElementFrame";
 
 @implementation WebController
 
diff --git a/WebKit/WebView.subproj/WebWindowOperationsDelegate.h b/WebKit/WebView.subproj/WebWindowOperationsDelegate.h
index b94e6f8..7b15d41 100644
--- a/WebKit/WebView.subproj/WebWindowOperationsDelegate.h
+++ b/WebKit/WebView.subproj/WebWindowOperationsDelegate.h
@@ -42,6 +42,15 @@
 - (NSString *)statusText;
 
 /*!
+    @method mouseDidMoveOverElement:modifierFlags:
+    @abstract Update the window's feedback for mousing over links to reflect a new item the mouse is over
+    or new modifier flags.
+    @param elementInformation Dictionary that describes the clicked element the mouse is over, or nil.
+    @param modifierFlags The modifier flags as in NSEvent.
+*/
+- (void)mouseDidMoveOverElement:(NSDictionary *)elementInformation modifierFlags:(unsigned int)modifierFlags;
+
+/*!
     @method areToolbarsVisible
     @abstract Determine whether the window's toolbars are currently visible
     @discussion This method should return true if the window has any

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list