[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 07:14:35 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 15cdfc522a6622465626ace6aece93cbdc4fbb3c
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 13 18:03:45 2002 +0000

            Reviewed by John.
    
    	Overall speedup on cvs-base is about 5%.
    
    	- reduce QString use in the tokenizer and tighten up QString implementation for a speedup
    	- fix up the QFontFamily implementation, using new QString features too, for a speedup
    
            * khtml/html/htmltokenizer.h: Take const QString & instead of QString to avoid an extra copy.
            * khtml/html/htmltokenizer.cpp:
            (HTMLTokenizer::begin): Use QString::null instead of "" for QString objects; faster.
            (HTMLTokenizer::scriptHandler): In APPLE_CHANGES, use new prepend that avoids the need to
    	create a temporary QString. Use QString::null instead of QString() for a null string, and
    	also made other small fixes to avoid temporary QStrings.
    	(HTMLTokenizer::setSrc): Take const QString & instead of QString to avoid an extra copy.
    
            * kwq/KWQFont.h: Rename QFontFamily to KWQFontFamily. Make family() inline, add inline
    	familyIsEmpty(). Change KWQFontFamily to store both the QString for the family and the
    	NSString instead of only the NSString to avoid constant conversions back and forth.
    	Remove type cases in CREATE_FAMILY_ARRAY that could result in copying the font object.
            * kwq/KWQFont.mm:
            (KWQFontFamily::KWQFontFamily): Fix bug where a copied family object would have a random
    	ref count instead of a ref count of 0. Also update for NSString change.
            (KWQFontFamily::operator=): Use the ref before deref algorithm instead of the check for
    	self-assignment.
            (KWQFontFamily::getNSFamily): Compute the NSString for the family name here. To avoid
    	making an NSString every time, use a CFDictionary with QString as a key and NSString as
    	a value instead of using an NSSet.
            (KWQFontFamily::setFamily): Invalidate the NSString family when the QString family is
    	changed. Moved the code to make things unique to getNSFamily.
            (KWQFontFamily::operator==): Call getNSFamily rather than
    
            * kwq/KWQString.h: Added a prepend and insert overload that take a QChar pointer and length, for
    	use in the tokenizer, and a hash function, for use in CFDictionary. Also added a global set of
    	CFDictionaryKeyCallBacks.
            * kwq/KWQString.mm:
            (QString::prepend): New overload calls new insert overload.
            (QString::insert): Old insert slightly tightened by calling detach() only after the early exit
    	and removing an extra detach from a function that already does forceUnicode. Added the new insert
    	that takes a QChar * and a length.
            (operator==): Rewrite this so that it is efficient and doesn't involve creating a QString temporary
    	or doing a function call.
            (QString::hash): Wrote this. Used the same hash algorithm I did in my recent KJS work.
            (retainQString): Added. For use in CFDictionaryKey callback.
            (releaseQString): Added. For use in CFDictionaryKey callback.
            (describeQString): Added. For use in CFDictionaryKey callback.
            (equalQString): Added. For use in CFDictionaryKey callback.
            (hashQString): Added. For use in CFDictionaryKey callback.
    
            * khtml/rendering/font.h: Change name to KWQFontFamily.
            * khtml/rendering/font.cpp: (Font::update): Call familyIsEmpty() instead of family().isEmpty()
    	to avoid making and destroying a QString every time. Also put this batch of KWQFontFamily-specific
    	changes inside #if APPLE_CHANGES. Much to my dismay, we have others elsewhere that aren't ifdef'd.
    
            * khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): Change name to KWQFontFamily.
    	Clearly this code needs some #if APPLE_CHANGES, and changing the class name helps make that clear.
    
    	- change KHTMLSettings so using it doesn't require copying QStrings for a speedup
    
            * kwq/KWQKHTMLSettings.h: Made all the functions static members to avoid the unnecessary
    	overhead of passing a this pointer. Added lots of setXXX functions for use by the WebCoreSettings
    	code that gets called by WebKit when settings are changed. Return objects by reference because we
    	can and it avoids copying QString objects.
            * kwq/KWQKHTMLSettings.mm: Changed all the functions in here to return the same global object
    	each time, and made the set functions update those globals.
            * kwq/WebCoreSettings.mm: All the setters now call through to KHTMLSettings set functions.
    
            - fixed 3126513 -- crash in KWQKHTMLPart::clearTimers() deallocating KWQPageState
    	- did some cleanup in the bridge and the part; part of the process of moving real work out of the bridge
    
            * kwq/KWQKHTMLPart.h: Rearrange things to be a little more logical. Mark isFrameSet() const.
    	added an attributedString function here so it's not inside WebCoreBridge. Added an overload
    	of clearTimers that takes a view parameter.
            * kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Mark this const.
            * kwq/KWQKHTMLPart.mm:
            (KWQKHTMLPart::clearTimers): Add the overload that takes the view parameter.
            (KWQKHTMLPart::attributedString): Moved this code in here from the bridge.
    
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge selectedAttributedString]): Call the attributedString function in its new home in
    	KWQKHTMLPart.
            (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
            (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
    	Take a const KURL & instead of a KURL to avoid unnecessary copying.
            (-[KWQPageState dealloc]): Call the new clearTimers that takes a view parameter. This should fix the
    	crash in autorelease pool deallocation mentioned above.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3033 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 740f39c..a0e4bc9 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,91 @@
+2002-12-13  Darin Adler  <darin at apple.com>
+
+        Reviewed by John.
+
+	Overall speedup on cvs-base is about 5%.
+
+	- reduce QString use in the tokenizer and tighten up QString implementation for a speedup
+	- fix up the QFontFamily implementation, using new QString features too, for a speedup
+
+        * khtml/html/htmltokenizer.h: Take const QString & instead of QString to avoid an extra copy.
+        * khtml/html/htmltokenizer.cpp:
+        (HTMLTokenizer::begin): Use QString::null instead of "" for QString objects; faster.
+        (HTMLTokenizer::scriptHandler): In APPLE_CHANGES, use new prepend that avoids the need to
+	create a temporary QString. Use QString::null instead of QString() for a null string, and
+	also made other small fixes to avoid temporary QStrings.
+	(HTMLTokenizer::setSrc): Take const QString & instead of QString to avoid an extra copy.
+
+        * kwq/KWQFont.h: Rename QFontFamily to KWQFontFamily. Make family() inline, add inline
+	familyIsEmpty(). Change KWQFontFamily to store both the QString for the family and the
+	NSString instead of only the NSString to avoid constant conversions back and forth.
+	Remove type cases in CREATE_FAMILY_ARRAY that could result in copying the font object.
+        * kwq/KWQFont.mm:
+        (KWQFontFamily::KWQFontFamily): Fix bug where a copied family object would have a random
+	ref count instead of a ref count of 0. Also update for NSString change.
+        (KWQFontFamily::operator=): Use the ref before deref algorithm instead of the check for
+	self-assignment.
+        (KWQFontFamily::getNSFamily): Compute the NSString for the family name here. To avoid
+	making an NSString every time, use a CFDictionary with QString as a key and NSString as
+	a value instead of using an NSSet.
+        (KWQFontFamily::setFamily): Invalidate the NSString family when the QString family is
+	changed. Moved the code to make things unique to getNSFamily.
+        (KWQFontFamily::operator==): Call getNSFamily rather than
+
+        * kwq/KWQString.h: Added a prepend and insert overload that take a QChar pointer and length, for
+	use in the tokenizer, and a hash function, for use in CFDictionary. Also added a global set of
+	CFDictionaryKeyCallBacks.
+        * kwq/KWQString.mm:
+        (QString::prepend): New overload calls new insert overload.
+        (QString::insert): Old insert slightly tightened by calling detach() only after the early exit
+	and removing an extra detach from a function that already does forceUnicode. Added the new insert
+	that takes a QChar * and a length.
+        (operator==): Rewrite this so that it is efficient and doesn't involve creating a QString temporary
+	or doing a function call.
+        (QString::hash): Wrote this. Used the same hash algorithm I did in my recent KJS work.
+        (retainQString): Added. For use in CFDictionaryKey callback.
+        (releaseQString): Added. For use in CFDictionaryKey callback.
+        (describeQString): Added. For use in CFDictionaryKey callback.
+        (equalQString): Added. For use in CFDictionaryKey callback.
+        (hashQString): Added. For use in CFDictionaryKey callback.
+
+        * khtml/rendering/font.h: Change name to KWQFontFamily.
+        * khtml/rendering/font.cpp: (Font::update): Call familyIsEmpty() instead of family().isEmpty()
+	to avoid making and destroying a QString every time. Also put this batch of KWQFontFamily-specific
+	changes inside #if APPLE_CHANGES. Much to my dismay, we have others elsewhere that aren't ifdef'd.
+
+        * khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): Change name to KWQFontFamily.
+	Clearly this code needs some #if APPLE_CHANGES, and changing the class name helps make that clear.
+
+	- change KHTMLSettings so using it doesn't require copying QStrings for a speedup
+
+        * kwq/KWQKHTMLSettings.h: Made all the functions static members to avoid the unnecessary
+	overhead of passing a this pointer. Added lots of setXXX functions for use by the WebCoreSettings
+	code that gets called by WebKit when settings are changed. Return objects by reference because we
+	can and it avoids copying QString objects.
+        * kwq/KWQKHTMLSettings.mm: Changed all the functions in here to return the same global object
+	each time, and made the set functions update those globals.
+        * kwq/WebCoreSettings.mm: All the setters now call through to KHTMLSettings set functions.
+
+        - fixed 3126513 -- crash in KWQKHTMLPart::clearTimers() deallocating KWQPageState
+	- did some cleanup in the bridge and the part; part of the process of moving real work out of the bridge
+
+        * kwq/KWQKHTMLPart.h: Rearrange things to be a little more logical. Mark isFrameSet() const.
+	added an attributedString function here so it's not inside WebCoreBridge. Added an overload
+	of clearTimers that takes a view parameter.
+        * kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Mark this const.
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::clearTimers): Add the overload that takes the view parameter.
+        (KWQKHTMLPart::attributedString): Moved this code in here from the bridge.
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge selectedAttributedString]): Call the attributedString function in its new home in
+	KWQKHTMLPart.
+        (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
+        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
+	Take a const KURL & instead of a KURL to avoid unnecessary copying.
+        (-[KWQPageState dealloc]): Call the new clearTimers that takes a view parameter. This should fix the
+	crash in autorelease pool deallocation mentioned above.
+
 2002-12-13  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3121865, content missing at disney.com.  Make
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 740f39c..a0e4bc9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,91 @@
+2002-12-13  Darin Adler  <darin at apple.com>
+
+        Reviewed by John.
+
+	Overall speedup on cvs-base is about 5%.
+
+	- reduce QString use in the tokenizer and tighten up QString implementation for a speedup
+	- fix up the QFontFamily implementation, using new QString features too, for a speedup
+
+        * khtml/html/htmltokenizer.h: Take const QString & instead of QString to avoid an extra copy.
+        * khtml/html/htmltokenizer.cpp:
+        (HTMLTokenizer::begin): Use QString::null instead of "" for QString objects; faster.
+        (HTMLTokenizer::scriptHandler): In APPLE_CHANGES, use new prepend that avoids the need to
+	create a temporary QString. Use QString::null instead of QString() for a null string, and
+	also made other small fixes to avoid temporary QStrings.
+	(HTMLTokenizer::setSrc): Take const QString & instead of QString to avoid an extra copy.
+
+        * kwq/KWQFont.h: Rename QFontFamily to KWQFontFamily. Make family() inline, add inline
+	familyIsEmpty(). Change KWQFontFamily to store both the QString for the family and the
+	NSString instead of only the NSString to avoid constant conversions back and forth.
+	Remove type cases in CREATE_FAMILY_ARRAY that could result in copying the font object.
+        * kwq/KWQFont.mm:
+        (KWQFontFamily::KWQFontFamily): Fix bug where a copied family object would have a random
+	ref count instead of a ref count of 0. Also update for NSString change.
+        (KWQFontFamily::operator=): Use the ref before deref algorithm instead of the check for
+	self-assignment.
+        (KWQFontFamily::getNSFamily): Compute the NSString for the family name here. To avoid
+	making an NSString every time, use a CFDictionary with QString as a key and NSString as
+	a value instead of using an NSSet.
+        (KWQFontFamily::setFamily): Invalidate the NSString family when the QString family is
+	changed. Moved the code to make things unique to getNSFamily.
+        (KWQFontFamily::operator==): Call getNSFamily rather than
+
+        * kwq/KWQString.h: Added a prepend and insert overload that take a QChar pointer and length, for
+	use in the tokenizer, and a hash function, for use in CFDictionary. Also added a global set of
+	CFDictionaryKeyCallBacks.
+        * kwq/KWQString.mm:
+        (QString::prepend): New overload calls new insert overload.
+        (QString::insert): Old insert slightly tightened by calling detach() only after the early exit
+	and removing an extra detach from a function that already does forceUnicode. Added the new insert
+	that takes a QChar * and a length.
+        (operator==): Rewrite this so that it is efficient and doesn't involve creating a QString temporary
+	or doing a function call.
+        (QString::hash): Wrote this. Used the same hash algorithm I did in my recent KJS work.
+        (retainQString): Added. For use in CFDictionaryKey callback.
+        (releaseQString): Added. For use in CFDictionaryKey callback.
+        (describeQString): Added. For use in CFDictionaryKey callback.
+        (equalQString): Added. For use in CFDictionaryKey callback.
+        (hashQString): Added. For use in CFDictionaryKey callback.
+
+        * khtml/rendering/font.h: Change name to KWQFontFamily.
+        * khtml/rendering/font.cpp: (Font::update): Call familyIsEmpty() instead of family().isEmpty()
+	to avoid making and destroying a QString every time. Also put this batch of KWQFontFamily-specific
+	changes inside #if APPLE_CHANGES. Much to my dismay, we have others elsewhere that aren't ifdef'd.
+
+        * khtml/css/cssstyleselector.cpp: (CSSStyleSelector::applyRule): Change name to KWQFontFamily.
+	Clearly this code needs some #if APPLE_CHANGES, and changing the class name helps make that clear.
+
+	- change KHTMLSettings so using it doesn't require copying QStrings for a speedup
+
+        * kwq/KWQKHTMLSettings.h: Made all the functions static members to avoid the unnecessary
+	overhead of passing a this pointer. Added lots of setXXX functions for use by the WebCoreSettings
+	code that gets called by WebKit when settings are changed. Return objects by reference because we
+	can and it avoids copying QString objects.
+        * kwq/KWQKHTMLSettings.mm: Changed all the functions in here to return the same global object
+	each time, and made the set functions update those globals.
+        * kwq/WebCoreSettings.mm: All the setters now call through to KHTMLSettings set functions.
+
+        - fixed 3126513 -- crash in KWQKHTMLPart::clearTimers() deallocating KWQPageState
+	- did some cleanup in the bridge and the part; part of the process of moving real work out of the bridge
+
+        * kwq/KWQKHTMLPart.h: Rearrange things to be a little more logical. Mark isFrameSet() const.
+	added an attributedString function here so it's not inside WebCoreBridge. Added an overload
+	of clearTimers that takes a view parameter.
+        * kwq/KWQKHTMLPart.cpp: (KWQKHTMLPart::isFrameSet): Mark this const.
+        * kwq/KWQKHTMLPart.mm:
+        (KWQKHTMLPart::clearTimers): Add the overload that takes the view parameter.
+        (KWQKHTMLPart::attributedString): Moved this code in here from the bridge.
+
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge selectedAttributedString]): Call the attributedString function in its new home in
+	KWQKHTMLPart.
+        (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): Ditto.
+        (-[KWQPageState initWithDocument:URL:windowProperties:locationProperties:]):
+	Take a const KURL & instead of a KURL to avoid unnecessary copying.
+        (-[KWQPageState dealloc]): Call the new clearTimers that takes a view parameter. This should fix the
+	crash in autorelease pool deallocation mentioned above.
+
 2002-12-13  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3121865, content missing at disney.com.  Make
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 59423ef..a2c8d26 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -2533,8 +2533,8 @@ void CSSStyleSelector::applyRule( DOM::CSSProperty *prop )
         CSSValueListImpl *list = static_cast<CSSValueListImpl *>(value);
         int len = list->length();
         QString family;
