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

gramps gramps at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:45:00 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 0aed4d6d9c6a64f343544d83ac4d7d6702ecee07
Author: gramps <gramps at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 19 15:53:27 2001 +0000

    Merged changes from KDE 2.2.1 distribution
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/kjs/Makefile.am b/JavaScriptCore/kjs/Makefile.am
index 1cd1be0..00f6e6f 100644
--- a/JavaScriptCore/kjs/Makefile.am
+++ b/JavaScriptCore/kjs/Makefile.am
@@ -39,7 +39,7 @@ noinst_HEADERS = nodes.h lexer.h regexp.h internal.h collector.h \
 	number_object.h date_object.h regexp_object.h error_object.h \
 	debugger.h
 
-libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined $(USER_LDFLAGS)
+libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined $(USER_LDFLAGS) $(all_libraries)
 libkjs_la_LIBADD = -lm $(LIBPCRE)
 
 parser: $(srcdir)/grammar.y
diff --git a/JavaScriptCore/kjs/Makefile.in b/JavaScriptCore/kjs/Makefile.in
index ca8efde..9b6fb8c 100644
--- a/JavaScriptCore/kjs/Makefile.in
+++ b/JavaScriptCore/kjs/Makefile.in
@@ -1,118 +1,738 @@
-#======================================================================
-#
-# Makefile
-#
-# $RCSfile$
-# $Revision$
-# $Author$
-# $Date$
-#
-# Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-#
-#======================================================================
-# set top source dir relative to this directory
-# include make vars boilerplate
-#
-
-TOPSRCDIR = ../../..
-include $(TOPSRCDIR)/Makefile.vars
-
-#----------------------------------------------------------------------
-# Set variables for this directory
-
-CXXYACCOBJECTS = grammar.cpp grammar.h
-
-CXXOBJECTS = \
-	array_object.o \
-	bool_object.o \
-	collector.o \
-	date_object.o \
-	debugger.o \
-	error_object.o \
-	function.o \
-	function_object.o \
-	global_object.o \
-	grammar.o \
-	internal.o \
-	kjs.o \
-	lexer.o \
-	lookup.o \
-	math_object.o \
-	nodes.o \
-	number_object.o \
-	object.o \
-	object_object.o \
-	operations.o \
-	regexp.o \
-	regexp_object.o \
-	string_object.o \
-	types.o \
-	ustring.o \
-	$(NULL)
-
-PROGRAM = testkjs
-
-OBJECTS = $(CXXYACCOBJECTS) $(CXXOBJECTS) 
-
-LIBRARY = libkjs.a
-
-CLEAN_FILES = $(OBJECTS) \
-	grammar.h \
-	grammar.cpp \
-	grammar.cpp.h \
-	testkjs.o \
-	$(LIBRARY) \
-	$(PROGRAM) \
-	$(NULL)
-
-#----------------------------------------------------------------------
-# Set flags for this directory
-
-YACCFLAGS = -d --output-file=grammar.cpp --name-prefix=kjsyy
-
-#----------------------------------------------------------------------
-# Set targets for this directory
-
-all: $(OBJECTS) $(LIBRARY) $(PROGRAM)
-
-$(LIBRARY): $(CXXOBJECTS)
-	$(AR) $(ARFLAGS) $(LIBRARY) $(CXXOBJECTS)
-	$(RANLIB) $(LIBRARY)
-
-$(PROGRAM): testkjs.o
-	$(CC) $< -o $@ -L. -lkjs
-
-depend:
-
-grammar.h: grammar.cpp.h
-	ln -s grammar.cpp.h grammar.h
-
-#----------------------------------------------------------------------
-# include make rules boilerplate
-
-include $(TOPSRCDIR)/Makefile.rules
-
-#======================================================================
-# end
-#======================================================================
+# KDE tags expanded automatically by am_edit - $Revision$ 
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+#    This file is part of the KDE libraries
+#    Copyright (C) 1999 Harri Porten (porten at kde.org)
+
+#    This library is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU Library General Public
+#    License as published by the Free Software Foundation; either
+#    version 2 of the License, or (at your option) any later version.
+
+#    This library is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    Library General Public License for more details.
+
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; see the file COPYING.LIB.  If not, write to
+#    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+#>- 
+bindir = @bindir@
+#>+ 3
+DEPDIR = .deps
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+ARTSCCONFIG = @ARTSCCONFIG@
+ARTS_BUILD_GMCOP = @ARTS_BUILD_GMCOP@
+ARTS_BUILD_KDE = @ARTS_BUILD_KDE@
+ARTS_MAJOR_VERSION = @ARTS_MAJOR_VERSION@
+ARTS_MICRO_VERSION = @ARTS_MICRO_VERSION@
+ARTS_MINOR_VERSION = @ARTS_MINOR_VERSION@
+ARTS_VERSION = @ARTS_VERSION@
+AS = @AS@
+AUTODIRS = @AUTODIRS@
+BZIP2DIR = @BZIP2DIR@
+BZIP2_FILTER = @BZIP2_FILTER@
+CC = @CC@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CUPSSUBDIR = @CUPSSUBDIR@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DCOPIDL = @DCOPIDL@
+DCOPIDL2CPP = @DCOPIDL2CPP@
+DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+DLLTOOL = @DLLTOOL@
+DPMSINC = @DPMSINC@
+DPMSLIB = @DPMSLIB@
+EXEEXT = @EXEEXT@
+EXTRA_SUBDIRS = @EXTRA_SUBDIRS@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_DEPLIBS = @GLIB_DEPLIBS@
+GLIB_LIBS = @GLIB_LIBS@
+GLINC = @GLINC@
+GLLIB = @GLLIB@
+GMSGFMT = @GMSGFMT@
+HAVE_MITSHM = @HAVE_MITSHM@
+HELP_SUBDIR = @HELP_SUBDIR@
+ICE_RLIB = @ICE_RLIB@
+ICE_SUBDIR = @ICE_SUBDIR@
+IDL = @IDL@
+IDL_DEPENDENCIES = @IDL_DEPENDENCIES@
+JAR = @JAR@
+JAVAC = @JAVAC@
+JAVAH = @JAVAH@
+JVMLIBS = @JVMLIBS@
+KDECONFIG = @KDECONFIG@
+KDE_CXXFLAGS = @KDE_CXXFLAGS@
+KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@
+KDE_INCLUDES = @KDE_INCLUDES@
+KDE_LDFLAGS = @KDE_LDFLAGS@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_RPATH = @KDE_RPATH@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_XSL_STYLESHEET = @KDE_XSL_STYLESHEET@
+LIBASOUND = @LIBASOUND@
+LIBAUDIOFILE = @LIBAUDIOFILE@
+LIBAUDIOIO = @LIBAUDIOIO@
+LIBAUDIONAS = @LIBAUDIONAS@
+LIBBZ2 = @LIBBZ2@
+LIBCOMPAT = @LIBCOMPAT@
+LIBCRYPT = @LIBCRYPT@
+LIBDL = @LIBDL@
+LIBFAM = @LIBFAM@
+LIBGEN = @LIBGEN@
+LIBICE = @LIBICE@
+LIBJPEG = @LIBJPEG@
+LIBMICO = @LIBMICO@
+LIBOBJS = @LIBOBJS@
+LIBOSSAUDIO = @LIBOSSAUDIO@
+LIBPCRE = @LIBPCRE@
+LIBPNG = @LIBPNG@
+LIBPOSIX1E = @LIBPOSIX1E@
+LIBPTHREAD = @LIBPTHREAD@
+LIBPYTHON = @LIBPYTHON@
+LIBQIMGIO = @LIBQIMGIO@
+LIBRESOLV = @LIBRESOLV@
+LIBSHADOW = @LIBSHADOW@
+LIBSM = @LIBSM@
+LIBSOCKET = @LIBSOCKET@
+LIBSSL = @LIBSSL@
+LIBTIFF = @LIBTIFF@
+LIBTOOL = @LIBTOOL@
+LIBUCB = @LIBUCB@
+LIBUTIL = @LIBUTIL@
+LIBVOLMGT = @LIBVOLMGT@
+LIBXINERAMA = @LIBXINERAMA@
+LIBXML_CFLAGS = @LIBXML_CFLAGS@
+LIBXML_LIBS = @LIBXML_LIBS@
+LIBXML_RPATH = @LIBXML_RPATH@
+LIBXSLT_MAJOR_VERSION = @LIBXSLT_MAJOR_VERSION@
+LIBXSLT_MICRO_VERSION = @LIBXSLT_MICRO_VERSION@
+LIBXSLT_MINOR_VERSION = @LIBXSLT_MINOR_VERSION@
+LIBXSLT_VERSION = @LIBXSLT_VERSION@
+LIBXSLT_VERSION_INFO = @LIBXSLT_VERSION_INFO@
+LIBXSLT_VERSION_NUMBER = @LIBXSLT_VERSION_NUMBER@
+LIBZ = @LIBZ@
+LIB_CUPS = @LIB_CUPS@
+LIB_DCOP = @LIB_DCOP@
+LIB_DMALLOC = @LIB_DMALLOC@
+LIB_KAB = @LIB_KAB@
+LIB_KDECORE = @LIB_KDECORE@
+LIB_KDEUI = @LIB_KDEUI@
+LIB_KFILE = @LIB_KFILE@
+LIB_KFM = @LIB_KFM@
+LIB_KFORMULA = @LIB_KFORMULA@
+LIB_KHTML = @LIB_KHTML@
+LIB_KIMGIO = @LIB_KIMGIO@
+LIB_KIO = @LIB_KIO@
+LIB_KPARTS = @LIB_KPARTS@
+LIB_KSPELL = @LIB_KSPELL@
+LIB_KSSL = @LIB_KSSL@
+LIB_KSYCOCA = @LIB_KSYCOCA@
+LIB_KWRITE = @LIB_KWRITE@
+LIB_QT = @LIB_QT@
+LIB_SMB = @LIB_SMB@
+LIB_X11 = @LIB_X11@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+MCOPIDL = @MCOPIDL@
+MEINPROC = @MEINPROC@
+MICO_INCLUDES = @MICO_INCLUDES@
+MICO_LDFLAGS = @MICO_LDFLAGS@
+MOC = @MOC@
+MSGFMT = @MSGFMT@
+M_LIBS = @M_LIBS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+NOREPO = @NOREPO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PAMLIBS = @PAMLIBS@
+PASSWDLIBS = @PASSWDLIBS@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHONINC = @PYTHONINC@
+PYTHONLIB = @PYTHONLIB@
+PYTHONMODDIR = @PYTHONMODDIR@
+QNAMESPACE_H = @QNAMESPACE_H@
+QTDOCDIR = @QTDOCDIR@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+RANLIB = @RANLIB@
+REPO = @REPO@
+SETUIDFLAGS = @SETUIDFLAGS@
+SSL_INCLUDES = @SSL_INCLUDES@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+UIC = @UIC@
+USER_INCLUDES = @USER_INCLUDES@
+USER_LDFLAGS = @USER_LDFLAGS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+USE_THREADS = @USE_THREADS@
+VERSION = @VERSION@
+WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
+WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@
+XGETTEXT = @XGETTEXT@
+XPMINC = @XPMINC@
+XPMLIB = @XPMLIB@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_INCLUDES = @X_INCLUDES@
+X_LDFLAGS = @X_LDFLAGS@
+X_PRE_LIBS = @X_PRE_LIBS@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+idldir = @idldir@
+jni_includes = @jni_includes@
+kde_appsdir = @kde_appsdir@
+kde_bindir = @kde_bindir@
+kde_confdir = @kde_confdir@
+kde_datadir = @kde_datadir@
+kde_htmldir = @kde_htmldir@
+kde_icondir = @kde_icondir@
+kde_includes = @kde_includes@
+kde_libraries = @kde_libraries@
+kde_libs_htmldir = @kde_libs_htmldir@
+kde_libs_prefix = @kde_libs_prefix@
+kde_locale = @kde_locale@
+kde_mimedir = @kde_mimedir@
+kde_moduledir = @kde_moduledir@
+kde_servicesdir = @kde_servicesdir@
+kde_servicetypesdir = @kde_servicetypesdir@
+kde_sounddir = @kde_sounddir@
+kde_templatesdir = @kde_templatesdir@
+kde_wallpaperdir = @kde_wallpaperdir@
+micodir = @micodir@
+path_su = @path_su@
+qt_includes = @qt_includes@
+qt_libraries = @qt_libraries@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+
+YACC = bison
+INCLUDES = $(all_includes)
+
+lib_LTLIBRARIES = libkjs.la
+
+libkjs_la_SOURCES = kjs.cpp grammar.cpp lexer.cpp nodes.cpp object.cpp 	operations.cpp ustring.cpp function.cpp types.cpp lookup.cpp 	internal.cpp regexp.cpp global_object.cpp math_object.cpp 	bool_object.cpp object_object.cpp error_object.cpp 	array_object.cpp string_object.cpp number_object.cpp 	date_object.cpp regexp_object.cpp collector.cpp function_object.cpp 	debugger.cpp
+
+
+kjsincludedir = $(includedir)/kjs
+kjsinclude_HEADERS = kjs.h object.h operations.h ustring.h 	function.h lookup.h types.h
+
+
+noinst_HEADERS = nodes.h lexer.h regexp.h internal.h collector.h 	grammar.h object_object.h function_object.h function_object.h 	bool_object.h math_object.h array_object.h string_object.h 	number_object.h date_object.h regexp_object.h error_object.h 	debugger.h
+
+
+libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined $(USER_LDFLAGS) $(all_libraries)
+libkjs_la_LIBADD = -lm $(LIBPCRE)
+
+EXTRA_PROGRAMS = testkjs_static
+testkjs_static_SOURCES = testkjs.cpp  $(libkjs_la_SOURCES)
+testkjs_static_LDADD = $(LIBPCRE)
+
+check_PROGRAMS = testkjs
+testkjs_SOURCES = testkjs.cpp
+testkjs_LDADD = libkjs.la
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = 
+LTLIBRARIES =  $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libkjs_la_DEPENDENCIES = 
+#>- libkjs_la_OBJECTS =  kjs.lo grammar.lo lexer.lo nodes.lo object.lo \
+#>- operations.lo ustring.lo function.lo types.lo lookup.lo internal.lo \
+#>- regexp.lo global_object.lo math_object.lo bool_object.lo \
+#>- object_object.lo error_object.lo array_object.lo string_object.lo \
+#>- number_object.lo date_object.lo regexp_object.lo collector.lo \
+#>- function_object.lo debugger.lo
+#>+ 9
+libkjs_la_final_OBJECTS = libkjs_la.all_cpp.lo 
+libkjs_la_nofinal_OBJECTS = kjs.lo grammar.lo lexer.lo nodes.lo object.lo \
+operations.lo ustring.lo function.lo types.lo lookup.lo internal.lo \
+regexp.lo global_object.lo math_object.lo bool_object.lo \
+object_object.lo error_object.lo array_object.lo string_object.lo \
+number_object.lo date_object.lo regexp_object.lo collector.lo \
+function_object.lo debugger.lo
+ at KDE_USE_FINAL_FALSE@libkjs_la_OBJECTS = $(libkjs_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libkjs_la_OBJECTS = $(libkjs_la_final_OBJECTS)
+check_PROGRAMS =  testkjs$(EXEEXT)
+#>- testkjs_static_OBJECTS =  testkjs.$(OBJEXT) kjs.$(OBJEXT) \
+#>- grammar.$(OBJEXT) lexer.$(OBJEXT) nodes.$(OBJEXT) object.$(OBJEXT) \
+#>- operations.$(OBJEXT) ustring.$(OBJEXT) function.$(OBJEXT) \
+#>- types.$(OBJEXT) lookup.$(OBJEXT) internal.$(OBJEXT) regexp.$(OBJEXT) \
+#>- global_object.$(OBJEXT) math_object.$(OBJEXT) bool_object.$(OBJEXT) \
+#>- object_object.$(OBJEXT) error_object.$(OBJEXT) array_object.$(OBJEXT) \
+#>- string_object.$(OBJEXT) number_object.$(OBJEXT) date_object.$(OBJEXT) \
+#>- regexp_object.$(OBJEXT) collector.$(OBJEXT) function_object.$(OBJEXT) \
+#>- debugger.$(OBJEXT)
+#>+ 9
+testkjs_static_OBJECTS = testkjs.$(OBJEXT) kjs.$(OBJEXT) \
+grammar.$(OBJEXT) lexer.$(OBJEXT) nodes.$(OBJEXT) object.$(OBJEXT) \
+operations.$(OBJEXT) ustring.$(OBJEXT) function.$(OBJEXT) \
+types.$(OBJEXT) lookup.$(OBJEXT) internal.$(OBJEXT) regexp.$(OBJEXT) \
+global_object.$(OBJEXT) math_object.$(OBJEXT) bool_object.$(OBJEXT) \
+object_object.$(OBJEXT) error_object.$(OBJEXT) array_object.$(OBJEXT) \
+string_object.$(OBJEXT) number_object.$(OBJEXT) date_object.$(OBJEXT) \
+regexp_object.$(OBJEXT) collector.$(OBJEXT) function_object.$(OBJEXT) \
+debugger.$(OBJEXT)
+testkjs_static_DEPENDENCIES = 
+testkjs_static_LDFLAGS = 
+#>- testkjs_OBJECTS =  testkjs.$(OBJEXT)
+#>+ 1
+testkjs_OBJECTS = testkjs.$(OBJEXT)
+testkjs_DEPENDENCIES =  libkjs.la
+testkjs_LDFLAGS = 
+CXXFLAGS = @CXXFLAGS@
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+#>+ 1
+CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(LDFLAGS) -o $@
+HEADERS =  $(kjsinclude_HEADERS) $(noinst_HEADERS)
+
+DIST_COMMON =  README ChangeLog Makefile.am Makefile.in THANKS
+
+
+#>- DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 4
+KDE_DIST=configure.in.in grammar.y keywords.table math_object.lut.h test.js create_hash_table lexer.lut.h 
+
+DISTFILES= $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+
+
+TAR = tar
+GZIP_ENV = --best
+SOURCES = $(libkjs_la_SOURCES) $(testkjs_static_SOURCES) $(testkjs_SOURCES)
+OBJECTS = $(libkjs_la_OBJECTS) $(testkjs_static_OBJECTS) $(testkjs_OBJECTS)
+
+#>- all: all-redirect
+#>+ 1
+all: docs-am  all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cpp .lo .o .obj .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+#>- 	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps kjs/Makefile
+#>+ 2
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps kjs/Makefile
+	cd $(top_srcdir) && perl admin/am_edit kjs/Makefile.in
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	done
+
+.c.o:
+	$(COMPILE) -c $<
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+	$(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+	-rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.c.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+#>- libkjs.la: $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+#>+ 2
+ at KDE_USE_CLOSURE_TRUE@libkjs.la: libkjs.la.closure $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+ at KDE_USE_CLOSURE_FALSE@libkjs.la: $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+	$(CXXLINK) -rpath $(libdir) $(libkjs_la_LDFLAGS) $(libkjs_la_OBJECTS) $(libkjs_la_LIBADD) $(LIBS)
+
+mostlyclean-checkPROGRAMS:
+
+clean-checkPROGRAMS:
+	-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+
+distclean-checkPROGRAMS:
+
+maintainer-clean-checkPROGRAMS:
+
+testkjs_static$(EXEEXT): $(testkjs_static_OBJECTS) $(testkjs_static_DEPENDENCIES)
+	@rm -f testkjs_static$(EXEEXT)
+	$(CXXLINK) $(testkjs_static_LDFLAGS) $(testkjs_static_OBJECTS) $(testkjs_static_LDADD) $(LIBS)
+
+testkjs$(EXEEXT): $(testkjs_OBJECTS) $(testkjs_DEPENDENCIES)
+	@rm -f testkjs$(EXEEXT)
+	$(CXXLINK) $(testkjs_LDFLAGS) $(testkjs_OBJECTS) $(testkjs_LDADD) $(LIBS)
+.cpp.o:
+	$(CXXCOMPILE) -c $<
+.cpp.obj:
+	$(CXXCOMPILE) -c `cygpath -w $<`
+.cpp.lo:
+	$(LTCXXCOMPILE) -c $<
+
+install-kjsincludeHEADERS: $(kjsinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(kjsincludedir)
+	@list='$(kjsinclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(kjsincludedir)/$$p"; \
+	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(kjsincludedir)/$$p; \
+	done
+
+uninstall-kjsincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	list='$(kjsinclude_HEADERS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(kjsincludedir)/$$p; \
+	done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = kjs
+
+distdir: $(DISTFILES)
+#>- 	@for file in $(DISTFILES); do \
+#>- 	  d=$(srcdir); \
+#>- 	  if test -d $$d/$$file; then \
+#>- 	    cp -pr $$/$$file $(distdir)/$$file; \
+#>- 	  else \
+#>- 	    test -f $(distdir)/$$file \
+#>- 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+#>- 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+#>- 	  fi; \
+#>- 	done
+#>+ 10
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-am
+
+install-data-am: install-kjsincludeHEADERS
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-libLTLIBRARIES uninstall-kjsincludeHEADERS
+uninstall: uninstall-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(kjsincludedir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-libLTLIBRARIES mostlyclean-compile \
+		mostlyclean-libtool mostlyclean-checkPROGRAMS \
+		mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+#>- clean-am:  clean-libLTLIBRARIES clean-compile clean-libtool \
+#>- 		clean-checkPROGRAMS clean-tags clean-generic \
+#>- 		mostlyclean-am
+#>+ 3
+clean-am: clean-closures clean-final   clean-libLTLIBRARIES clean-compile clean-libtool \
+		clean-checkPROGRAMS clean-tags clean-generic \
+		mostlyclean-am
+
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+distclean-am:  distclean-libLTLIBRARIES distclean-compile \
+		distclean-libtool distclean-checkPROGRAMS \
+		distclean-tags distclean-generic clean-am
+	-rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am:  maintainer-clean-libLTLIBRARIES \
+		maintainer-clean-compile maintainer-clean-libtool \
+		maintainer-clean-checkPROGRAMS maintainer-clean-tags \
+		maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool mostlyclean-checkPROGRAMS \
+distclean-checkPROGRAMS clean-checkPROGRAMS \
+maintainer-clean-checkPROGRAMS uninstall-kjsincludeHEADERS \
+install-kjsincludeHEADERS tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+parser: $(srcdir)/grammar.y
+	cd $(srcdir); \
+	$(YACC) -d -p kjsyy grammar.y && mv grammar.tab.c grammar.cpp; \
+	if test -f grammar.tab.h; then \
+	if cmp -s grammar.tab.h grammar.h; then rm -f grammar.tab.h; \
+	else mv grammar.tab.h grammar.h; fi \
+	else :; fi
+
+debugger: $(libkjs_la_SOURCES) $(kjsinclude_HEADERS) $(noinst_HEADERS)
+	$(MAKE) DEFS="-DKJS_DEBUGGER $(DEFS)" libkjs.la
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 8
+libkjs.la.closure: $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+	@echo "int main() {return 0;}" > libkjs_la_closure.cpp
+	@$(LTCXXCOMPILE) -c libkjs_la_closure.cpp
+	@$(CXXLINK) libkjs_la_closure.lo $(libkjs_la_LDFLAGS) $(libkjs_la_OBJECTS) $(libkjs_la_LIBADD) $(LIBS)
+	@rm -f libkjs_la_closure.* libkjs.la.closure
+	@echo "timestamp" > libkjs.la.closure
+
+
+#>+ 3
+clean-closures:
+	-rm -f  libkjs.la.closure
+
+#>+ 2
+docs-am:
+
+#>+ 5
+force-reedit:
+		cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps kjs/Makefile
+	cd $(top_srcdir) && perl admin/am_edit kjs/Makefile.in
+
+
+#>+ 11
+libkjs_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/kjs.cpp $(srcdir)/grammar.cpp $(srcdir)/lexer.cpp $(srcdir)/nodes.cpp $(srcdir)/object.cpp $(srcdir)/operations.cpp $(srcdir)/ustring.cpp $(srcdir)/function.cpp $(srcdir)/types.cpp $(srcdir)/lookup.cpp $(srcdir)/internal.cpp $(srcdir)/regexp.cpp $(srcdir)/global_object.cpp $(srcdir)/math_object.cpp $(srcdir)/bool_object.cpp $(srcdir)/object_object.cpp $(srcdir)/error_object.cpp $(srcdir)/array_object.cpp $(srcdir)/string_object.cpp $(srcdir)/number_object.cpp $(srcdir)/date_object.cpp $(srcdir)/regexp_object.cpp $(srcdir)/collector.cpp $(srcdir)/function_object.cpp $(srcdir)/debugger.cpp  
+	@echo 'creating libkjs_la.all_cpp.cpp ...'; \
+	rm -f libkjs_la.all_cpp.files libkjs_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libkjs_la.all_cpp.final; \
+	for file in kjs.cpp grammar.cpp lexer.cpp nodes.cpp object.cpp operations.cpp ustring.cpp function.cpp types.cpp lookup.cpp internal.cpp regexp.cpp global_object.cpp math_object.cpp bool_object.cpp object_object.cpp error_object.cpp array_object.cpp string_object.cpp number_object.cpp date_object.cpp regexp_object.cpp collector.cpp function_object.cpp debugger.cpp ; do \
+	  echo "#include \"$$file\"" >> libkjs_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libkjs_la.all_cpp.final; \
+	done; \
+	cat libkjs_la.all_cpp.final libkjs_la.all_cpp.files  > libkjs_la.all_cpp.cpp; \
+	rm -f libkjs_la.all_cpp.final libkjs_la.all_cpp.files
+
+#>+ 11
+testkjs.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/testkjs.cpp  
+	@echo 'creating testkjs.all_cpp.cpp ...'; \
+	rm -f testkjs.all_cpp.files testkjs.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> testkjs.all_cpp.final; \
+	for file in testkjs.cpp ; do \
+	  echo "#include \"$$file\"" >> testkjs.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> testkjs.all_cpp.final; \
+	done; \
+	cat testkjs.all_cpp.final testkjs.all_cpp.files  > testkjs.all_cpp.cpp; \
+	rm -f testkjs.all_cpp.final testkjs.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libkjs_la.all_cpp.cpp testkjs.all_cpp.cpp
+
+#>+ 2
+final:
+	$(MAKE) libkjs_la_OBJECTS="$(libkjs_la_final_OBJECTS)" all-am
+#>+ 2
+no-final:
+	$(MAKE) libkjs_la_OBJECTS="$(libkjs_la_nofinal_OBJECTS)" all-am
+#>+ 3
+cvs-clean:
+	$(MAKE) -f $(top_srcdir)/admin/Makefile.common cvs-clean
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
diff --git a/WebCore/khtml/css/csshelper.cpp b/WebCore/khtml/css/csshelper.cpp
index 3de37e7..00522a3 100644
--- a/WebCore/khtml/css/csshelper.cpp
+++ b/WebCore/khtml/css/csshelper.cpp
@@ -130,9 +130,7 @@ DOMString khtml::parseURL(const DOMString &url)
 
     int nl = 0;
     for(int k = o; k < o+l; k++)
-        if(i->s[k] == '\\')
-            j->s[nl++] = '/';
-        else if(i->s[k].unicode() > '\r')
+        if(i->s[k].unicode() > '\r')
             j->s[nl++] = i->s[k];
 
     j->l = nl;
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 346db49..d0e34e1 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -414,6 +414,9 @@ StyleBaseImpl::parseSelector2(const QChar *curP, const QChar *endP,
 #endif
                     cs->match = CSSSelector::Set;
                     endVal = closebracket + 1;
+                    // ### fixme we ignore everything after [..]
+                    if( endVal == endP )
+                        endVal = 0;
                 }
                 else
                 {
@@ -1587,7 +1590,7 @@ bool StyleBaseImpl::parseValue( const QChar *curP, const QChar *endP, int propId
 		value = khtml::parseURL(value);
             	parsedValue = new CSSImageValueImpl(value, baseUrl(), this);
 #ifdef CSS_DEBUG
-		kdDebug( 6080 ) << "image, url=" << value.string() << " base=" << baseUrl().string() << endl;
+		kdDebug( 6080 ) << "image, url=" << value.string() << " base=" << baseURL().string() << endl;
 #endif
 	      }
 	    }
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index eca3584..11001e9 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -62,9 +62,7 @@ using namespace DOM;
 #include <qintcache.h>
 
 CSSStyleSelectorList *CSSStyleSelector::defaultStyle = 0;
-CSSStyleSelectorList *CSSStyleSelector::userStyle = 0;
 CSSStyleSheetImpl *CSSStyleSelector::defaultSheet = 0;
-CSSStyleSheetImpl *CSSStyleSelector::userSheet = 0;
 
 enum PseudoState { PseudoUnknown, PseudoNone, PseudoLink, PseudoVisited};
 static PseudoState pseudoState;
@@ -84,6 +82,17 @@ CSSStyleSelector::CSSStyleSelector(DocumentImpl * doc)
     selectors = 0;
     selectorCache = 0;
     properties = 0;
+    userStyle = 0;
+    userSheet = 0;
+
+
+    if ( !doc->userStyleSheet().isEmpty() ) {
+        userSheet = new DOM::CSSStyleSheetImpl((DOM::CSSStyleSheetImpl *)0);
+        userSheet->parseString( DOMString( doc->userStyleSheet() ) );
+
+        userStyle = new CSSStyleSelectorList();
+        userStyle->append(userSheet);
+    }
 
     // add stylesheets from document
     authorStyle = new CSSStyleSelectorList();
@@ -124,6 +133,8 @@ CSSStyleSelector::~CSSStyleSelector()
 {
     clearLists();
     delete authorStyle;
+    delete userStyle;
+    delete userSheet;
 }
 
 void CSSStyleSelector::addSheet(StyleSheetImpl *sheet)
@@ -131,18 +142,6 @@ void CSSStyleSelector::addSheet(StyleSheetImpl *sheet)
     authorStyle->append(sheet);
 }
 
-void CSSStyleSelector::setUserStyle(const DOM::DOMString &str)
-{
-    if(userStyle) delete userStyle;
-    if(userSheet) delete userSheet;
-
-    userSheet = new DOM::CSSStyleSheetImpl((DOM::CSSStyleSheetImpl *)0);
-    userSheet->parseString( str );
-
-    userStyle = new CSSStyleSelectorList();
-    userStyle->append(userSheet);
-}
-
 void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
 {
     if(defaultStyle) return;
@@ -172,17 +171,12 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
 void CSSStyleSelector::clear()
 {
     delete defaultStyle;
-    delete userStyle;
     delete defaultSheet;
-    delete userSheet;
     defaultStyle = 0;
-    userStyle = 0;
     defaultSheet = 0;
-    userSheet = 0;
 }
 
 static bool strictParsing;
-//static QList<RenderStyle>* styleElementCache = 0;
 
 RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e, int state)
 {
@@ -266,6 +260,7 @@ RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e, int state)
             while( ordprop ) {
                 RenderStyle *pseudoStyle;
                 pseudoStyle = style->addPseudoStyle(ordprop->pseudoId);
+
                 if ( pseudoStyle )
                     applyRule(pseudoStyle, ordprop->prop, e);
                 ordprop = pseudoProps->next();
diff --git a/WebCore/khtml/css/cssstyleselector.h b/WebCore/khtml/css/cssstyleselector.h
index c12c52a..c920be6 100644
--- a/WebCore/khtml/css/cssstyleselector.h
+++ b/WebCore/khtml/css/cssstyleselector.h
@@ -116,9 +116,8 @@ namespace khtml
 	virtual ~CSSStyleSelector();
 	
 	void addSheet(DOM::StyleSheetImpl *sheet);
-	
+        
 	static void loadDefaultStyle(const KHTMLSettings *s = 0);
-	static void setUserStyle(const DOM::DOMString &sheet);
 	static void clear();
 	
 	virtual RenderStyle *styleForElement(DOM::ElementImpl *e, int state = None );
@@ -146,9 +145,9 @@ namespace khtml
 	
 	static DOM::CSSStyleSheetImpl *defaultSheet;
 	static CSSStyleSelectorList *defaultStyle;
-	static DOM::CSSStyleSheetImpl *userSheet;
-	static CSSStyleSelectorList *userStyle;
 	CSSStyleSelectorList *authorStyle;
+        CSSStyleSelectorList *userStyle;
+        DOM::CSSStyleSheetImpl *userSheet;
 	
     public: // we need to make the enum public for SelectorCache
 	enum SelectorState {
@@ -168,7 +167,6 @@ namespace khtml
 	unsigned int selectors_size;
 	DOM::CSSSelector **selectors;
 	SelectorCache *selectorCache;
-	
 	unsigned int properties_size;
 	CSSOrderedProperty **properties;
 	QArray<CSSOrderedProperty> inlineProps;
@@ -193,7 +191,7 @@ namespace khtml
 	{
 	    priority = (!first << 30) | (source << 24) | specificity;
 	}
-	
+
 	DOM::CSSProperty *prop;
 	RenderStyle::PseudoId pseudoId;
 	unsigned int selector;
diff --git a/WebCore/khtml/dom/dom_string.cpp b/WebCore/khtml/dom/dom_string.cpp
index 9b8775e..c3c5193 100644
--- a/WebCore/khtml/dom/dom_string.cpp
+++ b/WebCore/khtml/dom/dom_string.cpp
@@ -289,6 +289,8 @@ bool DOM::operator==( const DOMString &a, const QString &b )
 
 bool DOM::operator==( const DOMString &a, const char *b )
 {
+    if ( !b ) return a.isNull();
+    if ( a.isNull() ) return false;
     unsigned int blen = strlen(b);
     if(a.length() != blen) return false;
 
diff --git a/WebCore/khtml/ecma/kjs_binding.cpp b/WebCore/khtml/ecma/kjs_binding.cpp
index f30ce1e..0a67abf 100644
--- a/WebCore/khtml/ecma/kjs_binding.cpp
+++ b/WebCore/khtml/ecma/kjs_binding.cpp
@@ -1,3 +1,4 @@
+// -*- c-basic-offset: 2 -*-
 /*
  *  This file is part of the KDE libraries
  *  Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
diff --git a/WebCore/khtml/ecma/kjs_html.cpp b/WebCore/khtml/ecma/kjs_html.cpp
index c7cd8a6..19e9345 100644
--- a/WebCore/khtml/ecma/kjs_html.cpp
+++ b/WebCore/khtml/ecma/kjs_html.cpp
@@ -355,6 +355,8 @@ KJSO KJS::HTMLElement::tryGet(const UString &p) const
       else if (p == "link")            return getString(body.link());
       else if (p == "text")            return getString(body.text());
       else if (p == "vLink")           return getString(body.vLink());
+      else if (p == "scrollHeight" )   return Number(body.ownerDocument().view() ? body.ownerDocument().view()->contentsHeight() : 0);
+      else if (p == "scrollWidth" )    return Number(body.ownerDocument().view() ? body.ownerDocument().view()->contentsWidth() : 0);
     }
     break;
     case ID_FORM: {
diff --git a/WebCore/khtml/ecma/kjs_traversal.cpp b/WebCore/khtml/ecma/kjs_traversal.cpp
index 4a8044c..e58886b 100644
--- a/WebCore/khtml/ecma/kjs_traversal.cpp
+++ b/WebCore/khtml/ecma/kjs_traversal.cpp
@@ -302,7 +302,7 @@ DOM::NodeFilter KJS::toNodeFilter(const KJSO& obj)
 
 // -------------------------------------------------------------------------
 
-JSNodeFilter::JSNodeFilter(KJSO _filter) : CustomNodeFilter()
+JSNodeFilter::JSNodeFilter(KJSO _filter) : DOM::CustomNodeFilter()
 {
     filter = _filter;
 }
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index 99f03b1..a565edc 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -263,14 +263,19 @@ void HTMLFrameElementImpl::parseAttribute(AttrImpl *attr)
 
 void HTMLFrameElementImpl::attach()
 {
+    setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
+
     KHTMLView* w = ownerDocument()->view();
     // limit to how deep we can nest frames
     KHTMLPart *part = w->part();
     int depth = 0;
     while ((part = part->parentPart()))
         depth++;
-    if (depth > 10)
+
+    if (depth > 6 || url.isNull()) {
+        style()->setDisplay( NONE );
         return;
+    }
 
     // inherit default settings from parent frameset
     HTMLElementImpl* node = static_cast<HTMLElementImpl*>(parentNode());
@@ -286,7 +291,6 @@ void HTMLFrameElementImpl::attach()
         node = static_cast<HTMLElementImpl*>(node->parentNode());
     }
 
-    setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
     khtml::RenderObject *r = _parent->renderer();
 
     // ignore display: none for this element!
@@ -654,16 +658,18 @@ void HTMLIFrameElementImpl::parseAttribute(AttrImpl *attr )
 
 void HTMLIFrameElementImpl::attach()
 {
+  setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
+
   KHTMLView* w = ownerDocument()->view();
   // limit to how deep we can nest frames
   KHTMLPart *part = w->part();
   int depth = 0;
   while ((part = part->parentPart()))
     depth++;
-  if (depth > 10)
-    return;
-
-  setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
+  if (depth > 6) {
+      style()->setDisplay( NONE );
+      return;
+  }
 
   khtml::RenderObject *r = _parent->renderer();
 
diff --git a/WebCore/khtml/html/html_formimpl.cpp b/WebCore/khtml/html/html_formimpl.cpp
index 2379b94..4fc14ea 100644
--- a/WebCore/khtml/html/html_formimpl.cpp
+++ b/WebCore/khtml/html/html_formimpl.cpp
@@ -1274,6 +1274,7 @@ void HTMLInputElementImpl::defaultEventHandler(EventImpl *evt)
             dispatchUIEvent(EventImpl::DOMACTIVATE_EVENT,2);
         else
             dispatchUIEvent(EventImpl::DOMACTIVATE_EVENT,1);
+	me->setDefaultHandled();
     }
 
     if ((evt->id() == EventImpl::DOMACTIVATE_EVENT) &&
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index ee106ea..066dfcd 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -306,7 +306,7 @@ void HTMLMetaElementImpl::attach()
                 ownerDocument()->docLoader()->setExpireDate(expire_date);
         }
     }
-    else if(strcasecmp(_equiv, "pragma") == 0 && !_content.isNull())
+    else if( (strcasecmp(_equiv, "pragma") == 0 ||  strcasecmp(_equiv, "cache-control") == 0 ) && !_content.isNull() )
     {
         QString str = _content.string().lower().stripWhiteSpace();
         KURL url = v->part()->url();
diff --git a/WebCore/khtml/html/htmlparser.cpp b/WebCore/khtml/html/htmlparser.cpp
index b3cd16e..47342aa 100644
--- a/WebCore/khtml/html/htmlparser.cpp
+++ b/WebCore/khtml/html/htmlparser.cpp
@@ -190,11 +190,13 @@ void KHTMLParser::parseToken(Token *t)
       kdDebug( 6035 ) << "Unknown tag!! tagID = " << t->id << endl;
       return;
     }
-    if(discard_until)
-    {
+    if(discard_until) {
         if(t->id == discard_until)
             discard_until = 0;
-        return;
+
+        // do not skip </iframe>
+        if ( discard_until || current->id() + ID_CLOSE_TAG != t->id )
+            return;
     }
 
 #ifdef PARSER_DEBUG
@@ -559,7 +561,7 @@ bool KHTMLParser::insertNode(NodeImpl *n)
                    ( !checkChild( ID_TR, id ) && ( node->id() == ID_THEAD || node->id() == ID_TBODY || node->id() == ID_TFOOT ) &&
                      parent->id() == ID_TABLE ) )
                 {
-                    node = parentparent;
+                    node = ( node->id() == ID_TR ) ? parentparent : parent;
                     NodeImpl *parent = node->parentNode();
                     int exceptioncode = 0;
                     NodeImpl *container = new HTMLGenericElementImpl( document, ID__KONQBLOCK );
@@ -746,6 +748,7 @@ NodeImpl *KHTMLParser::getElement(Token* t)
         // a bit a special case, since the frame is inlined...
     case ID_IFRAME:
         n = new HTMLIFrameElementImpl(document);
+        discard_until = ID_IFRAME+ID_CLOSE_TAG;
         break;
 
 // form elements
@@ -876,7 +879,6 @@ NodeImpl *KHTMLParser::getElement(Token* t)
 
 // anchor
     case ID_A:
-        popBlock(ID_A);
         n = new HTMLAnchorElementImpl(document);
         break;
 
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index 12ef9cd..cb93849 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -58,10 +58,11 @@
 using namespace khtml;
 
 static const QChar commentStart [] = { '<','!','-','-', QChar::null };
-static const QChar scriptEnd [] = { '<','/','s','c','r','i','p','t',' ','>', QChar::null };
-static const QChar styleEnd [] = { '<','/','s','t','y','l','e', ' ','>', QChar::null };
-static const QChar listingEnd [] = { '<','/','l','i','s','t','i','n','g',' ','>', QChar::null };
-static const QChar textareaEnd [] = { '<','/','t','e','x','t','a','r','e','a',' ','>', QChar::null };
+
+static const char scriptEnd [] = "</script";
+static const char listingEnd [] = "</listing";
+static const char styleEnd [] =  "</style";
+static const char textareaEnd [] = "</textarea";
 
 #define KHTML_ALLOC_QCHAR_VEC( N ) (QChar*) malloc( sizeof(QChar)*( N ) )
 #define KHTML_REALLOC_QCHAR_VEC(P, N ) (QChar*) P = realloc(p, sizeof(QChar)*( N ))
@@ -102,7 +103,7 @@ HTMLTokenizer::HTMLTokenizer(DOM::DocumentPtr *_doc, KHTMLView *_view)
     view = _view;
     buffer = 0;
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
     charsets = KGlobal::charsets();
     parser = new KHTMLParser(_view, _doc);
     cachedScript = 0;
@@ -118,7 +119,7 @@ HTMLTokenizer::HTMLTokenizer(DOM::DocumentPtr *_doc, DOM::DocumentFragmentImpl *
     view = 0;
     buffer = 0;
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
     charsets = KGlobal::charsets();
     parser = new KHTMLParser( i, _doc );
     cachedScript = 0;
@@ -146,7 +147,7 @@ void HTMLTokenizer::reset()
     if ( scriptCode )
         KHTML_DELETE_QCHAR_VEC(scriptCode);
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
 
     currToken.reset();
 }
@@ -186,7 +187,7 @@ void HTMLTokenizer::begin()
     brokenComments = false;
 }
 
-void HTMLTokenizer::addListing(DOMStringIt list)
+void HTMLTokenizer::processListing(DOMStringIt list)
 {
     bool old_pre = pre;
     // This function adds the listing 'list' as
@@ -254,9 +255,7 @@ void HTMLTokenizer::addListing(DOMStringIt list)
     }
 
     if ((pending == SpacePending) || (pending == TabPending))
-    {
         addPending();
-    }
     pending = NonePending;
 
     processToken();
@@ -265,32 +264,56 @@ void HTMLTokenizer::addListing(DOMStringIt list)
     pre = old_pre;
 }
 
-void HTMLTokenizer::parseListing( DOMStringIt &src)
+void HTMLTokenizer::parseSpecial(DOMStringIt &src, bool begin)
 {
-    // Famous last words: I'm 99.9% sure.
-    assert( !Entity );
-
-    // We are inside a <script>, <style>, <textarea> . Look for the end tag
-    // which is either </script>, </style> , </textarea> or -->
-    // otherwise print out every received character
-
-#ifdef TOKEN_DEBUG
-    kdDebug( 6036 ) << "HTMLTokenizer::parseListing()" << endl;
-#endif
-
-    bool doScriptExec = false;
-    while ( src.length() )
-    {
-        // do we need to enlarge the buffer?
-        checkBuffer();
+    assert( textarea || !Entity );
+    assert( !tag );
+    assert( listing+textarea+style+script == 1 );
+
+    if ( begin ) {
+        if ( script )        { searchStopper = scriptEnd;   }
+        else if ( style )    { searchStopper = styleEnd;    }
+        else if ( textarea ) { searchStopper = textareaEnd; }
+        else if ( listing )  { searchStopper = listingEnd;  }
+        searchStopperLen = strlen( searchStopper );
+    }
+    if ( comment ) parseComment( src );
 
-        // Allocate memory to store the script. We will write maximal
-        // 10 characers.
+    while ( src.length() ) {
         checkScriptBuffer();
-
-        char ch = src->latin1();
-
-        if ( !escaped && !src.escaped() && script ) {
+        unsigned char ch = src->latin1();
+        if ( !scriptCodeResync && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && QConstString( scriptCode+scriptCodeSize-3, 3 ).string() == "<!-" ) {
+            comment = true;
+            parseComment( src );
+            continue;
+        }
+        if ( scriptCodeResync && !tquote && ( ch == '>' ) ) {
+            ++src;
+            scriptCodeSize = scriptCodeResync-1;
+            scriptCodeResync = 0;
+            scriptCode[ scriptCodeSize ] = scriptCode[ scriptCodeSize + 1 ] = 0;
+            if ( script )
+                scriptHandler();
+            else {
+                processListing(DOMStringIt(scriptCode, scriptCodeSize));
+                if ( style )         { currToken.id = ID_STYLE + ID_CLOSE_TAG; }
+                else if ( textarea ) { currToken.id = ID_TEXTAREA + ID_CLOSE_TAG; }
+                else if ( listing )  { currToken.id = ID_LISTING + ID_CLOSE_TAG; }
+                processToken();
+                style = script = style = textarea = listing = false;
+                scriptCodeSize = scriptCodeResync = 0;
+            }
+            return;
+        }
+        // possible end of tagname, lets check.
+        if ( !scriptCodeResync && !escaped && !src.escaped() && ( ch == '>' || ch == '/' || ch <= ' ' ) && ch &&
+             scriptCodeSize >= searchStopperLen &&
+             !QConstString( scriptCode+scriptCodeSize-searchStopperLen, searchStopperLen+1 ).string().find( searchStopper, 0, false )) {
+            scriptCodeResync = scriptCodeSize-searchStopperLen+1;
+            tquote = NoQuote;
+            continue;
+        }
+        if ( scriptCodeResync && !escaped ) {
             if(ch == '\"')
                 tquote = (tquote == NoQuote) ? DoubleQuote : ((tquote == SingleQuote) ? SingleQuote : NoQuote);
             else if(ch == '\'')
@@ -298,150 +321,8 @@ void HTMLTokenizer::parseListing( DOMStringIt &src)
             else if (tquote != NoQuote && (ch == '\r' || ch == '\n'))
                 tquote = NoQuote;
         }
-
-        if ( !escaped && !src.escaped() && ( ch == '>' ) &&
-             ( ( searchFor[ searchCount ] == '>' && tquote == NoQuote ) || searchFor[searchCount] == ' '))
-        {
-            ++src;
-            searchCount = 0;
-            scriptCode[ scriptCodeSize ] = 0;
-            scriptCode[ scriptCodeSize + 1 ] = 0;
-            if (script) {
-                if (!scriptSrc.isEmpty()) {
-                    // forget what we just got; load from src url instead
-                    cachedScript = parser->doc()->docLoader()->requestScript(scriptSrc, parser->doc()->baseURL(), scriptSrcCharset);
-                    scriptSrc="";
-                }
-                else {
-#ifdef TOKEN_DEBUG
-                    kdDebug( 6036 ) << "---START SCRIPT---" << endl;
-                    kdDebug( 6036 ) << QString(scriptCode, scriptCodeSize) << endl;
-                    kdDebug( 6036 ) << "---END SCRIPT---" << endl;
-#endif
-                    // Parse scriptCode containing <script> info
-                    doScriptExec = true;
-                }
-            }
-            else if (style)
-            {
-#ifdef TOKEN_DEBUG
-                kdDebug( 6036 ) << "---START STYLE---" << endl;
-                kdDebug( 6036 ) << QString(scriptCode, scriptCodeSize) << endl;
-                kdDebug( 6036 ) << "---END STYLE---" << endl;
-#endif
-            }
-            addListing(DOMStringIt(scriptCode, scriptCodeSize));
-
-            if(script)
-                currToken.id = ID_SCRIPT + ID_CLOSE_TAG;
-            else if(style)
-                currToken.id = ID_STYLE + ID_CLOSE_TAG;
-            else if (textarea)
-                currToken.id = ID_TEXTAREA + ID_CLOSE_TAG;
-            else
-                currToken.id = ID_LISTING + ID_CLOSE_TAG;
-            processToken();
-            QString prependingSrc;
-
-            if (cachedScript) {
-//                 qDebug( "cachedscript extern!" );
-//                 qDebug( "src: *%s*", QString( src.current(), src.length() ).latin1() );
-//                 qDebug( "pending: *%s*", pendingSrc.latin1() );
-                pendingSrc.prepend( QString(src.current(), src.length() ) );
-                _src = QString::null;
-                src = DOMStringIt(_src);
-                scriptCodeSize = 0;
-                cachedScript->ref(this);
-                // will be 0 if script was already loaded and ref() executed it
-                if (cachedScript)
-                    loadingExtScript = true;
-            }
-            else if (view && doScriptExec && javascript && !parser->skipMode()) {
-                if ( !m_executingScript )
-                    pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
-                else
-                    prependingSrc = QString( src.current(), src.length() ); // deep copy
-
-                _src = QString::null;
-                src = DOMStringIt( _src );
-                m_executingScript++;
-                script = false;
-                QString exScript( scriptCode, scriptCodeSize ); // deep copy
-                scriptCodeSize = 0;
-		view->part()->executeScript(exScript);
-                script = true;
-                m_executingScript--;
-            }
-            script = style = listing = textarea = false;
-            scriptCodeSize = 0;
-            if ( !m_executingScript && !loadingExtScript )
-                addPendingSource();
-            else if ( !prependingSrc.isEmpty() )
-                write( prependingSrc, false );
-
-
-            return; // Finished parsing script/style/listing
-        }
-        // Find out wether we see an end tag without looking at
-        // any other then the current character, since further characters
-        // may still be on their way thru the web!
-        else if ( searchCount > 0 )
-        {
-            const QChar& cmp = *src;
-              kdDebug(6050) << "KHTMLPart::checkEmitLoadEvent " << this << endl;
-
-            if (!escaped && !src.escaped() &&
-                ( cmp <= ' ' || cmp == '>' ) && searchFor[ searchCount ] == ' ') {
-                searchBuffer[ searchCount++] = cmp;
-                ++src;
-                continue;
-            }
-            // </script> can be in a quoted section! ( IE 5.5 )
-            else if (!escaped && !src.escaped() &&
-                searchFor[searchCount] != QChar::null && cmp.lower() == searchFor[ searchCount ] )
-            {
-                searchBuffer[ searchCount++ ] = cmp;
-                ++src;
-                continue;
-            }
-            // be tolerant: skip garbage before the ">", i.e "</script foo>"
-            else if ( ( !script || ( tquote == NoQuote && cmp != '>' ) || ( tquote != NoQuote ) ) &&
-                      searchFor[searchCount].latin1() == '>' )
-            {
-                ++src;
-                continue;
-            }
-            // We were wrong => print all buffered characters and the current one;
-            else
-            {
-                searchBuffer[ searchCount ] = 0;
-                DOMStringIt pit(searchBuffer,searchCount);
-                while (pit.length()) {
-                    if (textarea && *pit == '&') {
-                        QChar *scriptCodeDest = scriptCode+scriptCodeSize;
-                        ++pit;
-                        parseEntity(pit,scriptCodeDest,true);
-                        scriptCodeSize = scriptCodeDest-scriptCode;
-                    }
-                    else {
-                        scriptCode[ scriptCodeSize++ ] = *pit;
-                        ++pit;
-                    }
-                }
-                searchCount = 0;
-                // no continue here!
-            }
-        }
-        // Is this perhaps the start of the </script> or </style> tag?
-        else if ( !escaped && !src.escaped() && ch == '<' )
-        {
-            searchCount = 1;
-            searchBuffer[ 0 ] = *src;
-            ++src;
-            continue;
-        }
-
-        if (textarea && !escaped && !src.escaped() && ch == '&') {
+        escaped = ( !escaped && ch == '\\' );
+        if (!scriptCodeResync && textarea && !src.escaped() && ch == '&') {
             QChar *scriptCodeDest = scriptCode+scriptCodeSize;
             ++src;
             parseEntity(src,scriptCodeDest,true);
@@ -449,56 +330,103 @@ void HTMLTokenizer::parseListing( DOMStringIt &src)
         }
         else {
             scriptCode[ scriptCodeSize++ ] = *src;
-            if ( script && !escaped && ch == '\\' )
-                escaped = true;
-            else
-                escaped = false;
-
             ++src;
         }
     }
 }
 
-void HTMLTokenizer::parseScript(DOMStringIt &src)
+void HTMLTokenizer::scriptHandler()
 {
-    parseListing(src);
+    // We are inside a <script>
+    bool doScriptExec = false;
+    if (!scriptSrc.isEmpty()) {
+        // forget what we just got; load from src url instead
+        cachedScript = parser->doc()->docLoader()->requestScript(scriptSrc, parser->doc()->baseURL(), scriptSrcCharset);
+        scriptSrc="";
+    }
+    else {
+#ifdef TOKEN_DEBUG
+        kdDebug( 6036 ) << "---START SCRIPT---" << endl;
+        kdDebug( 6036 ) << QString(scriptCode, scriptCodeSize) << endl;
+        kdDebug( 6036 ) << "---END SCRIPT---" << endl;
+#endif
+        // Parse scriptCode containing <script> info
+        doScriptExec = true;
+    }
+    processListing(DOMStringIt(scriptCode, scriptCodeSize));
+    currToken.id = ID_SCRIPT + ID_CLOSE_TAG;
+    processToken();
+
+    QString prependingSrc;
+    if (cachedScript) {
+//                 qDebug( "cachedscript extern!" );
+//                 qDebug( "src: *%s*", QString( src.current(), src.length() ).latin1() );
+//                 qDebug( "pending: *%s*", pendingSrc.latin1() );
+        pendingSrc.prepend( QString(src.current(), src.length() ) );
+        _src = QString::null;
+        src = DOMStringIt(_src);
+        scriptCodeSize = scriptCodeResync = 0;
+        cachedScript->ref(this);
+        // will be 0 if script was already loaded and ref() executed it
+        if (cachedScript)
+            loadingExtScript = true;
+    }
+    else if (view && doScriptExec && javascript && !parser->skipMode()) {
+        if ( !m_executingScript )
+            pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
+        else
+            prependingSrc = QString( src.current(), src.length() ); // deep copy
+
+        _src = QString::null;
+        src = DOMStringIt( _src );
+        QString exScript( scriptCode, scriptCodeSize ); // deep copy
+        scriptCodeSize = scriptCodeResync = 0;
+        scriptExecution( exScript );
+    }
+    script = false;
+    scriptCodeSize = scriptCodeResync = 0;
+    if ( !m_executingScript && !loadingExtScript )
+        addPendingSource();
+    else if ( !prependingSrc.isEmpty() )
+        write( prependingSrc, false );
 }
-void HTMLTokenizer::parseStyle(DOMStringIt &src)
+
+void HTMLTokenizer::scriptExecution( const QString& str )
 {
-    parseListing(src);
+    bool oldscript = script;
+    m_executingScript++;
+    script = false;
+    view->part()->executeScript(str);
+    m_executingScript--;
+    script = oldscript;
 }
 
 void HTMLTokenizer::parseComment(DOMStringIt &src)
 {
-#ifdef TOKEN_DEBUG
-    kdDebug( 6036 ) << "HTMLTokenizer::parseComment()" << endl;
-#endif
-
     checkScriptBuffer(src.length());
-    while ( src.length() )
-    {
+    while ( src.length() ) {
+        scriptCode[ scriptCodeSize++ ] = *src;
         if (src->unicode() == '>' &&
-            ( brokenComments ||
-              ( scriptCodeSize >= 2 && scriptCode[scriptCodeSize-2] == '-' &&
-                scriptCode[scriptCodeSize-1] == '-' ) ) )
-        {
+            ( ( brokenComments && !( script || style || textarea || listing ) ) ||
+              ( scriptCodeSize > 2 && scriptCode[scriptCodeSize-3] == '-' &&
+                scriptCode[scriptCodeSize-2] == '-' ) ) ) {
             ++src;
+            if ( !( script || listing || textarea || style) ) {
 #ifdef COMMENTS_IN_DOM
-            checkScriptBuffer();
-            scriptCode[ scriptCodeSize ] = 0;
-            scriptCode[ scriptCodeSize + 1 ] = 0;
-            currToken.id = ID_COMMENT;
-            addListing(DOMStringIt(scriptCode, scriptCodeSize - 2));
-            processToken();
-            currToken.id = ID_COMMENT + ID_CLOSE_TAG;
-            processToken();
+                checkScriptBuffer();
+                scriptCode[ scriptCodeSize ] = 0;
+                scriptCode[ scriptCodeSize + 1 ] = 0;
+                currToken.id = ID_COMMENT;
+                processListing(DOMStringIt(scriptCode, scriptCodeSize - 2));
+                processToken();
+                currToken.id = ID_COMMENT + ID_CLOSE_TAG;
+                processToken();
 #endif
+                scriptCodeSize = 0;
+            }
             comment = false;
-            scriptCodeSize = 0;
             return; // Finished parsing comment
         }
-
-        scriptCode[ scriptCodeSize++ ] = *src;
         ++src;
     }
 }
@@ -508,7 +436,7 @@ void HTMLTokenizer::parseProcessingInstruction(DOMStringIt &src)
     char oldchar = 0;
     while ( src.length() )
     {
-        char chbegin = src->latin1();
+        unsigned char chbegin = src->latin1();
         if(chbegin == '\'') {
             tquote = tquote == SingleQuote ? NoQuote : SingleQuote;
         }
@@ -539,7 +467,7 @@ void HTMLTokenizer::parseText(DOMStringIt &src)
         checkBuffer();
 
         // ascii is okay because we only do ascii comparisons
-        char chbegin = src->latin1();
+        unsigned char chbegin = src->latin1();
 
         if (skipLF && ( chbegin != '\n' ))
         {
@@ -769,7 +697,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
             unsigned int ll = kMin(src.length(), CBUFLEN-cBufferPos);
             while(ll--) {
                 ushort curchar = *src;
-                if(curchar <= ' ' || curchar == '>') {
+                if(curchar <= ' ' || curchar == '>' ) {
                     finish = true;
                     break;
                 }
@@ -833,7 +761,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
             while(src.length()) {
                 curchar = *src;
                 if(curchar > ' ') {
-                    if(curchar == '>')
+                    if(curchar == '>' || curchar == '/')
                         tag = SearchEnd;
                     else if(atespace && (curchar == '\'' || curchar == '"'))
                     {
@@ -900,6 +828,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 qDebug("SearchEqual");
 #endif
             ushort curchar;
+            bool atespace = false;
             while(src.length()) {
                 curchar = src->unicode();
                 if(curchar > ' ') {
@@ -910,6 +839,12 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         tag = SearchValue;
                         ++src;
                     }
+                    else if(atespace && (curchar == '\'' || curchar == '"'))
+                    {
+                        tag = SearchValue;
+                        *dest++ = 0;
+                        attrName = QString::null;
+                    }
                     else {
                         AttrImpl* a = 0;
                         if(*buffer)
@@ -927,6 +862,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                     }
                     break;
                 }
+                atespace = true;
                 ++src;
             }
             break;
@@ -1022,7 +958,8 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         parseEntity(src, dest, true);
                         break;
                     }
-                    if ( curchar <= ' ' || curchar == '>')
+                    // '/' does not delimit in IE!
+                    if ( curchar <= ' ' || curchar == '>' )
                     {
                         // no quotes. Every space means end of value
                         AttrImpl* a;
@@ -1079,7 +1016,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 scriptSrc = scriptSrcCharset = "";
                 if ( currToken.attrs && !parser->doc()->view()->part()->onlyLocalReferences()) {
                     if ( ( a = currToken.attrs->getIdItem( ATTR_SRC ) ) )
-                        scriptSrc = khtml::parseURL( a->value() ).string();
+                        scriptSrc = parser->doc()->view()->part()->completeURL(khtml::parseURL( a->value() ).string() ).url();
                     if ( ( a = currToken.attrs->getIdItem( ATTR_CHARSET ) ) )
                         scriptSrcCharset = a->value().string().stripWhiteSpace();
                     a = currToken.attrs->getIdItem( ATTR_LANGUAGE );
@@ -1123,44 +1060,20 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 pre = beginTag;
                 break;
             case ID_TEXTAREA:
-                if(beginTag) {
-                    listing = true;
-                    textarea = true;
-                    searchCount = 0;
-                    searchFor = textareaEnd;
-                    parseListing(src);
-                }
+                if(beginTag)
+                    parseSpecial(src, textarea = true );
                 break;
             case ID_SCRIPT:
-                if (beginTag) {
-#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
-                    kdDebug( 6036 ) << "start of script, token->id = " << currToken.id << endl;
-#endif
-                    script = true;
-                    searchCount = 0;
-                    searchFor = scriptEnd;
-                    tquote = NoQuote;
-                    parseScript(src);
-#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
-                    kdDebug( 6036 ) << "end of script" << endl;
-#endif
-                }
+                if (beginTag)
+                    parseSpecial(src, script = true);
                 break;
             case ID_STYLE:
-                if (beginTag) {
-                    style = true;
-                    searchCount = 0;
-                    searchFor = styleEnd;
-                    parseStyle(src);
-                }
+                if (beginTag)
+                    parseSpecial(src, style = true);
                 break;
             case ID_LISTING:
-                if (beginTag) {
-                    listing = true;
-                    searchCount = 0;
-                    searchFor = listingEnd;
-                    parseListing(src);
-                }
+                if (beginTag)
+                    parseSpecial(src, listing = true);
                 break;
             case ID_SELECT:
                 select = beginTag;
@@ -1241,7 +1154,7 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
     if ( !buffer )
         return;
 
-    if ( loadingExtScript || ( m_executingScript && appendData ) ) {
+    if ( appendData && (loadingExtScript || m_executingScript ) ) {
         // don't parse; we will do this later
         pendingSrc += str;
         return;
@@ -1264,14 +1177,16 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
     if ( src.length() ) {
         if (plaintext)
             parseText(src);
-        else if (comment)
-            parseComment(src);
         else if (script)
-            parseScript(src);
+            parseSpecial(src, false);
         else if (style)
-            parseStyle(src);
+            parseSpecial(src, false);
         else if (listing)
-            parseListing(src);
+            parseSpecial(src, false);
+        else if (textarea)
+            parseSpecial(src, false);
+        else if (comment)
+            parseComment(src);
         else if (processingInstruction)
             parseProcessingInstruction(src);
         else if (tag)
@@ -1292,6 +1207,9 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
             skipLF = false;
             ++src;
         }
+        else if ( Entity ) {
+            parseEntity( src, dest );
+        }
         else if ( plaintext ) {
             parseText( src );
         }
@@ -1470,7 +1388,9 @@ void HTMLTokenizer::end()
         return;
     }
 
-    processToken();
+    // parseTag is using the buffer for different matters
+    if ( !tag )
+        processToken();
 
     if(buffer)
         KHTML_DELETE_QCHAR_VEC(buffer);
@@ -1479,7 +1399,7 @@ void HTMLTokenizer::end()
         KHTML_DELETE_QCHAR_VEC(scriptCode);
 
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
     buffer = 0;
     emit finishedParsing();
 }
@@ -1494,15 +1414,23 @@ void HTMLTokenizer::finish()
         checkScriptBuffer();
         scriptCode[ scriptCodeSize ] = 0;
         scriptCode[ scriptCodeSize + 1 ] = 0;
-        int pos = QConstString(scriptCode, scriptCodeSize).string().find('>');
+        int pos;
         QString food;
-        food.setUnicode(scriptCode+pos+1, scriptCodeSize-pos-1); // deep copy
+        if ( script || style || textarea || listing ) {
+            pos = QConstString( scriptCode, scriptCodeSize ).string().find( searchStopper, 0, false );
+            if ( pos >= 0 )
+                food.setUnicode( scriptCode+pos, scriptCodeSize-pos ); // deep copy
+        }
+        else {
+            pos = QConstString(scriptCode, scriptCodeSize).string().find('>');
+            food.setUnicode(scriptCode+pos+1, scriptCodeSize-pos-1); // deep copy
+        }
         KHTML_DELETE_QCHAR_VEC(scriptCode);
         scriptCode = 0;
-        scriptCodeSize = scriptCodeMaxSize = 0;
-        script = style = listing = comment = textarea = false;
-        scriptCodeSize = 0;
-        write(food, true);
+        scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
+        comment = false;
+        if ( !food.isEmpty() )
+            write(food, true);
     }
     // this indicates we will not recieve any more data... but if we are waiting on
     // an external script to load, we can't finish parsing until that is done
@@ -1516,8 +1444,11 @@ void HTMLTokenizer::processToken()
     if ( dest > buffer )
     {
 #ifdef TOKEN_DEBUG
-        if(currToken.id && currToken.id != ID_COMMENT)
+        if(currToken.id && currToken.id != ID_COMMENT) {
+            qDebug( "unexpected token id: %d, str: *%s*", currToken.id,QConstString( buffer,dest-buffer ).string().latin1() );
             assert(0);
+        }
+
 #endif
         if ( currToken.complexText ) {
             // ### we do too much QString copying here, but better here than in RenderText...
@@ -1612,12 +1543,7 @@ void HTMLTokenizer::notifyFinished(CachedObject *finishedObj)
 //         pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
         _src = QString::null;
         src = DOMStringIt( _src );
-        bool oldscript = script;
-        script = false;
-        m_executingScript++;
-        view->part()->executeScript(scriptSource.string());
-        m_executingScript--;
-        script = oldscript;
+        scriptExecution( scriptSource.string() );
         // 'script' is true when we are called synchronously from
         // parseScript(). In that case parseScript() will take care
         // of 'scriptOutput'.
diff --git a/WebCore/khtml/html/htmltokenizer.h b/WebCore/khtml/html/htmltokenizer.h
index 40423e6..0a3a551 100644
--- a/WebCore/khtml/html/htmltokenizer.h
+++ b/WebCore/khtml/html/htmltokenizer.h
@@ -163,17 +163,17 @@ protected:
     void reset();
     void addPending();
     void processToken();
-
-    void addListing(khtml::DOMStringIt list);
+    void processListing(khtml::DOMStringIt list);
 
     void parseComment(khtml::DOMStringIt &str);
     void parseText(khtml::DOMStringIt &str);
-    void parseStyle(khtml::DOMStringIt &str);
-    void parseScript(khtml::DOMStringIt &str);
     void parseListing(khtml::DOMStringIt &str);
+    void parseSpecial(khtml::DOMStringIt &str, bool begin);
     void parseTag(khtml::DOMStringIt &str);
     void parseEntity(khtml::DOMStringIt &str, QChar *&dest, bool start = false);
     void parseProcessingInstruction(khtml::DOMStringIt &str);
+    void scriptHandler();
+    void scriptExecution(const QString& script);
     void addPendingSource();
 
     // check if we have enough space in the buffer.
@@ -264,10 +264,10 @@ protected:
         SearchSemicolon
     } Entity;
 
-    QChar EntityChar;
+    // are we in a <script> ... </script block
+    bool script;
 
-    // Flag to say that we are just parsing an attribute
-    bool parseAttr;
+    QChar EntityChar;
 
     // Are we in a <pre> ... </pre> block
     bool pre;
@@ -275,9 +275,6 @@ protected:
     // if 'pre == true' we track in which column we are
     int prePos;
 
-    // Are we in a <script> ... </script> block
-    bool script;
-
     // Are we in a <style> ... </style> block
     bool style;
 
@@ -311,13 +308,19 @@ protected:
     int scriptCodeSize;
     // Maximal size that can be stored in @ref #scriptCode
     int scriptCodeMaxSize;
-
+    // resync point of script code size
+    int scriptCodeResync;
+    
     // Stores characters if we are scanning for a string like "</script>"
     QChar searchBuffer[ 10 ];
     // Counts where we are in the string we are scanning for
     int searchCount;
     // The string we are searching for
     const QChar *searchFor;
+    // the stopper string
+    const char* searchStopper;
+    // the stopper len
+    int searchStopperLen;
     // true if we are waiting for an external script (<SCRIPT SRC=...) to load, i.e.
     // we don't do any parsing while this is true
     bool loadingExtScript;
diff --git a/WebCore/khtml/khtml.desktop b/WebCore/khtml/khtml.desktop
index b0eb335..150d08e 100644
--- a/WebCore/khtml/khtml.desktop
+++ b/WebCore/khtml/khtml.desktop
@@ -1,7 +1,6 @@
 [Desktop Entry]
 Type=Service
 Comment=Embeddable HTML viewing component
-Comment[af]=INLEGBARE HTML AANSIG KOMPONENT
 Comment[az]=Hopdurula Bilən HTML nümayiş vasitəsi
 Comment[bg]=Елемент за преглед на вградени HTML
 Comment[br]=Parzh HTML gweler enframmus
@@ -45,8 +44,8 @@ Comment[ta]=¯ð¦À¡¾¢ì¸ÅøÄ HTML ¸¡ðº¢ì ÜÚ
 Comment[tr]=Gömülebilir HTML görüntüleme aracı
 Comment[uk]=Вбудований копмонент-переглядач HTML
 Comment[vi]=Component đềExem HTML có thềEembedd được 
+Comment[xh]=Inxenye yemboniselo elungisiweyo ye HTML
 Comment[zh_CN.GB2312]=嵌入的 HTML 查看部件
-Comment[zh_TW.Big5]=內建式 HTML 檢視元件
 MimeType=text/html;text/xml;
 Icon=konqueror
 Name=KHTML
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 519f320..75e795d 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -151,7 +151,6 @@ public:
     m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
     m_bClearing = false;
     m_bCleared = false;
-    m_userSheet = QString::null;
     m_fontBase = 0;
     m_bDnd = true;
     m_startOffset = m_endOffset = 0;
@@ -305,9 +304,6 @@ public:
 
   KParts::PartManager *m_manager;
 
-  DOM::DOMString m_userSheet;
-  DOM::DOMString m_userSheetUrl;
-
   QString m_popupMenuXML;
 
   int m_fontBase;
@@ -323,6 +319,7 @@ public:
     const char *submitAction;
     QString submitUrl;
     QByteArray submitFormData;
+    QString target;
     QString submitContentType;
     QString submitBoundary;
   };
@@ -380,12 +377,10 @@ namespace khtml {
     class PartStyleSheetLoader : public CachedObjectClient
     {
     public:
-        PartStyleSheetLoader(KHTMLPart *part, KHTMLPartPrivate *priv, DOM::DOMString url, DocLoader */*docLoader*/)
+        PartStyleSheetLoader(KHTMLPart *part, DOM::DOMString url, DocLoader* dl)
         {
             m_part = part;
-            m_priv = priv;
-            // the "foo" is needed, so that the docloader for the empty document doesn't cancel this request.
-            m_cachedSheet = Cache::requestStyleSheet(0, url, DOMString("foo") );
+            m_cachedSheet = dl->requestStyleSheet( url, part->baseURL().url(), QString::null );
             if (m_cachedSheet)
 		m_cachedSheet->ref( this );
         }
@@ -393,20 +388,14 @@ namespace khtml {
         {
             if ( m_cachedSheet ) m_cachedSheet->deref(this);
         }
-        virtual void setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheet)
+        virtual void setStyleSheet(const DOM::DOMString&, const DOM::DOMString &sheet)
         {
-            if ( m_part )
-            {
-                m_priv->m_userSheet = sheet;
-                m_priv->m_userSheetUrl = url;
-            }
-            khtml::CSSStyleSelector::setUserStyle( sheet );
-            if ( m_part && m_priv->m_doc )
-                m_priv->m_doc->applyChanges();
+          if ( m_part )
+            m_part->setUserStyleSheet( sheet.string() );
+
             delete this;
         }
         QGuardedPtr<KHTMLPart> m_part;
-        KHTMLPartPrivate *m_priv;
         khtml::CachedCSSStyleSheet *m_cachedSheet;
     };
 };
@@ -511,10 +500,6 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
   d->m_bJavaEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaEnabled();
   d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled();
 
-  QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
-  if ( !userStyleSheet.isEmpty() )
-      setUserStyleSheet( KURL( userStyleSheet ) );
-
   connect( this, SIGNAL( completed() ),
            this, SLOT( updateActions() ) );
   connect( this, SIGNAL( completed( bool ) ),
@@ -627,7 +612,7 @@ bool KHTMLPart::openURL( const KURL &url )
   // operation and d) the caller did not request to reload the page we try to
   // be smart and instead of reloading the whole document we just jump to the
   // request html anchor
-  if ( d->m_frames.count() == 0 &&
+  if ( d->m_frames.count() == 0 && d->m_doc && d->m_bComplete &&
        urlcmp( url.url(), m_url.url(), true, true ) && !args.doPost() && !args.reload )
   {
     kdDebug( 6050 ) << "KHTMLPart::openURL now m_url = " << url.url() << endl;
@@ -645,7 +630,12 @@ bool KHTMLPart::openURL( const KURL &url )
     emitLoadEvent();
 
     kdDebug( 6050 ) << "completed..." << endl;
-    emit completed();
+    if ( !d->m_redirectURL.isEmpty() )
+    {
+       emit completed(true);
+    }
+    else emit completed();
+
     return true;
   }
 
@@ -1377,6 +1367,9 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
   d->m_doc->setURL( m_url.url() );
 
   setAutoloadImages( KHTMLFactory::defaultHTMLSettings()->autoLoadImages() );
+  QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
+  if ( !userStyleSheet.isEmpty() )
+    setUserStyleSheet( KURL( userStyleSheet ) );
 
   d->m_doc->setRestoreState(args.docState);
   d->m_doc->open();
@@ -1641,7 +1634,6 @@ void KHTMLPart::checkEmitLoadEvent()
 {
   if ( d->m_bLoadEventEmitted || d->m_bParsing )
     return;
-  kdDebug(6050) << "KHTMLPart::checkEmitLoadEvent " << this << endl;
   ConstFrameIt it = d->m_frames.begin();
   ConstFrameIt end = d->m_frames.end();
   for (; it != end; ++it )
@@ -1653,6 +1645,7 @@ void KHTMLPart::checkEmitLoadEvent()
 void KHTMLPart::emitLoadEvent()
 {
   d->m_bLoadEventEmitted = true;
+  kdDebug(6050) << "KHTMLPart::emitLoadEvent " << this << endl;
 
   if ( d->m_doc && d->m_doc->isHTMLDocument() ) {
     HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>( d->m_doc );
@@ -1731,6 +1724,7 @@ void KHTMLPart::slotRedirect()
   QString target;
   u = splitUrlTarget( u, &target );
   KParts::URLArgs args;
+  args.reload = true;
   args.setLockHistory( true );
   urlSelected( u, 0, 0, target, args );
 }
@@ -1791,21 +1785,20 @@ QString KHTMLPart::encoding()
 
 void KHTMLPart::setUserStyleSheet(const KURL &url)
 {
-    d->m_userSheetUrl = DOMString();
-    d->m_userSheet = DOMString();
-    (void) new khtml::PartStyleSheetLoader(this, d, url.url(), d->m_doc ? d->m_doc->docLoader() : 0);
+  if ( d->m_doc && d->m_doc->docLoader() )
+    (void) new khtml::PartStyleSheetLoader(this, url.url(), d->m_doc->docLoader());
 }
 
 void KHTMLPart::setUserStyleSheet(const QString &styleSheet)
 {
-    d->m_userSheet = styleSheet;
-    d->m_userSheetUrl = DOMString();
-    khtml::CSSStyleSelector::setUserStyle( styleSheet );
+  if ( d->m_doc )
+    d->m_doc->setUserStyleSheet( styleSheet );
 }
 
-
 bool KHTMLPart::gotoAnchor( const QString &name )
 {
+  if (!d->m_doc)
+      return false;
   HTMLCollectionImpl *anchors =
       new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
   anchors->ref();
@@ -2783,6 +2776,7 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url
       KHTMLPart* p = static_cast<KHTMLPart*>(static_cast<KParts::ReadOnlyPart *>(child->m_part));
 
       p->begin();
+      p->m_url = url;
       p->write(url.path());
       p->end();
       return true;
@@ -2855,7 +2849,7 @@ KParts::PartManager *KHTMLPart::partManager()
 void KHTMLPart::submitFormAgain()
 {
   if( !d->m_bParsing && d->m_submitForm)
-    KHTMLPart::submitForm( d->m_submitForm->submitAction, d->m_submitForm->submitUrl, d->m_submitForm->submitFormData, d->m_submitForm->submitContentType, d->m_submitForm->submitBoundary );
+    KHTMLPart::submitForm( d->m_submitForm->submitAction, d->m_submitForm->submitUrl, d->m_submitForm->submitFormData, d->m_submitForm->target, d->m_submitForm->submitContentType, d->m_submitForm->submitBoundary );
 
   delete d->m_submitForm;
   d->m_submitForm = 0;
@@ -2927,6 +2921,7 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA
     d->m_submitForm->submitAction = action;
     d->m_submitForm->submitUrl = url;
     d->m_submitForm->submitFormData = formData;
+    d->m_submitForm->target = _target;
     d->m_submitForm->submitContentType = contentType;
     d->m_submitForm->submitBoundary = boundary;
     connect(this, SIGNAL(completed()), this, SLOT(submitFormAgain()));
@@ -3265,7 +3260,7 @@ void KHTMLPart::restoreState( QDataStream &stream )
   Q_INT32 charset;
   long old_cacheId = d->m_cacheId;
   QString encoding;
-  
+
   stream >> u >> xOffset >> yOffset;
 
   // restore link cursor position
@@ -3281,8 +3276,8 @@ void KHTMLPart::restoreState( QDataStream &stream )
   d->m_encoding = encoding;
   if ( d->m_settings ) d->m_settings->setCharset( d->m_charset );
   kdDebug(6050)<<"restoring charset to:"<< charset << endl;
-  
-  
+
+
   stream >> fSizes >> d->m_fontBase;
   // ### odd: this doesn't appear to have any influence on the used font
   // sizes :(
diff --git a/WebCore/khtml/khtml_settings.cc b/WebCore/khtml/khtml_settings.cc
index 8de2a2c..19ca5b1 100644
--- a/WebCore/khtml/khtml_settings.cc
+++ b/WebCore/khtml/khtml_settings.cc
@@ -123,14 +123,14 @@ void KHTMLSettings::init( KConfig * config, bool reset )
 	defaultFonts.append( QString( "0" ) ); // font size adjustment
     }
 
+    if ( reset || config->hasKey( "MinimumFontSize" ) )
+        m_minFontSize = config->readNumEntry( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE );
+
     if ( reset || config->hasKey( "MediumFontSize" ) ) {
         m_fontSize = config->readNumEntry( "MediumFontSize", 10 );
         resetFontSizes();
     }
 
-    if ( reset || config->hasKey( "MinimumFontSize" ) )
-        m_minFontSize = config->readNumEntry( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE );
-
     QStringList chSets = KGlobal::charsets()->availableCharsetNames();
     for ( QStringList::Iterator it = chSets.begin(); it != chSets.end(); ++it ) {
         if ( reset || config->hasKey( *it ) ){
diff --git a/WebCore/khtml/khtmlimage.desktop b/WebCore/khtml/khtmlimage.desktop
index f79edad..aba499a 100644
--- a/WebCore/khtml/khtmlimage.desktop
+++ b/WebCore/khtml/khtmlimage.desktop
@@ -1,7 +1,6 @@
 [Desktop Entry]
 Type=Service
 Comment=Embeddable Image Viewing Component
-Comment[af]=INLEGBARE BEELD AANSIG KOMPONENT
 Comment[az]=Hopdurula Bilən Rəsm Nümayiş Vasitəsi
 Comment[bg]=Вграден елемент на преглед за картини
 Comment[cs]=Komponenta pro zobrazování obrázků
@@ -39,11 +38,10 @@ Comment[ta]=¯ð¦À¡¾¢ó¾ ¯ì¸¡ðÊì ÜÚ
 Comment[tr]=Gömülebilir Resim Görüntüleme Aracı
 Comment[uk]=Вбудований копмонент-переглядач образів
 Comment[vi]=Component đềExem ảnh có thềEembedd được 
+Comment[xh]=Inxenye yemboniselo yomfanekiso olungisiweyo
 Comment[zh_CN.GB2312]=可嵌入的图像查看部件
-Comment[zh_TW.Big5]=可嵌入的圖形檢視元件
 MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/bmp;image/png;image/x-ico;
 Name=Embeddable Image Viewer
-Name[af]=INLEGBARE BEELD AANSIG
 Name[az]=Daxili Rəsm Nümayişçisi
 Name[bg]=Вграден преглед на картини
 Name[cs]=Zabudovaný prohlížeč obrázků
@@ -81,8 +79,8 @@ Name[ta]=¯ð¦À¡¾¢ó¾ ¯Õì ¸¡ðÊ
 Name[tr]=Gömülü Resim Görüntüleyici
 Name[uk]=Вмонтований переглядач образів
 Name[vi]=Trình xem ảnh có thềEembedd được 
+Name[xh]=Umboniseli womfanekiso olungisiweyo
 Name[zh_CN.GB2312]=可嵌入的图像查看器
-Name[zh_TW.Big5]=可嵌入的圖形檢視器
 ServiceTypes=KParts/ReadOnlyPart
 InitialPreference=4
 X-KDE-Library=libkhtmlimage
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index a5d3b22..51228f3 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -1190,6 +1190,7 @@ void KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, bool
 						button,0);
 	me->ref();
 	targetNode->dispatchEvent(me,exceptioncode);
+	bool defaultHandled = me->defaultHandled();
 	me->deref();
 
 	// special case for HTML click & ondblclick handler
@@ -1200,8 +1201,9 @@ void KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, bool
 				    ctrlKey,altKey,shiftKey,metaKey,
 				    button,0);
 
-
 	    me->ref();
+	    if (defaultHandled)
+		me->setDefaultHandled();
 	    targetNode->dispatchEvent(me,exceptioncode);
 	    me->deref();
 	}
@@ -1228,3 +1230,5 @@ void KHTMLView::focusOutEvent( QFocusEvent *e )
     m_part->stopAutoScroll();
     QScrollView::focusOutEvent( e );
 }
+
+// vim:ts=4:sw=4
diff --git a/WebCore/khtml/misc/loader.cpp b/WebCore/khtml/misc/loader.cpp
index 55410ea..a97ab03 100644
--- a/WebCore/khtml/misc/loader.cpp
+++ b/WebCore/khtml/misc/loader.cpp
@@ -387,9 +387,11 @@ CachedImage::CachedImage(const DOMString &url, const DOMString &baseURL, bool re
     p = 0;
     pixPart = 0;
     bg = 0;
+    bgColor = qRgba( 0, 0, 0, 0xFF );
     typeChecked = false;
     isFullyTransparent = false;
     errorOccured = false;
+    monochrome = false;
     formatType = 0;
     m_status = Unknown;
     m_size = 0;
@@ -442,27 +444,35 @@ void CachedImage::deref( CachedObjectClient *c )
 
 const QPixmap &CachedImage::tiled_pixmap(const QColor& newc)
 {
-    if (bg)
+
+    if ( newc.rgb() != bgColor ) {
+        delete bg; bg = 0;
+    }
+
+    if (bg) 
         return *bg;
 
     const QPixmap &r = pixmap();
 
-    if (r.isNull()) return r;
+    if (r.isNull()) 
+        return r;
 
     // no error indication for background images
-    if(errorOccured) return *Cache::nullPixmap;
-
-    if (newc != bgColor)
-    {
-        bool isvalid = newc.isValid();
-        QSize s(pixmap_size());
-        int w = r.width();
-        int h = r.height();
+    if(errorOccured)  
+      return *Cache::nullPixmap;
+
+    bool isvalid = newc.isValid();
+    QSize s(pixmap_size());
+    int w = r.width();
+    int h = r.height();
+    if ( w*h < 8192 ) {
         if ( r.width() < BGMINWIDTH )
             w = ((BGMINWIDTH  / s.width())+1) * s.width();
         if ( r.height() < BGMINHEIGHT )
             h = ((BGMINHEIGHT / s.height())+1) * s.height();
+    }
 
+    if ( w != r.width() || h != r.height() ) {
         bg = new QPixmap(w, h);
         QPixmap pix = pixmap();
         QPainter p(bg);
@@ -470,13 +480,16 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc)
         p.drawTiledPixmap(0, 0, w, h, pix);
         if(!isvalid && pix.mask())
         {
-            // unfortunately our avoid transparency trick doesn't work here
+            // unfortunately our anti-transparency trick doesn't work here
             // we need to create a mask.
             QBitmap newmask(w, h);
             QPainter pm(&newmask);
             pm.drawTiledPixmap(0, 0, w, h, *pix.mask());
             bg->setMask(newmask);
+            bgColor = qRgba( 0, 0, 0, 0xFF );
         }
+        else
+            bgColor= newc.rgb();
 
         return *bg;
     }
@@ -644,6 +657,7 @@ void CachedImage::clear()
     delete m;   m = 0;
     delete p;   p = 0;
     delete bg;  bg = 0;
+    bgColor = qRgba( 0, 0, 0, 0xff );
     delete pixPart; pixPart = 0;
 
     formatType = 0;
diff --git a/WebCore/khtml/misc/loader.h b/WebCore/khtml/misc/loader.h
index 87bbb14..11ec956 100644
--- a/WebCore/khtml/misc/loader.h
+++ b/WebCore/khtml/misc/loader.h
@@ -268,7 +268,7 @@ namespace khtml
         void do_notify(const QPixmap& p, const QRect& r);
 
         DOM::DOMString m_baseURL;
-        QColor bgColor;
+        QRgb bgColor;
 	QMovie* m;
         QPixmap* p;
 	QPixmap* bg;
@@ -279,6 +279,7 @@ namespace khtml
 
 	int width;
 	int height;
+        bool monochrome;
 
 	// Is set if movie format type ( incremental/animation) was checked
 	bool typeChecked;
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 89c7510..44bcb41 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -940,12 +940,6 @@ void RenderSelect::layout( )
     }
     else {
         QSize s(m_widget->sizeHint());
-        KComboBox* w = static_cast<KComboBox*>(m_widget);
-        // and now disable the widget in case there is no <option> given
-        // ### do the same if there is only optgroups
-        if(!w->count())
-            w->setEnabled(false);
-
         setIntrinsicWidth( s.width() );
         setIntrinsicHeight( s.height() );
     }
@@ -954,6 +948,15 @@ void RenderSelect::layout( )
     setLayouted( false );
     RenderFormElement::layout();
 
+    // and now disable the widget in case there is no <option> given
+    QArray<HTMLGenericFormElementImpl*> listItems = select->listItems();
+    bool foundOption = false;
+    for (uint i = 0; i < listItems.size() && !foundOption; i++)
+	foundOption = (listItems[i]->id() == ID_OPTION);
+
+    if (!foundOption)
+	m_widget->setEnabled(false);
+
     m_ignoreSelectEvents = false;
 }
 
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index ee48b9c..aa1e4ab 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -592,13 +592,15 @@ void RenderPart::setWidget( QWidget *widget )
 
     updateSize();
 
-    //slotViewCleared();
+    // make sure the scrollbars are set correctly for restore
+    // ### find better fix
+    slotViewCleared();
 }
 
 void RenderPart::layout( )
 {
     if ( m_widget )
-        m_widget->resize( QMIN( m_width, 2000 ), QMIN( m_height, 3072 ) );
+        m_widget->resize( QMIN( m_width, 2000 ), QMIN( m_height, 3860 ) );
 }
 
 void RenderPart::partLoadingErrorNotify()
@@ -615,6 +617,9 @@ int RenderPart::intrinsicHeight() const
     return 200;
 }
 
+void RenderPart::slotViewCleared()
+{
+}
 
 /***************************************************************************************/
 
diff --git a/WebCore/khtml/rendering/render_frames.h b/WebCore/khtml/rendering/render_frames.h
index d50393c..c0db375 100644
--- a/WebCore/khtml/rendering/render_frames.h
+++ b/WebCore/khtml/rendering/render_frames.h
@@ -106,6 +106,9 @@ public:
     
     virtual short intrinsicWidth() const;
     virtual int intrinsicHeight() const;
+    
+public slots:
+    virtual void slotViewCleared();
 };
 
 class RenderFrame : public khtml::RenderPart
diff --git a/WebCore/khtml/xml/dom2_eventsimpl.cpp b/WebCore/khtml/xml/dom2_eventsimpl.cpp
index 368448d..b8a048c 100644
--- a/WebCore/khtml/xml/dom2_eventsimpl.cpp
+++ b/WebCore/khtml/xml/dom2_eventsimpl.cpp
@@ -44,6 +44,7 @@ EventImpl::EventImpl()
     m_eventPhase = 0;
     m_target = 0;
     m_createTime = QDateTime::currentDateTime();
+    m_defaultHandled = false;
 }
 
 EventImpl::EventImpl(EventId _id, bool canBubbleArg, bool cancelableArg)
@@ -62,6 +63,7 @@ EventImpl::EventImpl(EventId _id, bool canBubbleArg, bool cancelableArg)
     m_eventPhase = 0;
     m_target = 0;
     m_createTime = QDateTime::currentDateTime();
+    m_defaultHandled = false;
 }
 
 EventImpl::~EventImpl()
@@ -286,6 +288,10 @@ DOMString EventImpl::idToType(EventImpl::EventId id)
     }
 }
 
