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

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:50:39 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 362c14db6393cbc4ecc324b2d229809fd0c18478
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 17 21:51:58 2001 +0000

    Whacky hacking to try to get the system to start chomping on data loaded
    from the network
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@347 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/Makefile.rules.in b/WebCore/Makefile.rules.in
index 3d86648..9cbe7fb 100644
--- a/WebCore/Makefile.rules.in
+++ b/WebCore/Makefile.rules.in
@@ -60,9 +60,12 @@ export-objects: $(EXPORT_OBJECTS)
 	touch $@
 
 lib:
-	@$(MAKE) && \
-        (cd $(TOPSRCDIR)/lib || mkdir $(TOPSRCDIR)/lib) && \
-	$(MAKE)
+	@$(MAKE)
+	if [ ! -d "$(TOPSRCDIR)/lib" ]; then \
+	rm -f $(EXPORT_OBJECTS_DIR); \
+	mkdir -p $(EXPORT_OBJECTS_DIR); \
+	fi
+	cd $(TOPSRCDIR)/lib; $(MAKE)
 
 setup:
 	@if (test -f "./MakeSystemChanges.sh"); then \
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 11001e9..3d95a6f 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -146,7 +146,10 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
 {
     if(defaultStyle) return;
 
-    QFile f(locate( "data", "khtml/css/html4.css" ) );
+    // FIXME: replace the next line with the commented out one
+    // immediately following it
+    QFile f("/symroots/html4.css");
+    //QFile f(locate( "data", "khtml/css/html4.css" ) );
     f.open(IO_ReadOnly);
 
     QCString file( f.size()+1 );
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 066dfcd..99a6b8c 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -465,6 +465,7 @@ void HTMLTitleElementImpl::setTitle()
     s = KStringHandler::csqueeze( s.visual(), 128 );
 
     HTMLDocumentImpl *d = static_cast<HTMLDocumentImpl *>(ownerDocument());
-    if ( !d->view()->part()->parentPart() )
-        emit d->view()->part()->setWindowCaption( s.visual() );
+    // FIXME: need to uncomment this eventually
+    //if ( !d->view()->part()->parentPart() )
+    //    emit d->view()->part()->setWindowCaption( s.visual() );
 }
diff --git a/WebCore/khtml/misc/helper.cpp b/WebCore/khtml/misc/helper.cpp
index 79bbf02..709cc10 100644
--- a/WebCore/khtml/misc/helper.cpp
+++ b/WebCore/khtml/misc/helper.cpp
@@ -232,7 +232,9 @@ void khtml::setNamedColor(QColor &color, const QString &_name)
     }
     else
     {
-        QColor tc = htmlColors->map[name];
+        // FIXME: for some reason not yet known, this does not work
+        //QColor tc = htmlColors->map[name];
+        QColor tc = QColor(0,0,0);
         if ( !tc.isValid() )
             tc = htmlColors->map[name.lower()];
 
diff --git a/WebCore/kwq/KWQColor.mm b/WebCore/kwq/KWQColor.mm
index 03450ff..d93707e 100644
--- a/WebCore/kwq/KWQColor.mm
+++ b/WebCore/kwq/KWQColor.mm
@@ -70,6 +70,8 @@ QColor::QColor(const char *)
     if ( !globals_init )
 	initGlobalColors();
     NSLog (@"WARNING %s:%s:%d (NOT YET IMPLEMENTED)\n", __FILE__, __FUNCTION__, __LINE__);
+    // FIXME: need to implement real construction of color based on string
+    _initialize (0,0,0);
 }
 
 