-        QFontFamily& firstFamily = fontDef.firstFamily();
-        QFontFamily* currFamily = 0;
+        KWQFontFamily &firstFamily = fontDef.firstFamily();
+        KWQFontFamily *currFamily = 0;
         
         for(int i = 0; i < len; i++) {
             CSSValueImpl *item = list->item(i);
@@ -2600,7 +2600,7 @@ void CSSStyleSelector::applyRule( DOM::CSSProperty *prop )
                         currFamily = &firstFamily;
                     }
                     else {
-                        QFontFamily* newFamily = new QFontFamily;
+                        KWQFontFamily *newFamily = new KWQFontFamily;
                         newFamily->setFamily(face);
                         currFamily->appendFamily(newFamily);
                         currFamily = newFamily;
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index c082d9b..15a64e3 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -284,8 +284,8 @@ void HTMLTokenizer::begin()
     searchCount = 0;
     Entity = NoEntity;
     loadingExtScript = false;
-    scriptSrc = "";
-    pendingSrc = "";
+    scriptSrc = QString::null;
+    pendingSrc = QString::null;
     noMoreData = false;
     brokenComments = false;
     brokenServer = false;
@@ -476,7 +476,11 @@ void HTMLTokenizer::scriptHandler()
              //kdDebug( 6036 ) << "cachedscript extern!" << endl;
              //kdDebug( 6036 ) << "src: *" << QString( src.current(), src.length() ).latin1() << "*" << endl;
              //kdDebug( 6036 ) << "pending: *" << pendingSrc.latin1() << "*" << endl;
+#if APPLE_CHANGES
+            pendingSrc.prepend(src.current(), src.length());
+#else
             pendingSrc.prepend( QString(src.current(), src.length() ) );
+#endif
             setSrc(QString::null);
             scriptCodeSize = scriptCodeResync = 0;
             cs->ref(this);
@@ -485,16 +489,23 @@ void HTMLTokenizer::scriptHandler()
                 loadingExtScript = true;
         }
         else if (view && doScriptExec && javascript ) {
+#if APPLE_CHANGES
+            if (!m_executingScript)
+                pendingSrc.prepend(src.current(), src.length());
+            else
+                prependingSrc.setUnicode(src.current(), src.length());
+#else
             if ( !m_executingScript )
                 pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
             else
                 prependingSrc = QString( src.current(), src.length() ); // deep copy
+#endif
 
             setSrc(QString::null);
             scriptCodeSize = scriptCodeResync = 0;
             //QTime dt;
             //dt.start();
-            scriptExecution( exScript, QString(), scriptStartLineno );
+            scriptExecution( exScript, QString::null, scriptStartLineno );
 	    //kdDebug( 6036 ) << "script execution time:" << dt.elapsed() << endl;
         }
     }