+void EventImpl::setDefaultHandled()
+{
+    m_defaultHandled = true;
+}
 
 // -----------------------------------------------------------------------------
 
@@ -604,3 +610,5 @@ bool RegisteredEventListener::operator==(const RegisteredEventListener &other)
 	    listener == other.listener &&
 	    useCapture == other.useCapture);
 }
+
+// vim:ts=4:sw=4
diff --git a/WebCore/khtml/xml/dom2_eventsimpl.h b/WebCore/khtml/xml/dom2_eventsimpl.h
index cd16683..97e3d4f 100644
--- a/WebCore/khtml/xml/dom2_eventsimpl.h
+++ b/WebCore/khtml/xml/dom2_eventsimpl.h
@@ -114,6 +114,9 @@ public:
     static EventId typeToId(DOMString type);
     static DOMString idToType(EventId id);
 
+    void setDefaultHandled();
+    bool defaultHandled() const { return m_defaultHandled; }
+
 protected:
     DOMStringImpl *m_type;
     bool m_canBubble;
@@ -121,6 +124,7 @@ protected:
 
     bool m_propagationStopped;
     bool m_defaultPrevented;
+    bool m_defaultHandled;
     EventId m_id;
     NodeImpl *m_currentTarget; // ref > 0 maintained externally
     unsigned short m_eventPhase;
