[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 05:59:43 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b74aa8369aaef510456434ded6453b6b4af3d21b
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Mar 31 00:15:17 2002 +0000

            Added support for scrolling to anchor points.
            Optimization:  we always load the page, even if the URL that contains
            the anchor is the current page.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@907 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 007a3ed..7e16e32 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,16 @@
 2002-03-30  Richard Williamson  <rjw at apple.com>
 
+        Added support for scrolling to anchor points.
+        Optimization:  we always load the page, even if the URL that contains
+        the anchor is the current page.
+        
+	* src/kwq/KWQKHTMLPart.h:
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::end), (KHTMLPart::gotoBaseAnchor),
+	(KHTMLPart::gotoAnchor), (KHTMLPart::setUserStyleSheet):
+	* src/kwq/KWQScrollView.mm: (QScrollView::setContentsPos):
+
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
         Added log to note cases of NSURL (CFURL) being unable to
         correctly initialize from URLs.  This log will likely indicate
         bugs in CFURL.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 007a3ed..7e16e32 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,16 @@
 2002-03-30  Richard Williamson  <rjw at apple.com>
 
+        Added support for scrolling to anchor points.
+        Optimization:  we always load the page, even if the URL that contains
+        the anchor is the current page.
+        
+	* src/kwq/KWQKHTMLPart.h:
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::end), (KHTMLPart::gotoBaseAnchor),
+	(KHTMLPart::gotoAnchor), (KHTMLPart::setUserStyleSheet):
+	* src/kwq/KWQScrollView.mm: (QScrollView::setContentsPos):
+
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
         Added log to note cases of NSURL (CFURL) being unable to
         correctly initialize from URLs.  This log will likely indicate
         bugs in CFURL.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 007a3ed..7e16e32 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,16 @@
 2002-03-30  Richard Williamson  <rjw at apple.com>
 
+        Added support for scrolling to anchor points.
+        Optimization:  we always load the page, even if the URL that contains
+        the anchor is the current page.
+        
+	* src/kwq/KWQKHTMLPart.h:
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::end), (KHTMLPart::gotoBaseAnchor),
+	(KHTMLPart::gotoAnchor), (KHTMLPart::setUserStyleSheet):
+	* src/kwq/KWQScrollView.mm: (QScrollView::setContentsPos):
+
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
         Added log to note cases of NSURL (CFURL) being unable to
         correctly initialize from URLs.  This log will likely indicate
         bugs in CFURL.
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 557f62c..48ff0b0 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -67,6 +67,7 @@
 #include <html/htmltokenizer.h>
 #include <html/html_imageimpl.h>
 #include <xml/dom_docimpl.h>
+#include <html/html_miscimpl.h>
 #include <html/html_documentimpl.h>
 #include <rendering/render_image.h>
 #include <loader.h>
@@ -75,6 +76,7 @@
 #include <dom_doc.h>
 #include <qcursor.h>
 #include <kurl.h>
+#include <khtmlview.h>
 
 #include <KWQKHTMLPart.h>
 
@@ -627,12 +629,42 @@ void KHTMLPart::end()
     d->m_doc->finishParsing();
 #endif /* not APPLE_CHANGES */
 
-    //QString str = d->m_doc->recursive_toHTML(1);
-    
     d->m_doc->close();
     KURL::clearCaches();
 }
 
+bool KHTMLPart::gotoBaseAnchor()
+{
+    if ( !d->m_url.ref().isEmpty() )
+        return gotoAnchor( d->m_url.ref() );
+    return false;
+}
+
+bool KHTMLPart::gotoAnchor( const QString &name )
+{
+    if (!d->m_doc)
+        return false;
+    
+    HTMLCollectionImpl *anchors =
+        new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
+    anchors->ref();
+    NodeImpl *n = anchors->namedItem(name);
+    anchors->deref();
+    
+    if(!n) {
+        //kdDebug(6050) << "KHTMLPart::gotoAnchor node '" << name << "' not found" << endl;
+        return false;
+    }
+    
+    int x = 0, y = 0;
+    HTMLElementImpl *a = static_cast<HTMLElementImpl *>(n);
+    a->getUpperLeftCorner(x, y);
+    d->m_view->setContentsPos(x, y);
+    
+    return true;
+}
+
+
 KHTMLSettings *KHTMLPart::settings()
 {
   return d->m_settings;
@@ -703,13 +735,6 @@ void KHTMLPart::setUserStyleSheet(const QString &styleSheet)
     _logNeverImplemented();
 }
 