@@ -505,10 +516,13 @@ void HTMLTokenizer::scriptHandler()
     if ( !parser->skipMode() ) {
         if ( !m_executingScript && !loadingExtScript ) {
             // kdDebug( 6036 ) << "adding pending Output to parsed string" << endl;
-            QString newStr = QString(src.current(), src.length());
-            newStr += pendingSrc;
-            setSrc(newStr);
-            pendingSrc = "";
+#if APPLE_CHANGES
+            pendingSrc.prepend(src.current(), src.length());
+#else
+            pendingSrc.prepend(QString(src.current(), src.length());
+#endif
+            setSrc(pendingSrc);
+            pendingSrc = QString::null;
         }
         else if ( !prependingSrc.isEmpty() )
             write( prependingSrc, false );
@@ -1164,7 +1178,8 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 tagID -= ID_CLOSE_TAG;
             else if ( beginTag && tagID == ID_SCRIPT ) {
                 AttributeImpl* a = 0;
-                scriptSrc = scriptSrcCharset = "";
+                scriptSrc = QString::null;
+                scriptSrcCharset = QString::null;
                 if ( currToken.attrs && /* potentially have a ATTR_SRC ? */
                      parser->doc()->view()->part()->jScriptEnabled() && /* jscript allowed at all? */
                      view /* are we a regular tokenizer or just for innerHTML ? */
@@ -1554,7 +1569,7 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
             ++src;
         }
     }
-    _src = QString();
+    _src = QString::null;
 
     if (noMoreData && !loadingExtScript && !m_executingScript )
         end(); // this actually causes us to be deleted
@@ -1744,7 +1759,7 @@ void HTMLTokenizer::notifyFinished(CachedObject */*finishedObj*/)
     }
 }
 