@@ -271,3 +275,4 @@ public:
 
 }; //namespace
 #endif
+// vim:ts=4:sw=4
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 07a3023..b921ada 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -838,6 +838,14 @@ void DocumentImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DOMString
     createSelector();
 }
 
+void DocumentImpl::setUserStyleSheet( const QString& sheet )
+{
+    if ( m_usersheet != sheet ) {
+        m_usersheet = sheet;
+        applyChanges();
+    }
+}
+
 CSSStyleSheetImpl* DocumentImpl::elementSheet()
 {
     if (!m_elemSheet) {
@@ -1102,7 +1110,7 @@ int DocumentImpl::findHighestTabIndex()
 
 ElementImpl *DocumentImpl::findNextLink(ElementImpl *cur, bool forward)
 {
-    int curTabIndex = (cur?cur->tabIndex():(forward?-1:0));
+    int curTabIndex = (cur?cur->tabIndex():(forward?1:-1));
 
     switch(curTabIndex)
     {
@@ -1143,8 +1151,9 @@ ElementImpl *DocumentImpl::notabindex(ElementImpl *cur, bool forward)
         return cur;
 
     if (forward)
-        return intabindex(cur, forward);
-    return 0;
+        return 0;
+    else
+        return tabindexzero(cur, forward);
 }
 
 ElementImpl *DocumentImpl::intabindex(ElementImpl *cur, bool forward)
@@ -1164,10 +1173,11 @@ ElementImpl *DocumentImpl::intabindex(ElementImpl *cur, bool forward)
             return cur;
         tmptabindex+=increment;
     }
+
     if (forward)
         return tabindexzero(cur, forward);
     else
-        return notabindex(cur, forward) ;
+        return 0;
 }
 
 ElementImpl *DocumentImpl::tabindexzero(ElementImpl *cur, bool forward)
@@ -1175,9 +1185,11 @@ ElementImpl *DocumentImpl::tabindexzero(ElementImpl *cur, bool forward)
     //REQ: tabindex of result must be 0 and it must be after the current node ;
     if ((cur = findLink(cur, forward, 0)))
         return cur;
-    if (!forward)
+
+    if (forward)
+        return notabindex(cur, forward);
+    else
         return intabindex(cur, forward);
-    return 0;
 }
 
 bool DocumentImpl::prepareMouseEvent( int _x, int _y,
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index 75b116b..4910606 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -182,6 +182,8 @@ public:
 
     // from cachedObjectClient
     virtual void setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheetStr);