diff --git a/WebCore/kwq/KWQKConfigBase.mm b/WebCore/kwq/KWQKConfigBase.mm
index 4ccce42..8da2177 100644
--- a/WebCore/kwq/KWQKConfigBase.mm
+++ b/WebCore/kwq/KWQKConfigBase.mm
@@ -51,12 +51,16 @@ void KConfigBase::writeEntry(const QString &pKey, const QStringList &rValue,
 QString KConfigBase::readEntry(const char *pKey, 
     const QString& aDefault=QString::null) const
 {
+    // FIXME: need to return a real value
+    return QString();
 }
 
 
 
 int KConfigBase::readNumEntry(const char *pKey, int nDefault=0) const
 {
+    // FIXME: need to return a real value
+    return 0;
 }
 
 
@@ -64,21 +68,29 @@ int KConfigBase::readNumEntry(const char *pKey, int nDefault=0) const
 unsigned int KConfigBase::readUnsignedNumEntry(const char *pKey, 
     unsigned int nDefault=0) const
 {
+    // FIXME: need to return a real value
+    return 0;
 }
 
 
 bool KConfigBase::readBoolEntry(const char *pKey, bool nDefault=0) const
 {
+    // FIXME: need to return a real value
+    return FALSE;
 }
 
 
 QColor KConfigBase::readColorEntry(const char *pKey, const QColor *pDefault=0L) const
 {
+    // FIXME: need to return a real value
+    return QColor(0,0,0);
 }
 
 
 QStringList KConfigBase::readListEntry(const QString &pKey, char sep=',') const
 {
+    // FIXME: need to return a real value
+    return QStringList();
 }
 
 
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index dfc295c..687add1 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -48,6 +48,19 @@
 
 static bool cache_init = false;
 
+static void recursive(const DOM::Node &pNode, const DOM::Node &node)
+{
+    DOM::Node cur_child = node.lastChild();
+
+    NSLog(@"cur_child: %s = %s", cur_child.nodeName().string().latin1(), cur_child.nodeValue().string().latin1());
+
+    while(!cur_child.isNull())
+    {
+        recursive(node, cur_child);
+        cur_child = cur_child.previousSibling();
+    }
+}
+
 // Class KHTMLPartNotificationReceiver ==============================================================
 
 @interface KHTMLPartNotificationReceiver : NSObject
@@ -61,11 +74,7 @@ static bool cache_init = false;
 
 -(void)cacheDataAvailable:(NSNotification *)notification
 {
-    id <WCURICacheData> data;
-    
-    data = [notification object];
-    
-    m_part->write((const char *)[data cacheData], [data cacheDataSize]);    
+    m_part->slotData([notification object]);
 }
 
 -(void)cacheFinished:(NSNotification *)notification
@@ -76,6 +85,7 @@ static bool cache_init = false;
 
 @end
 
+
 // Class KHTMLPartPrivate ================================================================================
 
 class KHTMLPartPrivate
@@ -104,7 +114,7 @@ public:
             cache_init = true;
         }
         m_part = part;
-        m_doc = 0L;
+        m_doc = new HTMLDocumentImpl();
         m_decoder = 0L;
         m_bFirstData = true;
         m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
@@ -146,6 +156,17 @@ KHTMLPart::~KHTMLPart()
     _logNotYetImplemented();
 }
 