-void HTMLTokenizer::setSrc(QString source)
+void HTMLTokenizer::setSrc(const QString &source)
 {
     lineno += src.lineCount();
     _src = source;
diff --git a/WebCore/khtml/html/htmltokenizer.h b/WebCore/khtml/html/htmltokenizer.h
index 4b0a7ff..ebf2b44 100644
--- a/WebCore/khtml/html/htmltokenizer.h
+++ b/WebCore/khtml/html/htmltokenizer.h
@@ -154,7 +154,7 @@ protected:
     void scriptHandler();
     void scriptExecution(const QString& script, QString scriptURL = QString(),
                          int baseLine = 0);
-    void setSrc(QString source);
+    void setSrc(const QString &source);
 
     // check if we have enough space in the buffer.
     // if not enlarge it
diff --git a/WebCore/khtml/rendering/font.cpp b/WebCore/khtml/rendering/font.cpp
index 20c781d..5cdbd3a 100644
--- a/WebCore/khtml/rendering/font.cpp
+++ b/WebCore/khtml/rendering/font.cpp
@@ -184,10 +184,14 @@ int Font::width( QChar *chs, int slen, int pos ) const
 
 void Font::update( QPaintDeviceMetrics* devMetrics ) const
 {
-    if (fontDef.family.family().isEmpty())
-        f.setFamily(KHTMLFactory::defaultHTMLSettings()->stdFontName());
+#if APPLE_CHANGES
+    if (fontDef.family.familyIsEmpty())
+	f.setFamily(KHTMLFactory::defaultHTMLSettings()->stdFontName());
     else
-        f.setFirstFamily(fontDef.family);
+	f.setFirstFamily(fontDef.family);
+#else
+    f.setFamily( fontDef.family.isEmpty() ? KHTMLFactory::defaultHTMLSettings()->stdFontName() : fontDef.family );
+#endif
     f.setItalic( fontDef.italic );
     f.setWeight( fontDef.weight );
 
diff --git a/WebCore/khtml/rendering/font.h b/WebCore/khtml/rendering/font.h
index 59bae0e..005f01a 100644
--- a/WebCore/khtml/rendering/font.h
+++ b/WebCore/khtml/rendering/font.h
@@ -56,9 +56,9 @@ public:
 
     void setGenericFamily(unsigned int aGenericFamily) { genericFamily = aGenericFamily; }
     
-    QFontFamily& firstFamily() { return family; }
+    KWQFontFamily &firstFamily() { return family; }
     
-    QFontFamily family;
+    KWQFontFamily family;
     short int size;
     bool italic 		: 1;
     bool smallCaps 		: 1;
diff --git a/WebCore/kwq/KWQFont.h b/WebCore/kwq/KWQFont.h
index 17cd774..833031b 100644
--- a/WebCore/kwq/KWQFont.h
+++ b/WebCore/kwq/KWQFont.h
@@ -26,7 +26,7 @@
 #ifndef QFONT_H_
 #define QFONT_H_
 
-class QString;
+#include "KWQString.h"
 
 #ifdef __OBJC__
 @class NSFont;
@@ -36,39 +36,43 @@ class NSFont;
 class NSString;
 #endif
 
-class QFontFamily {
+class KWQFontFamily {
 public:
-    QFontFamily();
-    ~QFontFamily() { if (_next) _next->deref();  }
+    KWQFontFamily();
+    ~KWQFontFamily() { if (_next) _next->deref();  }
     
-    QFontFamily(const QFontFamily& other);    
-    QFontFamily& operator=(const QFontFamily& other);
+    KWQFontFamily(const KWQFontFamily &);    
+    KWQFontFamily &operator=(const KWQFontFamily &);
         
-    void setFamily(const QString&);
-    QString family() const;
+    void setFamily(const QString &);
+    QString family() const { return _family; }
+    bool familyIsEmpty() const { return _family.isEmpty(); }
     
-    NSString* getNSFamily() const { return _family; }
+    NSString *getNSFamily() const;
+
+    KWQFontFamily *next() { return _next; }
+    const KWQFontFamily *next() const { return _next; }
 
-    QFontFamily* next() { return _next; }
-    void appendFamily(QFontFamily* family) 
-    { 
+    void appendFamily(KWQFontFamily *family) 
+    {
+        if (family)
+            family->ref();
         if (_next) 
             _next->deref(); 
         _next = family; 
-        if (_next)
-            _next->ref();
     }
     
-    bool operator==(const QFontFamily &compareFontFamily) const;
-    bool operator!=(const QFontFamily &x) const { return !(*this == x); }
+    bool operator==(const KWQFontFamily &) const;
+    bool operator!=(const KWQFontFamily &x) const { return !(*this == x); }
     
-    void ref() { _refCnt++; };
-    void deref() { _refCnt--; if (_refCnt == 0) delete this; };
+    void ref() { _refCnt++; }
+    void deref() { _refCnt--; if (_refCnt == 0) delete this; }
     
 private:
-    NSString* _family;
-    QFontFamily* _next;
+    QString _family;
+    KWQFontFamily *_next;
     int _refCnt;
+    mutable NSString *_NSFamily;
 };
 
 class QFont {
@@ -81,8 +85,9 @@ public:
     void setFamily(const QString &);
     QString family() const;
 
-    QFontFamily* firstFamily() { return &_family; }
-    void setFirstFamily(const QFontFamily& family) ;
+    const KWQFontFamily *firstFamily() const { return &_family; }
+    KWQFontFamily *firstFamily() { return &_family; }
+    void setFirstFamily(const KWQFontFamily &family);
     
     void setWeight(int);
     int weight() const;
@@ -102,9 +107,9 @@ public:
     float getNSSize() const { return _size; }
     
     NSFont *getNSFont() const;
-        
+
 private:
-    QFontFamily _family;
+    KWQFontFamily _family;
     int _trait;
     float _size;
     mutable NSFont *_nsfont;
@@ -118,21 +123,21 @@ private:
 #define CREATE_FAMILY_ARRAY(font,families)\
 int __numFamilies = 0;\
 {\
-    QFontFamily *__ff = ((QFont)font).firstFamily();\
+    const KWQFontFamily *__ff = (font).firstFamily();\
     while (__ff)\
     {\
         __numFamilies++;\
-            __ff = __ff->next();\
+        __ff = __ff->next();\
     }\
 }\
 NSString *families[__numFamilies+1];\
 {\
     int __i = 0;\
-    QFontFamily *__ff = ((QFont)font).firstFamily();\
+    const KWQFontFamily *__ff = (font).firstFamily();\
     while (__ff)\
     {\
         families[__i++] = __ff->getNSFamily();\
-            __ff = __ff->next();\
+        __ff = __ff->next();\
     }\
     families[__i] = 0;\
 }
diff --git a/WebCore/kwq/KWQFont.mm b/WebCore/kwq/KWQFont.mm
index 6ba087c..84b2bfa 100644
--- a/WebCore/kwq/KWQFont.mm
+++ b/WebCore/kwq/KWQFont.mm
@@ -24,67 +24,74 @@
  */
 
 #import "KWQFont.h"
-#import "KWQString.h"
 
-#import <Cocoa/Cocoa.h>
+#import "KWQString.h"
 #import "WebCoreTextRendererFactory.h"
 
-QFontFamily::QFontFamily()
-    : _family(@"")
-    , _next(0)
+KWQFontFamily::KWQFontFamily()
+    : _next(0)
     , _refCnt(0)
+    , _NSFamily(0)
 {
 }
 
-QFontFamily::QFontFamily(const QFontFamily& other) 
+KWQFontFamily::KWQFontFamily(const KWQFontFamily& other)
+    : _family(other._family)
+    , _next(other._next)
+    , _refCnt(0)
+    , _NSFamily(other._NSFamily)
 {
-    _next = other._next;
     if (_next)
         _next->ref();
-    _family = other._family;
 }
 
-QFontFamily& QFontFamily::operator=(const QFontFamily& other) {
-    if (this != &other) {
-        if (_next)
-            _next->deref();
-        _next = other._next;
-        if (_next)
-            _next->ref();
-        _family = other._family;
-    }
+KWQFontFamily& KWQFontFamily::operator=(const KWQFontFamily& other)
+{
+    if (other._next)
+        other._next->ref();
+    if (_next)
+        _next->deref();
+    _family = other._family;
+    _next = other._next;
+    _NSFamily = other._NSFamily;
     return *this;
 }
 
-QString QFontFamily::family() const
+NSString *KWQFontFamily::getNSFamily() const
 {
-    return QString::fromNSString(_family);
+    if (!_NSFamily) {
+        // Use an immutable copy of the name, but keep a set of
+        // all family names so we don't end up with too many objects.
+        static CFMutableDictionaryRef families;
+        if (families == NULL) {
+            families = CFDictionaryCreateMutable(NULL, 0, &CFDictionaryQStringKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+        }
+        _NSFamily = (NSString *)CFDictionaryGetValue(families, &_family);
+        if (!_NSFamily) {
+            _NSFamily = _family.getNSString();
+            CFDictionarySetValue(families, &_family, _NSFamily);
+        }
+    }
+    return _NSFamily;
 }
 
-void QFontFamily::setFamily(const QString &qfamilyName)
+void KWQFontFamily::setFamily(const QString &family)
 {
-    // Use an immutable copy of the name, but keep a set of
-    // all family names so we don't end up with too many objects.
-    static NSMutableSet *families;
-    if (families == nil) {
-        families = [[NSMutableSet alloc] init];
-    }
-    NSString *mutableName = qfamilyName.getNSString();
-    _family = [families member:mutableName];
-    if (!_family) {
-        [families addObject:mutableName];
-        _family = [families member:mutableName];
+    if (family == _family) {
+        return;
     }
+    _family = family;
+    _NSFamily = nil;
 }
 
-bool QFontFamily::operator==(const QFontFamily &compareFontFamily) const
+bool KWQFontFamily::operator==(const KWQFontFamily &compareFontFamily) const
 {
     if ((!_next && compareFontFamily._next) || 
         (_next && !compareFontFamily._next) ||
         ((_next && compareFontFamily._next) && (*_next != *(compareFontFamily._next))))
         return false;
     
-    return _family == compareFontFamily._family;
+    return getNSFamily() == compareFontFamily.getNSFamily();
 }
 
 QFont::QFont()
@@ -111,7 +118,7 @@ void QFont::setFamily(const QString &qfamilyName)
     _nsfont = 0;
 }
 
-void QFont::setFirstFamily(const QFontFamily& family) 
+void QFont::setFirstFamily(const KWQFontFamily& family) 
 {
     _family = family;
     [_nsfont release];
@@ -185,13 +192,12 @@ bool QFont::operator==(const QFont &compareFont) const
 
 NSFont *QFont::getNSFont() const
 {
-    if (!_nsfont){
+    if (!_nsfont) {
         CREATE_FAMILY_ARRAY(*this, families);
-    
         _nsfont = [[[WebCoreTextRendererFactory sharedFactory] 
             fontWithFamilies:families
-                    traits:getNSTraits() 
-                    size:getNSSize()] retain];
+                      traits:getNSTraits() 
+                        size:getNSSize()] retain];
     }
     return _nsfont;
 }
diff --git a/WebCore/kwq/KWQKHTMLPart.cpp b/WebCore/kwq/KWQKHTMLPart.cpp
index f0498d9..3bbb19b 100644
--- a/WebCore/kwq/KWQKHTMLPart.cpp
+++ b/WebCore/kwq/KWQKHTMLPart.cpp
@@ -34,7 +34,7 @@ using DOM::DocumentImpl;
 using DOM::HTMLDocumentImpl;
 using DOM::NodeImpl;
 
-bool KWQKHTMLPart::isFrameSet()
+bool KWQKHTMLPart::isFrameSet() const
 {
     DocumentImpl *document = d->m_doc;
     if (!document || !document->isHTMLDocument())
@@ -43,8 +43,7 @@ bool KWQKHTMLPart::isFrameSet()
     return body && body->renderer() && body->id() == ID_FRAMESET;
 }
 
-
 int KWQKHTMLPart::selectionStartOffset() const { return d->m_startOffset; }
 int KWQKHTMLPart::selectionEndOffset() const { return d->m_endOffset; }
-DOM::NodeImpl *KWQKHTMLPart::selectionStart() const { return d->m_selectionStart.handle(); }
-DOM::NodeImpl *KWQKHTMLPart::selectionEnd() const { return d->m_selectionEnd.handle(); }
+NodeImpl *KWQKHTMLPart::selectionStart() const { return d->m_selectionStart.handle(); }
+NodeImpl *KWQKHTMLPart::selectionEnd() const { return d->m_selectionEnd.handle(); }
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index fe562da..628a2ce 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -41,10 +41,12 @@ namespace KJS {
 }
 
 #ifdef __OBJC__
+ at class NSAttributedString;
+ at class NSEvent;
 @class NSView;
 @class WebCoreBridge;
- at class NSEvent;
 #else
+class NSAttributedString;
 class NSView;
 class WebCoreBridge;
 class NSEvent;
@@ -76,6 +78,7 @@ public:
     void submitForm(const KURL &, const KParts::URLArgs &);
     
     void scrollToAnchor(const KURL &);
+    void jumpToSelection();
     
     void slotData(NSString *, bool forceEncoding, const char *bytes, int length, bool complete = false);
 
@@ -95,16 +98,13 @@ public:
     void saveLocationProperties(KJS::SavedProperties *locationProperties);
     void restoreWindowProperties(KJS::SavedProperties *windowProperties);
     void restoreLocationProperties(KJS::SavedProperties *locationProperties);
-    void openURLFromPageCache(DOM::DocumentImpl *doc, RenderObject *renderer, KURL *url, KJS::SavedProperties *windowProperties, KJS::SavedProperties *locationProperties);
+    void openURLFromPageCache(DOM::DocumentImpl *, RenderObject *, KURL *,
+        KJS::SavedProperties *windowProperties, KJS::SavedProperties *locationProperties);
 
     void saveDocumentState();
     void restoreDocumentState();
     
-    bool isFrameSet();
-
-    void jumpToSelection();
-
-    QString userAgent() const;
+    bool isFrameSet() const;
 
     void updatePolicyBaseURL();
 
@@ -119,10 +119,6 @@ public:
     static bool runJavaScriptConfirm(const QString &message);
     static bool runJavaScriptPrompt(const QString &message, const QString &defaultValue, QString &result);
 
-    static WebCoreBridge *bridgeForWidget(QWidget *);
-    
-    // Incoming calls, used by the bridge.
-    
     using KHTMLPart::xmlDocImpl;
     khtml::RenderObject *renderer();
     void forceLayout();
@@ -130,20 +126,18 @@ public:
 
     void createDummyDocument();
 
-    // Used internally, but need to be public because they are used by non-member functions.
-
-    void redirectionTimerStartedOrStopped();
-    
-    QString referrer() const;
+    static WebCoreBridge *bridgeForWidget(QWidget *);
     
-    static const QPtrList<KWQKHTMLPart> &instances() { return mutableInstances(); }
-
     QString requestedURLString() const;
+    QString referrer() const;    
+    QString userAgent() const;
     
-    int selectionStartOffset() const;
-    int selectionEndOffset() const;
     DOM::NodeImpl *selectionStart() const;
+    int selectionStartOffset() const;
     DOM::NodeImpl *selectionEnd() const;
+    int selectionEndOffset() const;
+
+    static NSAttributedString *attributedString(DOM::NodeImpl *startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset);
 
     void addMetaData(const QString &key, const QString &value);
 
@@ -156,9 +150,14 @@ public:
     static void widgetWillReleaseView(NSView *);
     
     void clearTimers();
+    static void clearTimers(KHTMLView *);
     
     bool passSubframeEventToSubframe(DOM::NodeImpl::MouseEvent &);
     
+    void redirectionTimerStartedOrStopped();
+    
+    static const QPtrList<KWQKHTMLPart> &instances() { return mutableInstances(); }
+
 private:
     virtual void khtmlMousePressEvent(khtml::MousePressEvent *);
     virtual void khtmlMouseDoubleClickEvent(khtml::MouseDoubleClickEvent *);
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 479e38f..37eb87e 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -61,6 +61,7 @@ using khtml::MousePressEvent;
 using khtml::MouseReleaseEvent;
 using khtml::RenderObject;
 using khtml::RenderPart;
+using khtml::RenderStyle;
 using khtml::RenderText;
 using khtml::RenderWidget;
 
@@ -812,15 +813,19 @@ void KWQKHTMLPart::widgetWillReleaseView(NSView *view)
     }
 }
 
-void KWQKHTMLPart::clearTimers()
+void KWQKHTMLPart::clearTimers(KHTMLView *view)
 {
-    KHTMLView *v = d->m_view;
-    if (v) {
-        v->unscheduleRelayout();
-        v->unscheduleRepaint();
+    if (view) {
+        view->unscheduleRelayout();
+        view->unscheduleRepaint();
     }
 }
 
+void KWQKHTMLPart::clearTimers()
+{
+    clearTimers(d->m_view);
+}
+
 bool KWQKHTMLPart::passSubframeEventToSubframe(DOM::NodeImpl::MouseEvent &event)
 {
     switch ([_currentEvent type]) {
@@ -974,3 +979,159 @@ void KWQKHTMLPart::mouseMoved(NSEvent *event)
     
     _currentEvent = oldCurrentEvent;
 }
+
+NSAttributedString *KWQKHTMLPart::attributedString(NodeImpl *_startNode, int startOffset, NodeImpl *endNode, int endOffset)
+{
+    NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
+
+    bool hasNewLine = true;
+    bool hasParagraphBreak = true;
+
+    Node n = _startNode;
+    while (!n.isNull()) {
+        RenderObject *renderer = n.handle()->renderer();
+        if (renderer) {
+            if (n.nodeType() == Node::TEXT_NODE) {
+                NSFont *font = nil;
+                RenderStyle *style = renderer->style();
+                if (style) {
+                    font = style->font().getNSFont();
+                }
+    
+                QString str = n.nodeValue().string();
+    
+                QString text;
+                if(n == _startNode && n == endNode && startOffset >=0 && endOffset >= 0)
+                    text = str.mid(startOffset, endOffset - startOffset);
+                else if(n == _startNode && startOffset >= 0)
+                    text = str.mid(startOffset);
+                else if(n == endNode && endOffset >= 0)
+                    text = str.left(endOffset);
+                else
+                    text = str;
+    
+                text = text.stripWhiteSpace();
+                if (text.length() > 1)
+                    text += ' ';
+    
+                if (text.length() > 0) {
+                    hasNewLine = false;
+                    hasParagraphBreak = false;
+                    NSMutableDictionary *attrs = nil;
+                    if (font) {
+                        attrs = [[NSMutableDictionary alloc] init];
+                        [attrs setObject:font forKey:NSFontAttributeName];
+                        if (style && style->color().isValid())
+                            [attrs setObject:style->color().getNSColor() forKey:NSForegroundColorAttributeName];
+                        if (style && style->backgroundColor().isValid())
+                            [attrs setObject:style->backgroundColor().getNSColor() forKey:NSBackgroundColorAttributeName];
+                    }
+                    NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:text.getNSString() attributes:attrs];
+                    [attrs release];
+                    [result appendAttributedString: partialString];                
+                    [partialString release];
+                }
+            } else {
+                // This is our simple HTML -> ASCII transformation:
+                QString text;
+                unsigned short _id = n.elementId();
+                switch(_id) {
+                    case ID_BR:
+                        text += "\n";
+                        hasNewLine = true;
+                        break;
+    
+                    case ID_TD:
+                    case ID_TH:
+                    case ID_HR:
+                    case ID_OL:
+                    case ID_UL:
+                    case ID_LI:
+                    case ID_DD:
+                    case ID_DL:
+                    case ID_DT:
+                    case ID_PRE:
+                    case ID_BLOCKQUOTE:
+                    case ID_DIV:
+                        if (!hasNewLine)
+                            text += "\n";
+                        hasNewLine = true;
+                        break;
+                    case ID_P:
+                    case ID_TR:
+                    case ID_H1:
+                    case ID_H2:
+                    case ID_H3:
+                    case ID_H4:
+                    case ID_H5:
+                    case ID_H6:
+                        if (!hasNewLine)
+                            text += "\n";
+                        if (!hasParagraphBreak)
+                            text += "\n";
+                            hasParagraphBreak = true;
+                        hasNewLine = true;
+                        break;
+                }
+                NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:text.getNSString()];
+                [result appendAttributedString: partialString];
+                [partialString release];
+            }
+        }
+
+        if (n == endNode)
+            break;
+
+        Node next = n.firstChild();
+        if (next.isNull())
+            next = n.nextSibling();
+
+        while (next.isNull() && !n.parentNode().isNull()) {
+            QString text;
+            n = n.parentNode();
+            next = n.nextSibling();
+
+            unsigned short _id = n.elementId();
+            switch(_id) {
+                case ID_TD:
+                case ID_TH:
+                case ID_HR:
+                case ID_OL:
+                case ID_UL:
+                case ID_LI:
+                case ID_DD:
+                case ID_DL:
+                case ID_DT:
+                case ID_PRE:
+                case ID_BLOCKQUOTE:
+                case ID_DIV:
+                    if (!hasNewLine)
+                        text += "\n";
+                    hasNewLine = true;
+                    break;
+                case ID_P:
+                case ID_TR:
+                case ID_H1:
+                case ID_H2:
+                case ID_H3:
+                case ID_H4:
+                case ID_H5:
+                case ID_H6:
+                    if (!hasNewLine)
+                        text += "\n";
+                    // An extra newline is needed at the start, not the end, of these types of tags,
+                    // so don't add another here.
+                    hasNewLine = true;
+                    break;
+            }
+            
+            NSAttributedString *partialString = [[NSAttributedString alloc] initWithString:text.getNSString()];
+            [result appendAttributedString:partialString];
+            [partialString release];
+        }
+
+        n = next;
+    }
+
+    return result;
+}
diff --git a/WebCore/kwq/KWQKHTMLSettings.h b/WebCore/kwq/KWQKHTMLSettings.h
index 11774a8..1f1a643 100644
--- a/WebCore/kwq/KWQKHTMLSettings.h
+++ b/WebCore/kwq/KWQKHTMLSettings.h
@@ -40,44 +40,59 @@ public:
         KAnimationEnabled
     };
     
-    void init() { }
+    static void init() { }
 
     // Font settings
-    QString stdFontName() const;
-    QString fixedFontName() const;
-    QString serifFontName() const;
-    QString sansSerifFontName() const;
-    QString cursiveFontName() const;
-    QString fantasyFontName() const;
+    static const QString &stdFontName();
+    static const QString &fixedFontName();
+    static const QString &serifFontName();
+    static const QString &sansSerifFontName();
+    static const QString &cursiveFontName();
+    static const QString &fantasyFontName();
     
-    void setStdFontName(const QString &) { }
-    void setFixedFontName(const QString &) { }
+    static const QString &settingsToCSS() { return QString::null; }
 
-    QString settingsToCSS() const;
+    static const QString &encoding();
 
-    const QString &encoding() const;
+    static int minFontSize();
+    static int mediumFontSize();
+    static int mediumFixedFontSize();
 
-    int minFontSize() const;
-    int mediumFontSize() const;
-    int mediumFixedFontSize() const;
+    static bool changeCursor() { return true; }
 
-    bool changeCursor() const;
+    static bool isFormCompletionEnabled() { return false; }
+    static int maxFormCompletionItems() { return 0; }
 
-    bool isFormCompletionEnabled() const;
-    int maxFormCompletionItems() const;
+    static bool autoLoadImages();
+    static KAnimationAdvice showAnimations() { return KAnimationEnabled; }
 
-    bool autoLoadImages() const;
-    KAnimationAdvice showAnimations() const;
+    static bool isJavaScriptEnabled();
+    static bool isJavaScriptEnabled(const QString &host) { return isJavaScriptEnabled(); }
+    static bool isJavaScriptDebugEnabled() { return false; }
+    static bool isJavaEnabled();
+    static bool isJavaEnabled(const QString &host) { return isJavaEnabled(); }
+    static bool isPluginsEnabled();
+    static bool isPluginsEnabled(const QString &host) { return isPluginsEnabled(); }
+    
+    static const QString &userStyleSheet();
 
-    bool isJavaScriptEnabled() const;
-    bool isJavaScriptEnabled(const QString &host) const;
-    bool isJavaScriptDebugEnabled() const;
-    bool isJavaEnabled() const;
-    bool isJavaEnabled(const QString &host) const;
-    bool isPluginsEnabled() const;
-    bool isPluginsEnabled(const QString &host) const;
+    static void setStdFontName(const QString &);
+    static void setFixedFontName(const QString &);
+    static void setSerifFontName(const QString &);
+    static void setSansSerifFontName(const QString &);
+    static void setCursiveFontName(const QString &);
+    static void setFantasyFontName(const QString &);
+    
+    static void setMinFontSize(int);
+    static void setMediumFontSize(int);
+    static void setMediumFixedFontSize(int);
     
-    QString userStyleSheet() const;
+    static void setAutoLoadImages(bool);
+    static void setIsJavaScriptEnabled(bool);
+    static void setIsJavaEnabled(bool);
+    static void setArePluginsEnabled(bool);
+
+    static void setUserStyleSheet(const QString &);
 };
 
 #endif
diff --git a/WebCore/kwq/KWQKHTMLSettings.mm b/WebCore/kwq/KWQKHTMLSettings.mm
index b335fcf..1201ac5 100644
--- a/WebCore/kwq/KWQKHTMLSettings.mm
+++ b/WebCore/kwq/KWQKHTMLSettings.mm
@@ -25,125 +25,163 @@
 
 #import "KWQKHTMLSettings.h"
 
-#import "WebCoreSettings.h"
+static int minimumFontSize;
+static int defaultFontSize;
+static int defaultFixedFontSize;
+static bool JavaEnabled;
+static bool willLoadImagesAutomatically;
+static bool pluginsEnabled;
+static bool JavaScriptEnabled;
 
-QString KHTMLSettings::stdFontName() const
+const QString &KHTMLSettings::stdFontName()
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] standardFontFamily]);
+    static QString name;
+    return name;
 }
 