+    void setUserStyleSheet(const QString& sheet);
+    QString userStyleSheet() const { return m_usersheet; }
 
     CSSStyleSheetImpl* elementSheet();
     virtual Tokenizer *createTokenizer();
@@ -287,6 +289,7 @@ protected:
     DOMImplementationImpl *m_implementation;
 
     StyleSheetImpl *m_sheet;
+    QString m_usersheet;
     bool m_loadingSheet;
 
     CSSStyleSheetImpl *m_elemSheet;
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index bb097ba..58b39fc 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -498,10 +498,10 @@ bool NodeImpl::dispatchGenericEvent( EventImpl *evt, int &/*exceptioncode */)
     evt->setCurrentTarget(0);
     evt->setEventPhase(0); // I guess this is correct, the spec does not seem to say
 
-    if (!evt->defaultPrevented() && evt->bubbles()) {
+    if (evt->bubbles()) {
         // now we call all default event handlers (this is not part of DOM - it is internal to khtml)
         it.toLast();
-        for (; it.current() && !evt->propagationStopped(); --it)
+        for (; it.current() && !evt->propagationStopped() && !evt->defaultPrevented() && !evt->defaultHandled(); --it)
             it.current()->defaultEventHandler(evt);
     }
 
@@ -1687,4 +1687,4 @@ void GenericRONamedNodeMapImpl::addNode(NodeImpl *n)
     n->ref();
     m_contents->append(n);
 }
-
+// vim:ts=4:sw=4
diff --git a/WebCore/src/kdelibs/khtml/css/csshelper.cpp b/WebCore/src/kdelibs/khtml/css/csshelper.cpp
index 3de37e7..00522a3 100644
--- a/WebCore/src/kdelibs/khtml/css/csshelper.cpp
+++ b/WebCore/src/kdelibs/khtml/css/csshelper.cpp
@@ -130,9 +130,7 @@ DOMString khtml::parseURL(const DOMString &url)
 
     int nl = 0;
     for(int k = o; k < o+l; k++)
-        if(i->s[k] == '\\')
-            j->s[nl++] = '/';
-        else if(i->s[k].unicode() > '\r')
+        if(i->s[k].unicode() > '\r')
             j->s[nl++] = i->s[k];
 
     j->l = nl;
diff --git a/WebCore/src/kdelibs/khtml/css/cssparser.cpp b/WebCore/src/kdelibs/khtml/css/cssparser.cpp
index 346db49..d0e34e1 100644
--- a/WebCore/src/kdelibs/khtml/css/cssparser.cpp
+++ b/WebCore/src/kdelibs/khtml/css/cssparser.cpp
@@ -414,6 +414,9 @@ StyleBaseImpl::parseSelector2(const QChar *curP, const QChar *endP,
 #endif
                     cs->match = CSSSelector::Set;
                     endVal = closebracket + 1;
+                    // ### fixme we ignore everything after [..]
+                    if( endVal == endP )
+                        endVal = 0;
                 }
                 else
                 {
@@ -1587,7 +1590,7 @@ bool StyleBaseImpl::parseValue( const QChar *curP, const QChar *endP, int propId
 		value = khtml::parseURL(value);
             	parsedValue = new CSSImageValueImpl(value, baseUrl(), this);
 #ifdef CSS_DEBUG
-		kdDebug( 6080 ) << "image, url=" << value.string() << " base=" << baseUrl().string() << endl;
+		kdDebug( 6080 ) << "image, url=" << value.string() << " base=" << baseURL().string() << endl;
 #endif
 	      }
 	    }
diff --git a/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp b/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp
index eca3584..11001e9 100644
--- a/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp
+++ b/WebCore/src/kdelibs/khtml/css/cssstyleselector.cpp
@@ -62,9 +62,7 @@ using namespace DOM;
 #include <qintcache.h>
 
 CSSStyleSelectorList *CSSStyleSelector::defaultStyle = 0;
-CSSStyleSelectorList *CSSStyleSelector::userStyle = 0;
 CSSStyleSheetImpl *CSSStyleSelector::defaultSheet = 0;
-CSSStyleSheetImpl *CSSStyleSelector::userSheet = 0;
 
 enum PseudoState { PseudoUnknown, PseudoNone, PseudoLink, PseudoVisited};
 static PseudoState pseudoState;
@@ -84,6 +82,17 @@ CSSStyleSelector::CSSStyleSelector(DocumentImpl * doc)
     selectors = 0;
     selectorCache = 0;
     properties = 0;
