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

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


The following commit has been merged in the debian/unstable branch:
commit 37b7e6de9b9148aca14bd7dc2c818d3bf2e631b1
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Apr 5 20:46:24 2002 +0000

            Hacks to support:
    
            1.  Not loading a document when a link is to an anchor on same page.
            2.  Correctly targeting frames.
    
            Our documentation is actually useable now.
    
            New method on controller to find a frame of a particular name
            anywhere in the frame hierarchy.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@975 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index e59eb84..d3b5f10 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,15 @@
+2002-04-05  Richard Williamson  <rjw at apple.com>
+
+        Hacks to support:
+        
+        1.  Not loading a document when a link is to an anchor on same page.
+        2.  Correctly targeting frames.
+        
+        Our documentation is actually useable now.
+        
+	* src/kwq/KWQKHTMLPart.mm: (splitUrlTarget), (KHTMLPart::khtmlMouseReleaseEvent):
+	* src/kwq/external.h:
+
 2002-04-05  Darin Adler  <darin at apple.com>
 
 	* src/kwq/KWQKloader.mm:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index e59eb84..d3b5f10 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,15 @@
+2002-04-05  Richard Williamson  <rjw at apple.com>
+
+        Hacks to support:
+        
+        1.  Not loading a document when a link is to an anchor on same page.
+        2.  Correctly targeting frames.
+        
+        Our documentation is actually useable now.
+        
+	* src/kwq/KWQKHTMLPart.mm: (splitUrlTarget), (KHTMLPart::khtmlMouseReleaseEvent):
+	* src/kwq/external.h:
+
 2002-04-05  Darin Adler  <darin at apple.com>
 
 	* src/kwq/KWQKloader.mm:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e59eb84..d3b5f10 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,15 @@
+2002-04-05  Richard Williamson  <rjw at apple.com>
+
+        Hacks to support:
+        
+        1.  Not loading a document when a link is to an anchor on same page.
+        2.  Correctly targeting frames.
+        
+        Our documentation is actually useable now.
+        
+	* src/kwq/KWQKHTMLPart.mm: (splitUrlTarget), (KHTMLPart::khtmlMouseReleaseEvent):
+	* src/kwq/external.h:
+
 2002-04-05  Darin Adler  <darin at apple.com>
 
 	* src/kwq/KWQKloader.mm:
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 1d7bfe1..a7adead 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -219,15 +219,30 @@ public:
 
 static QString splitUrlTarget(const QString &url, QString *target=0)
 {
-   QString result = url;
-   if(url.left(7) == "target:")
-   {
-      KURL u(url);
-      result = u.ref();
-      if (target)
-         *target = u.host();
-   }
-   return result;
+    QString result = url;
+    if(url.left(7) == "target:")
+    {
+#ifdef APPLE_CHANGES
+        int pos, end;
+        if ((pos = url.find ('#', 7)) != -1){
+            result = url.mid(pos+1,url.length()-pos-1);
+        }
+        if (target){
+            pos = url.find ("//", 7);
+            if (pos > 0){
+                end = url.find ('/', pos+2);
+                if (end > 0)
+                    *target = url.mid (pos+2, end-pos-2);
+            }
+        }
+#else
+        KURL u(url);
+        result = u.ref();
+        if (target)
+            *target = u.host();
+#endif
+    }
+    return result;
 }
 
 KHTMLPart::KHTMLPart()
@@ -1417,13 +1432,29 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
     // HACK!  FIXME!
     if (d->m_strSelectedURL != QString::null) {
         IFWebDataSource *oldDataSource, *newDataSource;
-        KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
+        QString target;
+        KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL, &target)));
         NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
         NSURL *url = [NSURL URLWithString: urlString];
         IFWebFrame *frame;
+        KURL refLess(clickedURL);
         
-        oldDataSource = getDataSource();
-        frame = [oldDataSource frame];
+        d->m_url.setRef ("");
+        refLess.setRef ("");
+        if (refLess.url() == d->m_url.url()){
+            d->m_url = clickedURL;
+            gotoAnchor (clickedURL.ref());
+            return;
+        }
+        
+        if (target.isEmpty()){
+            oldDataSource = getDataSource();
+            frame = [oldDataSource frame];
+        }
+        else {
+            frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(target)];
+            oldDataSource = [frame dataSource];
+        }
         
         newDataSource = WCIFWebDataSourceMake(url);
         [newDataSource _setParent: [oldDataSource parent]];
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 1d7bfe1..a7adead 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -219,15 +219,30 @@ public:
 
 static QString splitUrlTarget(const QString &url, QString *target=0)
 {
-   QString result = url;
-   if(url.left(7) == "target:")
-   {
-      KURL u(url);
-      result = u.ref();
-      if (target)
-         *target = u.host();
-   }
-   return result;
+    QString result = url;
+    if(url.left(7) == "target:")
+    {
+#ifdef APPLE_CHANGES
+        int pos, end;
+        if ((pos = url.find ('#', 7)) != -1){
+            result = url.mid(pos+1,url.length()-pos-1);
+        }
+        if (target){
+            pos = url.find ("//", 7);
+            if (pos > 0){
+                end = url.find ('/', pos+2);
+                if (end > 0)
+                    *target = url.mid (pos+2, end-pos-2);
+            }
+        }
+#else
+        KURL u(url);
+        result = u.ref();
+        if (target)
+            *target = u.host();
+#endif
+    }
+    return result;
 }
 
 KHTMLPart::KHTMLPart()