-QString KHTMLSettings::fixedFontName() const
+const QString &KHTMLSettings::fixedFontName()
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] fixedFontFamily]);
+    static QString name;
+    return name;
 }
 
-QString KHTMLSettings::serifFontName() const
+const QString &KHTMLSettings::serifFontName()
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] serifFontFamily]);
+    static QString name;
+    return name;
 }
 
-QString KHTMLSettings::sansSerifFontName() const
+const QString &KHTMLSettings::sansSerifFontName()
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] sansSerifFontFamily]);
+    static QString name;
+    return name;
 }
 
-QString KHTMLSettings::cursiveFontName() const
+const QString &KHTMLSettings::cursiveFontName()
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] cursiveFontFamily]);
+    static QString name;
+    return name;
 }
 
-QString KHTMLSettings::fantasyFontName() const
+const QString &KHTMLSettings::fantasyFontName()
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] fantasyFontFamily]);
+    static QString name;
+    return name;
 }
 
-QString KHTMLSettings::settingsToCSS() const
+const QString &KHTMLSettings::encoding()
 {
-    return QString::null;
+    static QString latin1("latin1");
+    return latin1;
 }
 
-const QString &KHTMLSettings::encoding() const
+int KHTMLSettings::minFontSize()
 {
-    static QString latin1("latin1");
-    return latin1;
+    return minimumFontSize;
+}
+
+int KHTMLSettings::mediumFontSize()
+{
+    return defaultFontSize;
+}
+
+int KHTMLSettings::mediumFixedFontSize()
+{
+    return defaultFixedFontSize;
+}
+
+bool KHTMLSettings::isJavaEnabled()
+{
+    return JavaEnabled;
+}
+
+bool KHTMLSettings::autoLoadImages()
+{
+    return willLoadImagesAutomatically;
+}
+
+bool KHTMLSettings::isPluginsEnabled()
+{
+    return pluginsEnabled;
 }
 