+    userStyle = 0;
+    userSheet = 0;
+
+
+    if ( !doc->userStyleSheet().isEmpty() ) {
+        userSheet = new DOM::CSSStyleSheetImpl((DOM::CSSStyleSheetImpl *)0);
+        userSheet->parseString( DOMString( doc->userStyleSheet() ) );
+
+        userStyle = new CSSStyleSelectorList();
+        userStyle->append(userSheet);
+    }
 
     // add stylesheets from document
     authorStyle = new CSSStyleSelectorList();
@@ -124,6 +133,8 @@ CSSStyleSelector::~CSSStyleSelector()
 {
     clearLists();
     delete authorStyle;
+    delete userStyle;
+    delete userSheet;
 }
 
 void CSSStyleSelector::addSheet(StyleSheetImpl *sheet)
@@ -131,18 +142,6 @@ void CSSStyleSelector::addSheet(StyleSheetImpl *sheet)
     authorStyle->append(sheet);
 }
 
-void CSSStyleSelector::setUserStyle(const DOM::DOMString &str)
-{
-    if(userStyle) delete userStyle;
-    if(userSheet) delete userSheet;
-
-    userSheet = new DOM::CSSStyleSheetImpl((DOM::CSSStyleSheetImpl *)0);
-    userSheet->parseString( str );
-
-    userStyle = new CSSStyleSelectorList();
-    userStyle->append(userSheet);
-}
-
 void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
 {
     if(defaultStyle) return;
@@ -172,17 +171,12 @@ void CSSStyleSelector::loadDefaultStyle(const KHTMLSettings *s)
 void CSSStyleSelector::clear()
 {
     delete defaultStyle;
-    delete userStyle;
     delete defaultSheet;
-    delete userSheet;
     defaultStyle = 0;
-    userStyle = 0;
     defaultSheet = 0;
-    userSheet = 0;
 }
 
 static bool strictParsing;
-//static QList<RenderStyle>* styleElementCache = 0;
 
 RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e, int state)
 {
@@ -266,6 +260,7 @@ RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e, int state)
             while( ordprop ) {
                 RenderStyle *pseudoStyle;
                 pseudoStyle = style->addPseudoStyle(ordprop->pseudoId);
+
                 if ( pseudoStyle )
                     applyRule(pseudoStyle, ordprop->prop, e);
                 ordprop = pseudoProps->next();
diff --git a/WebCore/src/kdelibs/khtml/css/cssstyleselector.h b/WebCore/src/kdelibs/khtml/css/cssstyleselector.h
index c12c52a..c920be6 100644
--- a/WebCore/src/kdelibs/khtml/css/cssstyleselector.h
+++ b/WebCore/src/kdelibs/khtml/css/cssstyleselector.h
@@ -116,9 +116,8 @@ namespace khtml
 	virtual ~CSSStyleSelector();
 	
 	void addSheet(DOM::StyleSheetImpl *sheet);
-	
+        
 	static void loadDefaultStyle(const KHTMLSettings *s = 0);
-	static void setUserStyle(const DOM::DOMString &sheet);
 	static void clear();
 	
 	virtual RenderStyle *styleForElement(DOM::ElementImpl *e, int state = None );
@@ -146,9 +145,9 @@ namespace khtml
 	
 	static DOM::CSSStyleSheetImpl *defaultSheet;
 	static CSSStyleSelectorList *defaultStyle;
-	static DOM::CSSStyleSheetImpl *userSheet;
-	static CSSStyleSelectorList *userStyle;
 	CSSStyleSelectorList *authorStyle;
+        CSSStyleSelectorList *userStyle;
+        DOM::CSSStyleSheetImpl *userSheet;
 	
     public: // we need to make the enum public for SelectorCache
 	enum SelectorState {
@@ -168,7 +167,6 @@ namespace khtml
 	unsigned int selectors_size;
 	DOM::CSSSelector **selectors;
 	SelectorCache *selectorCache;
-	
 	unsigned int properties_size;
 	CSSOrderedProperty **properties;
 	QArray<CSSOrderedProperty> inlineProps;
@@ -193,7 +191,7 @@ namespace khtml
 	{
 	    priority = (!first << 30) | (source << 24) | specificity;
 	}
-	
+
 	DOM::CSSProperty *prop;
 	RenderStyle::PseudoId pseudoId;
 	unsigned int selector;
diff --git a/WebCore/src/kdelibs/khtml/dom/dom_string.cpp b/WebCore/src/kdelibs/khtml/dom/dom_string.cpp
index 9b8775e..c3c5193 100644
--- a/WebCore/src/kdelibs/khtml/dom/dom_string.cpp
+++ b/WebCore/src/kdelibs/khtml/dom/dom_string.cpp
@@ -289,6 +289,8 @@ bool DOM::operator==( const DOMString &a, const QString &b )
 
 bool DOM::operator==( const DOMString &a, const char *b )
 {
+    if ( !b ) return a.isNull();
+    if ( a.isNull() ) return false;
     unsigned int blen = strlen(b);
     if(a.length() != blen) return false;
 
diff --git a/WebCore/src/kdelibs/khtml/ecma/kjs_binding.cpp b/WebCore/src/kdelibs/khtml/ecma/kjs_binding.cpp
index f30ce1e..0a67abf 100644
--- a/WebCore/src/kdelibs/khtml/ecma/kjs_binding.cpp
+++ b/WebCore/src/kdelibs/khtml/ecma/kjs_binding.cpp
@@ -1,3 +1,4 @@
+// -*- c-basic-offset: 2 -*-
 /*
  *  This file is part of the KDE libraries
  *  Copyright (C) 1999-2001 Harri Porten (porten at kde.org)
diff --git a/WebCore/src/kdelibs/khtml/ecma/kjs_html.cpp b/WebCore/src/kdelibs/khtml/ecma/kjs_html.cpp
index c7cd8a6..19e9345 100644
--- a/WebCore/src/kdelibs/khtml/ecma/kjs_html.cpp
+++ b/WebCore/src/kdelibs/khtml/ecma/kjs_html.cpp
@@ -355,6 +355,8 @@ KJSO KJS::HTMLElement::tryGet(const UString &p) const
       else if (p == "link")            return getString(body.link());
       else if (p == "text")            return getString(body.text());
       else if (p == "vLink")           return getString(body.vLink());
+      else if (p == "scrollHeight" )   return Number(body.ownerDocument().view() ? body.ownerDocument().view()->contentsHeight() : 0);
+      else if (p == "scrollWidth" )    return Number(body.ownerDocument().view() ? body.ownerDocument().view()->contentsWidth() : 0);
     }
     break;
     case ID_FORM: {
diff --git a/WebCore/src/kdelibs/khtml/ecma/kjs_traversal.cpp b/WebCore/src/kdelibs/khtml/ecma/kjs_traversal.cpp
index 4a8044c..e58886b 100644
--- a/WebCore/src/kdelibs/khtml/ecma/kjs_traversal.cpp
+++ b/WebCore/src/kdelibs/khtml/ecma/kjs_traversal.cpp
@@ -302,7 +302,7 @@ DOM::NodeFilter KJS::toNodeFilter(const KJSO& obj)
 
 // -------------------------------------------------------------------------
 
-JSNodeFilter::JSNodeFilter(KJSO _filter) : CustomNodeFilter()
+JSNodeFilter::JSNodeFilter(KJSO _filter) : DOM::CustomNodeFilter()
 {
     filter = _filter;
 }
diff --git a/WebCore/src/kdelibs/khtml/html/html_baseimpl.cpp b/WebCore/src/kdelibs/khtml/html/html_baseimpl.cpp
index 99f03b1..a565edc 100644
--- a/WebCore/src/kdelibs/khtml/html/html_baseimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/html/html_baseimpl.cpp
@@ -263,14 +263,19 @@ void HTMLFrameElementImpl::parseAttribute(AttrImpl *attr)
 
 void HTMLFrameElementImpl::attach()
 {
+    setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
+
     KHTMLView* w = ownerDocument()->view();
     // limit to how deep we can nest frames
     KHTMLPart *part = w->part();
     int depth = 0;
     while ((part = part->parentPart()))
         depth++;
-    if (depth > 10)
+
+    if (depth > 6 || url.isNull()) {
+        style()->setDisplay( NONE );
         return;
+    }
 
     // inherit default settings from parent frameset
     HTMLElementImpl* node = static_cast<HTMLElementImpl*>(parentNode());
@@ -286,7 +291,6 @@ void HTMLFrameElementImpl::attach()
         node = static_cast<HTMLElementImpl*>(node->parentNode());
     }
 
-    setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
     khtml::RenderObject *r = _parent->renderer();
 
     // ignore display: none for this element!
@@ -654,16 +658,18 @@ void HTMLIFrameElementImpl::parseAttribute(AttrImpl *attr )
 
 void HTMLIFrameElementImpl::attach()
 {
+  setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
+
   KHTMLView* w = ownerDocument()->view();
   // limit to how deep we can nest frames
   KHTMLPart *part = w->part();
   int depth = 0;
   while ((part = part->parentPart()))
     depth++;
-  if (depth > 10)
-    return;
-
-  setStyle(ownerDocument()->styleSelector()->styleForElement( this ));
+  if (depth > 6) {
+      style()->setDisplay( NONE );
+      return;
+  }
 
   khtml::RenderObject *r = _parent->renderer();
 
diff --git a/WebCore/src/kdelibs/khtml/html/html_formimpl.cpp b/WebCore/src/kdelibs/khtml/html/html_formimpl.cpp
index 2379b94..4fc14ea 100644
--- a/WebCore/src/kdelibs/khtml/html/html_formimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/html/html_formimpl.cpp
@@ -1274,6 +1274,7 @@ void HTMLInputElementImpl::defaultEventHandler(EventImpl *evt)
             dispatchUIEvent(EventImpl::DOMACTIVATE_EVENT,2);
         else
             dispatchUIEvent(EventImpl::DOMACTIVATE_EVENT,1);
+	me->setDefaultHandled();
     }
 
     if ((evt->id() == EventImpl::DOMACTIVATE_EVENT) &&
diff --git a/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp b/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
index ee106ea..066dfcd 100644
--- a/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/html/html_headimpl.cpp
@@ -306,7 +306,7 @@ void HTMLMetaElementImpl::attach()
                 ownerDocument()->docLoader()->setExpireDate(expire_date);
         }
     }
-    else if(strcasecmp(_equiv, "pragma") == 0 && !_content.isNull())
+    else if( (strcasecmp(_equiv, "pragma") == 0 ||  strcasecmp(_equiv, "cache-control") == 0 ) && !_content.isNull() )
     {
         QString str = _content.string().lower().stripWhiteSpace();
         KURL url = v->part()->url();
diff --git a/WebCore/src/kdelibs/khtml/html/htmlparser.cpp b/WebCore/src/kdelibs/khtml/html/htmlparser.cpp
index b3cd16e..47342aa 100644
--- a/WebCore/src/kdelibs/khtml/html/htmlparser.cpp
+++ b/WebCore/src/kdelibs/khtml/html/htmlparser.cpp
@@ -190,11 +190,13 @@ void KHTMLParser::parseToken(Token *t)
       kdDebug( 6035 ) << "Unknown tag!! tagID = " << t->id << endl;
       return;
     }
-    if(discard_until)
-    {
+    if(discard_until) {
         if(t->id == discard_until)
             discard_until = 0;
-        return;
+
+        // do not skip </iframe>
+        if ( discard_until || current->id() + ID_CLOSE_TAG != t->id )
+            return;
     }
 
 #ifdef PARSER_DEBUG
@@ -559,7 +561,7 @@ bool KHTMLParser::insertNode(NodeImpl *n)
                    ( !checkChild( ID_TR, id ) && ( node->id() == ID_THEAD || node->id() == ID_TBODY || node->id() == ID_TFOOT ) &&
                      parent->id() == ID_TABLE ) )
                 {
-                    node = parentparent;
+                    node = ( node->id() == ID_TR ) ? parentparent : parent;
                     NodeImpl *parent = node->parentNode();
                     int exceptioncode = 0;
                     NodeImpl *container = new HTMLGenericElementImpl( document, ID__KONQBLOCK );
@@ -746,6 +748,7 @@ NodeImpl *KHTMLParser::getElement(Token* t)
         // a bit a special case, since the frame is inlined...
     case ID_IFRAME:
         n = new HTMLIFrameElementImpl(document);
+        discard_until = ID_IFRAME+ID_CLOSE_TAG;
         break;
 
 // form elements
@@ -876,7 +879,6 @@ NodeImpl *KHTMLParser::getElement(Token* t)
 
 // anchor
     case ID_A:
-        popBlock(ID_A);
         n = new HTMLAnchorElementImpl(document);
         break;
 
diff --git a/WebCore/src/kdelibs/khtml/html/htmltokenizer.cpp b/WebCore/src/kdelibs/khtml/html/htmltokenizer.cpp
index 12ef9cd..cb93849 100644
--- a/WebCore/src/kdelibs/khtml/html/htmltokenizer.cpp
+++ b/WebCore/src/kdelibs/khtml/html/htmltokenizer.cpp
@@ -58,10 +58,11 @@
 using namespace khtml;
 
 static const QChar commentStart [] = { '<','!','-','-', QChar::null };
-static const QChar scriptEnd [] = { '<','/','s','c','r','i','p','t',' ','>', QChar::null };
-static const QChar styleEnd [] = { '<','/','s','t','y','l','e', ' ','>', QChar::null };
-static const QChar listingEnd [] = { '<','/','l','i','s','t','i','n','g',' ','>', QChar::null };
-static const QChar textareaEnd [] = { '<','/','t','e','x','t','a','r','e','a',' ','>', QChar::null };
+
+static const char scriptEnd [] = "</script";
+static const char listingEnd [] = "</listing";
+static const char styleEnd [] =  "</style";
+static const char textareaEnd [] = "</textarea";
 
 #define KHTML_ALLOC_QCHAR_VEC( N ) (QChar*) malloc( sizeof(QChar)*( N ) )
 #define KHTML_REALLOC_QCHAR_VEC(P, N ) (QChar*) P = realloc(p, sizeof(QChar)*( N ))
@@ -102,7 +103,7 @@ HTMLTokenizer::HTMLTokenizer(DOM::DocumentPtr *_doc, KHTMLView *_view)
     view = _view;
     buffer = 0;
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
     charsets = KGlobal::charsets();
     parser = new KHTMLParser(_view, _doc);
     cachedScript = 0;
@@ -118,7 +119,7 @@ HTMLTokenizer::HTMLTokenizer(DOM::DocumentPtr *_doc, DOM::DocumentFragmentImpl *
     view = 0;
     buffer = 0;
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
     charsets = KGlobal::charsets();
     parser = new KHTMLParser( i, _doc );
     cachedScript = 0;
@@ -146,7 +147,7 @@ void HTMLTokenizer::reset()
     if ( scriptCode )
         KHTML_DELETE_QCHAR_VEC(scriptCode);
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
 
     currToken.reset();
 }
@@ -186,7 +187,7 @@ void HTMLTokenizer::begin()
     brokenComments = false;
 }
 
-void HTMLTokenizer::addListing(DOMStringIt list)
+void HTMLTokenizer::processListing(DOMStringIt list)
 {
     bool old_pre = pre;
     // This function adds the listing 'list' as
@@ -254,9 +255,7 @@ void HTMLTokenizer::addListing(DOMStringIt list)
     }
 
     if ((pending == SpacePending) || (pending == TabPending))
-    {
         addPending();
-    }
     pending = NonePending;
 
     processToken();
@@ -265,32 +264,56 @@ void HTMLTokenizer::addListing(DOMStringIt list)
     pre = old_pre;
 }
 
-void HTMLTokenizer::parseListing( DOMStringIt &src)
+void HTMLTokenizer::parseSpecial(DOMStringIt &src, bool begin)
 {
-    // Famous last words: I'm 99.9% sure.
-    assert( !Entity );
-
-    // We are inside a <script>, <style>, <textarea> . Look for the end tag
-    // which is either </script>, </style> , </textarea> or -->
-    // otherwise print out every received character
-
-#ifdef TOKEN_DEBUG
-    kdDebug( 6036 ) << "HTMLTokenizer::parseListing()" << endl;
-#endif
-
-    bool doScriptExec = false;
-    while ( src.length() )
-    {
-        // do we need to enlarge the buffer?
-        checkBuffer();
+    assert( textarea || !Entity );
+    assert( !tag );
+    assert( listing+textarea+style+script == 1 );
+
+    if ( begin ) {
+        if ( script )        { searchStopper = scriptEnd;   }
+        else if ( style )    { searchStopper = styleEnd;    }
+        else if ( textarea ) { searchStopper = textareaEnd; }
+        else if ( listing )  { searchStopper = listingEnd;  }
+        searchStopperLen = strlen( searchStopper );
+    }
+    if ( comment ) parseComment( src );
 
-        // Allocate memory to store the script. We will write maximal
-        // 10 characers.
+    while ( src.length() ) {
         checkScriptBuffer();
-
-        char ch = src->latin1();
-
-        if ( !escaped && !src.escaped() && script ) {
+        unsigned char ch = src->latin1();
+        if ( !scriptCodeResync && ch == '-' && scriptCodeSize >= 3 && !src.escaped() && QConstString( scriptCode+scriptCodeSize-3, 3 ).string() == "<!-" ) {
+            comment = true;
+            parseComment( src );
+            continue;
+        }
+        if ( scriptCodeResync && !tquote && ( ch == '>' ) ) {
+            ++src;
+            scriptCodeSize = scriptCodeResync-1;
+            scriptCodeResync = 0;
+            scriptCode[ scriptCodeSize ] = scriptCode[ scriptCodeSize + 1 ] = 0;
+            if ( script )
+                scriptHandler();
+            else {
+                processListing(DOMStringIt(scriptCode, scriptCodeSize));
+                if ( style )         { currToken.id = ID_STYLE + ID_CLOSE_TAG; }
+                else if ( textarea ) { currToken.id = ID_TEXTAREA + ID_CLOSE_TAG; }
+                else if ( listing )  { currToken.id = ID_LISTING + ID_CLOSE_TAG; }
+                processToken();
+                style = script = style = textarea = listing = false;
+                scriptCodeSize = scriptCodeResync = 0;
+            }
+            return;
+        }
+        // possible end of tagname, lets check.
+        if ( !scriptCodeResync && !escaped && !src.escaped() && ( ch == '>' || ch == '/' || ch <= ' ' ) && ch &&
+             scriptCodeSize >= searchStopperLen &&
+             !QConstString( scriptCode+scriptCodeSize-searchStopperLen, searchStopperLen+1 ).string().find( searchStopper, 0, false )) {
+            scriptCodeResync = scriptCodeSize-searchStopperLen+1;
+            tquote = NoQuote;
+            continue;
+        }
+        if ( scriptCodeResync && !escaped ) {
             if(ch == '\"')
                 tquote = (tquote == NoQuote) ? DoubleQuote : ((tquote == SingleQuote) ? SingleQuote : NoQuote);
             else if(ch == '\'')
@@ -298,150 +321,8 @@ void HTMLTokenizer::parseListing( DOMStringIt &src)
             else if (tquote != NoQuote && (ch == '\r' || ch == '\n'))
                 tquote = NoQuote;
         }
-
-        if ( !escaped && !src.escaped() && ( ch == '>' ) &&
-             ( ( searchFor[ searchCount ] == '>' && tquote == NoQuote ) || searchFor[searchCount] == ' '))
-        {
-            ++src;
-            searchCount = 0;
-            scriptCode[ scriptCodeSize ] = 0;
-            scriptCode[ scriptCodeSize + 1 ] = 0;
-            if (script) {
-                if (!scriptSrc.isEmpty()) {
-                    // forget what we just got; load from src url instead
-                    cachedScript = parser->doc()->docLoader()->requestScript(scriptSrc, parser->doc()->baseURL(), scriptSrcCharset);
-                    scriptSrc="";
-                }
-                else {
-#ifdef TOKEN_DEBUG
-                    kdDebug( 6036 ) << "---START SCRIPT---" << endl;
-                    kdDebug( 6036 ) << QString(scriptCode, scriptCodeSize) << endl;
-                    kdDebug( 6036 ) << "---END SCRIPT---" << endl;
-#endif
-                    // Parse scriptCode containing <script> info
-                    doScriptExec = true;
-                }
-            }
-            else if (style)
-            {
-#ifdef TOKEN_DEBUG
-                kdDebug( 6036 ) << "---START STYLE---" << endl;
-                kdDebug( 6036 ) << QString(scriptCode, scriptCodeSize) << endl;
-                kdDebug( 6036 ) << "---END STYLE---" << endl;
-#endif
-            }
-            addListing(DOMStringIt(scriptCode, scriptCodeSize));
-
-            if(script)
-                currToken.id = ID_SCRIPT + ID_CLOSE_TAG;
-            else if(style)
-                currToken.id = ID_STYLE + ID_CLOSE_TAG;
-            else if (textarea)
-                currToken.id = ID_TEXTAREA + ID_CLOSE_TAG;
-            else
-                currToken.id = ID_LISTING + ID_CLOSE_TAG;
-            processToken();
-            QString prependingSrc;
-
-            if (cachedScript) {
-//                 qDebug( "cachedscript extern!" );
-//                 qDebug( "src: *%s*", QString( src.current(), src.length() ).latin1() );
-//                 qDebug( "pending: *%s*", pendingSrc.latin1() );
-                pendingSrc.prepend( QString(src.current(), src.length() ) );
-                _src = QString::null;
-                src = DOMStringIt(_src);
-                scriptCodeSize = 0;
-                cachedScript->ref(this);
-                // will be 0 if script was already loaded and ref() executed it
-                if (cachedScript)
-                    loadingExtScript = true;
-            }
-            else if (view && doScriptExec && javascript && !parser->skipMode()) {
-                if ( !m_executingScript )
-                    pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
-                else
-                    prependingSrc = QString( src.current(), src.length() ); // deep copy
-
-                _src = QString::null;
-                src = DOMStringIt( _src );
-                m_executingScript++;
-                script = false;
-                QString exScript( scriptCode, scriptCodeSize ); // deep copy
-                scriptCodeSize = 0;
-		view->part()->executeScript(exScript);
-                script = true;
-                m_executingScript--;
-            }
-            script = style = listing = textarea = false;
-            scriptCodeSize = 0;
-            if ( !m_executingScript && !loadingExtScript )
-                addPendingSource();
-            else if ( !prependingSrc.isEmpty() )
-                write( prependingSrc, false );
-
-
-            return; // Finished parsing script/style/listing
-        }
-        // Find out wether we see an end tag without looking at
-        // any other then the current character, since further characters
-        // may still be on their way thru the web!
-        else if ( searchCount > 0 )
-        {
-            const QChar& cmp = *src;
-              kdDebug(6050) << "KHTMLPart::checkEmitLoadEvent " << this << endl;
-
-            if (!escaped && !src.escaped() &&
-                ( cmp <= ' ' || cmp == '>' ) && searchFor[ searchCount ] == ' ') {
-                searchBuffer[ searchCount++] = cmp;
-                ++src;
-                continue;
-            }
-            // </script> can be in a quoted section! ( IE 5.5 )
-            else if (!escaped && !src.escaped() &&
-                searchFor[searchCount] != QChar::null && cmp.lower() == searchFor[ searchCount ] )
-            {
-                searchBuffer[ searchCount++ ] = cmp;
-                ++src;
-                continue;
-            }
-            // be tolerant: skip garbage before the ">", i.e "</script foo>"
-            else if ( ( !script || ( tquote == NoQuote && cmp != '>' ) || ( tquote != NoQuote ) ) &&
-                      searchFor[searchCount].latin1() == '>' )
-            {
-                ++src;
-                continue;
-            }
-            // We were wrong => print all buffered characters and the current one;
-            else
-            {
-                searchBuffer[ searchCount ] = 0;
-                DOMStringIt pit(searchBuffer,searchCount);
-                while (pit.length()) {
-                    if (textarea && *pit == '&') {
-                        QChar *scriptCodeDest = scriptCode+scriptCodeSize;
-                        ++pit;
-                        parseEntity(pit,scriptCodeDest,true);
-                        scriptCodeSize = scriptCodeDest-scriptCode;
-                    }
-                    else {
-                        scriptCode[ scriptCodeSize++ ] = *pit;
-                        ++pit;
-                    }
-                }
-                searchCount = 0;
-                // no continue here!
-            }
-        }
-        // Is this perhaps the start of the </script> or </style> tag?
-        else if ( !escaped && !src.escaped() && ch == '<' )
-        {
-            searchCount = 1;
-            searchBuffer[ 0 ] = *src;
-            ++src;
-            continue;
-        }
-
-        if (textarea && !escaped && !src.escaped() && ch == '&') {
+        escaped = ( !escaped && ch == '\\' );
+        if (!scriptCodeResync && textarea && !src.escaped() && ch == '&') {
             QChar *scriptCodeDest = scriptCode+scriptCodeSize;
             ++src;
             parseEntity(src,scriptCodeDest,true);
@@ -449,56 +330,103 @@ void HTMLTokenizer::parseListing( DOMStringIt &src)
         }
         else {
             scriptCode[ scriptCodeSize++ ] = *src;
-            if ( script && !escaped && ch == '\\' )
-                escaped = true;
-            else
-                escaped = false;
-
             ++src;
         }
     }
 }
 
-void HTMLTokenizer::parseScript(DOMStringIt &src)
+void HTMLTokenizer::scriptHandler()
 {
-    parseListing(src);
+    // We are inside a <script>
+    bool doScriptExec = false;
+    if (!scriptSrc.isEmpty()) {
+        // forget what we just got; load from src url instead
+        cachedScript = parser->doc()->docLoader()->requestScript(scriptSrc, parser->doc()->baseURL(), scriptSrcCharset);
+        scriptSrc="";
+    }
+    else {
+#ifdef TOKEN_DEBUG
+        kdDebug( 6036 ) << "---START SCRIPT---" << endl;
+        kdDebug( 6036 ) << QString(scriptCode, scriptCodeSize) << endl;
+        kdDebug( 6036 ) << "---END SCRIPT---" << endl;
+#endif
+        // Parse scriptCode containing <script> info
+        doScriptExec = true;
+    }
+    processListing(DOMStringIt(scriptCode, scriptCodeSize));
+    currToken.id = ID_SCRIPT + ID_CLOSE_TAG;
+    processToken();
+
+    QString prependingSrc;
+    if (cachedScript) {
+//                 qDebug( "cachedscript extern!" );
+//                 qDebug( "src: *%s*", QString( src.current(), src.length() ).latin1() );
+//                 qDebug( "pending: *%s*", pendingSrc.latin1() );
+        pendingSrc.prepend( QString(src.current(), src.length() ) );
+        _src = QString::null;
+        src = DOMStringIt(_src);
+        scriptCodeSize = scriptCodeResync = 0;
+        cachedScript->ref(this);
+        // will be 0 if script was already loaded and ref() executed it
+        if (cachedScript)
+            loadingExtScript = true;
+    }
+    else if (view && doScriptExec && javascript && !parser->skipMode()) {
+        if ( !m_executingScript )
+            pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
+        else
+            prependingSrc = QString( src.current(), src.length() ); // deep copy
+
+        _src = QString::null;
+        src = DOMStringIt( _src );
+        QString exScript( scriptCode, scriptCodeSize ); // deep copy
+        scriptCodeSize = scriptCodeResync = 0;
+        scriptExecution( exScript );
+    }
+    script = false;
+    scriptCodeSize = scriptCodeResync = 0;
+    if ( !m_executingScript && !loadingExtScript )
+        addPendingSource();
+    else if ( !prependingSrc.isEmpty() )
+        write( prependingSrc, false );
 }
-void HTMLTokenizer::parseStyle(DOMStringIt &src)
+
+void HTMLTokenizer::scriptExecution( const QString& str )
 {
-    parseListing(src);
+    bool oldscript = script;
+    m_executingScript++;
+    script = false;
+    view->part()->executeScript(str);
+    m_executingScript--;
+    script = oldscript;
 }
 
 void HTMLTokenizer::parseComment(DOMStringIt &src)
 {
-#ifdef TOKEN_DEBUG
-    kdDebug( 6036 ) << "HTMLTokenizer::parseComment()" << endl;
-#endif
-
     checkScriptBuffer(src.length());
-    while ( src.length() )
-    {
+    while ( src.length() ) {
+        scriptCode[ scriptCodeSize++ ] = *src;
         if (src->unicode() == '>' &&
-            ( brokenComments ||
-              ( scriptCodeSize >= 2 && scriptCode[scriptCodeSize-2] == '-' &&
-                scriptCode[scriptCodeSize-1] == '-' ) ) )
-        {
+            ( ( brokenComments && !( script || style || textarea || listing ) ) ||
+              ( scriptCodeSize > 2 && scriptCode[scriptCodeSize-3] == '-' &&
+                scriptCode[scriptCodeSize-2] == '-' ) ) ) {
             ++src;
+            if ( !( script || listing || textarea || style) ) {
 #ifdef COMMENTS_IN_DOM
-            checkScriptBuffer();
-            scriptCode[ scriptCodeSize ] = 0;
-            scriptCode[ scriptCodeSize + 1 ] = 0;
-            currToken.id = ID_COMMENT;
-            addListing(DOMStringIt(scriptCode, scriptCodeSize - 2));
-            processToken();
-            currToken.id = ID_COMMENT + ID_CLOSE_TAG;
-            processToken();
+                checkScriptBuffer();
+                scriptCode[ scriptCodeSize ] = 0;
+                scriptCode[ scriptCodeSize + 1 ] = 0;
+                currToken.id = ID_COMMENT;
+                processListing(DOMStringIt(scriptCode, scriptCodeSize - 2));
+                processToken();
+                currToken.id = ID_COMMENT + ID_CLOSE_TAG;
+                processToken();
 #endif
+                scriptCodeSize = 0;
+            }
             comment = false;
-            scriptCodeSize = 0;
             return; // Finished parsing comment
         }
-
-        scriptCode[ scriptCodeSize++ ] = *src;
         ++src;
     }
 }
@@ -508,7 +436,7 @@ void HTMLTokenizer::parseProcessingInstruction(DOMStringIt &src)
     char oldchar = 0;
     while ( src.length() )
     {
-        char chbegin = src->latin1();
+        unsigned char chbegin = src->latin1();
         if(chbegin == '\'') {
             tquote = tquote == SingleQuote ? NoQuote : SingleQuote;
         }
@@ -539,7 +467,7 @@ void HTMLTokenizer::parseText(DOMStringIt &src)
         checkBuffer();
 
         // ascii is okay because we only do ascii comparisons
-        char chbegin = src->latin1();
+        unsigned char chbegin = src->latin1();
 
         if (skipLF && ( chbegin != '\n' ))
         {
@@ -769,7 +697,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
             unsigned int ll = kMin(src.length(), CBUFLEN-cBufferPos);
             while(ll--) {
                 ushort curchar = *src;
-                if(curchar <= ' ' || curchar == '>') {
+                if(curchar <= ' ' || curchar == '>' ) {
                     finish = true;
                     break;
                 }
@@ -833,7 +761,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
             while(src.length()) {
                 curchar = *src;
                 if(curchar > ' ') {
-                    if(curchar == '>')
+                    if(curchar == '>' || curchar == '/')
                         tag = SearchEnd;
                     else if(atespace && (curchar == '\'' || curchar == '"'))
                     {
@@ -900,6 +828,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 qDebug("SearchEqual");
 #endif
             ushort curchar;
+            bool atespace = false;
             while(src.length()) {
                 curchar = src->unicode();
                 if(curchar > ' ') {
@@ -910,6 +839,12 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         tag = SearchValue;
                         ++src;
                     }
+                    else if(atespace && (curchar == '\'' || curchar == '"'))
+                    {
+                        tag = SearchValue;
+                        *dest++ = 0;
+                        attrName = QString::null;
+                    }
                     else {
                         AttrImpl* a = 0;
                         if(*buffer)
@@ -927,6 +862,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                     }
                     break;
                 }
+                atespace = true;
                 ++src;
             }
             break;
@@ -1022,7 +958,8 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                         parseEntity(src, dest, true);
                         break;
                     }
-                    if ( curchar <= ' ' || curchar == '>')
+                    // '/' does not delimit in IE!
+                    if ( curchar <= ' ' || curchar == '>' )
                     {
                         // no quotes. Every space means end of value
                         AttrImpl* a;
@@ -1079,7 +1016,7 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 scriptSrc = scriptSrcCharset = "";
                 if ( currToken.attrs && !parser->doc()->view()->part()->onlyLocalReferences()) {
                     if ( ( a = currToken.attrs->getIdItem( ATTR_SRC ) ) )
-                        scriptSrc = khtml::parseURL( a->value() ).string();
+                        scriptSrc = parser->doc()->view()->part()->completeURL(khtml::parseURL( a->value() ).string() ).url();
                     if ( ( a = currToken.attrs->getIdItem( ATTR_CHARSET ) ) )
                         scriptSrcCharset = a->value().string().stripWhiteSpace();
                     a = currToken.attrs->getIdItem( ATTR_LANGUAGE );
@@ -1123,44 +1060,20 @@ void HTMLTokenizer::parseTag(DOMStringIt &src)
                 pre = beginTag;
                 break;
             case ID_TEXTAREA:
-                if(beginTag) {
-                    listing = true;
-                    textarea = true;
-                    searchCount = 0;
-                    searchFor = textareaEnd;
-                    parseListing(src);
-                }
+                if(beginTag)
+                    parseSpecial(src, textarea = true );
                 break;
             case ID_SCRIPT:
-                if (beginTag) {
-#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
-                    kdDebug( 6036 ) << "start of script, token->id = " << currToken.id << endl;
-#endif
-                    script = true;
-                    searchCount = 0;
-                    searchFor = scriptEnd;
-                    tquote = NoQuote;
-                    parseScript(src);
-#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
-                    kdDebug( 6036 ) << "end of script" << endl;
-#endif
-                }
+                if (beginTag)
+                    parseSpecial(src, script = true);
                 break;
             case ID_STYLE:
-                if (beginTag) {
-                    style = true;
-                    searchCount = 0;
-                    searchFor = styleEnd;
-                    parseStyle(src);
-                }
+                if (beginTag)
+                    parseSpecial(src, style = true);
                 break;
             case ID_LISTING:
-                if (beginTag) {
-                    listing = true;
-                    searchCount = 0;
-                    searchFor = listingEnd;
-                    parseListing(src);
-                }
+                if (beginTag)
+                    parseSpecial(src, listing = true);
                 break;
             case ID_SELECT:
                 select = beginTag;
@@ -1241,7 +1154,7 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
     if ( !buffer )
         return;
 
-    if ( loadingExtScript || ( m_executingScript && appendData ) ) {
+    if ( appendData && (loadingExtScript || m_executingScript ) ) {
         // don't parse; we will do this later
         pendingSrc += str;
         return;
@@ -1264,14 +1177,16 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
     if ( src.length() ) {
         if (plaintext)
             parseText(src);
-        else if (comment)
-            parseComment(src);
         else if (script)
-            parseScript(src);
+            parseSpecial(src, false);
         else if (style)
-            parseStyle(src);
+            parseSpecial(src, false);
         else if (listing)
-            parseListing(src);
+            parseSpecial(src, false);
+        else if (textarea)
+            parseSpecial(src, false);
+        else if (comment)
+            parseComment(src);
         else if (processingInstruction)
             parseProcessingInstruction(src);
         else if (tag)
@@ -1292,6 +1207,9 @@ void HTMLTokenizer::write( const QString &str, bool appendData )
             skipLF = false;
             ++src;
         }
+        else if ( Entity ) {
+            parseEntity( src, dest );
+        }
         else if ( plaintext ) {
             parseText( src );
         }
@@ -1470,7 +1388,9 @@ void HTMLTokenizer::end()
         return;
     }
 
-    processToken();
+    // parseTag is using the buffer for different matters
+    if ( !tag )
+        processToken();
 
     if(buffer)
         KHTML_DELETE_QCHAR_VEC(buffer);
@@ -1479,7 +1399,7 @@ void HTMLTokenizer::end()
         KHTML_DELETE_QCHAR_VEC(scriptCode);
 
     scriptCode = 0;
-    scriptCodeSize = scriptCodeMaxSize = 0;
+    scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
     buffer = 0;
     emit finishedParsing();
 }
@@ -1494,15 +1414,23 @@ void HTMLTokenizer::finish()
         checkScriptBuffer();
         scriptCode[ scriptCodeSize ] = 0;
         scriptCode[ scriptCodeSize + 1 ] = 0;
-        int pos = QConstString(scriptCode, scriptCodeSize).string().find('>');
+        int pos;
         QString food;
-        food.setUnicode(scriptCode+pos+1, scriptCodeSize-pos-1); // deep copy
+        if ( script || style || textarea || listing ) {
+            pos = QConstString( scriptCode, scriptCodeSize ).string().find( searchStopper, 0, false );
+            if ( pos >= 0 )
+                food.setUnicode( scriptCode+pos, scriptCodeSize-pos ); // deep copy
+        }
+        else {
+            pos = QConstString(scriptCode, scriptCodeSize).string().find('>');
+            food.setUnicode(scriptCode+pos+1, scriptCodeSize-pos-1); // deep copy
+        }
         KHTML_DELETE_QCHAR_VEC(scriptCode);
         scriptCode = 0;
-        scriptCodeSize = scriptCodeMaxSize = 0;
-        script = style = listing = comment = textarea = false;
-        scriptCodeSize = 0;
-        write(food, true);
+        scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0;
+        comment = false;
+        if ( !food.isEmpty() )
+            write(food, true);
     }
     // this indicates we will not recieve any more data... but if we are waiting on
     // an external script to load, we can't finish parsing until that is done
@@ -1516,8 +1444,11 @@ void HTMLTokenizer::processToken()
     if ( dest > buffer )
     {
 #ifdef TOKEN_DEBUG
-        if(currToken.id && currToken.id != ID_COMMENT)
+        if(currToken.id && currToken.id != ID_COMMENT) {
+            qDebug( "unexpected token id: %d, str: *%s*", currToken.id,QConstString( buffer,dest-buffer ).string().latin1() );
             assert(0);
+        }
+
 #endif
         if ( currToken.complexText ) {
             // ### we do too much QString copying here, but better here than in RenderText...
@@ -1612,12 +1543,7 @@ void HTMLTokenizer::notifyFinished(CachedObject *finishedObj)
 //         pendingSrc.prepend( QString( src.current(), src.length() ) ); // deep copy - again
         _src = QString::null;
         src = DOMStringIt( _src );
-        bool oldscript = script;
-        script = false;
-        m_executingScript++;
-        view->part()->executeScript(scriptSource.string());
-        m_executingScript--;
-        script = oldscript;
+        scriptExecution( scriptSource.string() );
         // 'script' is true when we are called synchronously from
         // parseScript(). In that case parseScript() will take care
         // of 'scriptOutput'.
diff --git a/WebCore/src/kdelibs/khtml/html/htmltokenizer.h b/WebCore/src/kdelibs/khtml/html/htmltokenizer.h
index 40423e6..0a3a551 100644
--- a/WebCore/src/kdelibs/khtml/html/htmltokenizer.h
+++ b/WebCore/src/kdelibs/khtml/html/htmltokenizer.h
@@ -163,17 +163,17 @@ protected:
     void reset();
     void addPending();
     void processToken();
-
-    void addListing(khtml::DOMStringIt list);
+    void processListing(khtml::DOMStringIt list);
 
     void parseComment(khtml::DOMStringIt &str);
     void parseText(khtml::DOMStringIt &str);
-    void parseStyle(khtml::DOMStringIt &str);
-    void parseScript(khtml::DOMStringIt &str);
     void parseListing(khtml::DOMStringIt &str);
+    void parseSpecial(khtml::DOMStringIt &str, bool begin);
     void parseTag(khtml::DOMStringIt &str);
     void parseEntity(khtml::DOMStringIt &str, QChar *&dest, bool start = false);
     void parseProcessingInstruction(khtml::DOMStringIt &str);
+    void scriptHandler();
+    void scriptExecution(const QString& script);
     void addPendingSource();
 
     // check if we have enough space in the buffer.
@@ -264,10 +264,10 @@ protected:
         SearchSemicolon
     } Entity;
 
-    QChar EntityChar;
+    // are we in a <script> ... </script block
+    bool script;
 
-    // Flag to say that we are just parsing an attribute
-    bool parseAttr;
+    QChar EntityChar;
 
     // Are we in a <pre> ... </pre> block
     bool pre;
@@ -275,9 +275,6 @@ protected:
     // if 'pre == true' we track in which column we are
     int prePos;
 
-    // Are we in a <script> ... </script> block
-    bool script;
-
     // Are we in a <style> ... </style> block
     bool style;
 
@@ -311,13 +308,19 @@ protected:
     int scriptCodeSize;
     // Maximal size that can be stored in @ref #scriptCode
     int scriptCodeMaxSize;
-
+    // resync point of script code size
+    int scriptCodeResync;
+    
     // Stores characters if we are scanning for a string like "</script>"
     QChar searchBuffer[ 10 ];
     // Counts where we are in the string we are scanning for
     int searchCount;
     // The string we are searching for
     const QChar *searchFor;
+    // the stopper string
+    const char* searchStopper;
+    // the stopper len
+    int searchStopperLen;
     // true if we are waiting for an external script (<SCRIPT SRC=...) to load, i.e.
     // we don't do any parsing while this is true
     bool loadingExtScript;
diff --git a/WebCore/src/kdelibs/khtml/khtml.desktop b/WebCore/src/kdelibs/khtml/khtml.desktop
index b0eb335..150d08e 100644
--- a/WebCore/src/kdelibs/khtml/khtml.desktop
+++ b/WebCore/src/kdelibs/khtml/khtml.desktop
@@ -1,7 +1,6 @@
 [Desktop Entry]
 Type=Service
 Comment=Embeddable HTML viewing component
-Comment[af]=INLEGBARE HTML AANSIG KOMPONENT
 Comment[az]=Hopdurula Bilən HTML nümayiş vasitəsi
 Comment[bg]=Елемент за преглед на вградени HTML
 Comment[br]=Parzh HTML gweler enframmus
@@ -45,8 +44,8 @@ Comment[ta]=¯ð¦À¡¾¢ì¸ÅøÄ HTML ¸¡ðº¢ì ÜÚ
 Comment[tr]=Gömülebilir HTML görüntüleme aracı
 Comment[uk]=Вбудований копмонент-переглядач HTML
 Comment[vi]=Component đềExem HTML có thềEembedd được 
+Comment[xh]=Inxenye yemboniselo elungisiweyo ye HTML
 Comment[zh_CN.GB2312]=嵌入的 HTML 查看部件
-Comment[zh_TW.Big5]=內建式 HTML 檢視元件
 MimeType=text/html;text/xml;
 Icon=konqueror
 Name=KHTML
diff --git a/WebCore/src/kdelibs/khtml/khtml_part.cpp b/WebCore/src/kdelibs/khtml/khtml_part.cpp
index 519f320..75e795d 100644
--- a/WebCore/src/kdelibs/khtml/khtml_part.cpp
+++ b/WebCore/src/kdelibs/khtml/khtml_part.cpp
@@ -151,7 +151,6 @@ public:
     m_settings = new KHTMLSettings(*KHTMLFactory::defaultHTMLSettings());
     m_bClearing = false;
     m_bCleared = false;
-    m_userSheet = QString::null;
     m_fontBase = 0;
     m_bDnd = true;
     m_startOffset = m_endOffset = 0;
@@ -305,9 +304,6 @@ public:
 
   KParts::PartManager *m_manager;
 
-  DOM::DOMString m_userSheet;
-  DOM::DOMString m_userSheetUrl;
-
   QString m_popupMenuXML;
 
   int m_fontBase;
@@ -323,6 +319,7 @@ public:
     const char *submitAction;
     QString submitUrl;
     QByteArray submitFormData;
+    QString target;
     QString submitContentType;
     QString submitBoundary;
   };
@@ -380,12 +377,10 @@ namespace khtml {
     class PartStyleSheetLoader : public CachedObjectClient
     {
     public:
-        PartStyleSheetLoader(KHTMLPart *part, KHTMLPartPrivate *priv, DOM::DOMString url, DocLoader */*docLoader*/)
+        PartStyleSheetLoader(KHTMLPart *part, DOM::DOMString url, DocLoader* dl)
         {
             m_part = part;
-            m_priv = priv;
-            // the "foo" is needed, so that the docloader for the empty document doesn't cancel this request.
-            m_cachedSheet = Cache::requestStyleSheet(0, url, DOMString("foo") );
+            m_cachedSheet = dl->requestStyleSheet( url, part->baseURL().url(), QString::null );
             if (m_cachedSheet)
 		m_cachedSheet->ref( this );
         }
@@ -393,20 +388,14 @@ namespace khtml {
         {
             if ( m_cachedSheet ) m_cachedSheet->deref(this);
         }
-        virtual void setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheet)
+        virtual void setStyleSheet(const DOM::DOMString&, const DOM::DOMString &sheet)
         {
-            if ( m_part )
-            {
-                m_priv->m_userSheet = sheet;
-                m_priv->m_userSheetUrl = url;
-            }
-            khtml::CSSStyleSelector::setUserStyle( sheet );
-            if ( m_part && m_priv->m_doc )
-                m_priv->m_doc->applyChanges();
+          if ( m_part )
+            m_part->setUserStyleSheet( sheet.string() );
+
             delete this;
         }
         QGuardedPtr<KHTMLPart> m_part;
-        KHTMLPartPrivate *m_priv;
         khtml::CachedCSSStyleSheet *m_cachedSheet;
     };
 };