-bool KHTMLPart::gotoAnchor( const QString &name )
-{
-// DUBIOUS, this should be handled by the view, also isn't the anchor a node?
-    _logNeverImplemented();
-    return FALSE;
-}
-
 void KHTMLPart::setFontSizes( const QValueList<int> &newFontSizes )
 {
     _logNeverImplemented();
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 557f62c..48ff0b0 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -67,6 +67,7 @@
 #include <html/htmltokenizer.h>
 #include <html/html_imageimpl.h>
 #include <xml/dom_docimpl.h>
+#include <html/html_miscimpl.h>
 #include <html/html_documentimpl.h>
 #include <rendering/render_image.h>
 #include <loader.h>
@@ -75,6 +76,7 @@
 #include <dom_doc.h>
 #include <qcursor.h>
 #include <kurl.h>
+#include <khtmlview.h>
 
 #include <KWQKHTMLPart.h>
 
@@ -627,12 +629,42 @@ void KHTMLPart::end()
     d->m_doc->finishParsing();
 #endif /* not APPLE_CHANGES */
 
-    //QString str = d->m_doc->recursive_toHTML(1);
-    
     d->m_doc->close();
     KURL::clearCaches();
 }
 
+bool KHTMLPart::gotoBaseAnchor()
+{
+    if ( !d->m_url.ref().isEmpty() )
+        return gotoAnchor( d->m_url.ref() );
+    return false;
+}
+
+bool KHTMLPart::gotoAnchor( const QString &name )
+{
+    if (!d->m_doc)
+        return false;
+    
+    HTMLCollectionImpl *anchors =
+        new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
+    anchors->ref();
+    NodeImpl *n = anchors->namedItem(name);
+    anchors->deref();
+    
+    if(!n) {
+        //kdDebug(6050) << "KHTMLPart::gotoAnchor node '" << name << "' not found" << endl;
+        return false;
+    }
+    
+    int x = 0, y = 0;
+    HTMLElementImpl *a = static_cast<HTMLElementImpl *>(n);
+    a->getUpperLeftCorner(x, y);
+    d->m_view->setContentsPos(x, y);
+    
+    return true;
+}
+
+
 KHTMLSettings *KHTMLPart::settings()
 {
   return d->m_settings;
@@ -703,13 +735,6 @@ void KHTMLPart::setUserStyleSheet(const QString &styleSheet)
     _logNeverImplemented();
 }
 
-bool KHTMLPart::gotoAnchor( const QString &name )
-{
-// DUBIOUS, this should be handled by the view, also isn't the anchor a node?
-    _logNeverImplemented();
-    return FALSE;
-}
-
 void KHTMLPart::setFontSizes( const QValueList<int> &newFontSizes )
 {
     _logNeverImplemented();
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index 38f1865..9ca9830 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -114,7 +114,11 @@ void QScrollView::scrollBy(int dx, int dy)
 
 void QScrollView::setContentsPos(int x, int y)
 {
-    _logNeverImplemented();
+    if (x < 0)
+        x = 0;
+    if (y < 0)
+        y = 0;
+    [getView() scrollPoint: NSMakePoint (x,y)];
 }
 
 
diff --git a/WebCore/src/kwq/KWQKHTMLPart.h b/WebCore/src/kwq/KWQKHTMLPart.h
index 27af6b3..79f4dc6 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.h
+++ b/WebCore/src/kwq/KWQKHTMLPart.h
@@ -425,8 +425,8 @@ public:
    * scrolls to the closest position. Returns @p if the anchor has
    * been found.
    */
-    // DUBIOUS, this should be handled by the view, also isn't the anchor a node?
   bool gotoAnchor( const QString &name );
+  bool gotoBaseAnchor();
 
   /**
    * Set the cursor to use when the cursor is on a link.
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index 557f62c..48ff0b0 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -67,6 +67,7 @@
 #include <html/htmltokenizer.h>
 #include <html/html_imageimpl.h>
 #include <xml/dom_docimpl.h>
+#include <html/html_miscimpl.h>
 #include <html/html_documentimpl.h>
 #include <rendering/render_image.h>
 #include <loader.h>
@@ -75,6 +76,7 @@
 #include <dom_doc.h>
 #include <qcursor.h>
 #include <kurl.h>
+#include <khtmlview.h>
 
 #include <KWQKHTMLPart.h>
 
@@ -627,12 +629,42 @@ void KHTMLPart::end()
     d->m_doc->finishParsing();
 #endif /* not APPLE_CHANGES */
 
-    //QString str = d->m_doc->recursive_toHTML(1);
-    
     d->m_doc->close();
     KURL::clearCaches();
 }
 