-int KHTMLSettings::minFontSize() const
+bool KHTMLSettings::isJavaScriptEnabled()
 {
-    return (int)rint([[WebCoreSettings sharedSettings] minimumFontSize]);
+    return JavaScriptEnabled;
 }
 
-int KHTMLSettings::mediumFontSize() const
+const QString &KHTMLSettings::userStyleSheet()
 {
-    return (int)rint([[WebCoreSettings sharedSettings] defaultFontSize]);
+    static QString location;
+    return location;
 }
 
-int KHTMLSettings::mediumFixedFontSize() const
+void KHTMLSettings::setStdFontName(const QString &n)
 {
-    return (int)rint([[WebCoreSettings sharedSettings] defaultFixedFontSize]);
+    const_cast<QString &>(stdFontName()) = n;
 }
 
-bool KHTMLSettings::changeCursor() const
+void KHTMLSettings::setFixedFontName(const QString &n)
 {
-    return true;
+    const_cast<QString &>(fixedFontName()) = n;
 }
 
-bool KHTMLSettings::isFormCompletionEnabled() const
+void KHTMLSettings::setSerifFontName(const QString &n)
 {
-    return false;
+    const_cast<QString &>(serifFontName()) = n;
 }
 
-KHTMLSettings::KAnimationAdvice KHTMLSettings::showAnimations() const
+void KHTMLSettings::setSansSerifFontName(const QString &n)
 {
-    return KAnimationEnabled;
+    const_cast<QString &>(sansSerifFontName()) = n;
 }
 
-int KHTMLSettings::maxFormCompletionItems() const
+void KHTMLSettings::setCursiveFontName(const QString &n)
 {
-    return 0;
+    const_cast<QString &>(cursiveFontName()) = n;
 }
 
-bool KHTMLSettings::isJavaEnabled(QString const&) const
+void KHTMLSettings::setFantasyFontName(const QString &n)
 {
-    return isJavaEnabled();
+    const_cast<QString &>(fantasyFontName()) = n;
 }
 
-bool KHTMLSettings::isJavaEnabled() const
+void KHTMLSettings::setMinFontSize(int i)
 {
-    return [[WebCoreSettings sharedSettings] JavaEnabled];
+    minimumFontSize = i;
 }
 
-bool KHTMLSettings::autoLoadImages() const
+void KHTMLSettings::setMediumFontSize(int i)
 {
-    return [[WebCoreSettings sharedSettings] willLoadImagesAutomatically];
+    defaultFontSize = i;
 }
 
-bool KHTMLSettings::isPluginsEnabled(QString const&) const
+void KHTMLSettings::setMediumFixedFontSize(int i)
 {
-    return isPluginsEnabled();
+    defaultFixedFontSize = i;
 }
 
-bool KHTMLSettings::isPluginsEnabled() const
+void KHTMLSettings::setAutoLoadImages(bool b)
 {
-    return [[WebCoreSettings sharedSettings] pluginsEnabled];
+    willLoadImagesAutomatically = b;
 }
 
-bool KHTMLSettings::isJavaScriptEnabled(QString const&) const
+void KHTMLSettings::setIsJavaScriptEnabled(bool b)
 {
-    return isJavaScriptEnabled();
+    JavaScriptEnabled = b;
 }
 
-bool KHTMLSettings::isJavaScriptEnabled() const
+void KHTMLSettings::setIsJavaEnabled(bool b)
 {
-    return [[WebCoreSettings sharedSettings] JavaScriptEnabled];
+    JavaEnabled = b;
 }
 
-bool KHTMLSettings::isJavaScriptDebugEnabled() const
+void KHTMLSettings::setArePluginsEnabled(bool b)
 {
-    return false;
+    pluginsEnabled = b;
 }
 
-QString KHTMLSettings::userStyleSheet() const
+void KHTMLSettings::setUserStyleSheet(const QString &n)
 {
-    return QString::fromNSString([[WebCoreSettings sharedSettings] userStyleSheetLocation]);
+    const_cast<QString &>(userStyleSheet()) = n;
 }
diff --git a/WebCore/kwq/KWQString.h b/WebCore/kwq/KWQString.h
index 7de4076..2383945 100644
--- a/WebCore/kwq/KWQString.h
+++ b/WebCore/kwq/KWQString.h
@@ -445,8 +445,7 @@ public:
     QString &insert(uint, char);
     QString &insert(uint index, const char *insertChars, uint insertLength);
     QString &remove(uint, uint);
-    QString &replace( uint index, uint len, const QString &s );
-    //QString &replace( uint index, uint len, const QChar* s, uint slen );
+    QString &replace(uint index, uint len, const QString &s);
     QString &replace(const QRegExp &, const QString &);
 
     void truncate(uint);
@@ -468,6 +467,11 @@ public:
 
     void setBufferFromCFString(CFStringRef);
     
+    QString &prepend(const QChar *, uint length);
+    QString &insert(uint position, const QChar *, uint length);
+    
+    uint hash() const;
+    
 private:
     // Used by QConstString.
     QString(QStringData *constData, bool /*dummy*/);