+// NOTE: This code emulates the interface used by the original khtml part  
+void KHTMLPart::slotData(id <WCURICacheData> data) 
+{
+    if (!d->m_workingURL.isEmpty()) {
+        //begin(d->m_workingURL, d->m_extension->urlArgs().xOffset, d->m_extension->urlArgs().yOffset);
+        begin(d->m_workingURL, 0, 0);
+        d->m_workingURL = KURL();
+    }
+          
+    write((const char *)[data cacheData], [data cacheDataSize]);    
+}
 
 bool KHTMLPart::openURL( const KURL &url )
 {
@@ -187,6 +208,10 @@ bool KHTMLPart::openURL( const KURL &url )
 
 bool KHTMLPart::closeURL()
 {
+    if (d && d->m_doc) {
+        recursive(0, d->m_doc);
+    }
+
     // Cancel any pending loads.
     
     // Reset the the current working URL to the default URL.
@@ -308,12 +333,32 @@ bool KHTMLPart::onlyLocalReferences() const
 
 void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset)
 {
+    //d->m_referrer = url.url();
+    
+    d->m_doc = new HTMLDocumentImpl();
+    d->m_doc->ref();
+    //FIXME: do we need this? 
+    //d->m_doc->attach( d->m_view );
+    d->m_doc->setURL( url.url() );
+
+    /* FIXME: we'll need to make this work....
+    QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
+    if ( !userStyleSheet.isEmpty() ) {
+        setUserStyleSheet( KURL( userStyleSheet ) );
+    }
+    */
+    
+    d->m_doc->open();    
+
     _logNotYetImplemented();
 }
 
 
 void KHTMLPart::write( const char *str, int len)
 {
+    /* 
+    FIXME: hook this code back when we have decoders working
+    
     if ( !d->m_decoder ) {
         d->m_decoder = new khtml::Decoder();
         if(d->m_encoding != QString::null)
@@ -329,6 +374,7 @@ void KHTMLPart::write( const char *str, int len)
         len = strlen( str );
     
     QString decoded = d->m_decoder->decode( str, len );
+        
     
     if(decoded.isEmpty())
         return;
@@ -353,10 +399,22 @@ void KHTMLPart::write( const char *str, int len)
         }
         d->m_doc->applyChanges(true, true);
     }
+
+    // End FIXME 
+    */
+
+    // begin lines added in lieu of big fixme
+    
+    QString decoded = QString(str);
+    //d->m_doc->applyChanges(true, true);
+    
+    // end lines added in lieu of big fixme
     
     Tokenizer* t = d->m_doc->tokenizer();
     if(t)
         t->write( decoded, true );
+        
+    NSLog(@"!!! write complete");
 }
 
 
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index dfc295c..687add1 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -48,6 +48,19 @@
 
 static bool cache_init = false;
 
+static void recursive(const DOM::Node &pNode, const DOM::Node &node)
+{
+    DOM::Node cur_child = node.lastChild();
+
+    NSLog(@"cur_child: %s = %s", cur_child.nodeName().string().latin1(), cur_child.nodeValue().string().latin1());
+
+    while(!cur_child.isNull())
+    {
+        recursive(node, cur_child);
+        cur_child = cur_child.previousSibling();
+    }
+}
+
 // Class KHTMLPartNotificationReceiver ==============================================================
 
 @interface KHTMLPartNotificationReceiver : NSObject
@@ -61,11 +74,7 @@ static bool cache_init = false;
 
 -(void)cacheDataAvailable:(NSNotification *)notification
 {
-    id <WCURICacheData> data;
-    
-    data = [notification object];
-    
-    m_part->write((const char *)[data cacheData], [data cacheDataSize]);    
+    m_part->slotData([notification object]);
 }
 
 -(void)cacheFinished:(NSNotification *)notification
@@ -76,6 +85,7 @@ static bool cache_init = false;
 
 @end
 
+
 // Class KHTMLPartPrivate ================================================================================
 
 class KHTMLPartPrivate
@@ -104,7 +114,7 @@ public:
             cache_init = true;
         }
         m_part = part;
-        m_doc = 0L;
+        m_doc = new HTMLDocumentImpl();
         m_decoder = 0L;
         m_bFirstData = true;
         m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
@@ -146,6 +156,17 @@ KHTMLPart::~KHTMLPart()
     _logNotYetImplemented();
 }
 