+bool KHTMLPart::gotoBaseAnchor()
+{
+    if ( !d->m_url.ref().isEmpty() )
+        return gotoAnchor( d->m_url.ref() );
+    return false;
+}
+
+bool KHTMLPart::gotoAnchor( const QString &name )
+{
+    if (!d->m_doc)
+        return false;
+    
+    HTMLCollectionImpl *anchors =
+        new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
+    anchors->ref();
+    NodeImpl *n = anchors->namedItem(name);
+    anchors->deref();
+    
+    if(!n) {
+        //kdDebug(6050) << "KHTMLPart::gotoAnchor node '" << name << "' not found" << endl;
+        return false;
+    }
+    
+    int x = 0, y = 0;
+    HTMLElementImpl *a = static_cast<HTMLElementImpl *>(n);
+    a->getUpperLeftCorner(x, y);
+    d->m_view->setContentsPos(x, y);
+    
+    return true;
+}
+
+
 KHTMLSettings *KHTMLPart::settings()
 {
   return d->m_settings;
@@ -703,13 +735,6 @@ void KHTMLPart::setUserStyleSheet(const QString &styleSheet)
     _logNeverImplemented();
 }
 
-bool KHTMLPart::gotoAnchor( const QString &name )
-{
-// DUBIOUS, this should be handled by the view, also isn't the anchor a node?
-    _logNeverImplemented();
-    return FALSE;
-}
-
 void KHTMLPart::setFontSizes( const QValueList<int> &newFontSizes )
 {
     _logNeverImplemented();
diff --git a/WebCore/src/kwq/KWQScrollView.mm b/WebCore/src/kwq/KWQScrollView.mm
index 38f1865..9ca9830 100644
--- a/WebCore/src/kwq/KWQScrollView.mm
+++ b/WebCore/src/kwq/KWQScrollView.mm
@@ -114,7 +114,11 @@ void QScrollView::scrollBy(int dx, int dy)
 
 void QScrollView::setContentsPos(int x, int y)
 {
-    _logNeverImplemented();
+    if (x < 0)
+        x = 0;
+    if (y < 0)
+        y = 0;
+    [getView() scrollPoint: NSMakePoint (x,y)];
 }
 
 
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 09ecf1b..652392e 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
+        Added support for scrolling to anchor points.
+        
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]):
+
 2002-03-30  Maciej Stachowiak  <mjs at apple.com>
 
 	* WebKit.pbproj/project.pbxproj: Link against
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 09ecf1b..652392e 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,9 @@
+2002-03-30  Richard Williamson  <rjw at apple.com>
+
+        Added support for scrolling to anchor points.
+        
+	* WebView.subproj/IFWebFramePrivate.mm: (-[IFWebFrame _isLoadComplete]):
+
 2002-03-30  Maciej Stachowiak  <mjs at apple.com>
 
 	* WebKit.pbproj/project.pbxproj: Link against
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index 98f185e..592a367 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -330,6 +330,9 @@ char *stateNames[6] = {
                 
                 if ([[self controller] mainFrame] == self){
                     [mainView layout];
+                        
+                    [[self dataSource] _part]->gotoBaseAnchor();
+                    
                     [mainView display];
                 }
                 
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 98f185e..592a367 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -330,6 +330,9 @@ char *stateNames[6] = {
                 
                 if ([[self controller] mainFrame] == self){
                     [mainView layout];
+                        
+                    [[self dataSource] _part]->gotoBaseAnchor();
+                    
                     [mainView display];
                 }
                 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list