@@ -634,4 +638,6 @@ public:
     const QString &string() const { return *this; }
 };
 
+extern const CFDictionaryKeyCallBacks CFDictionaryQStringKeyCallBacks;
+
 #endif
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 26f4545..8474249 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -2113,6 +2113,11 @@ QString &QString::prepend(const QString &qs)
     return insert(0, qs);
 }
 
+QString &QString::prepend(const QChar *characters, uint length)
+{
+    return insert(0, characters, length);
+}
+
 QString &QString::append(const QString &qs)
 {
     return insert(dataHandle[0]->_length, qs);
@@ -2121,11 +2126,11 @@ QString &QString::append(const QString &qs)
 
 QString &QString::insert(uint index, const char *insertChars, uint insertLength)
 {
-    detach();
-    
     if (insertLength == 0)
         return *this;
         
+    detach();
+    
     if (dataHandle[0]->_isAsciiValid){
         uint originalLength = dataHandle[0]->_length;
         char *targetChars;
@@ -2169,8 +2174,6 @@ QString &QString::insert(uint index, const char *insertChars, uint insertLength)
 
 QString &QString::insert(uint index, const QString &qs)
 {
-    detach();
-    
     if (qs.data()->_length == 0)
         return *this;
         
@@ -2213,6 +2216,24 @@ QString &QString::insert(uint index, const QString &qs)
 }
 
 
+QString &QString::insert(uint index, const QChar *insertChars, uint insertLength)
+{
+    if (insertLength == 0)
+        return *this;
+        
+    forceUnicode();
+    
+    uint originalLength = dataHandle[0]->_length;
+    setLength(originalLength + insertLength);
+
+    QChar *targetChars = const_cast<QChar *>(unicode());
+    memmove(targetChars + index + insertLength, targetChars + index, (originalLength - index) * sizeof(QChar));
+    memcpy(targetChars + index, insertChars, insertLength * sizeof(QChar));
+    
+    return *this;
+}
+
+
 QString &QString::insert(uint index, QChar qc)
 {
     detach();
@@ -2609,9 +2630,50 @@ bool operator==(const QString &s1, const QString &s2)
 
 bool operator==(const QString &s1, const char *chs)
 {
-    if (s1.data()->_isAsciiValid)
-        return strcmp(s1.ascii(), chs) == 0;
-    return s1 == QString(chs);
+    if (!chs)
+        return s1.isNull();
+    uint length = strlen(chs);
+    if (s1.data()->_length != length)
+        return false;
+    if (s1.data()->_isAsciiValid) {
+        const char *s = s1.ascii();
+        for (uint i = 0; i != length; ++i)
+            if (s[i] != chs[i])
+                return false;
+    } else {
+        const QChar *s = s1.unicode();
+        for (uint i = 0; i != length; ++i)
+            if (s[i] != chs[i])
+                return false;
+    }
+    return true;
+}
+
+uint QString::hash() const
+{
+    uint len = length();
+    uint h = len;
+    if (len) {
+        uint prefixLength = len < 8 ? len : 8;
+        uint suffixPosition = len < 16 ? 8 : len - 8;
+    
+        if (data()->_isAsciiValid) {
+            const char *s = ascii();
+            for (uint i = 0; i < prefixLength; i++)
+                h = 127 * h + (unsigned char)s[i];
+            for (uint i = suffixPosition; i < len; i++)
+                h = 127 * h + (unsigned char)s[i];
+        } else {
+            const QChar *s = unicode();
+            for (uint i = 0; i < prefixLength; i++)
+                h = 127 * h + s[i].unicode();
+            for (uint i = suffixPosition; i < len; i++)
+                h = 127 * h + s[i].unicode();
+        }
+    }
+    if (h == 0)
+        h = 0x80000000;
+    return h;
 }
 
 QString operator+(const QString &qs1, const QString &qs2)
@@ -2677,6 +2739,33 @@ QConstString::~QConstString()
     }
 }
 
+const void *retainQString(CFAllocatorRef allocator, const void *value)
+{
+    return new QString(*(QString *)value);
+}
+
+void releaseQString(CFAllocatorRef allocator, const void *value)
+{
+    delete (QString *)value;
+}
+
+CFStringRef describeQString(const void *value)
+{
+    return ((QString *)value)->getCFString();
+}
+
+Boolean equalQString(const void *value1, const void *value2)
+{
+    return *(QString *)value1 == *(QString *)value2;
+}
+
+CFHashCode hashQString(const void *value)
+{
+    return ((QString *)value)->hash();
+}
+
+const CFDictionaryKeyCallBacks CFDictionaryQStringKeyCallBacks = { 0, retainQString, releaseQString, describeQString, equalQString, hashQString };
+
 #define NODE_BLOCK_SIZE ((vm_page_size)/sizeof(HandleNode))
 
 #define TO_NODE_OFFSET(ptr)   ((uint)(((uint)ptr - (uint)base)/sizeof(HandleNode)))
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 06689f0..025545f 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -88,7 +88,7 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     SavedProperties *locationProperties;
     RenderObject *docRenderer; 
 }
-- initWithDocument: (DocumentImpl *)doc URL: (KURL)u windowProperties: (SavedProperties *)wp locationProperties: (SavedProperties *)lp;
+- initWithDocument:(DocumentImpl *)doc URL:(const KURL &)u windowProperties:(SavedProperties *)wp locationProperties:(SavedProperties *)lp;
 - (DocumentImpl *)document;
 - (KURL *)URL;
 - (SavedProperties *)windowProperties;
@@ -155,7 +155,6 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
         return;
     }
         
-
     // arguments
     URLArgs args(_part->browserExtension()->urlArgs());
     args.reload = reload;
@@ -249,6 +248,7 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
                                                                   URL:_part->m_url
                                                      windowProperties:windowProperties
                                                    locationProperties:locationProperties] autorelease];
+
     return [self saveDocumentToPageCache:pageState];
 }
 
@@ -583,175 +583,19 @@ NSString *WebCoreElementStringKey = 		@"WebElementString";
     _part->xmlDocImpl()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
 }
 
-static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffset, NodeImpl *endNode, int endOffset)
-{
-    bool hasNewLine = true;
-    bool hasParagraphBreak = true;
-    Node n = _startNode;
-    RenderObject *renderer;
-    NSFont *font;
-    NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
-    NSAttributedString *partialString;
-
-    while(!n.isNull()) {
-        renderer = n.handle()->renderer();
-        if (n.nodeType() == Node::TEXT_NODE && renderer) {
-            QString text;
-            QString str = n.nodeValue().string();
-            RenderStyle *style = 0;
-
-            font = nil;
-            style = renderer->style();
-            if (style) {
-                font = style->font().getNSFont();
-            }
-
-            if(n == _startNode && n == endNode && startOffset >=0 && endOffset >= 0)
-                text = str.mid(startOffset, endOffset - startOffset);
-            else if(n == _startNode && startOffset >= 0)
-                text = str.mid(startOffset);
-            else if(n == endNode && endOffset >= 0)
-                text = str.left(endOffset);
-            else
-                text = str;
-
-            text = text.stripWhiteSpace();
-            if (text.length() > 1)
-                text += ' ';
-
-            if (text.length() > 0){
-                hasNewLine = false;
-                hasParagraphBreak = false;
-                if (font){
-                    NSMutableDictionary *attrs = [[[NSMutableDictionary alloc] init] autorelease];
-                    [attrs setObject:font forKey:NSFontAttributeName];
-                    if (style && style->color().isValid())
-                        [attrs setObject:style->color().getNSColor() forKey:NSForegroundColorAttributeName];
-                    if (style && style->backgroundColor().isValid())
-                        [attrs setObject:style->backgroundColor().getNSColor() forKey:NSBackgroundColorAttributeName];
-                    partialString = [[[NSAttributedString alloc] initWithString: text.getNSString() attributes: attrs] autorelease];
-                }
-                else
-                    partialString = [[[NSAttributedString alloc] initWithString: text.getNSString() attributes: nil] autorelease];
-
-                [result appendAttributedString: partialString];
-            }
-        }
-        else if (renderer != 0){
-            // This is our simple HTML -> ASCII transformation:
-            QString text;
-            unsigned short _id = n.elementId();
-            switch(_id) {
-                case ID_BR:
-                    text += "\n";
-                    hasNewLine = true;
-                    break;
-
-                case ID_TD:
-                case ID_TH:
-                case ID_HR:
-                case ID_OL:
-                case ID_UL:
-                case ID_LI:
-                case ID_DD:
-                case ID_DL:
-                case ID_DT:
-                case ID_PRE:
-                case ID_BLOCKQUOTE:
-                case ID_DIV:
-                    if (!hasNewLine)
-                        text += "\n";
-                    hasNewLine = true;
-                    break;
-                case ID_P:
-                case ID_TR:
-                case ID_H1:
-                case ID_H2:
-                case ID_H3:
-                case ID_H4:
-                case ID_H5:
-                case ID_H6:
-                    if (!hasNewLine)
-                        text += "\n";
-                    if (!hasParagraphBreak)
-                        text += "\n";
-                        hasParagraphBreak = true;
-                    hasNewLine = true;
-                    break;
-            }
-            partialString = [[[NSAttributedString alloc] initWithString: text.getNSString() attributes: nil] autorelease];
-            [result appendAttributedString: partialString];
-        }
-
-        if(n == endNode)
-            break;
-
-        Node next = n.firstChild();
-        if(next.isNull())
-            next = n.nextSibling();
-
-        while( next.isNull() && !n.parentNode().isNull() ) {
-            QString text;
-            n = n.parentNode();
-            next = n.nextSibling();
-
-            unsigned short _id = n.elementId();
-            switch(_id) {
-                case ID_TD:
-                case ID_TH:
-                case ID_HR:
-                case ID_OL:
-                case ID_UL:
-                case ID_LI:
-                case ID_DD:
-                case ID_DL:
-                case ID_DT:
-                case ID_PRE:
-                case ID_BLOCKQUOTE:
-                case ID_DIV:
-                    if (!hasNewLine)
-                        text += "\n";
-                    hasNewLine = true;
-                    break;
-                case ID_P:
-                case ID_TR:
-                case ID_H1:
-                case ID_H2:
-                case ID_H3:
-                case ID_H4:
-                case ID_H5:
-                case ID_H6:
-                    if (!hasNewLine)
-                        text += "\n";
-                    // An extra newline is needed at the start, not the end, of these types of tags,
-                    // so don't add another here.
-                    hasNewLine = true;
-                    break;
-            }
-            partialString = [[[NSAttributedString alloc] initWithString: text.getNSString() attributes: nil] autorelease];
-            [result appendAttributedString: partialString];
-        }
-
-        n = next;
-    }
-
-    return result;
-}
-
 - (NSAttributedString *)selectedAttributedString
 {
-    return attributedString (_part->selectionStart(), _part->selectionStartOffset(), _part->selectionEnd(), _part->selectionEndOffset());
+    return KWQKHTMLPart::attributedString(_part->selectionStart(), _part->selectionStartOffset(), _part->selectionEnd(), _part->selectionEndOffset());
 }
 