+// NOTE: This code emulates the interface used by the original khtml part  
+void KHTMLPart::slotData(id <WCURICacheData> data) 
+{
+    if (!d->m_workingURL.isEmpty()) {
+        //begin(d->m_workingURL, d->m_extension->urlArgs().xOffset, d->m_extension->urlArgs().yOffset);
+        begin(d->m_workingURL, 0, 0);
+        d->m_workingURL = KURL();
+    }
+          
+    write((const char *)[data cacheData], [data cacheDataSize]);    
+}
 
 bool KHTMLPart::openURL( const KURL &url )
 {
@@ -187,6 +208,10 @@ bool KHTMLPart::openURL( const KURL &url )
 
 bool KHTMLPart::closeURL()
 {
+    if (d && d->m_doc) {
+        recursive(0, d->m_doc);
+    }
+
     // Cancel any pending loads.
     
     // Reset the the current working URL to the default URL.
@@ -308,12 +333,32 @@ bool KHTMLPart::onlyLocalReferences() const
 
 void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset)
 {
+    //d->m_referrer = url.url();
+    
+    d->m_doc = new HTMLDocumentImpl();
+    d->m_doc->ref();
+    //FIXME: do we need this? 
+    //d->m_doc->attach( d->m_view );
+    d->m_doc->setURL( url.url() );
+
+    /* FIXME: we'll need to make this work....
+    QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
+    if ( !userStyleSheet.isEmpty() ) {
+        setUserStyleSheet( KURL( userStyleSheet ) );
+    }
+    */
+    
+    d->m_doc->open();    
+
     _logNotYetImplemented();
 }
 
 
 void KHTMLPart::write( const char *str, int len)
 {
+    /* 
+    FIXME: hook this code back when we have decoders working
+    
     if ( !d->m_decoder ) {
         d->m_decoder = new khtml::Decoder();
         if(d->m_encoding != QString::null)
@@ -329,6 +374,7 @@ void KHTMLPart::write( const char *str, int len)
         len = strlen( str );
     
     QString decoded = d->m_decoder->decode( str, len );
+        
     
     if(decoded.isEmpty())
         return;
@@ -353,10 +399,22 @@ void KHTMLPart::write( const char *str, int len)
         }
         d->m_doc->applyChanges(true, true);
     }
+
+    // End FIXME 
+    */
+
+    // begin lines added in lieu of big fixme
+    
+    QString decoded = QString(str);
+    //d->m_doc->applyChanges(true, true);
+    
+    // end lines added in lieu of big fixme
     
     Tokenizer* t = d->m_doc->tokenizer();
     if(t)
         t->write( decoded, true );
+        
+    NSLog(@"!!! write complete");
 }
 
 
diff --git a/WebCore/kwq/KWQKStringHandler.mm b/WebCore/kwq/KWQKStringHandler.mm
index 4ff40e5..e642476 100644
--- a/WebCore/kwq/KWQKStringHandler.mm
+++ b/WebCore/kwq/KWQKStringHandler.mm
@@ -25,6 +25,11 @@
 
 #include <kstringhandler.h>
 
-QString KStringHandler::csqueeze(const QString &, uint maxlen)
+QString KStringHandler::csqueeze(const QString &str, uint maxlen)
 {
+    if (str.length() > maxlen && maxlen > 3) {
+    int part = (maxlen-3)/2;
+    return QString(str.left(part) + "..." + str.right(part));
+    }
+    else return str;
 }
diff --git a/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp b/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp
index 11001e9..3d95a6f 100644
--- a/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp
+++ b/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp
@@ -146,7 +146,10 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
 {
     if(defaultStyle) return;
 
-    QFile f(locate( "data", "khtml/css/html4.css" ) );
+    // FIXME: replace the next line with the commented out one
+    // immediately following it
+    QFile f("/symroots/html4.css");
+    //QFile f(locate( "data", "khtml/css/html4.css" ) );
     f.open(IO_ReadOnly);
 
     QCString file( f.size()+1 );
diff --git a/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp b/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
index 066dfcd..99a6b8c 100644
--- a/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
@@ -465,6 +465,7 @@ void HTMLTitleElementImpl::setTitle()
     s = KStringHandler::csqueeze( s.visual(), 128 );
 
     HTMLDocumentImpl *d = static_cast<HTMLDocumentImpl *>(ownerDocument());
-    if ( !d->view()->part()->parentPart() )
-        emit d->view()->part()->setWindowCaption( s.visual() );
+    // FIXME: need to uncomment this eventually
+    //if ( !d->view()->part()->parentPart() )
+    //    emit d->view()->part()->setWindowCaption( s.visual() );
 }
diff --git a/WebCore/src/kdelibs/khtml/misc/helper.cpp b/WebCore/src/kdelibs/khtml/misc/helper.cpp
index 79bbf02..709cc10 100644
--- a/WebCore/src/kdelibs/khtml/misc/helper.cpp
+++ b/WebCore/src/kdelibs/khtml/misc/helper.cpp
@@ -232,7 +232,9 @@ void khtml::setNamedColor(QColor &color, const QString &_name)
     }
     else
     {
-        QColor tc = htmlColors->map[name];
+        // FIXME: for some reason not yet known, this does not work
+        //QColor tc = htmlColors->map[name];
+        QColor tc = QColor(0,0,0);
         if ( !tc.isValid() )
             tc = htmlColors->map[name.lower()];
 
diff --git a/WebCore/src/kwq/KWQColor.mm b/WebCore/src/kwq/KWQColor.mm
index 03450ff..d93707e 100644
--- a/WebCore/src/kwq/KWQColor.mm
+++ b/WebCore/src/kwq/KWQColor.mm
@@ -70,6 +70,8 @@ QColor::QColor(const char *)
     if ( !globals_init )
 	initGlobalColors();
     NSLog (@"WARNING %s:%s:%d (NOT YET IMPLEMENTED)\n", __FILE__, __FUNCTION__, __LINE__);
+    // FIXME: need to implement real construction of color based on string
+    _initialize (0,0,0);
 }
 
 