@@ -511,10 +500,6 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
   d->m_bJavaEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaEnabled();
   d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled();
 
-  QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
-  if ( !userStyleSheet.isEmpty() )
-      setUserStyleSheet( KURL( userStyleSheet ) );
-
   connect( this, SIGNAL( completed() ),
            this, SLOT( updateActions() ) );
   connect( this, SIGNAL( completed( bool ) ),
@@ -627,7 +612,7 @@ bool KHTMLPart::openURL( const KURL &url )
   // operation and d) the caller did not request to reload the page we try to
   // be smart and instead of reloading the whole document we just jump to the
   // request html anchor
-  if ( d->m_frames.count() == 0 &&
+  if ( d->m_frames.count() == 0 && d->m_doc && d->m_bComplete &&
        urlcmp( url.url(), m_url.url(), true, true ) && !args.doPost() && !args.reload )
   {
     kdDebug( 6050 ) << "KHTMLPart::openURL now m_url = " << url.url() << endl;
@@ -645,7 +630,12 @@ bool KHTMLPart::openURL( const KURL &url )
     emitLoadEvent();
 
     kdDebug( 6050 ) << "completed..." << endl;
-    emit completed();
+    if ( !d->m_redirectURL.isEmpty() )
+    {
+       emit completed(true);
+    }
+    else emit completed();
+
     return true;
   }
 
@@ -1377,6 +1367,9 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
   d->m_doc->setURL( m_url.url() );
 
   setAutoloadImages( KHTMLFactory::defaultHTMLSettings()->autoLoadImages() );
+  QString userStyleSheet = KHTMLFactory::defaultHTMLSettings()->userStyleSheet();
+  if ( !userStyleSheet.isEmpty() )
+    setUserStyleSheet( KURL( userStyleSheet ) );
 
   d->m_doc->setRestoreState(args.docState);
   d->m_doc->open();
@@ -1641,7 +1634,6 @@ void KHTMLPart::checkEmitLoadEvent()
 {
   if ( d->m_bLoadEventEmitted || d->m_bParsing )
     return;
-  kdDebug(6050) << "KHTMLPart::checkEmitLoadEvent " << this << endl;
   ConstFrameIt it = d->m_frames.begin();
   ConstFrameIt end = d->m_frames.end();
   for (; it != end; ++it )
@@ -1653,6 +1645,7 @@ void KHTMLPart::checkEmitLoadEvent()
 void KHTMLPart::emitLoadEvent()
 {
   d->m_bLoadEventEmitted = true;
+  kdDebug(6050) << "KHTMLPart::emitLoadEvent " << this << endl;
 
   if ( d->m_doc && d->m_doc->isHTMLDocument() ) {
     HTMLDocumentImpl* hdoc = static_cast<HTMLDocumentImpl*>( d->m_doc );
@@ -1731,6 +1724,7 @@ void KHTMLPart::slotRedirect()
   QString target;
   u = splitUrlTarget( u, &target );
   KParts::URLArgs args;
+  args.reload = true;
   args.setLockHistory( true );
   urlSelected( u, 0, 0, target, args );
 }
@@ -1791,21 +1785,20 @@ QString KHTMLPart::encoding()
 
 void KHTMLPart::setUserStyleSheet(const KURL &url)
 {
-    d->m_userSheetUrl = DOMString();
-    d->m_userSheet = DOMString();
-    (void) new khtml::PartStyleSheetLoader(this, d, url.url(), d->m_doc ? d->m_doc->docLoader() : 0);
+  if ( d->m_doc && d->m_doc->docLoader() )
+    (void) new khtml::PartStyleSheetLoader(this, url.url(), d->m_doc->docLoader());
 }
 
 void KHTMLPart::setUserStyleSheet(const QString &styleSheet)
 {
-    d->m_userSheet = styleSheet;
-    d->m_userSheetUrl = DOMString();
-    khtml::CSSStyleSelector::setUserStyle( styleSheet );
+  if ( d->m_doc )
+    d->m_doc->setUserStyleSheet( styleSheet );
 }
 
-
 bool KHTMLPart::gotoAnchor( const QString &name )
 {
+  if (!d->m_doc)
+      return false;
   HTMLCollectionImpl *anchors =
       new HTMLCollectionImpl( d->m_doc, HTMLCollectionImpl::DOC_ANCHORS);
   anchors->ref();
@@ -2783,6 +2776,7 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url
       KHTMLPart* p = static_cast<KHTMLPart*>(static_cast<KParts::ReadOnlyPart *>(child->m_part));
 
       p->begin();
+      p->m_url = url;
       p->write(url.path());
       p->end();
       return true;
@@ -2855,7 +2849,7 @@ KParts::PartManager *KHTMLPart::partManager()
 void KHTMLPart::submitFormAgain()
 {
   if( !d->m_bParsing && d->m_submitForm)
-    KHTMLPart::submitForm( d->m_submitForm->submitAction, d->m_submitForm->submitUrl, d->m_submitForm->submitFormData, d->m_submitForm->submitContentType, d->m_submitForm->submitBoundary );
+    KHTMLPart::submitForm( d->m_submitForm->submitAction, d->m_submitForm->submitUrl, d->m_submitForm->submitFormData, d->m_submitForm->target, d->m_submitForm->submitContentType, d->m_submitForm->submitBoundary );
 
   delete d->m_submitForm;
   d->m_submitForm = 0;
@@ -2927,6 +2921,7 @@ void KHTMLPart::submitForm( const char *action, const QString &url, const QByteA
     d->m_submitForm->submitAction = action;
     d->m_submitForm->submitUrl = url;
     d->m_submitForm->submitFormData = formData;
+    d->m_submitForm->target = _target;
     d->m_submitForm->submitContentType = contentType;
     d->m_submitForm->submitBoundary = boundary;
     connect(this, SIGNAL(completed()), this, SLOT(submitFormAgain()));
@@ -3265,7 +3260,7 @@ void KHTMLPart::restoreState( QDataStream &stream )
   Q_INT32 charset;
   long old_cacheId = d->m_cacheId;
   QString encoding;
-  
+
   stream >> u >> xOffset >> yOffset;
 
   // restore link cursor position
@@ -3281,8 +3276,8 @@ void KHTMLPart::restoreState( QDataStream &stream )
   d->m_encoding = encoding;
   if ( d->m_settings ) d->m_settings->setCharset( d->m_charset );
   kdDebug(6050)<<"restoring charset to:"<< charset << endl;
-  
-  
+
+
   stream >> fSizes >> d->m_fontBase;
   // ### odd: this doesn't appear to have any influence on the used font
   // sizes :(
diff --git a/WebCore/src/kdelibs/khtml/khtml_settings.cc b/WebCore/src/kdelibs/khtml/khtml_settings.cc
index 8de2a2c..19ca5b1 100644
--- a/WebCore/src/kdelibs/khtml/khtml_settings.cc
+++ b/WebCore/src/kdelibs/khtml/khtml_settings.cc
@@ -123,14 +123,14 @@ void KHTMLSettings::init( KConfig * config, bool reset )
 	defaultFonts.append( QString( "0" ) ); // font size adjustment
     }
 
+    if ( reset || config->hasKey( "MinimumFontSize" ) )
+        m_minFontSize = config->readNumEntry( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE );
+
     if ( reset || config->hasKey( "MediumFontSize" ) ) {
         m_fontSize = config->readNumEntry( "MediumFontSize", 10 );
         resetFontSizes();
     }
 
-    if ( reset || config->hasKey( "MinimumFontSize" ) )
-        m_minFontSize = config->readNumEntry( "MinimumFontSize", HTML_DEFAULT_MIN_FONT_SIZE );
-
     QStringList chSets = KGlobal::charsets()->availableCharsetNames();
     for ( QStringList::Iterator it = chSets.begin(); it != chSets.end(); ++it ) {
         if ( reset || config->hasKey( *it ) ){
diff --git a/WebCore/src/kdelibs/khtml/khtmlimage.desktop b/WebCore/src/kdelibs/khtml/khtmlimage.desktop
index f79edad..aba499a 100644
--- a/WebCore/src/kdelibs/khtml/khtmlimage.desktop
+++ b/WebCore/src/kdelibs/khtml/khtmlimage.desktop
@@ -1,7 +1,6 @@
 [Desktop Entry]
 Type=Service
 Comment=Embeddable Image Viewing Component
-Comment[af]=INLEGBARE BEELD AANSIG KOMPONENT
 Comment[az]=Hopdurula Bilən Rəsm Nümayiş Vasitəsi
 Comment[bg]=Вграден елемент на преглед за картини
 Comment[cs]=Komponenta pro zobrazování obrázků
@@ -39,11 +38,10 @@ Comment[ta]=¯ð¦À¡¾¢ó¾ ¯ì¸¡ðÊì ÜÚ
 Comment[tr]=Gömülebilir Resim Görüntüleme Aracı
 Comment[uk]=Вбудований копмонент-переглядач образів
 Comment[vi]=Component đềExem ảnh có thềEembedd được 
+Comment[xh]=Inxenye yemboniselo yomfanekiso olungisiweyo
 Comment[zh_CN.GB2312]=可嵌入的图像查看部件
-Comment[zh_TW.Big5]=可嵌入的圖形檢視元件
 MimeType=image/gif;image/x-xpm;image/x-xbm;image/jpeg;image/bmp;image/png;image/x-ico;
 Name=Embeddable Image Viewer
-Name[af]=INLEGBARE BEELD AANSIG
 Name[az]=Daxili Rəsm Nümayişçisi
 Name[bg]=Вграден преглед на картини
 Name[cs]=Zabudovaný prohlížeč obrázků
@@ -81,8 +79,8 @@ Name[ta]=¯ð¦À¡¾¢ó¾ ¯Õì ¸¡ðÊ
 Name[tr]=Gömülü Resim Görüntüleyici
 Name[uk]=Вмонтований переглядач образів
 Name[vi]=Trình xem ảnh có thềEembedd được 
+Name[xh]=Umboniseli womfanekiso olungisiweyo
 Name[zh_CN.GB2312]=可嵌入的图像查看器
-Name[zh_TW.Big5]=可嵌入的圖形檢視器
 ServiceTypes=KParts/ReadOnlyPart
 InitialPreference=4
 X-KDE-Library=libkhtmlimage
diff --git a/WebCore/src/kdelibs/khtml/khtmlview.cpp b/WebCore/src/kdelibs/khtml/khtmlview.cpp
index a5d3b22..51228f3 100644
--- a/WebCore/src/kdelibs/khtml/khtmlview.cpp
+++ b/WebCore/src/kdelibs/khtml/khtmlview.cpp
@@ -1190,6 +1190,7 @@ void KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, bool
 						button,0);
 	me->ref();
 	targetNode->dispatchEvent(me,exceptioncode);
+	bool defaultHandled = me->defaultHandled();
 	me->deref();
 
 	// special case for HTML click & ondblclick handler
@@ -1200,8 +1201,9 @@ void KHTMLView::dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, bool
 				    ctrlKey,altKey,shiftKey,metaKey,
 				    button,0);
 
-
 	    me->ref();
+	    if (defaultHandled)
+		me->setDefaultHandled();
 	    targetNode->dispatchEvent(me,exceptioncode);
 	    me->deref();
 	}
@@ -1228,3 +1230,5 @@ void KHTMLView::focusOutEvent( QFocusEvent *e )
     m_part->stopAutoScroll();
     QScrollView::focusOutEvent( e );
 }
+
+// vim:ts=4:sw=4
diff --git a/WebCore/src/kdelibs/khtml/misc/loader.cpp b/WebCore/src/kdelibs/khtml/misc/loader.cpp
index 55410ea..a97ab03 100644
--- a/WebCore/src/kdelibs/khtml/misc/loader.cpp
+++ b/WebCore/src/kdelibs/khtml/misc/loader.cpp
@@ -387,9 +387,11 @@ CachedImage::CachedImage(const DOMString &url, const DOMString &baseURL, bool re
     p = 0;
     pixPart = 0;
     bg = 0;
+    bgColor = qRgba( 0, 0, 0, 0xFF );
     typeChecked = false;
     isFullyTransparent = false;
     errorOccured = false;
+    monochrome = false;
     formatType = 0;
     m_status = Unknown;
     m_size = 0;
@@ -442,27 +444,35 @@ void CachedImage::deref( CachedObjectClient *c )
 
 const QPixmap &CachedImage::tiled_pixmap(const QColor& newc)
 {
-    if (bg)
+
+    if ( newc.rgb() != bgColor ) {
+        delete bg; bg = 0;
+    }
+
+    if (bg) 
         return *bg;
 
     const QPixmap &r = pixmap();
 
-    if (r.isNull()) return r;
+    if (r.isNull()) 
+        return r;
 
     // no error indication for background images
-    if(errorOccured) return *Cache::nullPixmap;
-
-    if (newc != bgColor)
-    {
-        bool isvalid = newc.isValid();
-        QSize s(pixmap_size());
-        int w = r.width();
-        int h = r.height();
+    if(errorOccured)  
+      return *Cache::nullPixmap;
+
+    bool isvalid = newc.isValid();
+    QSize s(pixmap_size());
+    int w = r.width();
+    int h = r.height();
+    if ( w*h < 8192 ) {
         if ( r.width() < BGMINWIDTH )
             w = ((BGMINWIDTH  / s.width())+1) * s.width();
         if ( r.height() < BGMINHEIGHT )
             h = ((BGMINHEIGHT / s.height())+1) * s.height();
+    }
 
+    if ( w != r.width() || h != r.height() ) {
         bg = new QPixmap(w, h);
         QPixmap pix = pixmap();
         QPainter p(bg);
@@ -470,13 +480,16 @@ const QPixmap &CachedImage::tiled_pixmap(const QColor& newc)
         p.drawTiledPixmap(0, 0, w, h, pix);
         if(!isvalid && pix.mask())
         {
-            // unfortunately our avoid transparency trick doesn't work here
+            // unfortunately our anti-transparency trick doesn't work here
             // we need to create a mask.
             QBitmap newmask(w, h);
             QPainter pm(&newmask);
             pm.drawTiledPixmap(0, 0, w, h, *pix.mask());
             bg->setMask(newmask);
+            bgColor = qRgba( 0, 0, 0, 0xFF );
         }
+        else
+            bgColor= newc.rgb();
 
         return *bg;
     }
@@ -644,6 +657,7 @@ void CachedImage::clear()
     delete m;   m = 0;
     delete p;   p = 0;
     delete bg;  bg = 0;
+    bgColor = qRgba( 0, 0, 0, 0xff );
     delete pixPart; pixPart = 0;
 
     formatType = 0;
diff --git a/WebCore/src/kdelibs/khtml/misc/loader.h b/WebCore/src/kdelibs/khtml/misc/loader.h
index 87bbb14..11ec956 100644
--- a/WebCore/src/kdelibs/khtml/misc/loader.h
+++ b/WebCore/src/kdelibs/khtml/misc/loader.h
@@ -268,7 +268,7 @@ namespace khtml
         void do_notify(const QPixmap& p, const QRect& r);
 
         DOM::DOMString m_baseURL;
-        QColor bgColor;
+        QRgb bgColor;
 	QMovie* m;
         QPixmap* p;
 	QPixmap* bg;
@@ -279,6 +279,7 @@ namespace khtml
 
 	int width;
 	int height;
+        bool monochrome;
 
 	// Is set if movie format type ( incremental/animation) was checked
 	bool typeChecked;
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_form.cpp b/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
index 89c7510..44bcb41 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
@@ -940,12 +940,6 @@ void RenderSelect::layout( )
     }
     else {
         QSize s(m_widget->sizeHint());
-        KComboBox* w = static_cast<KComboBox*>(m_widget);
-        // and now disable the widget in case there is no <option> given
-        // ### do the same if there is only optgroups
-        if(!w->count())
-            w->setEnabled(false);
-
         setIntrinsicWidth( s.width() );
         setIntrinsicHeight( s.height() );
     }
@@ -954,6 +948,15 @@ void RenderSelect::layout( )
     setLayouted( false );
     RenderFormElement::layout();
 
+    // and now disable the widget in case there is no <option> given
+    QArray<HTMLGenericFormElementImpl*> listItems = select->listItems();
+    bool foundOption = false;
+    for (uint i = 0; i < listItems.size() && !foundOption; i++)
+	foundOption = (listItems[i]->id() == ID_OPTION);
+
+    if (!foundOption)
+	m_widget->setEnabled(false);
+
     m_ignoreSelectEvents = false;
 }
 
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp b/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp
index ee48b9c..aa1e4ab 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_frames.cpp
@@ -592,13 +592,15 @@ void RenderPart::setWidget( QWidget *widget )
 
     updateSize();
 
-    //slotViewCleared();
+    // make sure the scrollbars are set correctly for restore
+    // ### find better fix
+    slotViewCleared();
 }
 
 void RenderPart::layout( )
 {
     if ( m_widget )
-        m_widget->resize( QMIN( m_width, 2000 ), QMIN( m_height, 3072 ) );
+        m_widget->resize( QMIN( m_width, 2000 ), QMIN( m_height, 3860 ) );
 }
 
 void RenderPart::partLoadingErrorNotify()
@@ -615,6 +617,9 @@ int RenderPart::intrinsicHeight() const
     return 200;
 }
 
+void RenderPart::slotViewCleared()
+{
+}
 
 /***************************************************************************************/
 
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_frames.h b/WebCore/src/kdelibs/khtml/rendering/render_frames.h
index d50393c..c0db375 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_frames.h
+++ b/WebCore/src/kdelibs/khtml/rendering/render_frames.h
@@ -106,6 +106,9 @@ public:
     
     virtual short intrinsicWidth() const;
     virtual int intrinsicHeight() const;
+    
+public slots:
+    virtual void slotViewCleared();
 };
 
 class RenderFrame : public khtml::RenderPart
diff --git a/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.cpp b/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.cpp
index 368448d..b8a048c 100644
--- a/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.cpp
@@ -44,6 +44,7 @@ EventImpl::EventImpl()
     m_eventPhase = 0;
     m_target = 0;
     m_createTime = QDateTime::currentDateTime();
+    m_defaultHandled = false;
 }
 
 EventImpl::EventImpl(EventId _id, bool canBubbleArg, bool cancelableArg)
@@ -62,6 +63,7 @@ EventImpl::EventImpl(EventId _id, bool canBubbleArg, bool cancelableArg)
     m_eventPhase = 0;
     m_target = 0;
     m_createTime = QDateTime::currentDateTime();
+    m_defaultHandled = false;
 }
 
 EventImpl::~EventImpl()