@@ -1417,13 +1432,29 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
     // HACK!  FIXME!
     if (d->m_strSelectedURL != QString::null) {
         IFWebDataSource *oldDataSource, *newDataSource;
-        KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
+        QString target;
+        KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL, &target)));
         NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
         NSURL *url = [NSURL URLWithString: urlString];
         IFWebFrame *frame;
+        KURL refLess(clickedURL);
         
-        oldDataSource = getDataSource();
-        frame = [oldDataSource frame];
+        d->m_url.setRef ("");
+        refLess.setRef ("");
+        if (refLess.url() == d->m_url.url()){
+            d->m_url = clickedURL;
+            gotoAnchor (clickedURL.ref());
+            return;
+        }
+        
+        if (target.isEmpty()){
+            oldDataSource = getDataSource();
+            frame = [oldDataSource frame];
+        }
+        else {
+            frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(target)];
+            oldDataSource = [frame dataSource];
+        }
         
         newDataSource = WCIFWebDataSourceMake(url);
         [newDataSource _setParent: [oldDataSource parent]];
diff --git a/WebCore/kwq/external.h b/WebCore/kwq/external.h
index e413ff0..57f7557 100644
--- a/WebCore/kwq/external.h
+++ b/WebCore/kwq/external.h
@@ -40,6 +40,7 @@
 - (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource inScrollView: (BOOL)inScrollView;
 - (void)_receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
 - (void)_receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (IFWebFrame *)mainFrame;
 @end
 
 @protocol IFLocationChangeHandler
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 1d7bfe1..a7adead 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -219,15 +219,30 @@ public:
 
 static QString splitUrlTarget(const QString &url, QString *target=0)
 {
-   QString result = url;
-   if(url.left(7) == "target:")
-   {
-      KURL u(url);
-      result = u.ref();
-      if (target)
-         *target = u.host();
-   }
-   return result;
+    QString result = url;
+    if(url.left(7) == "target:")
+    {
+#ifdef APPLE_CHANGES
+        int pos, end;
+        if ((pos = url.find ('#', 7)) != -1){
+            result = url.mid(pos+1,url.length()-pos-1);
+        }
+        if (target){
+            pos = url.find ("//", 7);
+            if (pos > 0){
+                end = url.find ('/', pos+2);
+                if (end > 0)
+                    *target = url.mid (pos+2, end-pos-2);
+            }
+        }
+#else
+        KURL u(url);
+        result = u.ref();
+        if (target)
+            *target = u.host();
+#endif
+    }
+    return result;
 }
 
 KHTMLPart::KHTMLPart()
@@ -1417,13 +1432,29 @@ void KHTMLPart::khtmlMouseReleaseEvent( khtml::MouseReleaseEvent *event )
     // HACK!  FIXME!
     if (d->m_strSelectedURL != QString::null) {
         IFWebDataSource *oldDataSource, *newDataSource;
-        KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL)));
+        QString target;
+        KURL clickedURL(completeURL( splitUrlTarget(d->m_strSelectedURL, &target)));
         NSString *urlString = [NSString stringWithCString:clickedURL.url().latin1()];
         NSURL *url = [NSURL URLWithString: urlString];
         IFWebFrame *frame;
+        KURL refLess(clickedURL);
         
-        oldDataSource = getDataSource();
-        frame = [oldDataSource frame];
+        d->m_url.setRef ("");
+        refLess.setRef ("");
+        if (refLess.url() == d->m_url.url()){
+            d->m_url = clickedURL;
+            gotoAnchor (clickedURL.ref());
+            return;
+        }
+        
+        if (target.isEmpty()){
+            oldDataSource = getDataSource();
+            frame = [oldDataSource frame];
+        }
+        else {
+            frame = [[getDataSource() controller] frameNamed: QSTRING_TO_NSSTRING(target)];
+            oldDataSource = [frame dataSource];
+        }
         
         newDataSource = WCIFWebDataSourceMake(url);
         [newDataSource _setParent: [oldDataSource parent]];
diff --git a/WebCore/src/kwq/external.h b/WebCore/src/kwq/external.h
index e413ff0..57f7557 100644
--- a/WebCore/src/kwq/external.h
+++ b/WebCore/src/kwq/external.h
@@ -40,6 +40,7 @@
 - (IFWebFrame *)createFrameNamed: (NSString *)name for: (IFWebDataSource *)dataSource inParent: (IFWebDataSource *)dataSource inScrollView: (BOOL)inScrollView;
 - (void)_receivedProgress: (IFLoadProgress *)progress forResource: (NSString *)resourceDescription fromDataSource: (IFWebDataSource *)dataSource;
 - (void)_receivedError: (IFError *)error forResource: (NSString *)resourceDescription partialProgress: (IFLoadProgress *)progress fromDataSource: (IFWebDataSource *)dataSource;