diff --git a/WebCore/src/kwq/KWQKConfigBase.mm b/WebCore/src/kwq/KWQKConfigBase.mm
index 4ccce42..8da2177 100644
--- a/WebCore/src/kwq/KWQKConfigBase.mm
+++ b/WebCore/src/kwq/KWQKConfigBase.mm
@@ -51,12 +51,16 @@ void KConfigBase::writeEntry(const QString &pKey, const QStringList &rValue,
 QString KConfigBase::readEntry(const char *pKey, 
     const QString& aDefault=QString::null) const
 {
+    // FIXME: need to return a real value
+    return QString();
 }
 
 
 
 int KConfigBase::readNumEntry(const char *pKey, int nDefault=0) const
 {
+    // FIXME: need to return a real value
+    return 0;
 }
 
 
@@ -64,21 +68,29 @@ int KConfigBase::readNumEntry(const char *pKey, int nDefault=0) const
 unsigned int KConfigBase::readUnsignedNumEntry(const char *pKey, 
     unsigned int nDefault=0) const
 {
+    // FIXME: need to return a real value
+    return 0;
 }
 
 
 bool KConfigBase::readBoolEntry(const char *pKey, bool nDefault=0) const
 {
+    // FIXME: need to return a real value
+    return FALSE;
 }
 
 
 QColor KConfigBase::readColorEntry(const char *pKey, const QColor *pDefault=0L) const
 {
+    // FIXME: need to return a real value
+    return QColor(0,0,0);
 }
 
 
 QStringList KConfigBase::readListEntry(const QString &pKey, char sep=',') const
 {
+    // FIXME: need to return a real value
+    return QStringList();
 }
 
 
diff --git a/WebCore/src/kwq/KWQKHTMLPart.h b/WebCore/src/kwq/KWQKHTMLPart.h
index b1b49da..d694f81 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.h
+++ b/WebCore/src/kwq/KWQKHTMLPart.h
@@ -33,6 +33,10 @@
 #include <kparts/part.h>
 #include <kparts/browserextension.h>
 
+#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
+#import <WCURICacheData.h>
+#endif
+
 class KHTMLSettings;
 class KJavaAppletContext;
 class KJSProxy;
@@ -555,11 +559,15 @@ public:
 
 #ifdef _KWQ_
     void init();
+#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
+    void slotData(id <WCURICacheData> data);  
+#else
+    void slotData(void *data);  
+#endif
 #endif
 
 private:
     KHTMLPartPrivate *d;
-    
     // DUBIOUS, why are impls being referenced?
     DOM::HTMLDocumentImpl *docImpl() const;
 };
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index dfc295c..687add1 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -48,6 +48,19 @@
 
 static bool cache_init = false;
 
+static void recursive(const DOM::Node &pNode, const DOM::Node &node)
+{
+    DOM::Node cur_child = node.lastChild();
+
+    NSLog(@"cur_child: %s = %s", cur_child.nodeName().string().latin1(), cur_child.nodeValue().string().latin1());
+
+    while(!cur_child.isNull())
+    {
+        recursive(node, cur_child);
+        cur_child = cur_child.previousSibling();
+    }
+}
+
 // Class KHTMLPartNotificationReceiver ==============================================================
 
 @interface KHTMLPartNotificationReceiver : NSObject
@@ -61,11 +74,7 @@ static bool cache_init = false;
 
 -(void)cacheDataAvailable:(NSNotification *)notification
 {
-    id <WCURICacheData> data;
-    
-    data = [notification object];
-    
-    m_part->write((const char *)[data cacheData], [data cacheDataSize]);    
+    m_part->slotData([notification object]);
 }
 
 -(void)cacheFinished:(NSNotification *)notification