-- (NSAttributedString *)attributedStringFrom: (id<WebDOMNode>)startNode startOffset: (int)startOffset to: (id<WebDOMNode>)endNode endOffset: (int)endOffset
+- (NSAttributedString *)attributedStringFrom:(id<WebDOMNode>)startNode startOffset:(int)startOffset to:(id<WebDOMNode>)endNode endOffset:(int)endOffset
 {
-    return attributedString ([(WebCoreDOMNode *)startNode impl], startOffset, [(WebCoreDOMNode *)endNode impl], endOffset);
+    return KWQKHTMLPart::attributedString([(WebCoreDOMNode *)startNode impl], startOffset, [(WebCoreDOMNode *)endNode impl], endOffset);
 }
 
-
 - (id<WebDOMNode>)selectionStart
 {
-    return [WebCoreDOMNode nodeWithImpl: _part->selectionStart()];
+    return [WebCoreDOMNode nodeWithImpl:_part->selectionStart()];
 }
 
 - (int)selectionStartOffset
@@ -761,7 +605,7 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
 
 - (id<WebDOMNode>)selectionEnd
 {
-    return [WebCoreDOMNode nodeWithImpl: _part->selectionEnd()];
+    return [WebCoreDOMNode nodeWithImpl:_part->selectionEnd()];
 }
 
 - (int)selectionEndOffset
@@ -830,7 +674,8 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
 @end
 
 @implementation KWQPageState
-- initWithDocument:(DocumentImpl *)doc URL:(KURL)u windowProperties:(SavedProperties *)wp locationProperties:(SavedProperties *)lp
+
+- initWithDocument:(DocumentImpl *)doc URL:(const KURL &)u windowProperties:(SavedProperties *)wp locationProperties:(SavedProperties *)lp
 {
     [super init];
     doc->ref();
@@ -839,7 +684,7 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
     document->setInPageCache(YES);
     URL = new KURL(u);
     windowProperties = wp;
-    locationProperties =lp;
+    locationProperties = lp;
     return self;
 }
 
@@ -848,7 +693,7 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
 - (void)invalidate
 {
     // Should only ever invalidate once.
-    ASSERT (document);
+    ASSERT(document);
     
     document->setInPageCache(NO);
     document->deref();
@@ -865,33 +710,23 @@ static NSAttributedString *attributedString(NodeImpl *_startNode, int startOffse
 
 - (void)dealloc
 {
-    if (document){
+    if (document) {
         KHTMLView *view = document->view();
-        KWQ(view->part())->clearTimers();
+
+        KWQKHTMLPart::clearTimers(view);
+
         document->setInPageCache(NO);
         document->detach();
         document->deref();
-        document = 0;
         
         view->clearPart();
         delete view;
     }
     
-    if (URL){
-        delete URL;
-        URL = 0;
-    }
+    delete URL;
+    delete windowProperties;
+    delete locationProperties;
 
-    if (windowProperties){
-        delete windowProperties;
-        windowProperties = 0;
-    }
-    
-    if (locationProperties){
-        delete locationProperties;
-        locationProperties = 0;
-    }
-    
     [super dealloc];
 }
 
diff --git a/WebCore/kwq/WebCoreSettings.mm b/WebCore/kwq/WebCoreSettings.mm
index f7d4651..b591e46 100644
--- a/WebCore/kwq/WebCoreSettings.mm
+++ b/WebCore/kwq/WebCoreSettings.mm
@@ -26,6 +26,7 @@
 #import "WebCoreSettings.h"
 
 #import "KWQKHTMLPart.h"
+#import "KWQKHTMLSettings.h"
 #import "WebCoreBridge.h"
 
 @implementation WebCoreSettings
@@ -65,6 +66,7 @@
     }
     [standardFontFamily release];
     standardFontFamily = [s copy];
+    KHTMLSettings::setStdFontName(QString::fromNSString(s));
     [self _updateAllViews];
 }
 
@@ -80,6 +82,7 @@
     }
     [fixedFontFamily release];
     fixedFontFamily = [s copy];
+    KHTMLSettings::setFixedFontName(QString::fromNSString(s));
     [self _updateAllViews];
 }
 
@@ -95,6 +98,7 @@
     }
     [serifFontFamily release];
     serifFontFamily = [s copy];
+    KHTMLSettings::setSerifFontName(QString::fromNSString(s));
     [self _updateAllViews];
 }
 
@@ -110,6 +114,7 @@
     }
     [sansSerifFontFamily release];
     sansSerifFontFamily = [s copy];
+    KHTMLSettings::setSansSerifFontName(QString::fromNSString(s));
     [self _updateAllViews];
 }
 
@@ -125,6 +130,7 @@
     }
     [cursiveFontFamily release];
     cursiveFontFamily = [s copy];
+    KHTMLSettings::setCursiveFontName(QString::fromNSString(s));
     [self _updateAllViews];
 }
 
@@ -140,6 +146,7 @@
     }
     [fantasyFontFamily release];
     fantasyFontFamily = [s copy];
+    KHTMLSettings::setFantasyFontName(QString::fromNSString(s));
     [self _updateAllViews];
 }
 
@@ -154,6 +161,7 @@
         return;
     }
     minimumFontSize = size;
+    KHTMLSettings::setMinFontSize((int)rint(size));
     [self _updateAllViews];
 }
 
@@ -168,6 +176,7 @@
         return;
     }
     defaultFontSize = size;
+    KHTMLSettings::setMediumFontSize((int)rint(size));
     [self _updateAllViews];
 }
 
@@ -182,6 +191,7 @@
         return;
     }
     defaultFixedFontSize = size;
+    KHTMLSettings::setMediumFixedFontSize((int)rint(size));
     [self _updateAllViews];
 }
 
@@ -193,6 +203,7 @@
 - (void)setJavaEnabled:(BOOL)enabled
 {
     JavaEnabled = enabled;
+    KHTMLSettings::setIsJavaEnabled(enabled);
 }
 
 - (BOOL)JavaEnabled
@@ -203,6 +214,7 @@
 - (void)setPluginsEnabled:(BOOL)enabled
 {
     pluginsEnabled = enabled;
+    KHTMLSettings::setArePluginsEnabled(enabled);
 }
 
 - (BOOL)pluginsEnabled
@@ -213,6 +225,7 @@
 - (void)setJavaScriptEnabled:(BOOL)enabled
 {
     JavaScriptEnabled = enabled;
+    KHTMLSettings::setIsJavaScriptEnabled(enabled);
 }
 
 - (BOOL)JavaScriptEnabled
@@ -233,6 +246,7 @@
 - (void)setWillLoadImagesAutomatically:(BOOL)load
 {
     willLoadImagesAutomatically = load;
+    KHTMLSettings::setAutoLoadImages(load);
 }
 
 - (BOOL)willLoadImagesAutomatically
@@ -247,6 +261,7 @@
     }
     [userStyleSheetLocation release];
     userStyleSheetLocation = [s copy];
+    KHTMLSettings::setUserStyleSheet(QString::fromNSString(s));
     [self _updateAllViews];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list