+- (IFWebFrame *)mainFrame;
 @end
 
 @protocol IFLocationChangeHandler
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c146e1d..09c4fc6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,13 @@
+2002-04-05  Richard Williamson  <rjw at apple.com>
+
+        New method on controller to find a frame of a particular name
+        anywhere in the frame hierarchy.
+        
+	* WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController
+	initWithView:provisionalDataSource:]), (-[IFBaseWebController
+	_frameNamed:fromFrame:]), (-[IFBaseWebController frameNamed:]):
+	* WebView.subproj/IFWebController.h:
+
 2002-04-05  Darin Adler  <darin at apple.com>
 
 	* WebView.subproj/IFMainURLHandleClient.mm:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index c146e1d..09c4fc6 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,13 @@
+2002-04-05  Richard Williamson  <rjw at apple.com>
+
+        New method on controller to find a frame of a particular name
+        anywhere in the frame hierarchy.
+        
+	* WebView.subproj/IFBaseWebController.mm: (-[IFBaseWebController
+	initWithView:provisionalDataSource:]), (-[IFBaseWebController
+	_frameNamed:fromFrame:]), (-[IFBaseWebController frameNamed:]):
+	* WebView.subproj/IFWebController.h:
+
 2002-04-05  Darin Adler  <darin at apple.com>
 
 	* WebView.subproj/IFMainURLHandleClient.mm:
diff --git a/WebKit/WebView.subproj/IFBaseWebController.mm b/WebKit/WebView.subproj/IFBaseWebController.mm
index df18675..74601d3 100644
--- a/WebKit/WebView.subproj/IFBaseWebController.mm
+++ b/WebKit/WebView.subproj/IFBaseWebController.mm
@@ -53,7 +53,7 @@
     
     data = [[IFBaseWebControllerPrivate alloc] init];
     _controllerPrivate = data;
-    data->mainFrame = [[IFWebFrame alloc] initWithName: @"top" view: view provisionalDataSource: dataSource controller: self];
+    data->mainFrame = [[IFWebFrame alloc] initWithName: @"_top" view: view provisionalDataSource: dataSource controller: self];
 
     return self;   
 }
@@ -224,6 +224,29 @@
     return [self _frameForDataSource: dataSource fromFrame: frame];
 }
 
+- (IFWebFrame *)_frameNamed: (NSString *)name fromFrame: (IFWebFrame *)frame
+{
+    if ([[frame name] isEqual: name])
+        return frame;
+
+    int i, count;
+    IFWebFrame *aFrame;
+    NSArray *children = [[frame dataSource] children];
+    count = [children count];
+    for (i = 0; i < count; i++){
+        aFrame = [children objectAtIndex: i];
+        if ([self _frameNamed: name fromFrame: aFrame])
+            return aFrame;
+    }
+    return nil;
+}
+
+- (IFWebFrame *)frameNamed: (NSString *)name
+{
+    return [self _frameNamed: name fromFrame: [self mainFrame]];
+}
+
+
 
 - (IFWebFrame *)mainFrame
 {
diff --git a/WebKit/WebView.subproj/IFWebController.h b/WebKit/WebView.subproj/IFWebController.h
index 7dec647..5d4659d 100644
--- a/WebKit/WebView.subproj/IFWebController.h
+++ b/WebKit/WebView.subproj/IFWebController.h
@@ -183,6 +183,9 @@
 // specifics of creating and initializaing a view of the appropriate class.
 - (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)child inParent: (IFWebDataSource *)parent inScrollView: (BOOL)inScrollView;
 
+// Look for a frame named name recursively.
+- (IFWebFrame *)frameNamed: (NSString *)name;
+
 - (IFWebFrame *)mainFrame;
 
 
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 7dec647..5d4659d 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -183,6 +183,9 @@
 // specifics of creating and initializaing a view of the appropriate class.
 - (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)child inParent: (IFWebDataSource *)parent inScrollView: (BOOL)inScrollView;
 
+// Look for a frame named name recursively.
+- (IFWebFrame *)frameNamed: (NSString *)name;
+
 - (IFWebFrame *)mainFrame;
 
 
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 7dec647..5d4659d 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -183,6 +183,9 @@
 // specifics of creating and initializaing a view of the appropriate class.
 - (IFWebFrame *)createFrameNamed: (NSString *)fname for: (IFWebDataSource *)child inParent: (IFWebDataSource *)parent inScrollView: (BOOL)inScrollView;
 
+// Look for a frame named name recursively.
+- (IFWebFrame *)frameNamed: (NSString *)name;
+
 - (IFWebFrame *)mainFrame;
 
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list