@@ -76,6 +85,7 @@ static bool cache_init = false;
 
 @end
 
+
 // Class KHTMLPartPrivate ================================================================================
 
 class KHTMLPartPrivate
@@ -104,7 +114,7 @@ public:
             cache_init = true;
         }
         m_part = part;
-        m_doc = 0L;
+        m_doc = new HTMLDocumentImpl();
         m_decoder = 0L;
         m_bFirstData = true;
         m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
@@ -146,6 +156,17 @@ KHTMLPart::~KHTMLPart()
     _logNotYetImplemented();
 }
 
+// NOTE: This code emulates the interface used by the original khtml part  
+void KHTMLPart::slotData(id <WCURICacheData> data) 
+{
+    if (!d->m_workingURL.isEmpty()) {
+        //begin(d->m_workingURL, d->m_extension->urlArgs().xOffset, d->m_extension->urlArgs().yOffset);
+        begin(d->m_workingURL, 0, 0);
+        d->m_workingURL = KURL();
+    }
+          
+    write((const char *)[data cacheData], [data cacheDataSize]);    
+}
 
 bool KHTMLPart::openURL( const KURL &url )
 {
@@ -187,6 +208,10 @@ bool KHTMLPart::openURL( const KURL &url )
 
 bool KHTMLPart::closeURL()
 {
+    if (d && d->m_doc) {
+        recursive(0, d->m_doc);
+    }
+
     // Cancel any pending loads.
     
     // Reset the the current working URL to the default URL.
@@ -308,12 +333,32 @@ bool KHTMLPart::onlyLocalReferences() const
 
 void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset)
 {
+    //d->m_referrer = url.url();
+    
+    d->m_doc = new HTMLDocumentImpl();
+    d->m_doc->ref();
+    //FIXME: do we need this? 
+    //d->m_doc->attach( d->m_view );
+    d->m_doc->setURL( url.url() );
+
+    /* FIXME: we'll need to make this work....
+    QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
+    if ( !userStyleSheet.isEmpty() ) {
+        setUserStyleSheet( KURL( userStyleSheet ) );
+    }
+    */
+    
+    d->m_doc->open();    
+
     _logNotYetImplemented();
 }
 
 
 void KHTMLPart::write( const char *str, int len)
 {
+    /* 
+    FIXME: hook this code back when we have decoders working
+    
     if ( !d->m_decoder ) {
         d->m_decoder = new khtml::Decoder();
         if(d->m_encoding != QString::null)
@@ -329,6 +374,7 @@ void KHTMLPart::write( const char *str, int len)
         len = strlen( str );
     
     QString decoded = d->m_decoder->decode( str, len );
+        
     
     if(decoded.isEmpty())
         return;
@@ -353,10 +399,22 @@ void KHTMLPart::write( const char *str, int len)
         }
         d->m_doc->applyChanges(true, true);
     }
+
+    // End FIXME 
+    */
+
+    // begin lines added in lieu of big fixme
+    
+    QString decoded = QString(str);
+    //d->m_doc->applyChanges(true, true);
+    
+    // end lines added in lieu of big fixme
     
     Tokenizer* t = d->m_doc->tokenizer();
     if(t)
         t->write( decoded, true );
+        
+    NSLog(@"!!! write complete");
 }
 
 
diff --git a/WebCore/src/kwq/KWQKStringHandler.mm b/WebCore/src/kwq/KWQKStringHandler.mm
index 4ff40e5..e642476 100644
--- a/WebCore/src/kwq/KWQKStringHandler.mm
+++ b/WebCore/src/kwq/KWQKStringHandler.mm
@@ -25,6 +25,11 @@
 
 #include <kstringhandler.h>
 
-QString KStringHandler::csqueeze(const QString &, uint maxlen)
+QString KStringHandler::csqueeze(const QString &str, uint maxlen)
 {
+    if (str.length() > maxlen && maxlen > 3) {
+    int part = (maxlen-3)/2;
+    return QString(str.left(part) + "..." + str.right(part));
+    }
+    else return str;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list