@@ -286,6 +288,10 @@ DOMString EventImpl::idToType(EventImpl::EventId id)
     }
 }
 
+void EventImpl::setDefaultHandled()
+{
+    m_defaultHandled = true;
+}
 
 // -----------------------------------------------------------------------------
 
@@ -604,3 +610,5 @@ bool RegisteredEventListener::operator==(const RegisteredEventListener &other)
 	    listener == other.listener &&
 	    useCapture == other.useCapture);
 }
+
+// vim:ts=4:sw=4
diff --git a/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.h b/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.h
index cd16683..97e3d4f 100644
--- a/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.h
+++ b/WebCore/src/kdelibs/khtml/xml/dom2_eventsimpl.h
@@ -114,6 +114,9 @@ public:
     static EventId typeToId(DOMString type);
     static DOMString idToType(EventId id);
 
+    void setDefaultHandled();
+    bool defaultHandled() const { return m_defaultHandled; }
+
 protected:
     DOMStringImpl *m_type;
     bool m_canBubble;
@@ -121,6 +124,7 @@ protected:
 
     bool m_propagationStopped;
     bool m_defaultPrevented;
+    bool m_defaultHandled;
     EventId m_id;
     NodeImpl *m_currentTarget; // ref > 0 maintained externally
     unsigned short m_eventPhase;
@@ -271,3 +275,4 @@ public:
 
 }; //namespace
 #endif
+// vim:ts=4:sw=4
diff --git a/WebCore/src/kdelibs/khtml/xml/dom_docimpl.cpp b/WebCore/src/kdelibs/khtml/xml/dom_docimpl.cpp
index 07a3023..b921ada 100644
--- a/WebCore/src/kdelibs/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/xml/dom_docimpl.cpp
@@ -838,6 +838,14 @@ void DocumentImpl::setStyleSheet(const DOM::DOMString &url, const DOM::DOMString
     createSelector();
 }
 
+void DocumentImpl::setUserStyleSheet( const QString& sheet )
+{
+    if ( m_usersheet != sheet ) {
+        m_usersheet = sheet;
+        applyChanges();
+    }
+}
+
 CSSStyleSheetImpl* DocumentImpl::elementSheet()
 {
     if (!m_elemSheet) {
@@ -1102,7 +1110,7 @@ int DocumentImpl::findHighestTabIndex()
 
 ElementImpl *DocumentImpl::findNextLink(ElementImpl *cur, bool forward)
 {
-    int curTabIndex = (cur?cur->tabIndex():(forward?-1:0));
+    int curTabIndex = (cur?cur->tabIndex():(forward?1:-1));
 
     switch(curTabIndex)
     {
@@ -1143,8 +1151,9 @@ ElementImpl *DocumentImpl::notabindex(ElementImpl *cur, bool forward)
         return cur;
 
     if (forward)
-        return intabindex(cur, forward);
-    return 0;
+        return 0;
+    else
+        return tabindexzero(cur, forward);
 }
 
 ElementImpl *DocumentImpl::intabindex(ElementImpl *cur, bool forward)
@@ -1164,10 +1173,11 @@ ElementImpl *DocumentImpl::intabindex(ElementImpl *cur, bool forward)
             return cur;
         tmptabindex+=increment;
     }
+
     if (forward)
         return tabindexzero(cur, forward);
     else
-        return notabindex(cur, forward) ;
+        return 0;
 }
 
 ElementImpl *DocumentImpl::tabindexzero(ElementImpl *cur, bool forward)
@@ -1175,9 +1185,11 @@ ElementImpl *DocumentImpl::tabindexzero(ElementImpl *cur, bool forward)
     //REQ: tabindex of result must be 0 and it must be after the current node ;
     if ((cur = findLink(cur, forward, 0)))
         return cur;
-    if (!forward)
+
+    if (forward)
+        return notabindex(cur, forward);
+    else
         return intabindex(cur, forward);
-    return 0;
 }
 
 bool DocumentImpl::prepareMouseEvent( int _x, int _y,
diff --git a/WebCore/src/kdelibs/khtml/xml/dom_docimpl.h b/WebCore/src/kdelibs/khtml/xml/dom_docimpl.h
index 75b116b..4910606 100644
--- a/WebCore/src/kdelibs/khtml/xml/dom_docimpl.h
+++ b/WebCore/src/kdelibs/khtml/xml/dom_docimpl.h
@@ -182,6 +182,8 @@ public:
 
     // from cachedObjectClient
     virtual void setStyleSheet(const DOM::DOMString &url, const DOM::DOMString &sheetStr);
+    void setUserStyleSheet(const QString& sheet);
+    QString userStyleSheet() const { return m_usersheet; }
 
     CSSStyleSheetImpl* elementSheet();
     virtual Tokenizer *createTokenizer();
@@ -287,6 +289,7 @@ protected:
     DOMImplementationImpl *m_implementation;
 
     StyleSheetImpl *m_sheet;
+    QString m_usersheet;
     bool m_loadingSheet;
 
     CSSStyleSheetImpl *m_elemSheet;
diff --git a/WebCore/src/kdelibs/khtml/xml/dom_nodeimpl.cpp b/WebCore/src/kdelibs/khtml/xml/dom_nodeimpl.cpp
index bb097ba..58b39fc 100644
--- a/WebCore/src/kdelibs/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/src/kdelibs/khtml/xml/dom_nodeimpl.cpp
@@ -498,10 +498,10 @@ bool NodeImpl::dispatchGenericEvent( EventImpl *evt, int &/*exceptioncode */)
     evt->setCurrentTarget(0);
     evt->setEventPhase(0); // I guess this is correct, the spec does not seem to say
 
-    if (!evt->defaultPrevented() && evt->bubbles()) {
+    if (evt->bubbles()) {
         // now we call all default event handlers (this is not part of DOM - it is internal to khtml)
         it.toLast();
-        for (; it.current() && !evt->propagationStopped(); --it)
+        for (; it.current() && !evt->propagationStopped() && !evt->defaultPrevented() && !evt->defaultHandled(); --it)
             it.current()->defaultEventHandler(evt);
     }
 
@@ -1687,4 +1687,4 @@ void GenericRONamedNodeMapImpl::addNode(NodeImpl *n)
     n->ref();
     m_contents->append(n);
 }
-
+// vim:ts=4:sw=4
diff --git a/WebCore/src/kdelibs/kjs/Makefile.am b/WebCore/src/kdelibs/kjs/Makefile.am
index 1cd1be0..00f6e6f 100644
--- a/WebCore/src/kdelibs/kjs/Makefile.am
+++ b/WebCore/src/kdelibs/kjs/Makefile.am
@@ -39,7 +39,7 @@ noinst_HEADERS = nodes.h lexer.h regexp.h internal.h collector.h \
 	number_object.h date_object.h regexp_object.h error_object.h \
 	debugger.h
 
-libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined $(USER_LDFLAGS)
+libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined $(USER_LDFLAGS) $(all_libraries)
 libkjs_la_LIBADD = -lm $(LIBPCRE)
 
 parser: $(srcdir)/grammar.y
diff --git a/WebCore/src/kdelibs/kjs/Makefile.in b/WebCore/src/kdelibs/kjs/Makefile.in
index ca8efde..9b6fb8c 100644
--- a/WebCore/src/kdelibs/kjs/Makefile.in
+++ b/WebCore/src/kdelibs/kjs/Makefile.in
@@ -1,118 +1,738 @@
-#======================================================================
-#
-# Makefile
-#
-# $RCSfile$
-# $Revision$
-# $Author$
-# $Date$
-#
-# Copyright (C) 2001 Apple Computer, Inc.  All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-#
-#======================================================================
-# set top source dir relative to this directory
-# include make vars boilerplate
-#
-
-TOPSRCDIR = ../../..
-include $(TOPSRCDIR)/Makefile.vars
-
-#----------------------------------------------------------------------
-# Set variables for this directory
-
-CXXYACCOBJECTS = grammar.cpp grammar.h
-
-CXXOBJECTS = \
-	array_object.o \
-	bool_object.o \
-	collector.o \
-	date_object.o \
-	debugger.o \
-	error_object.o \
-	function.o \
-	function_object.o \
-	global_object.o \
-	grammar.o \
-	internal.o \
-	kjs.o \
-	lexer.o \
-	lookup.o \
-	math_object.o \
-	nodes.o \
-	number_object.o \
-	object.o \
-	object_object.o \
-	operations.o \
-	regexp.o \
-	regexp_object.o \
-	string_object.o \
-	types.o \
-	ustring.o \
-	$(NULL)
-
-PROGRAM = testkjs
-
-OBJECTS = $(CXXYACCOBJECTS) $(CXXOBJECTS) 
-
-LIBRARY = libkjs.a
-
-CLEAN_FILES = $(OBJECTS) \
-	grammar.h \
-	grammar.cpp \
-	grammar.cpp.h \
-	testkjs.o \
-	$(LIBRARY) \
-	$(PROGRAM) \
-	$(NULL)
-
-#----------------------------------------------------------------------
-# Set flags for this directory
-
-YACCFLAGS = -d --output-file=grammar.cpp --name-prefix=kjsyy
-
-#----------------------------------------------------------------------
-# Set targets for this directory
-
-all: $(OBJECTS) $(LIBRARY) $(PROGRAM)
-
-$(LIBRARY): $(CXXOBJECTS)
-	$(AR) $(ARFLAGS) $(LIBRARY) $(CXXOBJECTS)
-	$(RANLIB) $(LIBRARY)
-
-$(PROGRAM): testkjs.o
-	$(CC) $< -o $@ -L. -lkjs
-
-depend:
-
-grammar.h: grammar.cpp.h
-	ln -s grammar.cpp.h grammar.h
-
-#----------------------------------------------------------------------
-# include make rules boilerplate
-
-include $(TOPSRCDIR)/Makefile.rules
-
-#======================================================================
-# end
-#======================================================================
+# KDE tags expanded automatically by am_edit - $Revision$ 
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+#    This file is part of the KDE libraries
+#    Copyright (C) 1999 Harri Porten (porten at kde.org)
+
+#    This library is free software; you can redistribute it and/or
+#    modify it under the terms of the GNU Library General Public
+#    License as published by the Free Software Foundation; either
+#    version 2 of the License, or (at your option) any later version.
+
+#    This library is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#    Library General Public License for more details.
+
+#    You should have received a copy of the GNU Library General Public License
+#    along with this library; see the file COPYING.LIB.  If not, write to
+#    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#    Boston, MA 02111-1307, USA.
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+#>- 
+bindir = @bindir@
+#>+ 3
+DEPDIR = .deps
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+ARTSCCONFIG = @ARTSCCONFIG@
+ARTS_BUILD_GMCOP = @ARTS_BUILD_GMCOP@
+ARTS_BUILD_KDE = @ARTS_BUILD_KDE@
+ARTS_MAJOR_VERSION = @ARTS_MAJOR_VERSION@
+ARTS_MICRO_VERSION = @ARTS_MICRO_VERSION@
+ARTS_MINOR_VERSION = @ARTS_MINOR_VERSION@
+ARTS_VERSION = @ARTS_VERSION@
+AS = @AS@
+AUTODIRS = @AUTODIRS@
+BZIP2DIR = @BZIP2DIR@
+BZIP2_FILTER = @BZIP2_FILTER@
+CC = @CC@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CUPSSUBDIR = @CUPSSUBDIR@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DCOPIDL = @DCOPIDL@
+DCOPIDL2CPP = @DCOPIDL2CPP@
+DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+DLLTOOL = @DLLTOOL@
+DPMSINC = @DPMSINC@
+DPMSLIB = @DPMSLIB@
+EXEEXT = @EXEEXT@
+EXTRA_SUBDIRS = @EXTRA_SUBDIRS@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_DEPLIBS = @GLIB_DEPLIBS@
+GLIB_LIBS = @GLIB_LIBS@
+GLINC = @GLINC@
+GLLIB = @GLLIB@
+GMSGFMT = @GMSGFMT@
+HAVE_MITSHM = @HAVE_MITSHM@
+HELP_SUBDIR = @HELP_SUBDIR@
+ICE_RLIB = @ICE_RLIB@
+ICE_SUBDIR = @ICE_SUBDIR@
+IDL = @IDL@
+IDL_DEPENDENCIES = @IDL_DEPENDENCIES@
+JAR = @JAR@
+JAVAC = @JAVAC@
+JAVAH = @JAVAH@
+JVMLIBS = @JVMLIBS@
+KDECONFIG = @KDECONFIG@
+KDE_CXXFLAGS = @KDE_CXXFLAGS@
+KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@
+KDE_INCLUDES = @KDE_INCLUDES@
+KDE_LDFLAGS = @KDE_LDFLAGS@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_RPATH = @KDE_RPATH@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_XSL_STYLESHEET = @KDE_XSL_STYLESHEET@
+LIBASOUND = @LIBASOUND@
+LIBAUDIOFILE = @LIBAUDIOFILE@
+LIBAUDIOIO = @LIBAUDIOIO@
+LIBAUDIONAS = @LIBAUDIONAS@
+LIBBZ2 = @LIBBZ2@
+LIBCOMPAT = @LIBCOMPAT@
+LIBCRYPT = @LIBCRYPT@
+LIBDL = @LIBDL@
+LIBFAM = @LIBFAM@
+LIBGEN = @LIBGEN@
+LIBICE = @LIBICE@
+LIBJPEG = @LIBJPEG@
+LIBMICO = @LIBMICO@
+LIBOBJS = @LIBOBJS@
+LIBOSSAUDIO = @LIBOSSAUDIO@
+LIBPCRE = @LIBPCRE@
+LIBPNG = @LIBPNG@
+LIBPOSIX1E = @LIBPOSIX1E@
+LIBPTHREAD = @LIBPTHREAD@
+LIBPYTHON = @LIBPYTHON@
+LIBQIMGIO = @LIBQIMGIO@
+LIBRESOLV = @LIBRESOLV@
+LIBSHADOW = @LIBSHADOW@
+LIBSM = @LIBSM@
+LIBSOCKET = @LIBSOCKET@
+LIBSSL = @LIBSSL@
+LIBTIFF = @LIBTIFF@
+LIBTOOL = @LIBTOOL@
+LIBUCB = @LIBUCB@
+LIBUTIL = @LIBUTIL@
+LIBVOLMGT = @LIBVOLMGT@
+LIBXINERAMA = @LIBXINERAMA@
+LIBXML_CFLAGS = @LIBXML_CFLAGS@
+LIBXML_LIBS = @LIBXML_LIBS@
+LIBXML_RPATH = @LIBXML_RPATH@
+LIBXSLT_MAJOR_VERSION = @LIBXSLT_MAJOR_VERSION@
+LIBXSLT_MICRO_VERSION = @LIBXSLT_MICRO_VERSION@
+LIBXSLT_MINOR_VERSION = @LIBXSLT_MINOR_VERSION@
+LIBXSLT_VERSION = @LIBXSLT_VERSION@
+LIBXSLT_VERSION_INFO = @LIBXSLT_VERSION_INFO@
+LIBXSLT_VERSION_NUMBER = @LIBXSLT_VERSION_NUMBER@
+LIBZ = @LIBZ@
+LIB_CUPS = @LIB_CUPS@
+LIB_DCOP = @LIB_DCOP@
+LIB_DMALLOC = @LIB_DMALLOC@
+LIB_KAB = @LIB_KAB@
+LIB_KDECORE = @LIB_KDECORE@
+LIB_KDEUI = @LIB_KDEUI@
+LIB_KFILE = @LIB_KFILE@
+LIB_KFM = @LIB_KFM@
+LIB_KFORMULA = @LIB_KFORMULA@
+LIB_KHTML = @LIB_KHTML@
+LIB_KIMGIO = @LIB_KIMGIO@
+LIB_KIO = @LIB_KIO@
+LIB_KPARTS = @LIB_KPARTS@
+LIB_KSPELL = @LIB_KSPELL@
+LIB_KSSL = @LIB_KSSL@
+LIB_KSYCOCA = @LIB_KSYCOCA@
+LIB_KWRITE = @LIB_KWRITE@
+LIB_QT = @LIB_QT@
+LIB_SMB = @LIB_SMB@
+LIB_X11 = @LIB_X11@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+MCOPIDL = @MCOPIDL@
+MEINPROC = @MEINPROC@
+MICO_INCLUDES = @MICO_INCLUDES@
+MICO_LDFLAGS = @MICO_LDFLAGS@
+MOC = @MOC@
+MSGFMT = @MSGFMT@
+M_LIBS = @M_LIBS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+NOREPO = @NOREPO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PAMLIBS = @PAMLIBS@
+PASSWDLIBS = @PASSWDLIBS@
+PKG_CONFIG = @PKG_CONFIG@
+PYTHONINC = @PYTHONINC@
+PYTHONLIB = @PYTHONLIB@
+PYTHONMODDIR = @PYTHONMODDIR@
+QNAMESPACE_H = @QNAMESPACE_H@
+QTDOCDIR = @QTDOCDIR@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+RANLIB = @RANLIB@
+REPO = @REPO@
+SETUIDFLAGS = @SETUIDFLAGS@
+SSL_INCLUDES = @SSL_INCLUDES@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+UIC = @UIC@
+USER_INCLUDES = @USER_INCLUDES@
+USER_LDFLAGS = @USER_LDFLAGS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+USE_THREADS = @USE_THREADS@
+VERSION = @VERSION@
+WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
+WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@
+XGETTEXT = @XGETTEXT@
+XPMINC = @XPMINC@
+XPMLIB = @XPMLIB@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_INCLUDES = @X_INCLUDES@
+X_LDFLAGS = @X_LDFLAGS@
+X_PRE_LIBS = @X_PRE_LIBS@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+idldir = @idldir@
+jni_includes = @jni_includes@
+kde_appsdir = @kde_appsdir@
+kde_bindir = @kde_bindir@
+kde_confdir = @kde_confdir@
+kde_datadir = @kde_datadir@
+kde_htmldir = @kde_htmldir@
+kde_icondir = @kde_icondir@
+kde_includes = @kde_includes@
+kde_libraries = @kde_libraries@
+kde_libs_htmldir = @kde_libs_htmldir@
+kde_libs_prefix = @kde_libs_prefix@
+kde_locale = @kde_locale@
+kde_mimedir = @kde_mimedir@
+kde_moduledir = @kde_moduledir@
+kde_servicesdir = @kde_servicesdir@
+kde_servicetypesdir = @kde_servicetypesdir@
+kde_sounddir = @kde_sounddir@
+kde_templatesdir = @kde_templatesdir@
+kde_wallpaperdir = @kde_wallpaperdir@
+micodir = @micodir@
+path_su = @path_su@
+qt_includes = @qt_includes@
+qt_libraries = @qt_libraries@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+
+YACC = bison
+INCLUDES = $(all_includes)
+
+lib_LTLIBRARIES = libkjs.la
+
+libkjs_la_SOURCES = kjs.cpp grammar.cpp lexer.cpp nodes.cpp object.cpp 	operations.cpp ustring.cpp function.cpp types.cpp lookup.cpp 	internal.cpp regexp.cpp global_object.cpp math_object.cpp 	bool_object.cpp object_object.cpp error_object.cpp 	array_object.cpp string_object.cpp number_object.cpp 	date_object.cpp regexp_object.cpp collector.cpp function_object.cpp 	debugger.cpp
+
+
+kjsincludedir = $(includedir)/kjs
+kjsinclude_HEADERS = kjs.h object.h operations.h ustring.h 	function.h lookup.h types.h
+
+
+noinst_HEADERS = nodes.h lexer.h regexp.h internal.h collector.h 	grammar.h object_object.h function_object.h function_object.h 	bool_object.h math_object.h array_object.h string_object.h 	number_object.h date_object.h regexp_object.h error_object.h 	debugger.h
+
+
+libkjs_la_LDFLAGS = -version-info 1:0 -no-undefined $(USER_LDFLAGS) $(all_libraries)
+libkjs_la_LIBADD = -lm $(LIBPCRE)
+
+EXTRA_PROGRAMS = testkjs_static
+testkjs_static_SOURCES = testkjs.cpp  $(libkjs_la_SOURCES)
+testkjs_static_LDADD = $(LIBPCRE)
+
+check_PROGRAMS = testkjs
+testkjs_SOURCES = testkjs.cpp
+testkjs_LDADD = libkjs.la
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = 
+LTLIBRARIES =  $(lib_LTLIBRARIES)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+libkjs_la_DEPENDENCIES = 
+#>- libkjs_la_OBJECTS =  kjs.lo grammar.lo lexer.lo nodes.lo object.lo \
+#>- operations.lo ustring.lo function.lo types.lo lookup.lo internal.lo \
+#>- regexp.lo global_object.lo math_object.lo bool_object.lo \
+#>- object_object.lo error_object.lo array_object.lo string_object.lo \
+#>- number_object.lo date_object.lo regexp_object.lo collector.lo \
+#>- function_object.lo debugger.lo
+#>+ 9
+libkjs_la_final_OBJECTS = libkjs_la.all_cpp.lo 
+libkjs_la_nofinal_OBJECTS = kjs.lo grammar.lo lexer.lo nodes.lo object.lo \
+operations.lo ustring.lo function.lo types.lo lookup.lo internal.lo \
+regexp.lo global_object.lo math_object.lo bool_object.lo \
+object_object.lo error_object.lo array_object.lo string_object.lo \
+number_object.lo date_object.lo regexp_object.lo collector.lo \
+function_object.lo debugger.lo
+ at KDE_USE_FINAL_FALSE@libkjs_la_OBJECTS = $(libkjs_la_nofinal_OBJECTS)
+ at KDE_USE_FINAL_TRUE@libkjs_la_OBJECTS = $(libkjs_la_final_OBJECTS)
+check_PROGRAMS =  testkjs$(EXEEXT)
+#>- testkjs_static_OBJECTS =  testkjs.$(OBJEXT) kjs.$(OBJEXT) \
+#>- grammar.$(OBJEXT) lexer.$(OBJEXT) nodes.$(OBJEXT) object.$(OBJEXT) \
+#>- operations.$(OBJEXT) ustring.$(OBJEXT) function.$(OBJEXT) \
+#>- types.$(OBJEXT) lookup.$(OBJEXT) internal.$(OBJEXT) regexp.$(OBJEXT) \
+#>- global_object.$(OBJEXT) math_object.$(OBJEXT) bool_object.$(OBJEXT) \
+#>- object_object.$(OBJEXT) error_object.$(OBJEXT) array_object.$(OBJEXT) \
+#>- string_object.$(OBJEXT) number_object.$(OBJEXT) date_object.$(OBJEXT) \
+#>- regexp_object.$(OBJEXT) collector.$(OBJEXT) function_object.$(OBJEXT) \
+#>- debugger.$(OBJEXT)
+#>+ 9
+testkjs_static_OBJECTS = testkjs.$(OBJEXT) kjs.$(OBJEXT) \
+grammar.$(OBJEXT) lexer.$(OBJEXT) nodes.$(OBJEXT) object.$(OBJEXT) \
+operations.$(OBJEXT) ustring.$(OBJEXT) function.$(OBJEXT) \
+types.$(OBJEXT) lookup.$(OBJEXT) internal.$(OBJEXT) regexp.$(OBJEXT) \
+global_object.$(OBJEXT) math_object.$(OBJEXT) bool_object.$(OBJEXT) \
+object_object.$(OBJEXT) error_object.$(OBJEXT) array_object.$(OBJEXT) \
+string_object.$(OBJEXT) number_object.$(OBJEXT) date_object.$(OBJEXT) \
+regexp_object.$(OBJEXT) collector.$(OBJEXT) function_object.$(OBJEXT) \
+debugger.$(OBJEXT)
+testkjs_static_DEPENDENCIES = 
+testkjs_static_LDFLAGS = 
+#>- testkjs_OBJECTS =  testkjs.$(OBJEXT)
+#>+ 1
+testkjs_OBJECTS = testkjs.$(OBJEXT)
+testkjs_DEPENDENCIES =  libkjs.la
+testkjs_LDFLAGS = 
+CXXFLAGS = @CXXFLAGS@
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+#>+ 1
+CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(LDFLAGS) -o $@
+HEADERS =  $(kjsinclude_HEADERS) $(noinst_HEADERS)
+
+DIST_COMMON =  README ChangeLog Makefile.am Makefile.in THANKS
+
+
+#>- DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 4
+KDE_DIST=configure.in.in grammar.y keywords.table math_object.lut.h test.js create_hash_table lexer.lut.h 
+
+DISTFILES= $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+
+
+TAR = tar
+GZIP_ENV = --best
+SOURCES = $(libkjs_la_SOURCES) $(testkjs_static_SOURCES) $(testkjs_SOURCES)
+OBJECTS = $(libkjs_la_OBJECTS) $(testkjs_static_OBJECTS) $(testkjs_OBJECTS)
+
+#>- all: all-redirect
+#>+ 1
+all: docs-am  all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cpp .lo .o .obj .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+#>- 	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps kjs/Makefile
+#>+ 2
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps kjs/Makefile
+	cd $(top_srcdir) && perl admin/am_edit kjs/Makefile.in
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-libLTLIBRARIES:
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+
+distclean-libLTLIBRARIES:
+
+maintainer-clean-libLTLIBRARIES:
+
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(libdir)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+	  else :; fi; \
+	done
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+	done
+
+.c.o:
+	$(COMPILE) -c $<
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+	$(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+	-rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.c.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.s.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+#>- libkjs.la: $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+#>+ 2
+ at KDE_USE_CLOSURE_TRUE@libkjs.la: libkjs.la.closure $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+ at KDE_USE_CLOSURE_FALSE@libkjs.la: $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+	$(CXXLINK) -rpath $(libdir) $(libkjs_la_LDFLAGS) $(libkjs_la_OBJECTS) $(libkjs_la_LIBADD) $(LIBS)
+
+mostlyclean-checkPROGRAMS:
+
+clean-checkPROGRAMS:
+	-test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+
+distclean-checkPROGRAMS:
+
+maintainer-clean-checkPROGRAMS:
+
+testkjs_static$(EXEEXT): $(testkjs_static_OBJECTS) $(testkjs_static_DEPENDENCIES)
+	@rm -f testkjs_static$(EXEEXT)
+	$(CXXLINK) $(testkjs_static_LDFLAGS) $(testkjs_static_OBJECTS) $(testkjs_static_LDADD) $(LIBS)
+
+testkjs$(EXEEXT): $(testkjs_OBJECTS) $(testkjs_DEPENDENCIES)
+	@rm -f testkjs$(EXEEXT)
+	$(CXXLINK) $(testkjs_LDFLAGS) $(testkjs_OBJECTS) $(testkjs_LDADD) $(LIBS)
+.cpp.o:
+	$(CXXCOMPILE) -c $<
+.cpp.obj:
+	$(CXXCOMPILE) -c `cygpath -w $<`
+.cpp.lo:
+	$(LTCXXCOMPILE) -c $<
+
+install-kjsincludeHEADERS: $(kjsinclude_HEADERS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(kjsincludedir)
+	@list='$(kjsinclude_HEADERS)'; for p in $$list; do \
+	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(kjsincludedir)/$$p"; \
+	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(kjsincludedir)/$$p; \
+	done
+
+uninstall-kjsincludeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	list='$(kjsinclude_HEADERS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(kjsincludedir)/$$p; \
+	done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = kjs
+
+distdir: $(DISTFILES)
+#>- 	@for file in $(DISTFILES); do \
+#>- 	  d=$(srcdir); \
+#>- 	  if test -d $$d/$$file; then \
+#>- 	    cp -pr $$/$$file $(distdir)/$$file; \
+#>- 	  else \
+#>- 	    test -f $(distdir)/$$file \
+#>- 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+#>- 	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+#>- 	  fi; \
+#>- 	done
+#>+ 10
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-libLTLIBRARIES
+install-exec: install-exec-am
+
+install-data-am: install-kjsincludeHEADERS
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-libLTLIBRARIES uninstall-kjsincludeHEADERS
+uninstall: uninstall-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(libdir) $(DESTDIR)$(kjsincludedir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-libLTLIBRARIES mostlyclean-compile \
+		mostlyclean-libtool mostlyclean-checkPROGRAMS \
+		mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+#>- clean-am:  clean-libLTLIBRARIES clean-compile clean-libtool \
+#>- 		clean-checkPROGRAMS clean-tags clean-generic \
+#>- 		mostlyclean-am
+#>+ 3
+clean-am: clean-closures clean-final   clean-libLTLIBRARIES clean-compile clean-libtool \
+		clean-checkPROGRAMS clean-tags clean-generic \
+		mostlyclean-am
+
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+distclean-am:  distclean-libLTLIBRARIES distclean-compile \
+		distclean-libtool distclean-checkPROGRAMS \
+		distclean-tags distclean-generic clean-am
+	-rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am:  maintainer-clean-libLTLIBRARIES \
+		maintainer-clean-compile maintainer-clean-libtool \
+		maintainer-clean-checkPROGRAMS maintainer-clean-tags \
+		maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
+clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
+uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
+distclean-compile clean-compile maintainer-clean-compile \
+mostlyclean-libtool distclean-libtool clean-libtool \
+maintainer-clean-libtool mostlyclean-checkPROGRAMS \
+distclean-checkPROGRAMS clean-checkPROGRAMS \
+maintainer-clean-checkPROGRAMS uninstall-kjsincludeHEADERS \
+install-kjsincludeHEADERS tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
+check-am installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
+
+parser: $(srcdir)/grammar.y
+	cd $(srcdir); \
+	$(YACC) -d -p kjsyy grammar.y && mv grammar.tab.c grammar.cpp; \
+	if test -f grammar.tab.h; then \
+	if cmp -s grammar.tab.h grammar.h; then rm -f grammar.tab.h; \
+	else mv grammar.tab.h grammar.h; fi \
+	else :; fi
+
+debugger: $(libkjs_la_SOURCES) $(kjsinclude_HEADERS) $(noinst_HEADERS)
+	$(MAKE) DEFS="-DKJS_DEBUGGER $(DEFS)" libkjs.la
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 8
+libkjs.la.closure: $(libkjs_la_OBJECTS) $(libkjs_la_DEPENDENCIES)
+	@echo "int main() {return 0;}" > libkjs_la_closure.cpp
+	@$(LTCXXCOMPILE) -c libkjs_la_closure.cpp
+	@$(CXXLINK) libkjs_la_closure.lo $(libkjs_la_LDFLAGS) $(libkjs_la_OBJECTS) $(libkjs_la_LIBADD) $(LIBS)
+	@rm -f libkjs_la_closure.* libkjs.la.closure
+	@echo "timestamp" > libkjs.la.closure
+
+
+#>+ 3
+clean-closures:
+	-rm -f  libkjs.la.closure
+
+#>+ 2
+docs-am:
+
+#>+ 5
+force-reedit:
+		cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps kjs/Makefile
+	cd $(top_srcdir) && perl admin/am_edit kjs/Makefile.in
+
+
+#>+ 11
+libkjs_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/kjs.cpp $(srcdir)/grammar.cpp $(srcdir)/lexer.cpp $(srcdir)/nodes.cpp $(srcdir)/object.cpp $(srcdir)/operations.cpp $(srcdir)/ustring.cpp $(srcdir)/function.cpp $(srcdir)/types.cpp $(srcdir)/lookup.cpp $(srcdir)/internal.cpp $(srcdir)/regexp.cpp $(srcdir)/global_object.cpp $(srcdir)/math_object.cpp $(srcdir)/bool_object.cpp $(srcdir)/object_object.cpp $(srcdir)/error_object.cpp $(srcdir)/array_object.cpp $(srcdir)/string_object.cpp $(srcdir)/number_object.cpp $(srcdir)/date_object.cpp $(srcdir)/regexp_object.cpp $(srcdir)/collector.cpp $(srcdir)/function_object.cpp $(srcdir)/debugger.cpp  
+	@echo 'creating libkjs_la.all_cpp.cpp ...'; \
+	rm -f libkjs_la.all_cpp.files libkjs_la.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> libkjs_la.all_cpp.final; \
+	for file in kjs.cpp grammar.cpp lexer.cpp nodes.cpp object.cpp operations.cpp ustring.cpp function.cpp types.cpp lookup.cpp internal.cpp regexp.cpp global_object.cpp math_object.cpp bool_object.cpp object_object.cpp error_object.cpp array_object.cpp string_object.cpp number_object.cpp date_object.cpp regexp_object.cpp collector.cpp function_object.cpp debugger.cpp ; do \
+	  echo "#include \"$$file\"" >> libkjs_la.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> libkjs_la.all_cpp.final; \
+	done; \
+	cat libkjs_la.all_cpp.final libkjs_la.all_cpp.files  > libkjs_la.all_cpp.cpp; \
+	rm -f libkjs_la.all_cpp.final libkjs_la.all_cpp.files
+
+#>+ 11
+testkjs.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/testkjs.cpp  
+	@echo 'creating testkjs.all_cpp.cpp ...'; \
+	rm -f testkjs.all_cpp.files testkjs.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> testkjs.all_cpp.final; \
+	for file in testkjs.cpp ; do \
+	  echo "#include \"$$file\"" >> testkjs.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> testkjs.all_cpp.final; \
+	done; \
+	cat testkjs.all_cpp.final testkjs.all_cpp.files  > testkjs.all_cpp.cpp; \
+	rm -f testkjs.all_cpp.final testkjs.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f libkjs_la.all_cpp.cpp testkjs.all_cpp.cpp
+
+#>+ 2
+final:
+	$(MAKE) libkjs_la_OBJECTS="$(libkjs_la_final_OBJECTS)" all-am
+#>+ 2
+no-final:
+	$(MAKE) libkjs_la_OBJECTS="$(libkjs_la_nofinal_OBJECTS)" all-am
+#>+ 3
+cvs-clean:
+	$(MAKE) -f $(top_srcdir)/admin/Makefile.common cvs-clean
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list