rev 3229 - trunk/packages/kdelibs/debian/patches

Christopher Martin chrsmrtn at costa.debian.org
Thu Mar 2 19:39:09 UTC 2006


Author: chrsmrtn
Date: 2006-03-02 19:39:06 +0000 (Thu, 02 Mar 2006)
New Revision: 3229

Added:
   trunk/packages/kdelibs/debian/patches/01_kdelibs_branch_r515119.diff
Log:
New kdelibs branch pull.


Added: trunk/packages/kdelibs/debian/patches/01_kdelibs_branch_r515119.diff
===================================================================
--- trunk/packages/kdelibs/debian/patches/01_kdelibs_branch_r515119.diff	2006-03-02 08:26:39 UTC (rev 3228)
+++ trunk/packages/kdelibs/debian/patches/01_kdelibs_branch_r515119.diff	2006-03-02 19:39:06 UTC (rev 3229)
@@ -0,0 +1,12059 @@
+#DPATCHLEVEL=0
+--- kate/plugins/wordcompletion/docwordcompletion.cpp	(revision 506549)
++++ kate/plugins/wordcompletion/docwordcompletion.cpp	(revision 515119)
+@@ -317,7 +317,10 @@
+ 
+         // if this is a constructed word at cursor pos, retry.
+         if ( pos + wrd.length() == ccol )
++        {
++          d->col = pos + inc;
+           continue;
++        }
+ 
+         // we got good a match! replace text and return.
+         if ( d->lilen )
+@@ -332,30 +335,7 @@
+ 
+       // equal to last one, continue
+       else
+-      {
+-        d->col = pos; // for next try
+-        if ( fw )
+-          d->col += m.length();
+-        else // FIXME figure out if all of that is really nessecary
+-        {
+-          if ( pos == 0 )
+-          {
+-            if ( d->line > 0 )
+-            {
+-              d->line += inc;
+-              ln = ei->textLine( d->line );
+-              d->col = ln.length();
+-            }
+-            else
+-            {
+-              KNotifyClient::beep();
+-              return;
+-            }
+-          }
+-          else
+-            d->col--;
+-        }
+-      }
++        d->col = pos + inc; // for next try
+     }
+ 
+     else  // no match
+--- kate/part/katehighlight.h	(revision 506549)
++++ kate/part/katehighlight.h	(revision 515119)
+@@ -39,6 +39,7 @@
+ #include <qstringlist.h>
+ #include <qguardedptr.h>
+ #include <qdatetime.h>
++#include <qpopupmenu.h>
+ 
+ class KateHlContext;
+ class KateHlItem;
+@@ -51,8 +52,6 @@
+ class KateSyntaxModeListItem;
+ class KateSyntaxContextData;
+ 
+-class QPopupMenu;
+-
+ // some typedefs
+ typedef QPtrList<KateAttribute> KateAttributeList;
+ typedef QValueList<KateHlIncludeRule*> KateHlIncludeRules;
+--- kate/part/kateview.cpp	(revision 506549)
++++ kate/part/kateview.cpp	(revision 515119)
+@@ -1771,7 +1771,7 @@
+ 
+ void KateView::exportAsHTML ()
+ {
+-  KURL url = KFileDialog::getSaveURL(QString::null,"text/html",0,i18n("Export File as HTML"));
++  KURL url = KFileDialog::getSaveURL(m_doc->docName(),"text/html",0,i18n("Export File as HTML"));
+ 
+   if ( url.isEmpty() )
+     return;
+--- kate/part/kateschema.cpp	(revision 506549)
++++ kate/part/kateschema.cpp	(revision 515119)
+@@ -814,7 +814,9 @@
+ {
+   for ( QIntDictIterator< QIntDict<KateHlItemDataList> > it( m_hlDict ); it.current(); ++it )
+     for ( QIntDictIterator< KateHlItemDataList > it2( *it.current() ); it2.current(); ++it2 )
+-       KateHlManager::self()->getHl( it2.currentKey() )->setKateHlItemDataList (it.currentKey(), *(it2.current()));
++    {
++      KateHlManager::self()->getHl( it2.currentKey() )->setKateHlItemDataList (it.currentKey(), *(it2.current()));
++    }
+ }
+ 
+ //END KateSchemaConfigHighlightTab
+@@ -1207,12 +1209,14 @@
+     if ( is->weight() != st->weight())
+       st->setWeight( is->weight() );
+   }
++  else st->clearAttribute( KateAttribute::Weight );
+ 
+   if ( is->itemSet(KateAttribute::Italic) )
+   {
+     if ( is->italic() != st->italic())
+       st->setItalic( is->italic() );
+   }
++  else st->clearAttribute( KateAttribute::Italic );
+ 
+   if ( is->itemSet(KateAttribute::StrikeOut) )
+   {
+@@ -1220,42 +1224,49 @@
+ 
+       st->setStrikeOut( is->strikeOut() );
+   }
++  else st->clearAttribute( KateAttribute::StrikeOut );
+ 
+   if ( is->itemSet(KateAttribute::Underline) )
+   {
+     if ( is->underline() != st->underline())
+       st->setUnderline( is->underline() );
+   }
++  else st->clearAttribute( KateAttribute::Underline );
+ 
+   if ( is->itemSet(KateAttribute::Outline) )
+   {
+     if ( is->outline() != st->outline())
+       st->setOutline( is->outline() );
+   }
++  else st->clearAttribute( KateAttribute::Outline );
+ 
+   if ( is->itemSet(KateAttribute::TextColor) )
+   {
+     if ( is->textColor() != st->textColor())
+       st->setTextColor( is->textColor() );
+   }
++  else st->clearAttribute( KateAttribute::TextColor );
+ 
+   if ( is->itemSet(KateAttribute::SelectedTextColor) )
+   {
+     if ( is->selectedTextColor() != st->selectedTextColor())
+       st->setSelectedTextColor( is->selectedTextColor() );
+   }
++  else st->clearAttribute( KateAttribute::SelectedTextColor);
+ 
+   if ( is->itemSet(KateAttribute::BGColor) )
+   {
+     if ( is->bgColor() != st->bgColor())
+       st->setBGColor( is->bgColor() );
+   }
++  else st->clearAttribute( KateAttribute::BGColor );
+ 
+   if ( is->itemSet(KateAttribute::SelectedBGColor) )
+   {
+     if ( is->selectedBGColor() != st->selectedBGColor())
+       st->setSelectedBGColor( is->selectedBGColor() );
+   }
++  else st->clearAttribute( KateAttribute::SelectedBGColor );
+ }
+ 
+ /* only true for a hl mode item using it's default style */
+@@ -1345,6 +1356,7 @@
+   else {
+     delete is;
+     is = new KateAttribute( *ds );
++    updateStyle();
+     repaint();
+   }
+ }
+--- kate/part/katespell.cpp	(revision 506549)
++++ kate/part/katespell.cpp	(revision 515119)
+@@ -29,6 +29,7 @@
+ #include <kaction.h>
+ #include <kstdaction.h>
+ #include <kspell.h>
++#include <ksconfig.h>
+ #include <kdebug.h>
+ #include <kmessagebox.h>
+ 
+@@ -102,11 +103,24 @@
+   KSpell::SpellerType type = KSpell::Text;
+   if ( mt == "text/x-tex" || mt == "text/x-latex" )
+     type = KSpell::TeX;
+-  else if ( mt == "text/html" || mt == "text/xml" )
++  else if ( mt == "text/html" || mt == "text/xml" || mt == "text/docbook" || mt == "application/x-php")
+     type = KSpell::HTML;
+ 
++  KSpellConfig *ksc = new KSpellConfig;
++  QStringList ksEncodings;
++  ksEncodings << "US-ASCII" << "ISO 8859-1" << "ISO 8859-2" << "ISO 8859-3"
++      << "ISO 8859-4" << "ISO 8859-5" << "ISO 8859-7" << "ISO 8859-8"
++      << "ISO 8859-9" << "ISO 8859-13" << "ISO 8859-15" << "UTF-8"
++      << "KOI8-R" << "KOI8-U" << "CP1251" << "CP1255";
++
++  int enc = ksEncodings.findIndex( m_view->doc()->encoding() );
++  if ( enc > -1 )
++    ksc->setEncoding( enc );
++
++  kdDebug(13020)<<"KateSpell::spellCheck(): using encoding: "<<enc<<" ("<<ksEncodings[enc]<<") and KSpell::Type "<<type<<" (for '"<<mt<<"')"<<endl;
++
+   m_kspell = new KSpell( m_view, i18n("Spellcheck"),
+-                         this, SLOT(ready(KSpell *)), 0, true, true, type );
++                         this, SLOT(ready(KSpell *)), ksc, true, true, type );
+ 
+   connect( m_kspell, SIGNAL(death()),
+            this, SLOT(spellCleanDone()) );
+--- kate/Makefile.am	(revision 506549)
++++ kate/Makefile.am	(revision 515119)
+@@ -2,7 +2,7 @@
+ EXTRA_DIST = AUTHORS COPYING.LIB ChangeLog NEWS README TODO
+ 
+ messages:
+-	$(EXTRACTRC) ./*/*.rc > rc.cpp
++	$(EXTRACTRC) ./*/*.rc >> rc.cpp
+ 	$(EXTRACTATTR) --attr=language,name,Language --attr="language,section,Language Section" data/*.xml >> rc.cpp
+ 	$(XGETTEXT) `find . -name "*.cpp"` part/*.h -o $(podir)/katepart.pot
+ 
+--- kate/data/bash.xml	(revision 506549)
++++ kate/data/bash.xml	(revision 515119)
+@@ -763,7 +763,7 @@
+ 	<RegExpr attribute="Redirection" context="HereDocQ"   String="(&lt;&lt;\s*&quot;(&word;)&quot;)" lookAhead="true" />
+ 	<RegExpr attribute="Redirection" context="HereDocQ"   String="(&lt;&lt;\s*'(&word;)')" lookAhead="true" />
+ 	<RegExpr attribute="Redirection" context="HereDocQ"   String="(&lt;&lt;\s*\\(&word;))" lookAhead="true" />
+-	<RegExpr attribute="Redirection" context="HereDocNQ"  String="(&lt;&lt;\s*(&word;))" lookAhead="true" />
++	<RegExpr attribute="Redirection" context="HereDocNQ"  String="(&lt;&lt;(?!-)\s*(&word;))" lookAhead="true" />
+ 	<RegExpr attribute="Redirection" context="HereDocIQ"  String="(&lt;&lt;-\s*&quot;(&word;)&quot;)" lookAhead="true" />
+ 	<RegExpr attribute="Redirection" context="HereDocIQ"  String="(&lt;&lt;-\s*'(&word;)')" lookAhead="true" />
+ 	<RegExpr attribute="Redirection" context="HereDocIQ"  String="(&lt;&lt;-\s*\\(&word;))" lookAhead="true" />
+--- kate/data/ruby.xml	(revision 506549)
++++ kate/data/ruby.xml	(revision 515119)
+@@ -34,7 +34,7 @@
+ -->
+ 
+ <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
+-<language name="Ruby" version="1.16" kateversion="2.4" section="Scripts" extensions="*.rb" mimetype="application/x-ruby" author="Stefan Lang (langstefan at gmx.at), Sebastian Vuorinen (sebastian.vuorinen at helsinki.fi)" license="LGPL">
++<language name="Ruby" version="1.17" kateversion="2.4" section="Scripts" extensions="*.rb;*.rxml" mimetype="application/x-ruby" author="Stefan Lang (langstefan at gmx.at), Sebastian Vuorinen (sebastian.vuorinen at helsinki.fi)" license="LGPL">
+ 	
+ 	<highlighting>
+ 	
+@@ -198,6 +198,7 @@
+ 				
+ 				<!-- "def" - "end" blocks -->
+ 				<!-- check for statement modifiers with regexes -->
++                <DetectChar attribute="Operator" char="{" context="Find closing block brace" beginRegion="def block"/>
+ 				<RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/>
+ 				<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/>
+ 				<RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
+@@ -212,7 +213,7 @@
+ 				<RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/>
+ 				<RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/>
+ 				<!-- elsif/else close the current block and start a new one -->
+-				<RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\s+|$)" context="#stay" endRegion="def block" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\b|$)" context="#stay" endRegion="def block" beginRegion="def block"/>
+ 				
+ 				<StringDetect attribute="Operator" String="..." context="#stay"/>
+ 				<Detect2Chars attribute="Operator" char="." char1="." context="#stay"/>
+@@ -237,7 +238,7 @@
+ 				<RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="#stay"/>
+ 				<RegExpr attribute="Global Variable" String="\$\-[a-zA-z_]\b" context="#stay"/>
+ 				<!-- special-character globals -->
+-				<RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&amp;]" context="#stay"/>
++				<RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&amp;&quot;]" context="#stay"/>
+ 				<RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="#stay"/>
+ 				<!-- Generally a module or class name like "File", "MyModule_1", .. -->
+ 				<RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="#stay"/>
+@@ -285,7 +286,7 @@
+ 				<RegExpr attribute="Comment" String="#\s*BEGIN.*$"  context="#stay" beginRegion="marker" column="0"/>
+ 				<RegExpr attribute="Comment" String="#\s*END.*$"  context="#stay" endRegion="marker" column="0"/>
+ 				<RegExpr attribute="Comment" String="#"  context="Comment Line" firstNonSpace="true"/>
+-				<RegExpr attribute="Comment" String="\s#"  context="General Comment"/>
++				<RegExpr attribute="Comment" String="(\b|\s)#"  context="General Comment"/>
+ 				
+ 				<RegExpr attribute="Delimiter" String="[\[\]]+"  context="#stay"/>
+ 				<DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/>
+@@ -308,6 +309,11 @@
+ 				<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/>
+ 				<IncludeRules context="Normal"/>
+ 			</context>
++
++            <context name="Find closing block brace" attribute="Normal Text" lineEndContext="#stay">
++                <DetectChar attribute="Operator" char="}" context="#pop" endRegion="def block"/>
++                <IncludeRules context="Normal"/>
++            </context>
+ 			
+ 			<context name="Quoted String" attribute="String" lineEndContext="#stay">
+ 				<StringDetect attribute="String" String="\\" context="#stay"/>
+--- kate/data/Makefile.am	(revision 506549)
++++ kate/data/Makefile.am	(revision 515119)
+@@ -6,7 +6,7 @@
+ syntaxkatedir = $(kde_datadir)/katepart/syntax
+ syntaxkate_DATA = language.dtd syntax.template cpp.xml c.xml html.xml kbasic.xml objectivec.xml \
+                   changelog.xml ada.xml css.xml perl.xml php.xml xml.xml java.xml rpmspec.xml \
+-                sql.xml sql-mysql.xml sql-postgresql.xml vhdl.xml diff.xml bash.xml latex.xml postscript.xml ruby.xml \
++                sql.xml sql-mysql.xml sql-postgresql.xml vhdl.xml diff.xml bash.xml latex.xml postscript.xml ruby.xml rhtml.xml \
+                 desktop.xml eiffel.xml pascal.xml sather.xml python.xml makefile.xml \
+                 ferite.xml scheme.xml matlab.xml tcl.xml ilerpg.xml verilog.xml javascript.xml \
+                 sml.xml winehq.xml cs.xml sgml.xml idconsole.xml xmldebug.xml fortran.xml haskell.xml \
+--- kate/data/rhtml.xml	(revision 0)
++++ kate/data/rhtml.xml	(revision 515119)
+@@ -0,0 +1,1235 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE language SYSTEM "language.dtd"
++[
++	<!ENTITY name    "[A-Za-z_:][\w.:_-]*">
++	<!ENTITY entref  "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
++]>
++	
++<!--
++	RHTML syntax highlighting definition for Kate. It combines the ruby and
++	html syntax grammars. Some ideas, and the list of Rails method names were 
++	taken from an rhtml kate grammar for Quanta based on earlier versions of
++	the syntax highlighters.
++	
++	Copyright (C) 2004  by Sebastian Vuorinen (sebastian dot vuorinen at helsinki dot fi)
++	Copyright (C) 2004  by Stefan Lang (langstefan at gmx.at)
++	Copyright (C) 2006  by Wilbert Berendsen (wilbert at kde.nl
++	Copyright (C) 2005  by Chris Martin (linux at chriscodes.com
++	Copyright (C) 2006  by Richard Dale (rdale at foton.es)
++	
++	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; if not, write to the
++	Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
++	Boston, MA  02110-1301, USA.
++-->
++	
++<!--
++	TODO:	* Regular expressions spanning over multiple lines
++	work only if newlines are escaped.
++	* "Nested" HERE documents aren't recognized.
++	* Division is detected correctly only, if whitespace
++	is around the "/" operator.
++	E.g.:	detected correctly:				1 / 2
++	"/" interpreted as regex start:		1/2
++-->
++	
++<!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". -->
++<language name="Ruby/Rails/RHTML" version="1.00" kateversion="2.4" section="Markup" extensions="*.rhtml" mimetype="" author="Richard Dale rdale at foton.es" license="LGPL">
++	
++	<highlighting>
++	
++		<list name="keywords">
++			<item> BEGIN </item>
++			<item> END </item>
++			<item> and </item>
++			<item> begin </item>
++			<item> break </item>
++			<item> case </item>
++			<item> defined? </item>
++			<item> do </item>
++			<item> else </item>
++			<item> elsif </item>
++			<item> end </item>
++			<item> ensure </item>
++			<item> for </item>
++			<item> if </item>
++			<item> in </item>
++			<item> include </item>
++			<item> next </item>
++			<item> not </item>
++			<item> or </item>
++			<item> redo </item>
++			<item> rescue </item>
++			<item> retry </item>
++			<item> return </item>
++			<item> then </item>
++			<item> unless </item>
++			<item> until </item>
++			<item> when </item>
++			<item> while </item>
++			<item> yield </item>
++		</list>
++		
++		<list name="access-control">
++			<item> private_class_method </item>
++			<item> private </item>
++			<item> protected </item>
++			<item> public_class_method </item>
++			<item> public </item>
++		</list>
++
++		<list name="attribute-definitions">
++			<item> attr_reader </item>
++			<item> attr_writer </item>
++			<item> attr_accessor </item>
++		</list>
++		
++		<list name="definitions">
++			<item> alias </item>
++			<item> module </item>
++			<item> class </item>
++			<item> def </item>
++			<item> undef </item>
++		</list>
++		
++		<list name="pseudo-variables">
++			<item> self </item>
++			<item> super </item>
++			<item> nil </item>
++			<item> false </item>
++			<item> true </item>
++			<item> caller </item>
++			<item> __FILE__ </item>
++			<item> __LINE__ </item>
++		</list>
++		
++		<list name="default-globals">
++			<item> $stdout </item>
++			<item> $defout </item>
++			<item> $stderr </item>
++			<item> $deferr </item>
++			<item> $stdin </item>
++		</list>
++		
++		<!-- Kernel module methods.
++			NOTE: Methods ending in ? or !
++				are included below as regexes.
++		-->
++		<list name="kernel-methods">
++			<!-- backquote ` -->
++			<item> abort </item>
++			<item> at_exit </item>
++			<item> autoload </item>
++			<item> autoload? </item>
++			<item> binding </item>
++			<item> block_given? </item>
++			<item> callcc </item>
++			<item> caller </item>
++			<item> catch </item>
++			<item> chomp </item>
++			<item> chomp! </item>
++			<item> chop </item>
++			<item> chop! </item>
++			<item> eval </item>
++			<item> exec </item>
++			<item> exit </item>
++			<item> exit! </item>
++			<item> fail </item>
++			<item> fork </item>
++			<item> format </item>
++			<item> getc </item>
++			<item> gets </item>
++			<item> global_variables </item>
++			<item> gsub </item>
++			<item> gsub! </item>
++			<item> iterator? </item>
++			<item> lambda </item>
++			<item> load </item>
++			<item> local_variables </item>
++			<item> loop </item>
++			<item> method_missing </item>
++			<item> open </item>
++			<item> p </item>
++			<item> print </item>
++			<item> printf </item>
++			<item> proc </item>
++			<item> putc </item>
++			<item> puts </item>
++			<item> raise </item>
++			<item> rand </item>
++			<item> readline </item>
++			<item> readlines </item>
++			<item> require </item>
++			<item> scan </item>
++			<item> select </item>
++			<item> set_trace_func </item>
++			<item> sleep </item>
++			<item> split </item>
++			<item> sprintf </item>
++			<item> srand </item>
++			<item> sub </item>
++			<item> sub! </item>
++			<item> syscall </item>
++			<item> system </item>
++			<item> test </item>
++			<item> throw </item>
++			<item> trace_var </item>
++			<item> trap </item>
++			<item> untrace_var </item>
++			<item> warn </item>
++			
++			<!-- ActionView methods from Rails docs -->
++			<item>auto_complete_field</item>
++			<item>auto_complete_result</item>
++			<item>auto_discovery_link_tag</item>
++			<item>auto_link</item>
++			<item>benchmark</item>
++			<item>button_to</item>
++			<item>cache</item>
++			<item>capture</item>
++			<item>check_box</item>
++			<item>check_box_tag</item>
++			<item>collection_select</item>
++			<item>concat</item>
++			<item>content_for</item>
++			<item>content_tag</item>
++			<item>country_options_for_select</item>
++			<item>country_select</item>
++			<item>current_page?</item>
++			<item>date_select</item>
++			<item>datetime_select</item>
++			<item>debug</item>
++			<item>define_javascript_functions</item>
++			<item>distance_of_time_in_words</item>
++			<item>distance_of_time_in_words_to_now</item>
++			<item>draggable_element</item>
++			<item>drop_receiving_element</item>
++			<item>end_form_tag</item>
++			<item>error_message_on</item>
++			<item>error_messages_for</item>
++			<item>escape_javascript</item>
++			<item>evaluate_remote_response</item>
++			<item>excerpt</item>
++			<item>file_field</item>
++			<item>file_field_tag</item>
++			<item>finish_upload_status</item>
++			<item>form</item>
++			<item>form_remote_tag</item>
++			<item>form_tag</item>
++			<item>form_tag_with_upload_progress</item>
++			<item>h</item>
++			<item>hidden_field</item>
++			<item>hidden_field_tag</item>
++			<item>highlight</item>
++			<item>human_size</item>
++			<item>image_path</item>
++			<item>image_submit_tag</item>
++			<item>image_tag</item>
++			<item>input</item>
++			<item>javascript_include_tag</item>
++			<item>javascript_path</item>
++			<item>javascript_tag</item>
++			<item>link_image_to</item>
++			<item>link_to</item>
++			<item>link_to_function</item>
++			<item>link_to_if</item>
++			<item>link_to_image</item>
++			<item>link_to_remote</item>
++			<item>link_to_unless</item>
++			<item>link_to_unless_current</item>
++			<item>mail_to</item>
++			<item>markdown</item>
++			<item>number_to_currency</item>
++			<item>number_to_human_size</item>
++			<item>number_to_percentage</item>
++			<item>number_to_phone</item>
++			<item>number_with_delimiter</item>
++			<item>number_with_precision</item>
++			<item>observe_field</item>
++			<item>observe_form</item>
++			<item>option_groups_from_collection_for_select</item>
++			<item>options_for_select</item>
++			<item>options_from_collection_for_select</item>
++			<item>pagination_links</item>
++			<item>password_field</item>
++			<item>password_field_tag</item>
++			<item>periodically_call_remote</item>
++			<item>pluralize</item>
++			<item>radio_button</item>
++			<item>radio_button_tag</item>
++			<item>register_template_handler</item>
++			<item>render</item>
++			<item>render_file</item>
++			<item>render_template</item>
++			<item>sanitize</item>
++			<item>select</item>
++			<item>select_date</item>
++			<item>select_datetime</item>
++			<item>select_day</item>
++			<item>select_hour</item>
++			<item>select_minute</item>
++			<item>select_month</item>
++			<item>select_second</item>
++			<item>select_tag</item>
++			<item>select_time</item>
++			<item>select_year</item>
++			<item>simple_format</item>
++			<item>sortable_element</item>
++			<item>start_form_tag</item>
++			<item>strip_links</item>
++			<item>stylesheet_link_tag</item>
++			<item>stylesheet_path</item>
++			<item>submit_tag</item>
++			<item>submit_to_remote</item>
++			<item>tag</item>
++			<item>text_area</item>
++			<item>text_area_tag</item>
++			<item>text_field</item>
++			<item>text_field_tag</item>
++			<item>text_field_with_auto_complete</item>
++			<item>textilize</item>
++			<item>textilize_without_paragraph</item>
++			<item>time_ago_in_words</item>
++			<item>time_zone_options_for_select</item>
++			<item>time_zone_select</item>
++			<item>truncate</item>
++			<item>update_element_function</item>
++			<item>upload_progress_status</item>
++			<item>upload_progress_text</item>
++			<item>upload_progress_update_bar_js</item>
++			<item>upload_status_progress_bar_tag</item>
++			<item>upload_status_tag</item>
++			<item>upload_status_text_tag</item>
++			<item>url_for</item>
++			<item>visual_effect</item>
++			<item>word_wrap</item>
++		</list>
++		
++		<list name="attention">
++			<item> TODO </item>
++			<item> FIXME </item>
++			<item> NOTE </item>
++		</list>
++		
++		<contexts>
++			
++		<!-- BEGIN HTML contexts -->
++			<context name="Start" attribute="Normal Text" lineEndContext="#stay">
++				<IncludeRules context="FindHTML" />
++			</context>
++			
++			<context name="FindHTML" attribute="Normal Text" lineEndContext="#stay">
++				<DetectSpaces/>
++				<DetectIdentifier/>
++				
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				<StringDetect attribute="Keyword" context="rubysourceline" String="%" />
++				
++				<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
++				<StringDetect attribute="CDATA" context="CDATA" String="&lt;![CDATA[" beginRegion="cdata" />
++				<RegExpr attribute="Doctype" context="Doctype" String="&lt;!DOCTYPE\s+" beginRegion="doctype" />
++				<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
++				<RegExpr attribute="Element" context="CSS" String="&lt;style\b" insensitive="TRUE" beginRegion="style" />
++				<RegExpr attribute="Element" context="JS" String="&lt;script\b" insensitive="TRUE" beginRegion="script" />
++				<RegExpr attribute="Element" context="El Open" String="&lt;pre\b" insensitive="TRUE" beginRegion="pre" />
++				<RegExpr attribute="Element" context="El Open" String="&lt;div\b" insensitive="TRUE" beginRegion="div" />
++				<RegExpr attribute="Element" context="El Open" String="&lt;table\b" insensitive="TRUE" beginRegion="table" />
++				<RegExpr attribute="Element" context="El Open" String="&lt;&name;" />
++				<RegExpr attribute="Element" context="El Close" String="&lt;/pre\b" insensitive="TRUE" endRegion="pre" />
++				<RegExpr attribute="Element" context="El Close" String="&lt;/div\b" insensitive="TRUE" endRegion="div" />
++				<RegExpr attribute="Element" context="El Close" String="&lt;/table\b" insensitive="TRUE" endRegion="table" />
++				<RegExpr attribute="Element" context="El Close" String="&lt;/&name;" />
++				<!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
++				<IncludeRules context="FindEntityRefs" />
++			</context>
++			
++			<context name="FindEntityRefs" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
++				<AnyChar attribute="Error" context="#stay" String="&amp;&lt;" />
++			</context>
++			
++			<context name="FindPEntityRefs" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="EntityRef" context="#stay" String="&entref;" />
++				<RegExpr attribute="PEntityRef" context="#stay" String="%&name;;" />
++				<AnyChar attribute="Error" context="#stay" String="&amp;%" />
++			</context>
++			
++			<context name="FindAttributes" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Attribute" context="#stay" String="&name;" column="0"/>
++				<RegExpr attribute="Attribute" context="#stay" String="\s+&name;" />
++				<DetectChar attribute="Attribute" context="Value" char="=" />
++			</context>
++			
++			<context name="FindDTDRules" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Doctype" context="Doctype Markupdecl" String="&lt;!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b" />
++			</context>
++			
++			
++			<context name="Comment" attribute="Comment" lineEndContext="#stay">
++				<DetectSpaces/>
++				<IncludeRules context="##Alerts" />
++				<DetectIdentifier/>
++				<StringDetect attribute="Comment" context="#pop" String="--&gt;" endRegion="comment" />
++				<RegExpr attribute="Error" context="#stay" String="-(-(?!-&gt;))+" />
++			</context>
++			
++			<context name="CDATA" attribute="Normal Text" lineEndContext="#stay">
++				<DetectSpaces/>
++				<DetectIdentifier/>
++				<StringDetect attribute="CDATA" context="#pop" String="]]&gt;" endRegion="cdata" />
++				<StringDetect attribute="EntityRef" context="#stay" String="]]&amp;gt;" />
++			</context>
++			
++			<context name="PI" attribute="Normal Text" lineEndContext="#stay">
++				<Detect2Chars attribute="Processing Instruction" context="#pop" char="?" char1="&gt;" endRegion="pi" />
++			</context>
++			
++			<context name="Doctype" attribute="Normal Text" lineEndContext="#stay">
++				<DetectChar attribute="Doctype" context="#pop" char="&gt;" endRegion="doctype" />
++				<DetectChar attribute="Doctype" context="Doctype Internal Subset" char="[" beginRegion="int_subset" />
++			</context>
++			
++			<context name="Doctype Internal Subset" attribute="Normal Text" lineEndContext="#stay">
++				<DetectChar attribute="Doctype" context="#pop" char="]" endRegion="int_subset" />
++				<IncludeRules context="FindDTDRules" />
++				<StringDetect attribute="Comment" context="Comment" String="&lt;!--" beginRegion="comment" />
++				<RegExpr attribute="Processing Instruction" context="PI" String="&lt;\?[\w:-]*" beginRegion="pi" />
++				<IncludeRules context="FindPEntityRefs" />
++			</context>
++			
++			<context name="Doctype Markupdecl" attribute="Normal Text" lineEndContext="#stay">
++				<DetectChar attribute="Doctype" context="#pop" char="&gt;" />
++				<DetectChar attribute="Value" context="Doctype Markupdecl DQ" char="&quot;" />
++				<DetectChar attribute="Value" context="Doctype Markupdecl SQ" char="&apos;" />
++			</context>
++			
++			<context name="Doctype Markupdecl DQ" attribute="Value" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Value" context="#pop" char="&quot;" />
++				<IncludeRules context="FindPEntityRefs" />
++			</context>
++			
++			<context name="Doctype Markupdecl SQ" attribute="Value" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Value" context="#pop" char="&apos;" />
++				<IncludeRules context="FindPEntityRefs" />
++			</context>
++			
++			<context name="El Open" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" />
++				<DetectChar attribute="Element" context="#pop" char="&gt;" />
++				<IncludeRules context="FindAttributes" />
++				<RegExpr attribute="Error" context="#stay" String="\S" />
++			</context>
++			
++			<context name="El Close" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Element" context="#pop" char="&gt;" />
++				<RegExpr attribute="Error" context="#stay" String="\S" />
++			</context>
++			
++			<context name="El Close 2" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Element" context="#pop#pop#pop" char="&gt;" />
++				<RegExpr attribute="Error" context="#stay" String="\S" />
++			</context>
++			
++			<context name="El Close 3" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Element" context="#pop#pop#pop#pop" char="&gt;" />
++				<RegExpr attribute="Error" context="#stay" String="\S" />
++			</context>
++			
++			<context name="CSS" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="style" />
++				<DetectChar attribute="Element" context="CSS content" char="&gt;" />
++				<IncludeRules context="FindAttributes" />
++				<RegExpr attribute="Error" context="#stay" String="\S" />
++			</context>
++			
++			<context name="CSS content" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<RegExpr attribute="Element" context="El Close 2" String="&lt;/style\b" insensitive="TRUE" endRegion="style" />
++				<IncludeRules context="##CSS" includeAttrib="true"/>
++			</context>
++			
++			<context name="JS" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<Detect2Chars attribute="Element" context="#pop" char="/" char1="&gt;" endRegion="script" />
++				<DetectChar attribute="Element" context="JS content" char="&gt;" />
++				<IncludeRules context="FindAttributes" />
++				<RegExpr attribute="Error" context="#stay" String="\S" />
++			</context>
++			
++			<context name="JS content" attribute="Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<RegExpr attribute="Element" context="El Close 2" String="&lt;/script\b" insensitive="TRUE" endRegion="script" />
++				<RegExpr attribute="Comment" context="JS comment close" String="//(?=.*&lt;/script\b)" insensitive="TRUE" />
++				<IncludeRules context="##JavaScript" includeAttrib="true"/>
++			</context>
++			
++			<context name="JS comment close" attribute="Comment" lineEndContext="#pop">
++				<RegExpr attribute="Element" context="El Close 3" String="&lt;/script\b" insensitive="TRUE" endRegion="script" />
++				<IncludeRules context="##Alerts" />
++			</context>
++			
++			<context name="Value" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="Value NQ">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Value" context="Value DQ" char="&quot;" />
++				<DetectChar attribute="Value" context="Value SQ" char="&apos;" />
++				<DetectSpaces />
++			</context>
++			
++			<context name="Value NQ" attribute="Normal Text" lineEndContext="#pop#pop" fallthrough="true" fallthroughContext="#pop#pop">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<IncludeRules context="FindEntityRefs" />
++				<RegExpr attribute="Value" context="#stay" String="/(?!&gt;)" />
++				<RegExpr attribute="Value" context="#stay" String="[^/&gt;&lt;&quot;&apos;\s]" />
++			</context>
++			
++			<context name="Value DQ" attribute="Value" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Value" context="#pop#pop" char="&quot;" />
++				<IncludeRules context="FindEntityRefs" />
++			</context>
++			
++			<context name="Value SQ" attribute="Value" lineEndContext="#stay">
++				<RegExpr attribute="Keyword" context="rubysource" String="&lt;%=?" />
++				
++				<DetectChar attribute="Value" context="#pop#pop" char="&apos;" />
++				<IncludeRules context="FindEntityRefs" />
++  			</context>	
++		<!-- END HTML contexts -->
++		
++		<!-- BEGIN Ruby contexts -->
++		
++			<!-- A single line of ruby source after a '%' ERB tag -->
++			<context name="rubysourceline" attribute="RUBY RAILS ERB Text" lineEndContext="#pop">
++				<IncludeRules context="rubysource" />
++			</context>
++			
++			<context name="rubysource" attribute="RUBY RAILS ERB Text" lineEndContext="#stay">
++				<!-- ruby ignores newline after \ -->
++				<LineContinue attribute="Ruby Normal Text" context="Line Continue"/>
++				
++				<RegExpr attribute="Keyword" context="#pop" String="-?%&gt;" />
++				
++				<!-- __END__ token on own line. -->
++				<RegExpr attribute="Keyword" String="__END__$" context="DATA" column="0"/>
++				
++				<!-- "shebang" line -->
++				<RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/>
++				
++				<!-- "def" - "end" blocks -->
++				<!-- check for statement modifiers with regexes -->
++				<RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/>
++				<RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/>
++				<RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bclass\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bmodule\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bbegin\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bcase\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bdo\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/>
++				<RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/>
++				<!-- elsif/else close the current block and start a new one -->
++				<RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\s+|$)" context="#stay" endRegion="def block" beginRegion="def block"/>
++				
++				<StringDetect attribute="Operator" String="..." context="#stay"/>
++				<Detect2Chars attribute="Operator" char="." char1="." context="#stay"/>
++				
++				<!-- marks a message (being sent, not defined) -->
++				<RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" context="#stay"/>
++				
++				<!-- Check for "ASCII code operator". e.g.: ?a -->
++				<RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" context="#stay"/>
++				
++				<keyword attribute="Keyword" String="keywords" context="#stay"/>
++				<keyword attribute="Attribute Definition" String="attribute-definitions"  context="#stay"/>
++				<keyword attribute="Access Control" String="access-control" context="#stay"/>
++				<keyword attribute="Definition" String="definitions"  context="#stay" />
++				<keyword attribute="Pseudo variable" String="pseudo-variables"  context="#stay"/>
++				<keyword attribute="Default globals" String="default-globals" context="#stay"/>
++				<keyword attribute="Kernel methods" String="kernel-methods" context="#stay"/>
++				
++				<!-- (global) vars starting with $
++					Match them before $_.
++					-->
++				<RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="#stay"/>
++				<RegExpr attribute="Global Variable" String="\$\-[a-zA-z_]\b" context="#stay"/>
++				<!-- special-character globals -->
++				<RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&amp;]" context="#stay"/>
++				<RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="#stay"/>
++				<!-- Generally a module or class name like "File", "MyModule_1", .. -->
++				<RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="#stay"/>
++				
++				<RegExpr attribute="Hex" String="\b\-?0[xX][_0-9a-fA-F]+" context="#stay"/>
++				<RegExpr attribute="Bin" String="\b\-?0[bB][_01]+" context="#stay"/>
++				<RegExpr attribute="Octal" String="\b\-?0[1-7][_0-7]*" context="#stay"/>
++				<RegExpr attribute="Float" String="\b\-?[0-9][0-9_]*\.[0-9][0-9_]*([eE]\-?[1-9][0-9]*(\.[0-9]*)?)?" context="#stay"/>
++				<RegExpr attribute="Dec" String="\b\-?[1-9][0-9_]*\b" context="#stay"/>
++				<Int attribute="Dec" context="#stay"/>
++				<HlCChar attribute="Char" context="#stay"/>
++				
++				<!-- Check for =begin before assignment operator. -->
++				<StringDetect attribute="Blockcomment" String="=begin" context="Embedded documentation" beginRegion="comment block" column="0"/>
++				
++				<!-- recognize the beginning of a HEREDOC
++					This uses new features in Kate 2.3 and later
++					
++					There is no other chance of keeping heredoc apart from the
++					push operator '<<' than requiring to put space between the operator
++										and the string.
++										-->
++				<RegExpr attribute="Operator" context="find_indented_heredoc" String="\s*&lt;&lt;-(?=\w+|[&quot;'])" beginRegion="HereDocument" />
++				<RegExpr attribute="Operator" context="find_heredoc" String="\s*&lt;&lt;(?=\w+|[&quot;'])" beginRegion="HereDocument" />
++				
++				<DetectChar attribute="Operator" char="." context="#stay"/>
++				<Detect2Chars attribute="Operator" char="&amp;" char1="&amp;" context="#stay"/>
++				<Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/>
++				<RegExpr attribute="Operator" String="\s[\?\:\%/]\s" context="#stay"/>
++				<RegExpr attribute="Operator" String="[|&amp;&lt;&gt;\^\+*~\-=]+" context="#stay"/>
++				<!-- regexp hack -->
++				<RegExpr attribute="Operator" String="\s!" context="#stay"/>
++				<RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/>
++				<StringDetect attribute="Operator" String="%=" context="#stay" insensitive="0"/>
++				<Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/>
++				
++				<RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="#stay"/>
++				
++				<DetectChar attribute="String" char="&quot;" context="Quoted String"/>
++				<DetectChar attribute="Raw String" char="'" context="Apostrophed String"/>
++				<DetectChar attribute="Command" char="`" context="Command String"/>
++				
++				<StringDetect attribute="Normal Text" String="?#" context="#stay"/>
++				
++				<RegExpr attribute="Comment" String="#\s*BEGIN.*$"  context="#stay" beginRegion="marker" column="0"/>
++				<RegExpr attribute="Comment" String="#\s*END.*$"  context="#stay" endRegion="marker" column="0"/>
++				<RegExpr attribute="Comment" String="#"  context="Comment Line" firstNonSpace="true"/>
++				<RegExpr attribute="Comment" String="\s#"  context="General Comment"/>
++				
++				<RegExpr attribute="Delimiter" String="[\[\]]+"  context="#stay"/>
++				<DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/>
++				<DetectChar attribute="Delimiter" char="}" context="#stay" endRegion="def block"/>
++				
++				<RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="#stay"/>
++				<RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="#stay"/>
++				
++				<!-- handle the different regular expression formats -->
++				<DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/>
++				
++				<!-- recognize the beginning of a general delimited input format -->
++				<!-- this moves to the next context to separate out the exact nature of the GDL input -->
++				<RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[Qqxw]?[^\s&gt;])" beginRegion="GdlInput" />
++			</context>
++			
++			<context name="Line Continue" attribute="Ruby Normal Text" lineEndContext="#pop">
++				<RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/>
++				<RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/>
++				<IncludeRules context="rubysource"/>
++			</context>
++			
++			<context name="Quoted String" attribute="String" lineEndContext="#stay">
++				<StringDetect attribute="String" String="\\" context="#stay"/>
++				<RegExpr attribute="String" String="\\\&quot;" context="#stay"/>
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++				<!--HlCChar attribute="Char" context="#pop"/-->
++				<DetectChar char="&quot;" attribute="String" context="#pop"/>
++			</context>
++			
++			<context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay">
++				<!-- <HlCChar attribute="Char" context="#pop"/> -->
++				<StringDetect attribute="String" String="\\" context="#stay"/>
++				<RegExpr attribute="String" String="\\\'" context="#stay"/>
++				<DetectChar char="'" attribute="Raw String" context="#pop"/>
++			</context>
++			
++			<context name="Command String" attribute="Command" lineEndContext="#stay">
++				<StringDetect attribute="String" String="\\" context="#stay"/>
++				<RegExpr attribute="String" String="\\\`" context="#stay"/>
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++				<HlCChar attribute="Char" context="#pop"/>
++				<DetectChar char="`" attribute="Command" context="#pop"/>
++			</context>
++			
++			<context name="Embedded documentation" attribute="Ruby Comment" lineEndContext="#stay">
++				<StringDetect attribute="Ruby Comment" String="=end" context="#pop" endRegion="comment block" column="0"/>
++			</context>
++			
++			<context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay">
++				<RegExpr attribute="Regular Expression" String="\\\/" context="#stay"/>
++				<RegExpr attribute="Regular Expression" String="[^\\]$" context="#pop"/>
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++				<RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="#pop"/>
++			</context>
++			
++			<!-- Substitutions can be nested -->
++			<context name="Subst" attribute="Ruby Normal Text" lineEndContext="#stay">
++				<DetectChar attribute="Substitution" char="}" context="#pop"/>
++				<!-- Highlight substitution as code. -->
++				<IncludeRules context="rubysource"/>
++			</context>
++			
++			<context name="Short Subst" attribute="Substitution" lineEndContext="#pop">
++				<!-- Check for e.g.: "#@var#@@xy" -->
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="#stay"/>
++				<RegExpr attribute="Substitution" String="\w(?!\w)" context="#pop"/>
++			</context>
++			
++			<!-- This handles access of nested module classes and class methods -->
++			<context name="Member Access" attribute="Member" lineEndContext="#pop">
++				<!-- marks a message (being sent, not defined) -->
++				<RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?(?=[^\w\d\.\:])" context="#pop"/>
++				<RegExpr attribute="Message" String="\.?[_a-z]\w*(\?|\!)?" context="#stay"/>
++				<RegExpr attribute="Constant" String="[A-Z]+_*(\d|[a-z])\w*(?=[^\w\d\.\:])" context="#pop"/>
++				<RegExpr attribute="Constant" String="[A-Z]+_*([0-9]|[a-z])\w*" context="#stay"/>
++				<RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*(?=[^\w\d\.\:])" context="#pop"/>
++				<RegExpr attribute="Constant Value" String="[_A-Z][_A-Z0-9]*" context="#stay"/>
++				<Detect2Chars attribute="Operator" char=":" char1=":" context="#stay"/>
++				<DetectChar attribute="Member" char="." context="#stay"/>
++				
++				<AnyChar attribute="Operator" String="=+-*/%|&amp;[]{}~" context="#pop"/>
++				<DetectChar attribute="Ruby Comment" char="#" context="#pop"/>
++				<AnyChar attribute="Ruby Normal Text" String="()\" context="#pop"/>
++				<RegExpr attribute="Member" String="\W" context="#pop"/>
++			</context>
++			
++			<context name="Comment Line" attribute="Ruby Comment" lineEndContext="#pop">
++				<RegExpr attribute="Ruby Comment" String="\w\:\:\s" context="RDoc Label"/>
++				<keyword attribute="Alert" String="attention" context="#stay"/>
++				<RegExpr attribute="Keyword" context="#pop#pop" String="-?%&gt;" />
++			</context>
++			
++			<context name="General Comment" attribute="Ruby Comment" lineEndContext="#pop">
++				<keyword attribute="Dec" String="attention" context="#stay"/>
++			</context>
++			
++			<context name="RDoc Label" attribute="RDoc Value" lineEndContext="#pop"/>
++			
++			<!-- HEREDOC support
++				The contexts below support both normal and indented heredocs
++				-->
++			<!-- here we markup the heredoc markers -->
++			<context name="find_heredoc" attribute="Ruby Normal Text" lineEndContext="#pop" >
++				<RegExpr attribute="Keyword" context="apostrophed_normal_heredoc" String="'(\w+)'" />
++				<RegExpr attribute="Keyword" context="normal_heredoc" String="&quot;?(\w+)&quot;?" />
++			</context>
++			<context name="find_indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#pop" >
++				<RegExpr attribute="Keyword" context="apostrophed_indented_heredoc" String="'(\w+)'" />
++				<RegExpr attribute="Keyword" context="indented_heredoc" String="&quot;?(\w+)&quot;?" />
++			</context>
++			<!-- these are the real heredoc contexts -->
++			<context name="indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
++				<!--				<RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>-->
++				<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
++				<IncludeRules context="heredoc_rules" />
++			</context>
++			<context name="apostrophed_indented_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
++				<!--				<RegExpr attribute="Keyword" context="#pop#pop" String="^\s*%1$" dynamic="true" endRegion="HereDocument"/>-->
++				<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" firstNonSpace="true"/>
++			</context>
++			
++			<context name="normal_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
++				<!--				<RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>-->
++				<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
++				<IncludeRules context="heredoc_rules" />
++			</context>
++			<context name="apostrophed_normal_heredoc" attribute="Ruby Normal Text" lineEndContext="#stay" dynamic="true">
++				<!--				<RegExpr attribute="Keyword" context="#pop#pop" String="^%1$" dynamic="true" endRegion="HereDocument"/>-->
++				<RegExpr attribute="Keyword" context="#pop#pop" String="%1$" dynamic="true" endRegion="HereDocument" column="0"/>
++			</context>
++			
++			<!-- rules for heredoc types -->
++			<context name="heredoc_rules" attribute="Ruby Normal Text" lineEndContext="#stay">
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++			</context>
++			
++			<!-- General delimited input support
++				The contexts below handle the various gdl formats
++				-->
++			<context name="find_gdl_input" attribute="Ruby Normal Text" lineEndContext="#pop">
++				
++				<!-- handle token arrays -->
++				<RegExpr attribute="GDL input" context="gdl_token_array_1" String="w\(" />
++				<RegExpr attribute="GDL input" context="gdl_token_array_2" String="w\{" />
++				<RegExpr attribute="GDL input" context="gdl_token_array_3" String="w\[" />
++				<RegExpr attribute="GDL input" context="gdl_token_array_4" String="w&lt;" />
++				<!-- then we handle the 'any char' format -->
++				<RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" />
++				
++				<!-- handle apostrophed strings -->
++				<RegExpr attribute="GDL input" context="gdl_apostrophed_1" String="q\(" />
++				<RegExpr attribute="GDL input" context="gdl_apostrophed_2" String="q\{" />
++				<RegExpr attribute="GDL input" context="gdl_apostrophed_3" String="q\[" />
++				<RegExpr attribute="GDL input" context="gdl_apostrophed_4" String="q&lt;" />
++				<!-- then we handle the 'any char' format -->
++				<RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" />
++				
++				<!-- handle shell commands -->
++				<RegExpr attribute="GDL input" context="gdl_shell_command_1" String="x\(" />
++				<RegExpr attribute="GDL input" context="gdl_shell_command_2" String="x\{" />
++				<RegExpr attribute="GDL input" context="gdl_shell_command_3" String="x\[" />
++				<RegExpr attribute="GDL input" context="gdl_shell_command_4" String="x&lt;" />
++				<!-- then we handle the 'any char' format -->
++				<RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" />
++				
++				<!-- handle regular expressions -->
++				<RegExpr attribute="GDL input" context="gdl_regexpr_1" String="r\(" />
++				<RegExpr attribute="GDL input" context="gdl_regexpr_2" String="r\{" />
++				<RegExpr attribute="GDL input" context="gdl_regexpr_3" String="r\[" />
++				<RegExpr attribute="GDL input" context="gdl_regexpr_4" String="r&lt;" />
++				<!-- then we handle the 'any char' format -->
++				<RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" />
++				
++				<!-- handle double-quoted strings -->
++				<!-- 
++					be careful to make this the last GDL ruleset, because the rule for
++					the short form %?foo? will otherwise catch any of the other formats
++					-->
++				<RegExpr attribute="GDL input" context="gdl_dq_string_1" String="Q?\(" />
++				<RegExpr attribute="GDL input" context="gdl_dq_string_2" String="Q?\{" />
++				<RegExpr attribute="GDL input" context="gdl_dq_string_3" String="Q?\[" />
++				<RegExpr attribute="GDL input" context="gdl_dq_string_4" String="Q?&lt;" />
++				<!-- then we handle the 'any char' format -->
++				<RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" />
++				
++			</context>
++			<!-- double-quoted string specific contexts follow -->
++			<context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="dq_string_rules" />
++				<Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
++				<DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_dq_string_1_nested" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="dq_string_rules" />
++				<DetectChar attribute="String" context="gdl_dq_string_1_nested" char="(" />
++				<DetectChar attribute="String" context="#pop" char=")" />
++			</context>
++			<!-- note that here substitution should win over nesting -->
++			<context name="gdl_dq_string_2" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="dq_string_rules" />
++				<Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
++				<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
++				<DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
++			</context>
++			<context name="gdl_dq_string_2_nested" attribute="String" lineEndContext="#stay" >
++				<DetectChar attribute="String" context="gdl_dq_string_2_nested" char="{" />
++				<DetectChar attribute="String" context="#pop" char="}" />
++				<IncludeRules context="dq_string_rules" />
++			</context>
++			
++			<context name="gdl_dq_string_3" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="dq_string_rules" />
++				<Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
++				<DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_dq_string_3_nested" attribute="String" lineEndContext="#stay" >
++				<DetectChar attribute="String" context="gdl_dq_string_3_nested" char="[" />
++				<DetectChar attribute="String" context="#pop" char="]" />
++				<IncludeRules context="dq_string_rules" />
++			</context>
++			
++			<context name="gdl_dq_string_4" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="dq_string_rules" />
++				<Detect2Chars attribute="String" char="\" char1="&gt;" context="#stay"/>
++				<DetectChar attribute="String" context="gdl_dq_string_4_nested" char="&lt;" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_dq_string_4_nested" attribute="String" lineEndContext="#stay" >
++				<DetectChar attribute="String" context="gdl_dq_string_4_nested" char="&lt;" />
++				<DetectChar attribute="String" context="#pop" char="&gt;" />
++				<IncludeRules context="dq_string_rules" />
++			</context>
++			
++			<!-- this format doesn't allow nesting. it is terminated by the next occurence of the
++				delimiter character
++				-->
++			<context name="gdl_dq_string_5" attribute="String" lineEndContext="#stay" dynamic="true">
++				<IncludeRules context="dq_string_rules" />
++				<RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true" />
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
++			</context>
++			<!-- rules to be included in all dq_string contexts -->
++			<context name="dq_string_rules" attribute="String" lineEndContext="#stay" >
++				<Detect2Chars attribute="String" char="\" char1="\" context="#stay"/>
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++			</context>
++			
++			<!-- token array specific contexts -->
++			
++			<context name="gdl_token_array_1" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<Detect2Chars attribute="String" char="\" char1=")" context="#stay"/>
++				<DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_token_array_1_nested" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<DetectChar attribute="String" context="gdl_token_array_1_nested" char="(" />
++				<DetectChar attribute="String" context="#pop" char=")" />
++			</context>
++			
++			<context name="gdl_token_array_2" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<Detect2Chars attribute="String" char="\" char1="}" context="#stay"/>
++				<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
++				<DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
++			</context>
++			<context name="gdl_token_array_2_nested" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<DetectChar attribute="String" context="gdl_token_array_2_nested" char="{" />
++				<DetectChar attribute="String" context="#pop" char="}" />
++			</context>
++			
++			<context name="gdl_token_array_3" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<Detect2Chars attribute="String" char="\" char1="]" context="#stay"/>
++				<DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_token_array_3_nested" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<DetectChar attribute="String" context="gdl_token_array_3_nested" char="[" />
++				<DetectChar attribute="String" context="#pop" char="]" />
++			</context>
++			
++			<context name="gdl_token_array_4" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<Detect2Chars attribute="String" char="\" char1="&gt;" context="#stay"/>
++				<DetectChar attribute="String" context="gdl_token_array_4_nested" char="&lt;" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_token_array_4_nested" attribute="String" lineEndContext="#stay" >
++				<IncludeRules context="token_array_rules" />
++				<DetectChar attribute="String" context="gdl_token_array_4_nested" char="&lt;" />
++				<DetectChar attribute="String" context="#pop" char="&gt;" />
++			</context>
++			
++			<!-- this format doesn't allow nesting. it is terminated by the next occurence of the
++				delimiter character
++				-->
++			<context name="gdl_token_array_5" attribute="String" lineEndContext="#stay" dynamic="true">
++				<IncludeRules context="token_array_rules" />
++				<RegExpr attribute="String" String="\\%1" context="#stay" dynamic="true"/>
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
++			</context>
++			
++			<!-- rules to be included in all token_array contexts -->
++			<context name="token_array_rules" attribute="String" lineEndContext="#stay" >
++				<StringDetect attribute="String" String="\\" context="#stay"/>
++			</context>
++			
++			<!-- apostrophed string specific contexts -->
++			
++			<context name="gdl_apostrophed_1" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<Detect2Chars attribute="Raw String" char="\" char1=")" context="#stay"/>
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_apostrophed_1_nested" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_1_nested" char="(" />
++				<DetectChar attribute="Raw String" context="#pop" char=")" />
++			</context>
++			
++			<context name="gdl_apostrophed_2" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<Detect2Chars attribute="Raw String" char="\" char1="}" context="#stay"/>
++				<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
++			</context>
++			<context name="gdl_apostrophed_2_nested" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_2_nested" char="{" />
++				<DetectChar attribute="Raw String" context="#pop" char="}" />
++			</context>
++			
++			<context name="gdl_apostrophed_3" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<Detect2Chars attribute="Raw String" char="\" char1="]" context="#stay"/>
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_apostrophed_3_nested" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_3_nested" char="[" />
++				<DetectChar attribute="Raw String" context="#pop" char="]" />
++			</context>
++			
++			<context name="gdl_apostrophed_4" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<Detect2Chars attribute="Raw String" char="\" char1="&gt;" context="#stay"/>
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="&lt;" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_apostrophed_4_nested" attribute="Raw String" lineEndContext="#stay" >
++				<IncludeRules context="apostrophed_rules" />
++				<DetectChar attribute="Raw String" context="gdl_apostrophed_4_nested" char="&lt;" />
++				<DetectChar attribute="Raw String" context="#pop" char="&gt;" />
++			</context>
++			
++			<!-- this format doesn't allow nesting. it is terminated by the next occurence of the
++				delimiter character
++				-->
++			<context name="gdl_apostrophed_5" attribute="Raw String" lineEndContext="#stay" dynamic="true">
++				<IncludeRules context="apostrophed_rules" />
++				<RegExpr attribute="Raw String" String="\\%1" context="#stay" dynamic="true"/>
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
++			</context>
++			
++			<!-- rules to be included in all apostrophed contexts -->
++			<context name="apostrophed_rules" attribute="Raw String" lineEndContext="#stay" >
++				<Detect2Chars attribute="Raw String" char="\" char1="\" context="#stay"/>
++			</context>
++			
++			<!-- shell command specific contexts -->
++			
++			<context name="gdl_shell_command_1" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<Detect2Chars attribute="Command" char="\" char1=")" context="#stay"/>
++				<DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char=")" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_shell_command_1_nested" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<DetectChar attribute="Command" context="gdl_shell_command_1_nested" char="(" />
++				<DetectChar attribute="Command" context="#pop" char=")" />
++			</context>
++			
++			<context name="gdl_shell_command_2" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<Detect2Chars attribute="Command" char="\" char1="}" context="#stay"/>
++				<DetectChar attribute="GDL input" context="#pop#pop" char="}" endRegion="GdlInput" />
++				<DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
++			</context>
++			<context name="gdl_shell_command_2_nested" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<DetectChar attribute="Command" context="gdl_shell_command_2_nested" char="{" />
++				<DetectChar attribute="Command" context="#pop" char="}" />
++			</context>
++			
++			<context name="gdl_shell_command_3" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<Detect2Chars attribute="Command" char="\" char1="]" context="#stay"/>
++				<DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="]" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_shell_command_3_nested" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<DetectChar attribute="Command" context="gdl_shell_command_3_nested" char="[" />
++				<DetectChar attribute="Command" context="#pop" char="]" />
++			</context>
++			
++			<context name="gdl_shell_command_4" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<Detect2Chars attribute="Command" char="\" char1="&gt;" context="#stay"/>
++				<DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="&lt;" />
++				<DetectChar attribute="GDL input" context="#pop#pop" char="&gt;" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_shell_command_4_nested" attribute="Command" lineEndContext="#stay" >
++				<IncludeRules context="shell_command_rules" />
++				<DetectChar attribute="Command" context="gdl_shell_command_4_nested" char="&lt;" />
++				<DetectChar attribute="Command" context="#pop" char="&gt;" />
++			</context>
++			
++			<!-- this format doesn't allow nesting. it is terminated by the next occurence of the
++				delimiter character
++				-->
++			<context name="gdl_shell_command_5" attribute="Command" lineEndContext="#stay" dynamic="true">
++				<IncludeRules context="shell_command_rules" />
++				<RegExpr attribute="Command" String="\\%1" context="#stay" dynamic="true" />
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1" dynamic="true" endRegion="GdlInput" />
++			</context>
++			
++			<!-- rules to be included in all shell_command contexts -->
++			<context name="shell_command_rules" attribute="Command" lineEndContext="#stay" >
++				<Detect2Chars attribute="Command" char="\" char1="\" context="#stay"/>
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++			</context>
++			
++			<!-- regular expression specific contexts -->
++			
++			<context name="gdl_regexpr_1" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<Detect2Chars attribute="Regular Expression" char="\" char1=")" context="#stay"/>
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\)[uiomxn]*" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_regexpr_1_nested" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_1_nested" char="(" />
++				<DetectChar attribute="Regular Expression" context="#pop" char=")" />
++			</context>
++			
++			<context name="gdl_regexpr_2" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<Detect2Chars attribute="Regular Expression" char="\" char1="}" context="#stay"/>
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\}[uiomxn]*" endRegion="GdlInput" />
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
++			</context>
++			<context name="gdl_regexpr_2_nested" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_2_nested" char="{" />
++				<DetectChar attribute="Regular Expression" context="#pop" char="}" />
++			</context>
++			
++			<context name="gdl_regexpr_3" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<Detect2Chars attribute="Regular Expression" char="\" char1="]" context="#stay"/>
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\][uiomxn]*" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_regexpr_3_nested" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_3_nested" char="[" />
++				<DetectChar attribute="Regular Expression" context="#pop" char="]" />
++			</context>
++			
++			<context name="gdl_regexpr_4" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<Detect2Chars attribute="Regular Expression" char="\" char1="&gt;" context="#stay"/>
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="&lt;" />
++				<RegExpr attribute="GDL input" context="#pop#pop" String="&gt;[uiomxn]*" endRegion="GdlInput" />
++			</context>
++			<context name="gdl_regexpr_4_nested" attribute="Regular Expression" lineEndContext="#stay" >
++				<IncludeRules context="regexpr_rules" />
++				<DetectChar attribute="Regular Expression" context="gdl_regexpr_4_nested" char="&lt;" />
++				<DetectChar attribute="Regular Expression" context="#pop" char="&gt;" />
++			</context>
++			
++			<!-- this format doesn't allow nesting. it is terminated by the next occurence of the
++				delimiter character
++				-->
++			<context name="gdl_regexpr_5" attribute="Regular Expression" lineEndContext="#stay" dynamic="true">
++				<IncludeRules context="regexpr_rules" />
++				<RegExpr attribute="Regular Expression" String="\\%1" context="#stay" dynamic="true" />
++				<RegExpr attribute="GDL input" context="#pop#pop" String="\s*%1[uiomxn]*" dynamic="true" endRegion="GdlInput" />
++			</context>
++			
++			<!-- rules to be included in all regexpr contexts -->
++			<context name="regexpr_rules" attribute="Regular Expression" lineEndContext="#stay" >
++				<Detect2Chars attribute="Regular Expression" char="\" char1="\" context="#stay"/>
++				<RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/>
++				<Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/>
++			</context>
++			
++			<!-- END of General delimited input support -->
++			
++			<!-- handle data in script -->
++			<context name="DATA" attribute="Data" lineEndContext="#stay"/>
++		<!-- END Ruby contexts -->			
++		</contexts>
++		
++		<itemDatas>
++		<!-- BEGIN Ruby itemData -->
++			<itemData name="Ruby Normal Text" defStyleNum="dsNormal"/>
++			
++			<itemData name="Keyword" defStyleNum="dsKeyword"/>
++			<itemData name="Attribute Definition" defStyleNum="dsOthers"/>
++			<itemData name="Access Control" defStyleNum="dsKeyword" color="#0000FF"/>
++			<itemData name="Definition" defStyleNum="dsKeyword"/>
++			<itemData name="Pseudo variable" defStyleNum="dsDecVal"/>
++			
++			<itemData name="Dec" defStyleNum="dsDecVal"/>
++			<itemData name="Float" defStyleNum="dsFloat"/>
++			<itemData name="Char" defStyleNum="dsChar"/>
++			<itemData name="Octal" defStyleNum="dsBaseN"/>
++			<itemData name="Hex" defStyleNum="dsBaseN"/>
++			<itemData name="Bin" defStyleNum="dsBaseN"/>
++			
++			<itemData name="Symbol" defStyleNum="dsString" color="#D40000"/>
++			<itemData name="String" defStyleNum="dsString"/>
++			<itemData name="Raw String" defStyleNum="dsString" color="#DD4A4A" selColor="#DD4A4A"/>
++			<itemData name="Command" defStyleNum="dsString" color="#AA3000"/>
++			<itemData name="Message" defStyleNum="dsNormal" color="#4000A7"/> <!-- #4A00C0 -->
++			<itemData name="Regular Expression" defStyleNum="dsOthers" color="#4A5704"/>
++			<itemData name="Substitution"	defStyleNum="dsOthers"/>
++			<itemData name="Data" defStyleNum="dsNormal"/>
++			<!-- short for 'general delimited input' -->
++			<itemData name="GDL input" defStyleNum="dsOthers" />
++			
++			<itemData name="Default globals" defStyleNum="dsDataType" color="#C00000" bold="1"/>
++			<itemData name="Global Variable" defStyleNum="dsDataType" color="#C00000"/>
++			<itemData name="Global Constant" defStyleNum="dsDataType" color="#bb1188" bold="1"/>
++			<itemData name="Constant" defStyleNum="dsDataType"/>
++			<itemData name="Constant Value" defStyleNum="dsDataType" color="#bb1188"/>
++			<itemData name="Kernel methods" defStyleNum="dsNormal" color="#000080" selColor="#ffffff"/> <!-- #CC0E86 -->
++			<itemData name="Member" defStyleNum="dsNormal"/>
++			<itemData name="Instance Variable" defStyleNum="dsOthers"/>
++			<itemData name="Class Variable" defStyleNum="dsOthers"/>
++			
++			<itemData name="Ruby Comment" defStyleNum="dsComment"/>
++			<itemData name="Blockcomment" defStyleNum="dsComment"/>
++			<itemData name="Region Marker" defStyleNum="dsNormal" color="#0000ff"/>
++			<itemData name="RDoc Value" defStyleNum="dsOthers"/>
++			
++			<!-- use these to mark errors and alerts things -->
++			<itemData name="Error" defStyleNum="dsError" />
++			<itemData name="Alert" defStyleNum="dsAlert" />
++
++			<itemData name="Delimiter" defStyleNum="dsChar"/>
++			<itemData name="Expression" defStyleNum="dsOthers"/>
++			<itemData name="Operator" defStyleNum="dsChar"/>
++		<!-- END Ruby itemData -->
++			
++		<!-- BEGIN HTML itemData -->
++			<itemData name="Normal Text" defStyleNum="dsNormal" />
++			<itemData name="Comment" defStyleNum="dsComment" />
++			<itemData name="CDATA" defStyleNum="dsBaseN" bold="1" />
++			<itemData name="Processing Instruction" defStyleNum="dsKeyword" />
++			<itemData name="Doctype" defStyleNum="dsDataType" bold="1" />
++			<itemData name="Element" defStyleNum="dsKeyword" />
++			<itemData name="Attribute" defStyleNum="dsOthers" />
++			<itemData name="Value" defStyleNum="dsString" color="#a00" />
++			<itemData name="EntityRef" defStyleNum="dsDecVal" />
++			<itemData name="PEntityRef" defStyleNum="dsDecVal" />
++			<itemData name="Error" defStyleNum="dsError" />
++		<!-- END HTML itemData -->
++		
++		</itemDatas>
++	</highlighting>
++	<general>
++		<comments>
++			<comment name="singleLine" start="#"/>
++			<comment name="multiLine" start="&lt;!--" end="--&gt;" />
++		</comments>
++		<keywords casesensitive="1" weakDeliminator="!?"/> 
++	</general>
++</language>
+--- mimetypes/audio/x-vorbis.desktop	(revision 506549)
++++ mimetypes/audio/x-vorbis.desktop	(revision 515119)
+@@ -13,7 +13,7 @@
+ Comment[br]=Klevet Ogg Vorbis
+ Comment[bs]=Ogg Vorbis audio
+ Comment[ca]=Àudio Ogg Vorbis
+-Comment[cs]=Zvuv Ogg Vorbis
++Comment[cs]=Zvuk Ogg Vorbis
+ Comment[cy]=Sain Ogg Vorbis
+ Comment[da]=Ogg Vorbis lyd
+ Comment[de]=Ogg-Vorbis-Audio
+--- mimetypes/audio/vorbis.desktop	(revision 506549)
++++ mimetypes/audio/vorbis.desktop	(revision 515119)
+@@ -13,7 +13,7 @@
+ Comment[br]=Klevet Ogg Vorbis
+ Comment[bs]=Ogg Vorbis audio
+ Comment[ca]=Àudio Ogg Vorbis
+-Comment[cs]=Zvuv Ogg Vorbis
++Comment[cs]=Zvuk Ogg Vorbis
+ Comment[cy]=Sain Ogg Vorbis
+ Comment[da]=Ogg Vorbis lyd
+ Comment[de]=Ogg-Vorbis-Audio
+--- mimetypes/image/x-raw.desktop	(revision 0)
++++ mimetypes/image/x-raw.desktop	(revision 515119)
+@@ -0,0 +1,16 @@
++[Desktop Entry]
++Encoding=UTF-8
++Type=MimeType
++MimeType=image/x-raw
++Icon=image
++Patterns=*.raw;*.RAW;*.dcr;*.DCR;*.dng;*.DNG;*.crw;*.CRW;*.cr2,*.CR2;*.nef;*.NEF;*.mrw;*.MRW;
++Comment=RAW Camera Image
++Comment[ca]=Fitxer de càmera RAW
++Comment[da]=Ubehandlet kamerabillede
++Comment[de]=Kamera-Bild im RAW-Format
++Comment[el]=RAW εικόνα κάμερας
++Comment[hu]=RAW-képfájl
++Comment[is]=RAW ljósmynd
++Comment[pt]=Ficheiro de Máquina Fotográfica RAW
++Comment[pt_BR]=Ficheiro de Máquina Fotográfica RAW
++Comment[sv]=Obehandlad kamerafil
+--- mimetypes/image/Makefile.am	(revision 506549)
++++ mimetypes/image/Makefile.am	(revision 515119)
+@@ -8,7 +8,7 @@
+     x-vnd.trolltech.qpicture.desktop x-vnd.adobe.photoshop.desktop \
+     x-xcursor.desktop pjpeg.desktop x-exr.desktop \
+     x-rgb.desktop x-dds.desktop x-djvu.desktop x-djvu-2.desktop x-hdr.desktop \
+-    fits.desktop
++    fits.desktop x-raw.desktop
+ 
+ mimetypeimagedatadir = $(kde_mimedir)/image
+ 
+--- mimetypes/application/mbox.desktop	(revision 506549)
++++ mimetypes/application/mbox.desktop	(revision 515119)
+@@ -11,8 +11,10 @@
+ Comment[el]=Φάκελος αλληλογραφίας MBOX
+ Comment[es]=Carpeta de correo MBOX
+ Comment[et]=MBOX e-posti kaust
++Comment[eu]=MBOX posta karpeta
+ Comment[fi]=MBOX-sähköpostikansio
+ Comment[fr]=Dossier de boîte aux lettres MBox
++Comment[ga]=Comhadlann Ríomhphoist MBOX
+ Comment[hu]=MBOX levélmappa
+ Comment[is]=MBOX póstmappa
+ Comment[it]=Cartella di posta MBOX
+--- mimetypes/message/rfc822.desktop	(revision 506549)
++++ mimetypes/message/rfc822.desktop	(revision 515119)
+@@ -51,7 +51,7 @@
+ Comment[nn]=E-postmelding
+ Comment[nso]=Molaetsa wa E-poso
+ Comment[pa]=ਈ-ਮੇਲ ਸੁਨੇਹਾ
+-Comment[pl]=List elektroniczny
++Comment[pl]=E-mail
+ Comment[pt]=Mensagem de E-mail
+ Comment[pt_BR]=Mensagem de E-mail
+ Comment[ro]=FiÅŸier email
+--- mimetypes/text/plain.desktop	(revision 506549)
++++ mimetypes/text/plain.desktop	(revision 515119)
+@@ -14,7 +14,7 @@
+ Comment[cy]=Dogfen Testun Plaen
+ Comment[da]=Almindeligt tekstdokument
+ Comment[de]=Einfacher Text
+-Comment[el]=Έγγραφο σκέτου κειμένου
++Comment[el]=Έγγραφο απλού κειμένου
+ Comment[eo]=Plena teksto
+ Comment[es]=Documento simple de texto
+ Comment[et]=Tavaline tekstifail
+--- kioslave/file/file.cc	(revision 506549)
++++ kioslave/file/file.cc	(revision 515119)
+@@ -103,7 +103,7 @@
+ #ifdef USE_POSIX_ACL
+ static QString aclAsString(  acl_t p_acl );
+ static bool isExtendedACL(  acl_t p_acl );
+-static void appendACLAtoms( const QCString & path, UDSEntry& entry, 
++static void appendACLAtoms( const QCString & path, UDSEntry& entry,
+                             mode_t type, bool withACL );
+ #endif
+ 
+@@ -149,7 +149,7 @@
+     if ( !ACLString.isEmpty() ) {
+         acl_t acl = 0;
+         if ( ACLString == "ACL_DELETE" ) {
+-            // user told us to delete the extended ACL, so let's write only 
++            // user told us to delete the extended ACL, so let's write only
+             // the minimal (UNIX permission bits) part
+             acl = acl_from_mode( perm );
+         }
+@@ -183,7 +183,7 @@
+ {
+     QCString _path( QFile::encodeName(url.path()) );
+     /* FIXME: Should be atomic */
+-    if ( ::chmod( _path.data(), permissions ) == -1 || 
++    if ( ::chmod( _path.data(), permissions ) == -1 ||
+         ( setACL( _path.data(), permissions, false ) == -1 ) ||
+         /* if not a directory, cannot set default ACLs */
+         ( setACL( _path.data(), permissions, true ) == -1 && errno != ENOTDIR ) ) {
+@@ -555,6 +555,23 @@
+         }
+     }
+ 
++    // set modification time
++    const QString mtimeStr = metaData( "modified" );
++    if ( !mtimeStr.isEmpty() ) {
++        QDateTime dt = QDateTime::fromString( mtimeStr, Qt::ISODate );
++        if ( dt.isValid() ) {
++            KDE_struct_stat dest_statbuf;
++            if (KDE_stat( _dest_orig.data(), &dest_statbuf ) == 0) {
++                struct utimbuf utbuf;
++                utbuf.actime = dest_statbuf.st_atime; // access time, unchanged
++                utbuf.modtime = dt.toTime_t(); // modification time
++                kdDebug() << k_funcinfo << "setting modtime to " << utbuf.modtime << endl;
++                utime( _dest_orig.data(), &utbuf );
++            }
++        }
++
++    }
++
+     // We have done our job => finish
+     finished();
+ }
+@@ -917,7 +934,7 @@
+ }
+ 
+ 
+-QString FileProtocol::getUserName( uid_t uid ) 
++QString FileProtocol::getUserName( uid_t uid )
+ {
+     QString *temp;
+     temp = usercache.find( uid );
+@@ -934,7 +951,7 @@
+         return *temp;
+ }
+ 
+-QString FileProtocol::getGroupName( gid_t gid ) 
++QString FileProtocol::getGroupName( gid_t gid )
+ {
+     QString *temp;
+     temp = groupcache.find( gid );
+@@ -953,7 +970,7 @@
+ 
+ 
+ 
+-bool FileProtocol::createUDSEntry( const QString & filename, const QCString & path, UDSEntry & entry, 
++bool FileProtocol::createUDSEntry( const QString & filename, const QCString & path, UDSEntry & entry,
+                                    short int details, bool withACL )
+ {
+     assert(entry.count() == 0); // by contract :-)
+@@ -1024,7 +1041,7 @@
+     atom.m_uds = KIO::UDS_SIZE;
+     atom.m_long = buff.st_size;
+     entry.append( atom );
+-    
++
+ #ifdef USE_POSIX_ACL
+     /* Append an atom indicating whether the file has extended acl information
+      * and if withACL is specified also one with the acl itself. If it's a directory
+@@ -1209,8 +1226,8 @@
+     QStrListIterator it(entryNames);
+     for (; it.current(); ++it) {
+         entry.clear();
+-        if ( createUDSEntry( QFile::decodeName(*it), 
+-                             *it /* we can use the filename as relative path*/, 
++        if ( createUDSEntry( QFile::decodeName(*it),
++                             *it /* we can use the filename as relative path*/,
+                              entry, 2, true ) )
+           listEntry( entry, false);
+         //else
+@@ -1718,9 +1735,9 @@
+     UDSAtom atom;
+     bool isDir = S_ISDIR( type );
+     // do we have an acl for the file, and/or a default acl for the dir, if it is one?
+-    if ( ( acl = acl_get_file( path.data(), ACL_TYPE_ACCESS ) ) ) { 
++    if ( ( acl = acl_get_file( path.data(), ACL_TYPE_ACCESS ) ) ) {
+         if ( !isExtendedACL( acl ) ) {
+-            acl_free( acl ); 
++            acl_free( acl );
+             acl = 0;
+         }
+     }
+--- kinit/autostart.cpp	(revision 506549)
++++ kinit/autostart.cpp	(revision 515119)
+@@ -117,6 +117,17 @@
+           continue;
+        if (config.readBoolEntry("Hidden", false))
+           continue;
++
++       if (config.hasKey("OnlyShowIn"))
++       {
++          if (!config.readListEntry("OnlyShowIn", ';').contains("KDE"))
++              continue;
++       }
++       if (config.hasKey("NotShowIn"))
++       {
++           if (config.readListEntry("NotShowIn", ';').contains("KDE"))
++               continue;
++       }
+        
+        AutoStartItem *item = new AutoStartItem;
+        item->name = extractName(*it);
+--- kio/magic	(revision 506549)
++++ kio/magic	(revision 515119)
+@@ -582,6 +582,23 @@
+ 0 	string		II\x2a\x00
+ >8	string		CR\x02		image/x-raw
+ 
++# Phase One RAW image, big-endian
++32	string		MMMMRawT	image/x-raw
++# Phase One RAW image, little-endian
++32	string		IIIITwaR	image/x-raw
++# Canon RAW image
++6	string		HEAPCCDR	image/x-raw
++# Canon CR2 image (20D, 1Dmk2, ...)
++0	string		II*\000\020\000\000\000CR	image/x-raw
++# Minolta RAW image
++0	string		\x00MRM		image/x-raw
++# Fuji RAW image
++0	string		FUJIFILM	image/x-raw
++# Rollei RAW image
++0	string		DSC-Image	image/x-raw
++# Foveon RAW image
++0	string		FOVb		image/x-raw
++
+ # TIFF and friends
+ #					TIFF file, big-endian
+ 0	string		MM\x00\x2a		image/tiff
+--- kio/kio/kfilemetainfo.cpp	(revision 506549)
++++ kio/kio/kfilemetainfo.cpp	(revision 515119)
+@@ -1541,6 +1541,11 @@
+     m_itemDict.setAutoDelete( true );
+ }
+ 
++KFileMimeTypeInfo::GroupInfo::~GroupInfo()
++{
++    delete m_variableItemInfo;
++} 
++
+ const KFileMimeTypeInfo::ItemInfo * KFileMimeTypeInfo::GroupInfo::itemInfo( const QString& key ) const
+ {
+     ItemInfo* item = m_itemDict.find( key );
+--- kio/kio/slavebase.h	(revision 506549)
++++ kio/kio/slavebase.h	(revision 515119)
+@@ -299,11 +299,18 @@
+ 
+     /**
+      * @obsolete kept for binary compatibility
+-     * Queries for config/meta-data send by the application to the slave.
++     * Queries for config/meta-data sent by the application to the slave.
+      */
+     QString metaData(const QString &key);
+ 
+     /**
++     * @internal for ForwardingSlaveBase
++     * Contains all metadata (but no config) sent by the application to the slave.
++     * @since 3.5.2
++     */
++    MetaData allMetaData() const { return mIncomingMetaData; }
++
++    /**
+      * Returns a configuration object to query config/meta-data information
+      * from.
+      *
+@@ -374,15 +381,21 @@
+     virtual void get( const KURL& url );
+ 
+     /**
+-     * put, aka write.
+-     * @param url where to write the file (decoded)
++     * put, i.e. write data into a file.
++     *
++     * @param url where to write the file
+      * @param permissions may be -1. In this case no special permission mode is set.
+      * @param overwrite if true, any existing file will be overwritten.
+      * If the file indeed already exists, the slave should NOT apply the
+      * permissions change to it.
+-     * @param resume
++     * @param resume currently unused, please ignore.
++     *   The support for resuming using .part files is done by calling canResume().
++     *
++     * IMPORTANT: Use the "modified" metadata in order to set the modification time of the file.
++     *
++     * @see canResume()
+      */
+-    virtual void put( const KURL& url, int permissions, bool overwrite, bool resume );
++    virtual void put( const KURL& url, int permissions, bool overwrite, bool /*resume*/ );
+ 
+     /**
+      * Finds all details for one file or directory.
+--- kio/kio/kfilemetainfo.h	(revision 506549)
++++ kio/kio/kfilemetainfo.h	(revision 515119)
+@@ -219,6 +219,8 @@
+             return m_variableItemInfo;
+         }
+ 
++        /** @internal */
++        ~GroupInfo();
+     private:
+         /** @internal */
+         GroupInfo( const QString& name, const QString& translatedName);
+--- kio/kio/jobclasses.h	(revision 506549)
++++ kio/kio/jobclasses.h	(revision 515119)
+@@ -1263,6 +1263,15 @@
+         void setSourceSize64(KIO::filesize_t size);
+ 
+         /**
++         * Sets the modification time of the file
++         *
++         * Note that this is ignored if a direct copy (SlaveBase::copy) can be done,
++         * in which case the mtime of the source is applied to the destination (if the protocol
++         * supports the concept).
++         */
++        void setModificationTime( time_t mtime );
++
++        /**
+          * @deprecated
+          */
+         void setSourceSize( off_t size ) KDE_DEPRECATED;
+@@ -1654,6 +1663,8 @@
+         void deleteNextDir();
+         void skip( const KURL & sourceURL );
+         void slotResultRenaming( KIO::Job * job );
++        //void slotResultSettingDirAttributes( KIO::Job * job );
++        void setNextDirAttribute();
+     private:
+         void startRenameJob(const KURL &slave_url);
+         bool shouldOverwrite( const QString& path ) const;
+@@ -1682,7 +1693,7 @@
+         DestinationState destinationState;
+         enum { STATE_STATING, STATE_RENAMING, STATE_LISTING, STATE_CREATING_DIRS,
+                STATE_CONFLICT_CREATING_DIRS, STATE_COPYING_FILES, STATE_CONFLICT_COPYING_FILES,
+-               STATE_DELETING_DIRS } state;
++               STATE_DELETING_DIRS, STATE_SETTING_DIR_ATTRIBUTES } state;
+         KIO::filesize_t m_totalSize;
+         KIO::filesize_t m_processedSize;
+         KIO::filesize_t m_fileProcessedSize;
+--- kio/kio/job.cpp	(revision 506549)
++++ kio/kio/job.cpp	(revision 515119)
+@@ -70,6 +70,10 @@
+ #include <ktempfile.h>
+ #include <dcopclient.h>
+ 
++#ifdef Q_OS_UNIX
++#include <utime.h>
++#endif
++
+ using namespace KIO;
+ template class QPtrList<KIO::Job>;
+ 
+@@ -1511,6 +1515,7 @@
+ {
+ public:
+     KIO::filesize_t m_sourceSize;
++    time_t m_modificationTime;
+     SimpleJob *m_delJob;
+ };
+ 
+@@ -1540,6 +1545,7 @@
+     d = new FileCopyJobPrivate;
+     d->m_delJob = 0;
+     d->m_sourceSize = (KIO::filesize_t) -1;
++    d->m_modificationTime = static_cast<time_t>( -1 );
+     QTimer::singleShot(0, this, SLOT(slotStart()));
+ }
+ 
+@@ -1617,6 +1623,11 @@
+        m_totalSize = size;
+ }
+ 
++void FileCopyJob::setModificationTime( time_t mtime )
++{
++    d->m_modificationTime = mtime;
++}
++
+ void FileCopyJob::startCopyJob()
+ {
+     startCopyJob(m_src);
+@@ -1690,6 +1701,10 @@
+     m_resumeAnswerSent = false;
+     m_getJob = 0L; // for now
+     m_putJob = put( m_dest, m_permissions, m_overwrite, m_resume, false /* no GUI */);
++    if ( d->m_modificationTime != static_cast<time_t>( -1 ) ) {
++        QDateTime dt; dt.setTime_t( d->m_modificationTime );
++        m_putJob->addMetaData( "modified", dt.toString( Qt::ISODate ) );
++    }
+     //kdDebug(7007) << "FileCopyJob: m_putJob = " << m_putJob << " m_dest=" << m_dest << endl;
+ 
+     // The first thing the put job will tell us is whether we can
+@@ -2157,6 +2172,9 @@
+     bool m_defaultPermissions;
+     // Whether URLs changed (and need to be emitted by the next slotReport call)
+     bool m_bURLDirty;
++    // Used after copying all the files into the dirs, to set mtime (TODO: and permissions?)
++    // after the copy is done
++    QValueList<CopyInfo> m_directoriesCopied;
+ };
+ 
+ CopyJob::CopyJob( const KURL::List& src, const KURL& dest, CopyMode mode, bool asMethod, bool showProgressInfo )
+@@ -2192,6 +2210,7 @@
+        STATE_COPYING_FILES (copyNextFile, iterating over 'files')
+             if conflict: STATE_CONFLICT_COPYING_FILES
+        STATE_DELETING_DIRS (deleteNextDir) (if moving)
++       STATE_SETTING_DIR_ATTRIBUTES (setNextDirAttribute, iterating over d->m_directoriesCopied)
+        done.
+     */
+ }
+@@ -2219,6 +2238,9 @@
+     addSubjob(job);
+ }
+ 
++// For unit test purposes
++KIO_EXPORT bool kio_resolve_local_urls = true;
++
+ void CopyJob::slotResultStating( Job *job )
+ {
+     //kdDebug(7007) << "CopyJob::slotResultStating" << endl;
+@@ -2285,7 +2307,7 @@
+         if ( m_dest == d->m_globalDest )
+             d->m_globalDestinationState = destinationState;
+ 
+-        if ( !sLocalPath.isEmpty() ) {
++        if ( !sLocalPath.isEmpty() && kio_resolve_local_urls ) {
+             m_dest = KURL();
+             m_dest.setPath(sLocalPath);
+         }
+@@ -2493,7 +2515,7 @@
+                 }
+             }
+             //kdDebug(7007) << "displayName=" << displayName << " url=" << url << endl;
+-            if (!localPath.isEmpty()) {
++            if (!localPath.isEmpty() && kio_resolve_local_urls) {
+                 url = KURL();
+                 url.setPath(localPath);
+             }
+@@ -2809,15 +2831,16 @@
+     }
+     else // no error : remove from list, to move on to next dir
+     {
+-       //this is required for the undo feature
++        //this is required for the undo feature
+         emit copyingDone( this, (*it).uSource, (*it).uDest, true, false );
++        d->m_directoriesCopied.append( *it );
+         dirs.remove( it );
+     }
+ 
+     m_processedDirs++;
+     //emit processedDirs( this, m_processedDirs );
+     subjobs.remove( job );
+-    assert ( subjobs.isEmpty() ); // We should have only one job at a time ...
++    assert( subjobs.isEmpty() ); // We should have only one job at a time ...
+     createNextDir();
+ }
+ 
+@@ -3408,6 +3431,7 @@
+             KIO::FileCopyJob * copyJob = KIO::file_copy( (*it).uSource, (*it).uDest, permissions, bOverwrite, false, false/*no GUI*/ );
+             copyJob->setParentJob( this ); // in case of rename dialog
+             copyJob->setSourceSize64( (*it).size );
++            copyJob->setModificationTime( (*it).mtime );
+             newjob = copyJob;
+             //kdDebug(7007) << "CopyJob::copyNextFile : Copying " << (*it).uSource << " to " << (*it).uDest << endl;
+             m_currentSrcURL=(*it).uSource;
+@@ -3443,6 +3467,40 @@
+     }
+     else
+     {
++        // This step is done, move on
++        setNextDirAttribute();
++    }
++}
++
++void CopyJob::setNextDirAttribute()
++{
++    if ( !d->m_directoriesCopied.isEmpty() )
++    {
++        state = STATE_SETTING_DIR_ATTRIBUTES;
++#ifdef Q_OS_UNIX
++        // TODO KDE4: this should use a SlaveBase method, but we have none yet in KDE3.
++        QValueList<CopyInfo>::Iterator it = d->m_directoriesCopied.begin();
++        for ( ; it != d->m_directoriesCopied.end() ; ++it ) {
++            const KURL& url = (*it).uDest;
++            if ( url.isLocalFile() && (*it).mtime != (time_t)-1 ) {
++                const QCString path = QFile::encodeName( url.path() );
++                KDE_struct_stat statbuf;
++                if (KDE_lstat(path, &statbuf) == 0) {
++                    struct utimbuf utbuf;
++                    utbuf.actime = statbuf.st_atime; // access time, unchanged
++                    utbuf.modtime = (*it).mtime; // modification time
++                    utime( path, &utbuf );
++                }
++
++            }
++        }
++#endif
++        d->m_directoriesCopied.clear();
++    }
++
++    // No "else" here, since the above is a simple sync loop
++
++    {
+         // Finished - tell the world
+         if ( !m_bOnlyRenames )
+         {
+@@ -3469,14 +3527,14 @@
+ 
+ void CopyJob::slotProcessedSize( KIO::Job*, KIO::filesize_t data_size )
+ {
+-  //kdDebug(7007) << "CopyJob::slotProcessedSize " << (unsigned long)data_size << endl;
++  //kdDebug(7007) << "CopyJob::slotProcessedSize " << data_size << endl;
+   m_fileProcessedSize = data_size;
+   setProcessedSize(m_processedSize + m_fileProcessedSize);
+ 
+   if ( m_processedSize + m_fileProcessedSize > m_totalSize )
+   {
+     m_totalSize = m_processedSize + m_fileProcessedSize;
+-    //kdDebug(7007) << "Adjusting m_totalSize to " << (unsigned long) m_totalSize << endl;
++    //kdDebug(7007) << "Adjusting m_totalSize to " << m_totalSize << endl;
+     emit totalSize( this, m_totalSize ); // safety
+   }
+   //kdDebug(7007) << "emit processedSize " << (unsigned long) (m_processedSize + m_fileProcessedSize) << endl;
+@@ -3486,13 +3544,14 @@
+ 
+ void CopyJob::slotTotalSize( KIO::Job*, KIO::filesize_t size )
+ {
++  //kdDebug(7007) << "slotTotalSize: " << size << endl;
+   // Special case for copying a single file
+   // This is because some protocols don't implement stat properly
+   // (e.g. HTTP), and don't give us a size in some cases (redirection)
+   // so we'd rather rely on the size given for the transfer
+   if ( m_bSingleFileCopy && size > m_totalSize)
+   {
+-    //kdDebug(7007) << "Single file -> updating totalsize to " << (long)size << endl;
++    //kdDebug(7007) << "slotTotalSize: updating totalsize to " << size << endl;
+     m_totalSize = size;
+     emit totalSize( this, size );
+   }
+@@ -3511,6 +3570,21 @@
+     deleteNextDir();
+ }
+ 
++#if 0 // TODO KDE4
++void CopyJob::slotResultSettingDirAttributes( Job * job )
++{
++    if (job->error())
++    {
++        // Couldn't set directory attributes. Ignore the error, it can happen
++        // with inferior file systems like VFAT.
++        // Let's not display warnings for each dir like "cp -a" does.
++    }
++    subjobs.remove( job );
++    assert ( subjobs.isEmpty() );
++    setNextDirAttribute();
++}
++#endif
++
+ void CopyJob::slotResultRenaming( Job* job )
+ {
+     int err = job->error();
+@@ -3740,6 +3814,10 @@
+         case STATE_DELETING_DIRS:
+             slotResultDeletingDirs( job );
+             break;
++        case STATE_SETTING_DIR_ATTRIBUTES: // TODO KDE4
++            assert( 0 );
++            //slotResultSettingDirAttributes( job );
++            break;
+         default:
+             assert( 0 );
+     }
+@@ -3774,11 +3852,13 @@
+ 
+ CopyJob *KIO::copy( const KURL::List& src, const KURL& dest, bool showProgressInfo )
+ {
++    //kdDebug(7007) << src << " " << dest << endl;
+     return new CopyJob( src, dest, CopyJob::Copy, false, showProgressInfo );
+ }
+ 
+ CopyJob *KIO::move(const KURL& src, const KURL& dest, bool showProgressInfo )
+ {
++    //kdDebug(7007) << src << " " << dest << endl;
+     KURL::List srcList;
+     srcList.append( src );
+     return new CopyJob( srcList, dest, CopyJob::Move, false, showProgressInfo );
+@@ -3786,6 +3866,7 @@
+ 
+ CopyJob *KIO::moveAs(const KURL& src, const KURL& dest, bool showProgressInfo )
+ {
++    //kdDebug(7007) << src << " " << dest << endl;
+     KURL::List srcList;
+     srcList.append( src );
+     return new CopyJob( srcList, dest, CopyJob::Move, true, showProgressInfo );
+@@ -3793,6 +3874,7 @@
+ 
+ CopyJob *KIO::move( const KURL::List& src, const KURL& dest, bool showProgressInfo )
+ {
++    //kdDebug(7007) << src << " " << dest << endl;
+     return new CopyJob( src, dest, CopyJob::Move, false, showProgressInfo );
+ }
+ 
+@@ -4018,6 +4100,7 @@
+             // Normal deletion
+             // If local file, try do it directly
+             if ( (*it).isLocalFile() && unlink( QFile::encodeName((*it).path()) ) == 0 ) {
++                //kdDebug(7007) << "DeleteJob deleted " << (*it).path() << endl;
+                 job = 0;
+                 m_processedFiles++;
+                 if ( m_processedFiles % 300 == 0 || m_totalFilesDirs < 300) { // update progress info every 300 files
+--- kio/kio/forwardingslavebase.cpp	(revision 506549)
++++ kio/kio/forwardingslavebase.cpp	(revision 515119)
+@@ -325,6 +325,15 @@
+     // display it itself
+     job->setInteractive(false);
+ 
++    // Forward metadata (e.g. modification time for put())
++    job->setMetaData( allMetaData() );
++#if 0 // debug code
++    kdDebug() << k_funcinfo << "transferring metadata:" << endl;
++    const MetaData md = allMetaData();
++    for ( MetaData::const_iterator it = md.begin(); it != md.end(); ++it )
++        kdDebug() << it.key() << " = " << it.data() << endl;
++#endif
++
+     connect( job, SIGNAL( result(KIO::Job *) ),
+              this, SLOT( slotResult(KIO::Job *) ) );
+     connect( job, SIGNAL( warning(KIO::Job *, const QString &) ),
+--- kio/kfile/kimagefilepreview.cpp	(revision 506549)
++++ kio/kfile/kimagefilepreview.cpp	(revision 515119)
+@@ -39,19 +39,16 @@
+     KConfigGroupSaver cs( config, ConfigGroup );
+     autoMode = config->readBoolEntry( "Automatic Preview", true );
+ 
+-    QGridLayout *vb = new QGridLayout( this, 2, 2, 0, KDialog::spacingHint() );
+-    vb->addItem( new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 0 );
++    QVBoxLayout *vb = new QVBoxLayout( this, 0, KDialog::spacingHint() );
+ 
+     imageLabel = new QLabel( this );
+     imageLabel->setFrameStyle( QFrame::NoFrame );
+     imageLabel->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
+-    imageLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
+-    vb->addWidget( imageLabel, 0, 1 );
++    imageLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding) );
++    vb->addWidget( imageLabel );
+ 
+-    vb->addItem( new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 2 );
+-
+     QHBoxLayout *hb = new QHBoxLayout( 0 );
+-    vb->addLayout( hb, 1, 1 );
++    vb->addLayout( hb );
+ 
+     autoPreview = new QCheckBox( i18n("&Automatic preview"), this );
+     autoPreview->setChecked( autoMode );
+@@ -109,6 +106,9 @@
+             int h = imageLabel->contentsRect().height() - 4;
+ 
+             m_job =  createJob( url, w, h );
++            if ( force ) // explicitly requested previews shall always be generated!
++                m_job->setIgnoreMaximumSize( true );
++            
+             connect( m_job, SIGNAL( result( KIO::Job * )),
+                      this, SLOT( slotResult( KIO::Job * )));
+             connect( m_job, SIGNAL( gotPreview( const KFileItem*,
+--- kio/misc/kpac/eventsrc	(revision 506549)
++++ kio/misc/kpac/eventsrc	(revision 515119)
+@@ -29,7 +29,7 @@
+ Comment[hr]=Automatsko podešavanje proxyja
+ Comment[hu]=Automatikus proxybeállítás
+ Comment[id]=Konfigurasi Proxi Otomatis
+-Comment[is]=Sjálfvirkar stillingar leppþjóns
++Comment[is]=Sjálfvirkar stillingar milliþjóns
+ Comment[it]=Configurazione automatica proxy
+ Comment[ja]=自動プロキシ設定
+ Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ប្រូកស៊ី​ដោយ​ស្វ័យ​ប្រវត្តិ
+@@ -97,7 +97,7 @@
+ Name[hr]=Neispravna proxy skripta
+ Name[hu]=Érvénytelen proxy-szkript
+ Name[id]=Skrip proxi tidak sah
+-Name[is]=Ógild leppþjónsskrifta
++Name[is]=Ógild milliþjónsskrifta
+ Name[it]=Script proxy non valido
+ Name[ja]=無効なプロキシスクリプト
+ Name[km]=ស្គ្រីប​ប្រូកស៊ី​មិន​ត្រឹមត្រូវ
+@@ -161,7 +161,7 @@
+ Comment[hi]=ङाउनलोडेड प्रॉक्सी कॉन्फ़िगरेटर स्क्रिप्ट अवैध है।
+ Comment[hr]=Preuzeta skripta za podešavanje proxyja je neispravna
+ Comment[hu]=A letöltött proxybeállító szkript érvénytelen
+-Comment[is]=Sótt leppþjónsskrifta er ógild
++Comment[is]=Sótt milliþjónsskrifta er ógild
+ Comment[it]=Lo script di configurazione proxy scaricato non è valido
+ Comment[ja]=ダウンロードされたプロキシ設定スクリプトは無効です。
+ Comment[km]=ស្គ្រីប​កំណត់​រចនាសម្ព័ន្ធ​​ប្រូកស៊ី​ដែល​បាន​ទាញយក មិន​ត្រឹមត្រូវ​ឡើយ
+@@ -296,7 +296,7 @@
+ Comment[hi]=प्रॉक्सी कॉन्फ़िगरेशन स्क्रिप्ट डाउनलोड नही की जा सकी।
+ Comment[hr]=Skripta za podešavanje proxy-ja nije mogla biti preuzeta s interneta. 
+ Comment[hu]=A proxybeállító szkript letöltése nem sikerült
+-Comment[is]=Gat ekki sótt stillingaskriftu leppþjóns
++Comment[is]=Gat ekki sótt stillingaskriftu milliþjóns
+ Comment[it]=Impossibile scaricare lo script di configurazione proxy
+ Comment[ja]=プロキシ設定スクリプトをダウンロードすることができないかもしれません。
+ Comment[km]=មិន​អាច​ទាញយក​ស្គ្រីប​កំណត់​រចនាសម្ព័ន្ធ​ប្រូកស៊ី
+@@ -426,7 +426,7 @@
+ Comment[hi]=प्रॉक्सी कॉन्फ़िगरेशन स्क्रिप्ट चलाने में त्रुटि हुई
+ Comment[hr]=Dogodila se greška prilikom izvršavanja skripte za podešavanje proxyja
+ Comment[hu]=Hiba történt a proxybeállító szkript végrehajtása közben
+-Comment[is]=Það kom upp villa við keyrslu stillingaskriftu leppþjóns
++Comment[is]=Það kom upp villa við keyrslu stillingaskriftu milliþjóns
+ Comment[it]=Si è verificato un errore durante l'esecuzione dello script di configurazione proxy
+ Comment[ja]=プロキシ設定スクリプトを実行中エラーがありました
+ Comment[km]=មាន​កំហុស​មួយ​ក្នុងការ​​ប្រតិបត្តិ​ស្គ្រីបកំណត់​រចនាសម្ព័ន្ធ​ប្រូកស៊ី
+--- kio/misc/kpac/proxyscout.desktop	(revision 506549)
++++ kio/misc/kpac/proxyscout.desktop	(revision 515119)
+@@ -18,6 +18,7 @@
+ Name[gl]=Proxy Explorador
+ Name[hi]= प्रॉक्सी स्काउट
+ Name[hr]=Proxy izvidnik
++Name[is]=Milliþjóns leitari
+ Name[it]=Esploratore proxy
+ Name[ja]=プロキシを探す
+ Name[ko]=프록시 찾기
+@@ -68,7 +69,7 @@
+ Comment[he]=הגדרות מתווך אוטומטיות
+ Comment[hi]=स्वचालित प्रॉक्सी कॉन्फ़िगरेशन
+ Comment[hu]=Automatikus proxybeállítás
+-Comment[is]=Sjálfvirkar stillingar leppþjóns
++Comment[is]=Sjálfvirkar stillingar milliþjóns
+ Comment[it]=Configurazione automatica proxy
+ Comment[ja]=自動プロキシ設定
+ Comment[km]=ការ​កំណត់​រចនាសម្ព័ន្ធ​ប្រូកស៊ី​ដោយ​ស្វ័យប្រវត្តិ
+--- kio/misc/kio_uiserver.desktop	(revision 506549)
++++ kio/misc/kio_uiserver.desktop	(revision 515119)
+@@ -30,7 +30,7 @@
+ Comment[eo]=Progresinforma servo
+ Comment[es]=Servidor UI de información de progreso de KDE
+ Comment[et]=KDE edenemise info UI server
+-Comment[eu]=KDEren progresio-informazioen UI zerbitzaria
++Comment[eu]=KDEren aurrerapen-informazioen UI zerbitzaria
+ Comment[fa]=کارگزار واسطه‌ی کاریر اطلاعات پیشرفت KDE
+ Comment[fi]=KDE:n edistymispalkin käyttöliittymäpalvelin
+ Comment[fr]=Serveur graphique d'infos de progression de KDE
+--- kio/tests/jobtest.h	(revision 506549)
++++ kio/tests/jobtest.h	(revision 515119)
+@@ -34,10 +34,11 @@
+     void runAll();
+     void cleanup();
+ 
++    // Local tests (kio_file only)
+     void get();
+-    void twoGets();
+     void copyFileToSamePartition();
+     void copyDirectoryToSamePartition();
++    void copyDirectoryToExistingDirectory();
+     void copyFileToOtherPartition();
+     void copyDirectoryToOtherPartition();
+     void listRecursive();
+@@ -49,6 +50,9 @@
+     void moveFileNoPermissions();
+     void moveDirectoryNoPermissions();
+ 
++    // Remote tests
++    void copyFileToSystem();
++
+ private slots:
+     void slotEntries( KIO::Job*, const KIO::UDSEntryList& lst );
+     void slotGetResult( KIO::Job* );
+@@ -56,10 +60,14 @@
+ private:
+     QString homeTmpDir() const;
+     QString otherTmpDir() const;
++    QString realSystemPath() const;
++    KURL systemTmpDir() const;
++    enum { AlreadyExists = 1 };
+     void copyLocalFile( const QString& src, const QString& dest );
+-    void copyLocalDirectory( const QString& src, const QString& dest );
++    void copyLocalDirectory( const QString& src, const QString& dest, int flags = 0 );
+     void moveLocalFile( const QString& src, const QString& dest );
+     void moveLocalDirectory( const QString& src, const QString& dest );
++    void copyFileToSystem( bool resolve_local_urls );
+ 
+     int m_result;
+     QByteArray m_data;
+--- kio/tests/jobtest.cpp	(revision 506549)
++++ kio/tests/jobtest.cpp	(revision 515119)
+@@ -1,5 +1,5 @@
+ /* This file is part of the KDE project
+-   Copyright (C) 2004 David Faure <faure at kde.org>
++   Copyright (C) 2004-2006 David Faure <faure 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
+@@ -27,6 +27,7 @@
+ #include <kio/netaccess.h>
+ #include <kdebug.h>
+ #include <kcmdlineargs.h>
++#include <kprotocolinfo.h>
+ 
+ #include <qfileinfo.h>
+ #include <qeventloop.h>
+@@ -38,6 +39,10 @@
+ #include <assert.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <sys/time.h>
++#include <sys/types.h>
++#include <time.h>
++#include <utime.h>
+ 
+ // The code comes partly from kdebase/kioslave/trash/testtrash.cpp
+ 
+@@ -82,6 +87,16 @@
+     return "/tmp/jobtest/";
+ }
+ 
++KURL JobTest::systemTmpDir() const
++{
++    return "system:/home/.kde/jobtest-system/";
++}
++
++QString JobTest::realSystemPath() const
++{
++    return QDir::homeDirPath() + "/.kde/jobtest-system/";
++}
++
+ void JobTest::setup()
+ {
+     // Start with a clean base dir
+@@ -93,6 +108,9 @@
+     ok = dir.mkdir( otherTmpDir() );
+     if ( !ok )
+         kdFatal() << "Couldn't create " << otherTmpDir() << endl;
++    ok = dir.mkdir( realSystemPath() );
++    if ( !ok )
++        kdFatal() << "Couldn't create " << realSystemPath() << endl;
+ }
+ 
+ void JobTest::runAll()
+@@ -100,6 +118,7 @@
+     get();
+     copyFileToSamePartition();
+     copyDirectoryToSamePartition();
++    copyDirectoryToExistingDirectory();
+     copyFileToOtherPartition();
+     copyDirectoryToOtherPartition();
+     listRecursive();
+@@ -110,14 +129,32 @@
+     moveDirectoryToOtherPartition();
+     moveFileNoPermissions();
+     moveDirectoryNoPermissions();
++
++    copyFileToSystem();
+ }
+ 
+ void JobTest::cleanup()
+ {
+     KIO::NetAccess::del( homeTmpDir(), 0 );
+     KIO::NetAccess::del( otherTmpDir(), 0 );
++    KIO::NetAccess::del( systemTmpDir(), 0 );
+ }
+ 
++static void setTimeStamp( const QString& path )
++{
++#ifdef Q_OS_UNIX
++    // Put timestamp in the past so that we can check that the
++    // copy actually preserves it.
++    struct timeval tp;
++    gettimeofday( &tp, 0 );
++    struct utimbuf utbuf;
++    utbuf.actime = tp.tv_sec - 30; // 30 seconds ago
++    utbuf.modtime = tp.tv_sec - 60; // 60 second ago
++    utime( QFile::encodeName( path ), &utbuf );
++    qDebug( "Time changed for %s", path.latin1() );
++#endif
++}
++
+ static void createTestFile( const QString& path )
+ {
+     QFile f( path );
+@@ -125,6 +162,7 @@
+         kdFatal() << "Can't create " << path << endl;
+     f.writeBlock( "Hello world", 11 );
+     f.close();
++    setTimeStamp( path );
+ }
+ 
+ static void createTestSymlink( const QString& path )
+@@ -146,6 +184,7 @@
+         kdFatal() << "couldn't create " << path << endl;
+     createTestFile( path + "/testfile" );
+     createTestSymlink( path + "/testlink" );
++    setTimeStamp( path );
+ }
+ 
+ void JobTest::get()
+@@ -186,29 +225,61 @@
+     assert( QFile::exists( dest ) );
+     assert( QFile::exists( src ) ); // still there
+ 
++    {
++        // check that the timestamp is the same (#24443)
++        // Note: this only works because of copy() in kio_file.
++        // The datapump solution ignores mtime, the app has to call FileCopyJob::setModificationTime()
++        QFileInfo srcInfo( src );
++        QFileInfo destInfo( dest );
++        assert( srcInfo.lastModified() == destInfo.lastModified() );
++    }
++
+     // cleanup and retry with KIO::copy()
+     QFile::remove( dest );
+     ok = KIO::NetAccess::dircopy( u, d, 0 );
+     assert( ok );
+     assert( QFile::exists( dest ) );
+     assert( QFile::exists( src ) ); // still there
++    {
++        // check that the timestamp is the same (#24443)
++        QFileInfo srcInfo( src );
++        QFileInfo destInfo( dest );
++        assert( srcInfo.lastModified() == destInfo.lastModified() );
++    }
+ }
+ 
+-void JobTest::copyLocalDirectory( const QString& src, const QString& dest )
++void JobTest::copyLocalDirectory( const QString& src, const QString& _dest, int flags )
+ {
+     assert( QFileInfo( src ).isDir() );
+     assert( QFileInfo( src + "/testfile" ).isFile() );
+     KURL u;
+     u.setPath( src );
++    QString dest( _dest );
+     KURL d;
+     d.setPath( dest );
++    if ( flags & AlreadyExists )
++        assert( QFile::exists( dest ) );
++    else
++        assert( !QFile::exists( dest ) );
+ 
+     bool ok = KIO::NetAccess::dircopy( u, d, 0 );
+     assert( ok );
++
++    if ( flags & AlreadyExists ) {
++        dest += "/" + u.fileName();
++        //kdDebug() << "Expecting dest=" << dest << endl;
++    }
++
+     assert( QFile::exists( dest ) );
+     assert( QFileInfo( dest ).isDir() );
+     assert( QFileInfo( dest + "/testfile" ).isFile() );
+     assert( QFile::exists( src ) ); // still there
++    {
++        // check that the timestamp is the same (#24443)
++        QFileInfo srcInfo( src );
++        QFileInfo destInfo( dest );
++        assert( srcInfo.lastModified() == destInfo.lastModified() );
++    }
+ }
+ 
+ void JobTest::copyFileToSamePartition()
+@@ -229,6 +300,17 @@
+     copyLocalDirectory( src, dest );
+ }
+ 
++void JobTest::copyDirectoryToExistingDirectory()
++{
++    kdDebug() << k_funcinfo << endl;
++    // just the same as copyDirectoryToSamePartition, but it means that
++    // this time dest exists.
++    const QString src = homeTmpDir() + "dirFromHome";
++    const QString dest = homeTmpDir() + "dirFromHome_copied";
++    createTestDirectory( src );
++    copyLocalDirectory( src, dest, AlreadyExists );
++}
++
+ void JobTest::copyFileToOtherPartition()
+ {
+     kdDebug() << k_funcinfo << endl;
+@@ -242,8 +324,11 @@
+ {
+     kdDebug() << k_funcinfo << endl;
+     const QString src = homeTmpDir() + "dirFromHome";
+-    const QString dest = homeTmpDir() + "dirFromHome_copied";
++    const QString dest = otherTmpDir() + "dirFromHome_copied";
+     // src is already created by copyDirectoryToSamePartition()
++    // so this is just in case someone calls this method only
++    if ( !QFile::exists( src ) )
++        createTestDirectory( src );
+     copyLocalDirectory( src, dest );
+ }
+ 
+@@ -388,8 +473,8 @@
+ void JobTest::moveDirectoryNoPermissions()
+ {
+     kdDebug() << k_funcinfo << endl;
+-    const QString src = "/etc";
+-    const QString dest = homeTmpDir() + "etc";
++    const QString src = "/etc/rc.d";
++    const QString dest = homeTmpDir() + "rc.d";
+     assert( QFile::exists( src ) );
+     assert( QFileInfo( src ).isDir() );
+     KURL u;
+@@ -445,4 +530,69 @@
+     }
+ }
+ 
++void JobTest::copyFileToSystem()
++{
++    if ( !KProtocolInfo::isKnownProtocol( QString::fromLatin1( "system" ) ) ) {
++        kdDebug() << k_funcinfo << "no kio_system, skipping test" << endl;
++        return;
++    }
++
++    // First test with support for UDS_LOCAL_PATH
++    copyFileToSystem( true );
++
++    QString dest = realSystemPath() + "fileFromHome_copied";
++    QFile::remove( dest );
++
++    // Then disable support for UDS_LOCAL_PATH, i.e. test what would
++    // happen for ftp, smb, http etc.
++    copyFileToSystem( false );
++}
++
++void JobTest::copyFileToSystem( bool resolve_local_urls )
++{
++    kdDebug() << k_funcinfo << resolve_local_urls << endl;
++    extern KIO_EXPORT bool kio_resolve_local_urls;
++    kio_resolve_local_urls = resolve_local_urls;
++
++    const QString src = homeTmpDir() + "fileFromHome";
++    createTestFile( src );
++    KURL u;
++    u.setPath( src );
++    KURL d = systemTmpDir();
++    d.addPath( "fileFromHome_copied" );
++
++    kdDebug() << "copying " << u << " to " << d << endl;
++
++    // copy the file with file_copy
++    bool ok = KIO::NetAccess::file_copy( u, d );
++    assert( ok );
++
++    QString dest = realSystemPath() + "fileFromHome_copied";
++
++    assert( QFile::exists( dest ) );
++    assert( QFile::exists( src ) ); // still there
++
++    {
++        // do NOT check that the timestamp is the same.
++        // It can't work with file_copy when it uses the datapump,
++        // unless we use setModificationTime in the app code.
++    }
++
++    // cleanup and retry with KIO::copy()
++    QFile::remove( dest );
++    ok = KIO::NetAccess::dircopy( u, d, 0 );
++    assert( ok );
++    assert( QFile::exists( dest ) );
++    assert( QFile::exists( src ) ); // still there
++    {
++        // check that the timestamp is the same (#79937)
++        QFileInfo srcInfo( src );
++        QFileInfo destInfo( dest );
++        assert( srcInfo.lastModified() == destInfo.lastModified() );
++    }
++
++    // restore normal behavior
++    kio_resolve_local_urls = true;
++}
++
+ #include "jobtest.moc"
+--- kstyles/plastik/config/plastikconf.cpp	(revision 506549)
++++ kstyles/plastik/config/plastikconf.cpp	(revision 515119)
+@@ -95,7 +95,7 @@
+ // 	scrollBarLines->setChecked(origScrollBarLines);
+ 	origAnimProgressBar = s.readBoolEntry("/plastikstyle/Settings/animateProgressBar", false);
+ 	animateProgressBar->setChecked(origAnimProgressBar);
+-	origDrawToolBarSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarSeparator", true);
++	origDrawToolBarSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarSeparator", false);
+ 	drawToolBarSeparator->setChecked(origDrawToolBarSeparator);
+ 	origDrawToolBarItemSeparator = s.readBoolEntry("/plastikstyle/Settings/drawToolBarItemSeparator", true);
+ 	drawToolBarItemSeparator->setChecked(origDrawToolBarItemSeparator);
+@@ -172,7 +172,7 @@
+ {
+ // 	scrollBarLines->setChecked(false);
+ 	animateProgressBar->setChecked(false);
+-	drawToolBarSeparator->setChecked(true);
++	drawToolBarSeparator->setChecked(false);
+ 	drawToolBarItemSeparator->setChecked(true);
+ // 	drawFocusRect->setChecked(true);
+ 	drawTriangularExpander->setChecked(false);
+--- kstyles/plastik/plastik.cpp	(revision 506549)
++++ kstyles/plastik/plastik.cpp	(revision 515119)
+@@ -170,7 +170,7 @@
+     settings.beginGroup("/plastikstyle/Settings");
+     _scrollBarLines = settings.readBoolEntry("/scrollBarLines", false);
+     _animateProgressBar = settings.readBoolEntry("/animateProgressBar", false);
+-    _drawToolBarSeparator = settings.readBoolEntry("/drawToolBarSeparator", true);
++    _drawToolBarSeparator = settings.readBoolEntry("/drawToolBarSeparator", false);
+     _drawToolBarItemSeparator = settings.readBoolEntry("/drawToolBarItemSeparator", true);
+     _drawFocusRect = settings.readBoolEntry("/drawFocusRect", true);
+     _drawTriangularExpander = settings.readBoolEntry("/drawTriangularExpander", false);
+--- kabc/plugins/file/resourcefile.cpp	(revision 506549)
++++ kabc/plugins/file/resourcefile.cpp	(revision 515119)
+@@ -58,7 +58,7 @@
+ };
+ 
+ ResourceFile::ResourceFile( const KConfig *config )
+-  : Resource( config ), mFormat( 0 ), mLocalTempFile( 0 ),
++  : Resource( config ), mFormat( 0 ), mTempFile( 0 ),
+     mAsynchronous( false ), d( new ResourceFilePrivate )
+ {
+   QString fileName, formatName;
+@@ -76,7 +76,7 @@
+ 
+ ResourceFile::ResourceFile( const QString &fileName,
+                             const QString &formatName )
+-  : Resource( 0 ), mFormat( 0 ), mLocalTempFile( 0 ),
++  : Resource( 0 ), mFormat( 0 ), mTempFile( 0 ),
+     mAsynchronous( false ), d( new ResourceFilePrivate )
+ {
+   init( fileName, formatName );
+@@ -119,8 +119,8 @@
+   d = 0;
+   delete mFormat;
+   mFormat = 0;
+-  delete mLocalTempFile;
+-  mLocalTempFile = 0;
++
++  deleteLocalTempFile();
+ }
+ 
+ void ResourceFile::writeConfig( KConfig *config )
+@@ -207,6 +207,10 @@
+ {
+   kdDebug(5700) << "ResourceFile::load(): '" << mFileName << "'" << endl;
+ 
++  if ( d->mIsLoading ) {
++    abortAsyncLoading();
++  }
++
+   mAsynchronous = false;
+ 
+   QFile file( mFileName );
+@@ -215,24 +219,45 @@
+     return false;
+   }
+ 
+-  return mFormat->loadAll( addressBook(), this, &file );
++  if ( !clearAndLoad( &file ) ) {
++      addressBook()->error( i18n( "Problems during parsing file '%1'." ).arg( mFileName ) );
++    return false;
++  }
++
++  return true;
+ }
+ 
++bool ResourceFile::clearAndLoad( QFile *file )
++{
++  clear();
++  return mFormat->loadAll( addressBook(), this, file );
++}
++
+ bool ResourceFile::asyncLoad()
+ {
++  if ( d->mIsLoading ) {
++    abortAsyncLoading();
++  }
++
++  if (d->mIsSaving) {
++    kdWarning(5700) << "Aborted asyncSave() because we're still asyncSave()ing!" << endl;
++    return false;
++  }
++
+   mAsynchronous = true;
+ 
+-  if ( mLocalTempFile ) {
+-    kdDebug(5700) << "stale temp file detected " << mLocalTempFile->name() << endl;
+-    delete mLocalTempFile;
++  bool ok = createLocalTempFile();
++  if ( ok )
++    ok = mTempFile->close(); // we only need the filename
++
++  if ( !ok ) {
++    emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) );
++    deleteLocalTempFile();
++    return false;
+   }
+ 
+-  mLocalTempFile = new KTempFile();
+-  mLocalTempFile->setAutoDelete( true );
+-  mTempFile = mLocalTempFile->name();
+-
+   KURL dest, src;
+-  dest.setPath( mTempFile );
++  dest.setPath( mTempFile->name() );
+   src.setPath( mFileName );
+ 
+   KIO::Scheduler::checkSlaveOnHold( true );
+@@ -244,26 +269,60 @@
+   return true;
+ }
+ 
++void ResourceFile::abortAsyncLoading()
++{
++  kdDebug(5700) << "ResourceFile::abortAsyncLoading()" << endl;
++
++  if ( d->mLoadJob ) {
++    d->mLoadJob->kill(); // result not emitted
++    d->mLoadJob = 0;
++  }
++
++  deleteLocalTempFile();
++  d->mIsLoading = false;
++}
++
++void ResourceFile::abortAsyncSaving()
++{
++  kdDebug(5700) << "ResourceFile::abortAsyncSaving()" << endl;
++
++  if ( d->mSaveJob ) {
++    d->mSaveJob->kill(); // result not emitted
++    d->mSaveJob = 0;
++  }
++
++  deleteLocalTempFile();
++  d->mIsSaving = false;
++}
++
+ bool ResourceFile::save( Ticket * )
+ {
+   kdDebug(5700) << "ResourceFile::save()" << endl;
+ 
++  if (d->mIsSaving) {
++    abortAsyncSaving();
++  }
++
+   // create backup file
+   QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() );
+   (void) KSaveFile::backupFile( mFileName, QString::null /*directory*/,
+                                 extension );
+ 
+   mDirWatch.stopScan();
++
+   KSaveFile saveFile( mFileName );
+   bool ok = false;
+-  if ( saveFile.status() == 0 && saveFile.file() )
+-  {
+-    mFormat->saveAll( addressBook(), this, saveFile.file() );
++
++  if ( saveFile.status() == 0 && saveFile.file() ) {
++    saveToFile( saveFile.file() );
+     ok = saveFile.close();
+   }
+ 
+-  if ( !ok )
++  if ( !ok ) {
++    saveFile.abort();
+     addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) );
++  }
++
+   mDirWatch.startScan();
+ 
+   return ok;
+@@ -271,30 +330,70 @@
+ 
+ bool ResourceFile::asyncSave( Ticket * )
+ {
+-  QFile file( mTempFile );
++  kdDebug(5700) << "ResourceFile::asyncSave()" << endl;
+ 
+-  if ( !file.open( IO_WriteOnly ) ) {
+-    emit savingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile ) );
++  if (d->mIsSaving) {
++    abortAsyncSaving();
++  }
++
++  if (d->mIsLoading) {
++    kdWarning(5700) << "Aborted asyncSave() because we're still asyncLoad()ing!" << endl;
+     return false;
+   }
+ 
+-  mDirWatch.stopScan();
+-  mFormat->saveAll( addressBook(), this, &file );
+-  file.close();
++  bool ok = createLocalTempFile();
++  if ( ok ) {
++    saveToFile( mTempFile->file() );
++    ok = mTempFile->close();
++  }
+ 
++  if ( !ok ) {
++    emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mTempFile->name() ) );
++    deleteLocalTempFile();
++    return false;
++  }
++
+   KURL src, dest;
+-  src.setPath( mTempFile );
++  src.setPath( mTempFile->name() );
+   dest.setPath( mFileName );
+ 
+   KIO::Scheduler::checkSlaveOnHold( true );
++  d->mIsSaving = true;
++  mDirWatch.stopScan(); // restarted in uploadFinished()
+   d->mSaveJob = KIO::file_copy( src, dest, -1, true, false, false );
+-  d->mIsSaving = true;
+   connect( d->mSaveJob, SIGNAL( result( KIO::Job* ) ),
+            this, SLOT( uploadFinished( KIO::Job* ) ) );
+ 
+   return true;
+ }
+ 
++bool ResourceFile::createLocalTempFile()
++{
++  deleteStaleTempFile();
++  mTempFile = new KTempFile();
++  mTempFile->setAutoDelete( true );
++  return mTempFile->status() == 0;
++}
++
++void ResourceFile::deleteStaleTempFile()
++{
++  if ( hasTempFile() ) {
++    kdDebug(5700) << "stale temp file detected " << mTempFile->name() << endl;
++    deleteLocalTempFile();
++  }
++}
++
++void ResourceFile::deleteLocalTempFile()
++{
++  delete mTempFile;
++  mTempFile = 0;
++}
++
++void ResourceFile::saveToFile( QFile *file )
++{
++  mFormat->saveAll( addressBook(), this, file );
++}
++
+ void ResourceFile::setFileName( const QString &fileName )
+ {
+   mDirWatch.stopScan();
+@@ -328,10 +427,12 @@
+ 
+ void ResourceFile::fileChanged()
+ {
++    kdDebug(5700) << "ResourceFile::fileChanged(): " << mFileName << endl;
++
+   if ( !addressBook() )
+     return;
+ 
+-  clear();
++//  clear(); // moved to clearAndLoad()
+   if ( mAsynchronous )
+     asyncLoad();
+   else {
+@@ -352,31 +453,41 @@
+ 
+ void ResourceFile::downloadFinished( KIO::Job* )
+ {
++  kdDebug(5700) << "ResourceFile::downloadFinished()" << endl;
++
+   d->mIsLoading = false;
+ 
+-  if ( !mLocalTempFile )
++  if ( !hasTempFile() || mTempFile->status() != 0 ) {
+     emit loadingError( this, i18n( "Download failed in some way!" ) );
+-
+-  QFile file( mTempFile );
+-  if ( !file.open( IO_ReadOnly ) ) {
+-    emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile ) );
+     return;
+   }
+ 
+-  if ( !mFormat->loadAll( addressBook(), this, &file ) )
+-    emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile ) );
+-  else
+-    emit loadingFinished( this );
++  QFile file( mTempFile->name() );
++  if ( file.open( IO_ReadOnly ) ) {
++    if ( clearAndLoad( &file ) )
++      emit loadingFinished( this );
++    else
++      emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile->name() ) );
++  }
++  else {
++    emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) );
++  }
++
++  deleteLocalTempFile();
+ }
+ 
+ void ResourceFile::uploadFinished( KIO::Job *job )
+ {
++  kdDebug(5700) << "ResourceFile::uploadFinished()" << endl;
++
+   d->mIsSaving = false;
+ 
+   if ( job->error() )
+     emit savingError( this, job->errorString() );
+   else
+     emit savingFinished( this );
++
++  deleteLocalTempFile();
+   mDirWatch.startScan();
+ }
+ 
+--- kabc/plugins/file/resourcefile.h	(revision 506549)
++++ kabc/plugins/file/resourcefile.h	(revision 515119)
+@@ -28,8 +28,8 @@
+ 
+ #include <kabc/resource.h>
+ 
++class QFile;
+ class QTimer;
+-
+ class KTempFile;
+ 
+ namespace KIO {
+@@ -82,7 +82,7 @@
+       Closes the file again.
+      */
+     virtual void doClose();
+-  
++
+     /**
+       Requests a save ticket, that is used by save()
+      */
+@@ -148,17 +148,25 @@
+     void unlock( const QString &fileName );
+ 
+   private:
++    bool clearAndLoad( QFile *file );
++    void saveToFile( QFile *file );
++    void abortAsyncLoading();
++    void abortAsyncSaving();
++    bool createLocalTempFile();
++    void deleteLocalTempFile();
++    void deleteStaleTempFile();
++    bool hasTempFile() const { return mTempFile != 0; }
++
+     QString mFileName;
+     QString mFormatName;
+ 
+     FormatPlugin *mFormat;
+ 
+     Lock *mLock;
+-    
++
+     KDirWatch mDirWatch;
+ 
+-    QString mTempFile;
+-    KTempFile *mLocalTempFile;
++    KTempFile *mTempFile;
+ 
+     bool mAsynchronous;
+ 
+--- kabc/plugins/net/resourcenet.cpp	(revision 506549)
++++ kabc/plugins/net/resourcenet.cpp	(revision 515119)
+@@ -24,6 +24,7 @@
+ #include <kio/netaccess.h>
+ #include <kio/scheduler.h>
+ #include <klocale.h>
++#include <ksavefile.h>
+ #include <ktempfile.h>
+ #include <kurlrequester.h>
+ 
+@@ -48,7 +49,7 @@
+ 
+ ResourceNet::ResourceNet( const KConfig *config )
+   : Resource( config ), mFormat( 0 ),
+-    mLocalTempFile( 0 ), mUseLocalTempFile( false ),
++    mTempFile( 0 ),
+     d( new ResourceNetPrivate )
+ {
+   if ( config ) {
+@@ -60,7 +61,7 @@
+ 
+ ResourceNet::ResourceNet( const KURL &url, const QString &format )
+   : Resource( 0 ), mFormat( 0 ),
+-    mLocalTempFile( 0 ), mUseLocalTempFile( false ),
++    mTempFile( 0 ),
+     d( new ResourceNetPrivate )
+ {
+   init( url, format );
+@@ -98,8 +99,7 @@
+   delete mFormat;
+   mFormat = 0;
+ 
+-  delete mLocalTempFile;
+-  mLocalTempFile = 0;
++  deleteLocalTempFile();
+ }
+ 
+ void ResourceNet::writeConfig( KConfig *config )
+@@ -114,15 +114,11 @@
+ {
+   kdDebug(5700) << "ResourceNet::requestSaveTicket()" << endl;
+ 
+-  if ( mTempFile.isEmpty() )
+-    return 0;
+-
+   return createTicket( this );
+ }
+ 
+ void ResourceNet::releaseSaveTicket( Ticket *ticket )
+ {
+-  KIO::NetAccess::removeTempFile( mTempFile );
+   delete ticket;
+ }
+ 
+@@ -137,41 +133,58 @@
+ 
+ bool ResourceNet::load()
+ {
+-  if ( !KIO::NetAccess::exists( mUrl, true, 0 ) ) {
+-    mLocalTempFile = new KTempFile();
+-    mLocalTempFile->setAutoDelete( true );
+-    mUseLocalTempFile = true;
+-    mTempFile = mLocalTempFile->name();
+-  }
+-
+-  if ( !KIO::NetAccess::download( mUrl, mTempFile, 0 ) ) {
+-    addressBook()->error( i18n( "Unable to download file '%1'." ).arg( mUrl.url() ) );
++  QString tempFile;
++    
++  if ( !KIO::NetAccess::download( mUrl, tempFile, 0 ) ) {
++    addressBook()->error( i18n( "Unable to download file '%1'." ).arg( mUrl.prettyURL() ) );
+     return false;
+   }
+ 
+-  QFile file( mTempFile );
++  QFile file( tempFile );
+   if ( !file.open( IO_ReadOnly ) ) {
+-    addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mUrl.url() ) );
++    addressBook()->error( i18n( "Unable to open file '%1'." ).arg( tempFile ) );
++    KIO::NetAccess::removeTempFile( tempFile );
+     return false;
+   }
+ 
+-  return mFormat->loadAll( addressBook(), this, &file );
++  bool result = clearAndLoad( &file );
++  if ( !result )
++      addressBook()->error( i18n( "Problems during parsing file '%1'." ).arg( tempFile ) );
++
++  KIO::NetAccess::removeTempFile( tempFile );
++  
++  return result;
+ }
+ 
++bool ResourceNet::clearAndLoad( QFile *file )
++{
++  clear();
++  return mFormat->loadAll( addressBook(), this, file );
++}
++
+ bool ResourceNet::asyncLoad()
+ {
+-  if ( mLocalTempFile ) {
+-    kdDebug(5700) << "stale temp file detected " << mLocalTempFile->name() << endl;
+-    mLocalTempFile->setAutoDelete( true );
+-    delete mLocalTempFile;
++  if ( d->mIsLoading ) {
++    abortAsyncLoading();
+   }
+ 
+-  mLocalTempFile = new KTempFile();
+-  mUseLocalTempFile = true;
+-  mTempFile = mLocalTempFile->name();
++  if (d->mIsSaving) {
++    kdWarning(5700) << "Aborted asyncLoad() because we're still asyncSave()ing!" << endl;
++    return false;
++  }
++  
++  bool ok = createLocalTempFile();
++  if ( ok )
++    ok = mTempFile->close();
+ 
++  if ( !ok ) {
++    emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) );
++    deleteLocalTempFile();
++    return false;
++  }
++  
+   KURL dest;
+-  dest.setPath( mTempFile );
++  dest.setPath( mTempFile->name() );
+ 
+   KIO::Scheduler::checkSlaveOnHold( true );
+   d->mLoadJob = KIO::file_copy( mUrl, dest, -1, true, false, false );
+@@ -182,45 +195,125 @@
+   return true;
+ }
+ 
++void ResourceNet::abortAsyncLoading()
++{
++  kdDebug(5700) << "ResourceNet::abortAsyncLoading()" << endl;
++
++  if ( d->mLoadJob ) {
++    d->mLoadJob->kill(); // result not emitted
++    d->mLoadJob = 0;
++  }
++
++  deleteLocalTempFile();
++  d->mIsLoading = false;
++}
++
++void ResourceNet::abortAsyncSaving()
++{
++  kdDebug(5700) << "ResourceNet::abortAsyncSaving()" << endl;
++
++  if ( d->mSaveJob ) {
++    d->mSaveJob->kill(); // result not emitted
++    d->mSaveJob = 0;
++  }
++  
++  deleteLocalTempFile();
++  d->mIsSaving = false;
++}
++
+ bool ResourceNet::save( Ticket* )
+ {
+-  QFile file( mTempFile );
++  kdDebug(5700) << "ResourceNet::save()" << endl;
+ 
+-  if ( !file.open( IO_WriteOnly ) ) {
+-    addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mUrl.url() ) );
++  if (d->mIsSaving) {
++    abortAsyncSaving();
++  }
++
++  KTempFile tempFile;
++  tempFile.setAutoDelete( true );
++  bool ok = false;
++  
++  if ( tempFile.status() == 0 && tempFile.file() ) {
++    saveToFile( tempFile.file() );
++    ok = tempFile.close();
++  }
++  
++  if ( !ok ) {
++    addressBook()->error( i18n( "Unable to save file '%1'." ).arg( tempFile.name() ) );
+     return false;
+   }
+ 
+-  mFormat->saveAll( addressBook(), this, &file );
+-  file.close();
+-
+-  return KIO::NetAccess::upload( mTempFile, mUrl, 0 );
++  ok = KIO::NetAccess::upload( tempFile.name(), mUrl, 0 );
++  if ( !ok )
++    addressBook()->error( i18n( "Unable to upload to '%1'." ).arg( mUrl.prettyURL() ) );
++  
++  return ok;
+ }
+ 
+ bool ResourceNet::asyncSave( Ticket* )
+ {
+-  QFile file( mTempFile );
++  kdDebug(5700) << "ResourceNet::asyncSave()" << endl;
+ 
+-  if ( !file.open( IO_WriteOnly ) ) {
+-    emit savingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile ) );
++  if (d->mIsSaving) {
++    abortAsyncSaving();
++  }
++
++  if (d->mIsLoading) {
++    kdWarning(5700) << "Aborted asyncSave() because we're still asyncLoad()ing!" << endl;
+     return false;
+   }
++  
++  bool ok = createLocalTempFile();
++  if ( ok ) {
++    saveToFile( mTempFile->file() );
++    ok = mTempFile->close();
++  }
++  
++  if ( !ok ) {
++    emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mTempFile->name() ) );
++    deleteLocalTempFile();
++    return false;
++  }
+ 
+-  mFormat->saveAll( addressBook(), this, &file );
+-  file.close();
+-
+   KURL src;
+-  src.setPath( mTempFile );
++  src.setPath( mTempFile->name() );
+ 
+   KIO::Scheduler::checkSlaveOnHold( true );
++  d->mIsSaving = true;
+   d->mSaveJob = KIO::file_copy( src, mUrl, -1, true, false, false );
+-  d->mIsSaving = true;
+   connect( d->mSaveJob, SIGNAL( result( KIO::Job* ) ),
+            this, SLOT( uploadFinished( KIO::Job* ) ) );
+ 
+   return true;
+ }
+ 
++bool ResourceNet::createLocalTempFile()
++{
++  deleteStaleTempFile();
++  mTempFile = new KTempFile();
++  mTempFile->setAutoDelete( true );
++  return mTempFile->status() == 0;
++}
++
++void ResourceNet::deleteStaleTempFile()
++{
++  if ( hasTempFile() ) {
++    kdDebug(5700) << "stale temp file detected " << mTempFile->name() << endl;
++    deleteLocalTempFile();
++  }
++}
++
++void ResourceNet::deleteLocalTempFile()
++{
++  delete mTempFile;
++  mTempFile = 0;
++}
++
++void ResourceNet::saveToFile( QFile *file )
++{
++  mFormat->saveAll( addressBook(), this, file );
++}
++
+ void ResourceNet::setUrl( const KURL &url )
+ {
+   mUrl = url;
+@@ -248,31 +341,41 @@
+ 
+ void ResourceNet::downloadFinished( KIO::Job* )
+ {
++  kdDebug(5700) << "ResourceNet::downloadFinished()" << endl;
++
+   d->mIsLoading = false;
+ 
+-  if ( !mLocalTempFile )
++  if ( !hasTempFile() || mTempFile->status() != 0 ) {
+     emit loadingError( this, i18n( "Download failed in some way!" ) );
+-
+-  QFile file( mTempFile );
+-  if ( !file.open( IO_ReadOnly ) ) {
+-    emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile ) );
+     return;
+   }
+ 
+-  if ( !mFormat->loadAll( addressBook(), this, &file ) )
+-    emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile ) );
+-  else
+-    emit loadingFinished( this );
++  QFile file( mTempFile->name() );
++  if ( file.open( IO_ReadOnly ) ) {
++    if ( clearAndLoad( &file ) )
++      emit loadingFinished( this );
++    else
++      emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile->name() ) );
++  }
++  else {
++    emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) );
++  }
++
++  deleteLocalTempFile();
+ }
+ 
+ void ResourceNet::uploadFinished( KIO::Job *job )
+ {
++  kdDebug(5700) << "ResourceFile::uploadFinished()" << endl;
++
+   d->mIsSaving = false;
+ 
+   if ( job->error() )
+     emit savingError( this, job->errorString() );
+   else
+     emit savingFinished( this );
++
++  deleteLocalTempFile();
+ }
+ 
+ #include "resourcenet.moc"
+--- kabc/plugins/net/resourcenet.h	(revision 506549)
++++ kabc/plugins/net/resourcenet.h	(revision 515119)
+@@ -27,6 +27,7 @@
+ 
+ #include <kabc/resource.h>
+ 
++class QFile;
+ class QTimer;
+ class KTempFile;
+ 
+@@ -54,7 +55,7 @@
+ 
+     virtual bool doOpen();
+     virtual void doClose();
+-  
++
+     virtual Ticket *requestSaveTicket();
+     virtual void releaseSaveTicket( Ticket* );
+ 
+@@ -91,13 +92,20 @@
+     void uploadFinished( KIO::Job* );
+ 
+   private:
++    bool clearAndLoad( QFile *file );
++    void saveToFile( QFile *file );
++    bool hasTempFile() const { return mTempFile != 0; }
++    void abortAsyncLoading();
++    void abortAsyncSaving();
++    bool createLocalTempFile();
++    void deleteLocalTempFile();
++    void deleteStaleTempFile();
++
+     FormatPlugin *mFormat;
+     QString mFormatName;
+ 
+     KURL mUrl;
+-    QString mTempFile;
+-    KTempFile *mLocalTempFile;
+-    bool mUseLocalTempFile;
++    KTempFile *mTempFile;
+ 
+     class ResourceNetPrivate;
+     ResourceNetPrivate *d;
+--- kabc/kab2kabc.desktop	(revision 506549)
++++ kabc/kab2kabc.desktop	(revision 515119)
+@@ -94,3 +94,4 @@
+ Terminal=false
+ NoDisplay=true
+ X-KDE-autostart-condition=kab2kabcrc:Startup:EnableAutostart:true
++OnlyShowIn=KDE;
+--- kabc/vcardtool.cpp	(revision 506549)
++++ kabc/vcardtool.cpp	(revision 515119)
+@@ -661,8 +661,12 @@
+       QByteArray input;
+       QBuffer buffer( input );
+       buffer.open( IO_WriteOnly );
+-      pic.data().save( &buffer, "JPEG" );
+ 
++      QImageIO iio( &buffer, "JPEG" );
++      iio.setImage( pic.data() );
++      iio.setQuality( 100 );
++      iio.write();
++
+       line.setValue( input );
+       line.addParameter( "encoding", "b" );
+       line.addParameter( "type", "image/jpeg" );
+--- kdecore/ktempdir.h	(revision 506549)
++++ kdecore/ktempdir.h	(revision 515119)
+@@ -120,6 +120,29 @@
+     */
+    bool existing() const;
+ 
++   /**
++    * @brief Remove a directory and all its contents
++    *
++    * Remove recursively a directory, even if it is not empty
++    * or contains other directories.
++    *
++    * However the function works too when the @p path given
++    * is a non-directory file. In that case it simply remove that file.
++    *
++    * The function stops on the first error.
++    *
++    * @note This function is more meant for removing a directory
++    * not created by the user. For user-created directories,
++    * using KIO::NetAccess::del is recommended instead,
++    * especially as it has user feedback for long operations.
++    *
++    * @param path Path of the directory to delete
++    * @return true if successful, otherwise false 
++    * (Use errno for more details about the error.)
++    * @since 3.5.2
++    */
++    static bool removeDir( const QString& path );
++
+ protected:
+ 
+    /**
+--- kdecore/kaboutdata.h	(revision 506549)
++++ kdecore/kaboutdata.h	(revision 515119)
+@@ -302,8 +302,8 @@
+      *
+      * For example:
+      * \code
+-     * setTranslator(I18N_NOOP2("NAME OF TRANSLATORS","Your names")
+-     * ,I18N_NOOP2("EMAIL OF TRANSLATORS","Your emails"));
++     * setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\\nYour names")
++     * ,I18N_NOOP("_: EMAIL OF TRANSLATORS\\nYour emails"));
+      * \endcode
+      *
+      * The translator can then translate this dummy text with his name
+--- kdecore/ktempdir.cpp	(revision 506549)
++++ kdecore/ktempdir.cpp	(revision 515119)
+@@ -31,6 +31,7 @@
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <dirent.h>
+ 
+ #ifdef HAVE_TEST
+ #include <test.h>
+@@ -53,6 +54,7 @@
+ #include "kstandarddirs.h"
+ #include "kprocess.h"
+ #include <kdebug.h>
++#include "kde_file.h"
+ 
+ KTempDir::KTempDir(QString directoryPrefix, int mode)
+ {
+@@ -136,12 +138,78 @@
+ KTempDir::unlink()
+ {
+    if (!bExisting) return;
+-   QString rmstr("/bin/rm -rf ");
+-   rmstr += KProcess::quote(mTmpName);
+-   ::system( QFile::encodeName(rmstr) );
+-
++   if (KTempDir::removeDir(mTmpName))
++      mError=0;
++   else
++      mError=errno;
+    bExisting=false;
+-   mError=0;
+ }
+ 
++// Auxiliary recursive function for removeDirs
++static bool
++rmtree(const QCString& name)
++{
++    kdDebug() << "Checking directory for remove " << name << endl;
++    KDE_struct_stat st;
++    if ( KDE_lstat( name.data(), &st ) == -1 ) // Do not dereference symlink!
++        return false;
++    if ( S_ISDIR( st.st_mode ) )
++    {
++        // This is a directory, so process it
++        kdDebug() << "File " << name << " is DIRECTORY!" << endl;
++        KDE_struct_dirent* ep;
++        DIR* dp = ::opendir( name.data() );
++        if ( !dp )
++            return false;
++        while ( ( ep = KDE_readdir( dp ) ) )
++        {
++            kdDebug() << "CHECKING " << name << "/" << ep->d_name << endl;
++            if ( !qstrcmp( ep->d_name, "." ) || !qstrcmp( ep->d_name, ".." ) )
++                continue;
++            QCString newName( name );
++            newName += "/"; // Careful: do not add '/' instead or you get problems with Qt3.
++            newName += ep->d_name;
++            /*
++             * Be defensive and close the directory.
++             *
++             * Potential problems:
++             * - opendir/readdir/closedir is not re-entrant
++             * - unlink and rmdir invalidates a opendir/readdir/closedir
++             * - limited number of file descriptors for opendir/readdir/closedir
++             */
++            if ( ::closedir( dp ) )
++                return false;
++            // Recurse!
++            kdDebug() << "RECURSE: " << newName << endl;
++            if ( ! rmtree( newName ) )
++                return false;
++            // We have to re-open the directory before continuing
++            dp = ::opendir( name.data() );
++            if ( !dp )
++                return false;
++        }
++        if ( ::closedir( dp ) )
++            return false;
++        kdDebug() << "RMDIR dir " << name << endl;
++        return ! ::rmdir( name );
++    }
++    else
++    {
++         // This is a non-directory file, so remove it
++         kdDebug() << "UNLINKING file " << name << endl;
++         return ! ::unlink( name );
++    }
++}
+ 
++bool
++KTempDir::removeDir(const QString& path)
++{
++    kdDebug() << k_funcinfo << " " << path << endl;
++    if ( !QFile::exists( path ) )
++        return true; // The goal is that there is no directory
++
++    const QCString cstr( QFile::encodeName( path ) );
++    return rmtree( cstr );
++}
++
++
+--- kdecore/kconfigbase.h	(revision 506549)
++++ kdecore/kconfigbase.h	(revision 515119)
+@@ -558,8 +558,8 @@
+    * Reads a boolean entry.
+    *
+    * Read the value of an entry specified by @p pKey in the current group
+-   * and interpret it as a boolean value. Currently "on" and "true" are
+-   * accepted as true, everything else if false.
++   * and interpret it as a boolean value. Currently "on", "yes", "1" and
++   * "true" are accepted as true, everything else if false.
+    *
+    * @param pKey The key to search for
+    * @param bDefault A default value returned if the key was not found.
+@@ -571,8 +571,8 @@
+    * Reads a boolean entry.
+    *
+    * Read the value of an entry specified by @p pKey in the current group
+-   * and interpret it as a boolean value. Currently "on" and "true" are
+-   * accepted as true, everything else if false.
++   * and interpret it as a boolean value. Currently "on", "yes", "1" and
++   * "true" are accepted as true, everything else if false.
+    *
+    * @param pKey The key to search for
+    * @param bDefault A default value returned if the key was not found.
+--- kdecore/all_languages.desktop	(revision 506549)
++++ kdecore/all_languages.desktop	(revision 515119)
+@@ -7457,6 +7457,7 @@
+ Name[el]=Ρουμανία
+ Name[es]=Rumaní
+ Name[et]=Mustlaskeel
++Name[eu]=Errumaniera
+ Name[fi]=Romani
+ Name[fr]=Rromani
+ Name[hu]=Lovári cigány
+@@ -8404,11 +8405,13 @@
+ Name[br]=Serbeg latin
+ Name[ca]=Serbi llatí
+ Name[cs]=Srbský (latinka)
++Name[cy]=Serbieg Lladin
+ Name[da]=Serbisk latin
+ Name[de]=Serbisch Latein
+ Name[el]=Σερβικά (Λατινικά)
+ Name[es]=Latín Serbio
+ Name[et]=Serbia (ladina)
++Name[eu]=Serbiera (Latina)
+ Name[fi]=Serbian latina
+ Name[fr]=Serbe Latin
+ Name[ga]=Seirbis (aibítir Laidineach)
+@@ -10259,8 +10262,10 @@
+ Name[el]=Κινέζικα (Χονγκ Κονγκ)
+ Name[es]=Chino (Hong Kong)
+ Name[et]=Hiina (Hong Kong)
++Name[eu]=Txinera (Hong Kong)
+ Name[fi]=Kiina (Hong Kong)
+ Name[fr]=Chinois (Hong Kong)
++Name[ga]=Sínis (Hong Cong)
+ Name[hu]=Kínai (hongkongi)
+ Name[is]=Kínverska (Hong Kong)
+ Name[it]=Cinese (Hong Kong)
+--- kdecore/kconfig_compiler/exampleprefs_base.kcfgc	(revision 506549)
++++ kdecore/kconfig_compiler/exampleprefs_base.kcfgc	(revision 515119)
+@@ -1,18 +0,0 @@
+-# Code generation options for kconfig_compiler
+-ClassName=ExamplePrefsBase
+-#
+-# Singleton=false
+-#
+-# Inherits=KConfigSkeleton
+-#
+-# IncludeFiles=libkdepim/kpimprefs.h
+-#
+-# MemberVariables=public
+-#
+-### The following line includes the file exampleprefs_base_addon.h
+-### It can be used to add extra functions and variables to the
+-### class.
+-# CustomAdditions=true
+-#
+-### Provide setFooBar(int) style functions
+-Mutators=true
+--- kdecore/kconfig_compiler/general_base.ui	(revision 506549)
++++ kdecore/kconfig_compiler/general_base.ui	(revision 515119)
+@@ -1,46 +0,0 @@
+-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+-<class>GeneralBase</class>
+-<widget class="QWidget">
+-    <property name="name">
+-        <cstring>GeneralBase</cstring>
+-    </property>
+-    <property name="geometry">
+-        <rect>
+-            <x>0</x>
+-            <y>0</y>
+-            <width>600</width>
+-            <height>486</height>
+-        </rect>
+-    </property>
+-    <property name="caption">
+-        <string>AutoExampleDialog</string>
+-    </property>
+-    <grid>
+-        <property name="name">
+-            <cstring>unnamed</cstring>
+-        </property>
+-        <widget class="QCheckBox" row="0" column="1">
+-            <property name="name">
+-                <cstring>kcfg_OneOption</cstring>
+-            </property>
+-            <property name="text">
+-                <string>OneOption</string>
+-            </property>
+-        </widget>
+-        <widget class="QSpinBox" row="1" column="1">
+-            <property name="name">
+-                <cstring>kcfg_AnotherOption2</cstring>
+-            </property>
+-        </widget>
+-        <widget class="QLabel" row="1" column="0">
+-            <property name="name">
+-                <cstring>textLabel1</cstring>
+-            </property>
+-            <property name="text">
+-                <string>AnotherOption:</string>
+-            </property>
+-        </widget>
+-    </grid>
+-</widget>
+-<layoutdefaults spacing="6" margin="11"/>
+-</UI>
+--- kdecore/kconfig_compiler/example.kcfg	(revision 506549)
++++ kdecore/kconfig_compiler/example.kcfg	(revision 515119)
+@@ -1,63 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8"?>
+-<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+-      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+-      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+-      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+-  <include>qdir.h</include>
+-  <kcfgfile name="examplerc">
+-    <parameter name="transport" />
+-    <parameter name="folder" />
+-  </kcfgfile>
+-  <group name="General-$(folder)">
+-    <entry name="OneOption" type="Bool">
+-      <label>One option</label>
+-      <default>true</default>
+-    </entry>
+-    <entry name="AnotherOption" type="Int" key="Another Option">
+-      <label>Another option</label>
+-      <default>5</default>
+-    </entry>
+-    <entry name="ListOption" type="Enum">
+-      <label>This is some funky option</label>
+-      <whatsthis>And this is a longer description of this option. Just wondering, how will the translations of those be handled?</whatsthis>
+-      <choices>
+-        <choice name="One"/>
+-        <choice name="Two"/>
+-        <choice name="Three"/>
+-      </choices>
+-      <default>One</default>
+-    </entry>
+-  </group>
+-  <group name="MyOptions">
+-    <entry name="MyString" type="String">
+-      <label>This is a string</label>
+-      <default>Default String</default>
+-    </entry>
+-    <entry name="MyPath" type="Path">
+-      <label>This is a path</label>
+-      <default code="true">QDir::homeDirPath()+QString::fromLatin1(".hidden_file")</default>
+-    </entry>
+-    <entry name="MyPaths" type="PathList">
+-      <label>This is a list of paths</label>
+-      <default>/home,~</default>
+-    </entry>
+-    <entry name="MyPaths2" type="PathList">
+-      <label>This is a list of paths (test2)</label>
+-      <default code="true">QStringList(QDir::homeDirPath())</default>
+-    </entry>
+-    <entry name="AnotherOption2" type="Int" key="Another Option">
+-      <label>Another option</label>
+-      <default>10</default>
+-    </entry>
+-    <entry name="MyStringList" type="StringList">
+-      <default>up,down</default>
+-    </entry>
+-    <entry name="MyStringListHidden" hidden="true" type="StringList">
+-      <default>up,down</default>
+-    </entry>
+-    <entry name="MyNumber" type="Int64" key="List-$(transport)-$(folder)">
+-      <label>List Number</label>
+-      <default>1</default>
+-    </entry>
+-  </group>
+-</kcfg>
+--- kdecore/kconfig_compiler/autoexample.cpp	(revision 506549)
++++ kdecore/kconfig_compiler/autoexample.cpp	(revision 515119)
+@@ -1,64 +0,0 @@
+-/*
+-    This file is part of KDE.
+-
+-    Copyright (c) 2003 Cornelius Schumacher <schumacher 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., 51 Franklin Street, Fifth Floor,
+-    Boston, MA 02110-1301, USA.
+-*/
+-
+-#include "general_base.h"
+-#include "myoptions_base.h"
+-
+-#include "exampleprefs_base.h"
+-
+-#include <kaboutdata.h>
+-#include <kapplication.h>
+-#include <kdebug.h>
+-#include <klocale.h>
+-#include <kcmdlineargs.h>
+-#include <kglobal.h>
+-#include <kconfig.h>
+-#include <kstandarddirs.h>
+-#include <kconfigdialog.h>
+-
+-#include <qlabel.h>
+-
+-int main( int argc, char **argv )
+-{
+-  KAboutData aboutData( "example", I18N_NOOP("autoconfig example"), "0.1" );
+-  aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher at kde.org" );
+-
+-  KCmdLineArgs::init( argc, argv, &aboutData );
+-
+-  KApplication app;
+-
+-  ExamplePrefsBase configSkeleton( "dummy1", "dummy2" );
+-  configSkeleton.readConfig();
+-
+-  KConfigDialog *dialog = new KConfigDialog( 0, "settings", &configSkeleton );
+-  
+-  GeneralBase *general = new GeneralBase( 0 );
+-  dialog->addPage( general, i18n("General"), "General", "" );
+-
+-  MyOptionsBase *myOptions = new MyOptionsBase( 0 );
+-  dialog->addPage( myOptions, i18n("MyOptions"), "MyOptions", "" );
+-
+-  app.setMainWidget( dialog );
+-
+-  dialog->show();
+-    
+-  return app.exec();
+-}
+--- kdecore/kconfig_compiler/myoptions_base.ui	(revision 506549)
++++ kdecore/kconfig_compiler/myoptions_base.ui	(revision 515119)
+@@ -1,35 +0,0 @@
+-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+-<class>MyOptionsBase</class>
+-<widget class="QWidget">
+-    <property name="name">
+-        <cstring>MyOptionsBase</cstring>
+-    </property>
+-    <property name="geometry">
+-        <rect>
+-            <x>0</x>
+-            <y>0</y>
+-            <width>600</width>
+-            <height>486</height>
+-        </rect>
+-    </property>
+-    <grid>
+-        <property name="name">
+-            <cstring>unnamed</cstring>
+-        </property>
+-        <widget class="QLabel" row="0" column="0">
+-            <property name="name">
+-                <cstring>textLabel1</cstring>
+-            </property>
+-            <property name="text">
+-                <string>MyString:</string>
+-            </property>
+-        </widget>
+-        <widget class="QLineEdit" row="0" column="1">
+-            <property name="name">
+-                <cstring>kcfg_MyString</cstring>
+-            </property>
+-        </widget>
+-    </grid>
+-</widget>
+-<layoutdefaults spacing="6" margin="11"/>
+-</UI>
+--- kdecore/kconfig_compiler/example.cpp	(revision 506549)
++++ kdecore/kconfig_compiler/example.cpp	(revision 515119)
+@@ -1,52 +0,0 @@
+-/*
+-    This file is part of KDE.
+-
+-    Copyright (c) 2003 Cornelius Schumacher <schumacher 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., 51 Franklin Street, Fifth Floor,
+-    Boston, MA 02110-1301, USA.
+-*/
+-
+-#include "exampleprefs_base.h"
+-
+-#include <kaboutdata.h>
+-#include <kapplication.h>
+-#include <kdebug.h>
+-#include <klocale.h>
+-#include <kcmdlineargs.h>
+-#include <kglobal.h>
+-#include <kconfig.h>
+-#include <kstandarddirs.h>
+-
+-int main( int argc, char **argv )
+-{
+-  KAboutData aboutData( "example", I18N_NOOP("cfgc example"), "0.1" );
+-  aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher at kde.org" );
+-
+-  KCmdLineArgs::init( argc, argv, &aboutData );
+-
+-  KApplication app;
+-
+-  ExamplePrefsBase *prefs = new ExamplePrefsBase("Trans1", "Folder2");
+-  
+-  prefs->readConfig();
+-
+-  prefs->setAnotherOption(17);
+-
+-  kdWarning() << "Another Option  = " << prefs->anotherOption() << endl;
+-  kdWarning() << "Another Option2 = " << prefs->anotherOption2() << endl;
+-  kdWarning() << "MyPaths         = " << prefs->myPaths() << endl;
+-  kdWarning() << "MyPaths2        = " << prefs->myPaths2() << endl;
+-}
+--- kdecore/kconfig_compiler/TODO	(revision 506549)
++++ kdecore/kconfig_compiler/TODO	(revision 515119)
+@@ -1 +0,0 @@
+-- Support linebreaks in whasthis texts in the kcfg file.
+--- kdecore/kconfig_compiler/Makefile.am	(revision 506549)
++++ kdecore/kconfig_compiler/Makefile.am	(revision 515119)
+@@ -1,4 +1,4 @@
+-SUBDIRS = tests
++SUBDIRS = example tests
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/kdecore -I$(top_srcdir) $(all_includes)
+ 
+@@ -8,28 +8,6 @@
+ kconfig_compiler_LDADD = $(LIB_KDECORE)
+ kconfig_compiler_SOURCES = kconfig_compiler.cpp
+ 
+-check_PROGRAMS = example # autoexample
+-EXTRA_PROGRAMS = autoexample
+-
+-example_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+-example_LDADD = $(LIB_KDECORE)
+-example_SOURCES = example.cpp exampleprefs_base.cpp
+-
+-autoexample_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+-autoexample_LDADD = $(LIB_KDECORE) $(LIB_KDEUI)
+-autoexample_SOURCES = exampleprefs_base.cpp general_base.ui myoptions_base.ui \
+-  autoexample.cpp  
+-
+-example.o exampleprefs_base.o: exampleprefs_base.h
+-# avoid running the below command in parallel
+-exampleprefs_base.cpp: exampleprefs_base.h
+-exampleprefs_base.cpp exampleprefs_base.h: $(srcdir)/example.kcfg kconfig_compiler $(srcdir)/exampleprefs_base.kcfgc
+-	./kconfig_compiler $(srcdir)/example.kcfg $(srcdir)/exampleprefs_base.kcfgc
+-
+-METASOURCES = AUTO
+-
+-CLEANFILES = exampleprefs_base.h exampleprefs_base.cpp
+-
+ TESTFILES = test1.kcfg test2.kcfg test3.kcfg test4.kcfg test_dpointer.kcfg
+ 
+ check-local:
+--- kdecore/kconfig_compiler/example/exampleprefs_base.kcfgc	(revision 0)
++++ kdecore/kconfig_compiler/example/exampleprefs_base.kcfgc	(revision 515119)
+@@ -0,0 +1,18 @@
++# Code generation options for kconfig_compiler
++ClassName=ExamplePrefsBase
++#
++# Singleton=false
++#
++# Inherits=KConfigSkeleton
++#
++# IncludeFiles=libkdepim/kpimprefs.h
++#
++# MemberVariables=public
++#
++### The following line includes the file exampleprefs_base_addon.h
++### It can be used to add extra functions and variables to the
++### class.
++# CustomAdditions=true
++#
++### Provide setFooBar(int) style functions
++Mutators=true
+--- kdecore/kconfig_compiler/example/general_base.ui	(revision 0)
++++ kdecore/kconfig_compiler/example/general_base.ui	(revision 515119)
+@@ -0,0 +1,46 @@
++<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
++<class>GeneralBase</class>
++<widget class="QWidget">
++    <property name="name">
++        <cstring>GeneralBase</cstring>
++    </property>
++    <property name="geometry">
++        <rect>
++            <x>0</x>
++            <y>0</y>
++            <width>600</width>
++            <height>486</height>
++        </rect>
++    </property>
++    <property name="caption">
++        <string>AutoExampleDialog</string>
++    </property>
++    <grid>
++        <property name="name">
++            <cstring>unnamed</cstring>
++        </property>
++        <widget class="QCheckBox" row="0" column="1">
++            <property name="name">
++                <cstring>kcfg_OneOption</cstring>
++            </property>
++            <property name="text">
++                <string>OneOption</string>
++            </property>
++        </widget>
++        <widget class="QSpinBox" row="1" column="1">
++            <property name="name">
++                <cstring>kcfg_AnotherOption2</cstring>
++            </property>
++        </widget>
++        <widget class="QLabel" row="1" column="0">
++            <property name="name">
++                <cstring>textLabel1</cstring>
++            </property>
++            <property name="text">
++                <string>AnotherOption:</string>
++            </property>
++        </widget>
++    </grid>
++</widget>
++<layoutdefaults spacing="6" margin="11"/>
++</UI>
+--- kdecore/kconfig_compiler/example/example.kcfg	(revision 0)
++++ kdecore/kconfig_compiler/example/example.kcfg	(revision 515119)
+@@ -0,0 +1,63 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
++      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
++      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
++      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
++  <include>qdir.h</include>
++  <kcfgfile name="examplerc">
++    <parameter name="transport" />
++    <parameter name="folder" />
++  </kcfgfile>
++  <group name="General-$(folder)">
++    <entry name="OneOption" type="Bool">
++      <label>One option</label>
++      <default>true</default>
++    </entry>
++    <entry name="AnotherOption" type="Int" key="Another Option">
++      <label>Another option</label>
++      <default>5</default>
++    </entry>
++    <entry name="ListOption" type="Enum">
++      <label>This is some funky option</label>
++      <whatsthis>And this is a longer description of this option. Just wondering, how will the translations of those be handled?</whatsthis>
++      <choices>
++        <choice name="One"/>
++        <choice name="Two"/>
++        <choice name="Three"/>
++      </choices>
++      <default>One</default>
++    </entry>
++  </group>
++  <group name="MyOptions">
++    <entry name="MyString" type="String">
++      <label>This is a string</label>
++      <default>Default String</default>
++    </entry>
++    <entry name="MyPath" type="Path">
++      <label>This is a path</label>
++      <default code="true">QDir::homeDirPath()+QString::fromLatin1(".hidden_file")</default>
++    </entry>
++    <entry name="MyPaths" type="PathList">
++      <label>This is a list of paths</label>
++      <default>/home,~</default>
++    </entry>
++    <entry name="MyPaths2" type="PathList">
++      <label>This is a list of paths (test2)</label>
++      <default code="true">QStringList(QDir::homeDirPath())</default>
++    </entry>
++    <entry name="AnotherOption2" type="Int" key="Another Option">
++      <label>Another option</label>
++      <default>10</default>
++    </entry>
++    <entry name="MyStringList" type="StringList">
++      <default>up,down</default>
++    </entry>
++    <entry name="MyStringListHidden" hidden="true" type="StringList">
++      <default>up,down</default>
++    </entry>
++    <entry name="MyNumber" type="Int64" key="List-$(transport)-$(folder)">
++      <label>List Number</label>
++      <default>1</default>
++    </entry>
++  </group>
++</kcfg>
+--- kdecore/kconfig_compiler/example/autoexample.cpp	(revision 0)
++++ kdecore/kconfig_compiler/example/autoexample.cpp	(revision 515119)
+@@ -0,0 +1,64 @@
++/*
++    This file is part of KDE.
++
++    Copyright (c) 2003 Cornelius Schumacher <schumacher 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., 51 Franklin Street, Fifth Floor,
++    Boston, MA 02110-1301, USA.
++*/
++
++#include "general_base.h"
++#include "myoptions_base.h"
++
++#include "exampleprefs_base.h"
++
++#include <kaboutdata.h>
++#include <kapplication.h>
++#include <kdebug.h>
++#include <klocale.h>
++#include <kcmdlineargs.h>
++#include <kglobal.h>
++#include <kconfig.h>
++#include <kstandarddirs.h>
++#include <kconfigdialog.h>
++
++#include <qlabel.h>
++
++int main( int argc, char **argv )
++{
++  KAboutData aboutData( "example", I18N_NOOP("autoconfig example"), "0.1" );
++  aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher at kde.org" );
++
++  KCmdLineArgs::init( argc, argv, &aboutData );
++
++  KApplication app;
++
++  ExamplePrefsBase configSkeleton( "dummy1", "dummy2" );
++  configSkeleton.readConfig();
++
++  KConfigDialog *dialog = new KConfigDialog( 0, "settings", &configSkeleton );
++  
++  GeneralBase *general = new GeneralBase( 0 );
++  dialog->addPage( general, i18n("General"), "General", "" );
++
++  MyOptionsBase *myOptions = new MyOptionsBase( 0 );
++  dialog->addPage( myOptions, i18n("MyOptions"), "MyOptions", "" );
++
++  app.setMainWidget( dialog );
++
++  dialog->show();
++    
++  return app.exec();
++}
+--- kdecore/kconfig_compiler/example/myoptions_base.ui	(revision 0)
++++ kdecore/kconfig_compiler/example/myoptions_base.ui	(revision 515119)
+@@ -0,0 +1,35 @@
++<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
++<class>MyOptionsBase</class>
++<widget class="QWidget">
++    <property name="name">
++        <cstring>MyOptionsBase</cstring>
++    </property>
++    <property name="geometry">
++        <rect>
++            <x>0</x>
++            <y>0</y>
++            <width>600</width>
++            <height>486</height>
++        </rect>
++    </property>
++    <grid>
++        <property name="name">
++            <cstring>unnamed</cstring>
++        </property>
++        <widget class="QLabel" row="0" column="0">
++            <property name="name">
++                <cstring>textLabel1</cstring>
++            </property>
++            <property name="text">
++                <string>MyString:</string>
++            </property>
++        </widget>
++        <widget class="QLineEdit" row="0" column="1">
++            <property name="name">
++                <cstring>kcfg_MyString</cstring>
++            </property>
++        </widget>
++    </grid>
++</widget>
++<layoutdefaults spacing="6" margin="11"/>
++</UI>
+--- kdecore/kconfig_compiler/example/Makefile.am	(revision 0)
++++ kdecore/kconfig_compiler/example/Makefile.am	(revision 515119)
+@@ -0,0 +1,27 @@
++AM_CPPFLAGS = -I$(top_srcdir)/kdecore -I$(top_srcdir) $(all_includes)
++
++check_PROGRAMS = example # autoexample
++EXTRA_PROGRAMS = autoexample
++
++example_LDFLAGS = $(all_libraries) $(KDE_RPATH)
++example_LDADD = $(LIB_KDECORE)
++example_SOURCES = example.cpp exampleprefs_base.cpp
++
++autoexample_LDFLAGS = $(all_libraries) $(KDE_RPATH)
++autoexample_LDADD = $(LIB_KDECORE) $(LIB_KDEUI)
++autoexample_SOURCES = exampleprefs_base.cpp general_base.ui myoptions_base.ui \
++  autoexample.cpp  
++
++example.o exampleprefs_base.o: exampleprefs_base.h
++# avoid running the below command in parallel
++exampleprefs_base.cpp: exampleprefs_base.h
++exampleprefs_base.cpp exampleprefs_base.h: $(srcdir)/example.kcfg ../kconfig_compiler $(srcdir)/exampleprefs_base.kcfgc
++	../kconfig_compiler $(srcdir)/example.kcfg $(srcdir)/exampleprefs_base.kcfgc
++
++METASOURCES = AUTO
++
++CLEANFILES = exampleprefs_base.h exampleprefs_base.cpp
++
++## The example's messages should not go into kdelibs.pot
++messages: rc.cpp
++	true
+--- kdecore/kconfig_compiler/example/example.cpp	(revision 0)
++++ kdecore/kconfig_compiler/example/example.cpp	(revision 515119)
+@@ -0,0 +1,52 @@
++/*
++    This file is part of KDE.
++
++    Copyright (c) 2003 Cornelius Schumacher <schumacher 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., 51 Franklin Street, Fifth Floor,
++    Boston, MA 02110-1301, USA.
++*/
++
++#include "exampleprefs_base.h"
++
++#include <kaboutdata.h>
++#include <kapplication.h>
++#include <kdebug.h>
++#include <klocale.h>
++#include <kcmdlineargs.h>
++#include <kglobal.h>
++#include <kconfig.h>
++#include <kstandarddirs.h>
++
++int main( int argc, char **argv )
++{
++  KAboutData aboutData( "example", I18N_NOOP("cfgc example"), "0.1" );
++  aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher at kde.org" );
++
++  KCmdLineArgs::init( argc, argv, &aboutData );
++
++  KApplication app;
++
++  ExamplePrefsBase *prefs = new ExamplePrefsBase("Trans1", "Folder2");
++  
++  prefs->readConfig();
++
++  prefs->setAnotherOption(17);
++
++  kdWarning() << "Another Option  = " << prefs->anotherOption() << endl;
++  kdWarning() << "Another Option2 = " << prefs->anotherOption2() << endl;
++  kdWarning() << "MyPaths         = " << prefs->myPaths() << endl;
++  kdWarning() << "MyPaths2        = " << prefs->myPaths2() << endl;
++}
+--- kdecore/network/kresolver.cpp	(revision 506549)
++++ kdecore/network/kresolver.cpp	(revision 515119)
+@@ -936,7 +936,7 @@
+ {
+   const char *kde_use_idn = getenv("KDE_USE_IDN");
+   if (!kde_use_idn)
+-     kde_use_idn = "ac:at:br:ch:cl:cn:de:dk:fi:hu:info:io:jp:kr:li:lt:museum:no:se:sh:th:tm:tw:vn";
++     kde_use_idn = "ac:at:cat:br:ch:cl:cn:de:dk:fi:hu:info:io:jp:kr:li:lt:museum:no:se:sh:th:tm:tw:vn";
+   return new QStringList(QStringList::split(':', QString::fromLatin1(kde_use_idn).lower()));
+ }
+ 
+--- kdecore/kaboutdata.cpp	(revision 506549)
++++ kdecore/kaboutdata.cpp	(revision 515119)
+@@ -388,7 +388,8 @@
+             "<p>KDE is translated into many languages thanks to the work "
+             "of the translation teams all over the world.</p>"
+             "<p>For more information on KDE internationalization "
+-            "visit http://i18n.kde.org</p>");
++            "visit <a href=\"http://l10n.kde.org\">http://l10n.kde.org</a></p>"
++            );
+ }
+ 
+ QString
+--- kdecore/tests/kmdcodectest.cpp	(revision 506549)
++++ kdecore/tests/kmdcodectest.cpp	(revision 515119)
+@@ -154,7 +154,9 @@
+     {
+         QCString result;
+ 
+-        memcpy (output.data(), msg, strlen(msg));
++        const size_t len = strlen(msg);
++        output.resize(len);
++        memcpy (output.data(), msg, len);
+ 
+         switch (type)
+         {
+--- kdecore/tests/kurltest.cpp	(revision 506549)
++++ kdecore/tests/kurltest.cpp	(revision 515119)
+@@ -715,6 +715,11 @@
+   check("Broken stuff #5 path", broken.path(), "");
+   broken = "file";
+   check("Broken stuff #6 valid", broken.isValid()?"VALID":"MALFORMED", "MALFORMED");
++  broken = "/";
++  check("Broken stuff #7 valid", broken.isValid()?"VALID":"MALFORMED", "VALID");
++  check("Broken stuff #7 path", broken.path(), "/" );
++  check("Broken stuff #7 url", broken.url(), "file:///" );
++  check("Broken stuff #7 file", broken.protocol(), "file" );
+ 
+   broken = "LABEL=USB_STICK"; // 71430, can we use KURL for this?
+   check("Broken stuff #6 valid", broken.isValid()?"VALID":"MALFORMED", "MALFORMED");
+@@ -790,6 +795,7 @@
+   check("UTF8",uloc.url(0, 106),"file:///home/dfaure/konqtests/Mat%C3%A9riel");
+   uloc = KURL("file:///home/dfaure/konqtests/Mat%C3%A9riel", 106);
+   check("UTF8 path", uloc.path(), "/home/dfaure/konqtests/Matériel");
++  check("encodedPathAndQuery", uloc.encodedPathAndQuery(), "/home/dfaure/konqtests/Mat%E9riel");
+ 
+   // fromPathOrURL tests
+   uloc = KURL::fromPathOrURL( "/home/dfaure/konqtests/Mat%E9riel" );
+@@ -835,14 +841,17 @@
+ 
+   tobi1 = "http://host.net/path/#no-query";
+   check("no query", tobi1.query(),"");
++  check("encodedPathAndQuery", tobi1.encodedPathAndQuery(), "/path/");
+ 
+   tobi1 = "http://host.net/path?myfirstquery#andsomeReference";
+   tobi1.setEncodedPathAndQuery("another/path/?another&query");
+   check("setEncodedPathAndQuery test#1", tobi1.query(), "?another&query");
+-  check("setEncodedPathAndQuery test#2", tobi1.path(), "another/path/");
++  check("setEncodedPathAndQuery test#2", tobi1.path(), "another/path/"); // with trailing slash
++  check("encodedPathAndQuery", tobi1.encodedPathAndQuery(), "another/path/?another&query");
+   tobi1.setEncodedPathAndQuery("another/path?another&query");
+   check("setEncodedPathAndQuery test#1", tobi1.query(), "?another&query");
+-  check("setEncodedPathAndQuery test#2", tobi1.path(), "another/path");
++  check("setEncodedPathAndQuery test#2", tobi1.path(), "another/path"); // without trailing slash
++  check("encodedPathAndQuery", tobi1.encodedPathAndQuery(), "another/path?another&query");
+ 
+   KURL theKow = "http://www.google.de/search?q=frerich&hlx=xx&hl=de&empty=&lr=lang+de&test=%2B%20%3A%25";
+   check("queryItem (first item)", theKow.queryItem("q"), "frerich");
+@@ -851,6 +860,7 @@
+   check("queryItem (invalid item)", theKow.queryItem("InterstellarCounselor"), QString::null);
+   check("queryItem (empty item)", theKow.queryItem("empty"), "");
+   check("queryItem (item with encoded chars)", theKow.queryItem("test"), "+ :%");
++  check("encodedPathAndQuery", theKow.encodedPathAndQuery(), "/search?q=frerich&hlx=xx&hl=de&empty=&lr=lang+de&test=%2B%20%3A%25");
+ 
+   // checks for queryItems(), which returns a QMap<QString,QString>:
+   KURL queryUrl( "mailto:Marc%20Mutz%20%3cmutz at kde.org%3E?"
+--- kdecore/tests/krfcdatetest.cpp	(revision 506549)
++++ kdecore/tests/krfcdatetest.cpp	(revision 515119)
+@@ -59,6 +59,23 @@
+   a = KRFCDate::parseDateISO8601("1994-01-01");
+   check( "1994-01-01", a, b );
+ 
++  b = 0;
++
++  // pass RFC date to ISO parser
++  a = KRFCDate::parseDateISO8601("Thu, 01 Jan 2004 19:48:21 GMT");
++  check("pass RFC date \"Thu, 01 Jan 2004 19:48:21 GMT\" to parseDateISO8601", a, b);
++
++  // pass ISO date to RFC parser
++  a = KRFCDate::parseDate("1994-01-01T12:00:00");
++  check("pass ISO date \"1994-01-01T12:00:00\" to parseDate()",  a, b);
++
++  // empty/null strings
++
++  check("parseDateISO8601(QString())", KRFCDate::parseDateISO8601(QString()), b);
++  check("parseDateISO8601(\"\")", KRFCDate::parseDateISO8601(""), b);
++  check("parseDate(QString())", KRFCDate::parseDate(QString()), b);
++  check("parseDate(\"\")", KRFCDate::parseDate(""), b);
++  
+   printf("\nTest OK !\n");
+ }
+ 
+--- kdecore/krfcdate.cpp	(revision 506549)
++++ kdecore/krfcdate.cpp	(revision 515119)
+@@ -97,6 +97,9 @@
+ time_t
+ KRFCDate::parseDate(const QString &_date)
+ {
++     if (_date.isEmpty())
++         return 0;
++
+      // This parse a date in the form:
+      //     Wednesday, 09-Nov-99 23:12:40 GMT
+      // or
+@@ -339,6 +342,9 @@
+ time_t
+ KRFCDate::parseDateISO8601( const QString& input_ )
+ {
++  if (input_.isEmpty())
++    return 0;
++
+   // These dates look like this:
+   // YYYY-MM-DDTHH:MM:SS
+   // But they may also have 0, 1 or 2 suffixes.
+@@ -380,6 +386,9 @@
+ 
+   QStringList l = QStringList::split('-', dateString);
+ 
++  if (l.size() < 3)
++    return 0;
++
+   year   = l[0].toUInt();
+   month  = l[1].toUInt();
+   mday   = l[2].toUInt();
+@@ -422,6 +431,9 @@
+ 
+   l = QStringList::split(':', timeString);
+ 
++  if (l.size() < 3)
++    return 0;
++
+   hour   = l[0].toUInt();
+   min    = l[1].toUInt();
+   sec    = l[2].toUInt();
+--- kdecore/kapplication.cpp	(revision 506549)
++++ kdecore/kapplication.cpp	(revision 515119)
+@@ -2468,6 +2468,11 @@
+    keyMap.insert('B', body);
+    keyMap.insert('u', url.url());
+ 
++   QString attachlist = attachURLs.join(",");
++   attachlist.prepend('\'');
++   attachlist.append('\'');
++   keyMap.insert('A', attachlist);
++
+    for (QStringList::Iterator it = cmdTokens.begin(); it != cmdTokens.end(); )
+    {
+      if (*it == "%A")
+--- khtml/khtml_part.cpp	(revision 506549)
++++ khtml/khtml_part.cpp	(revision 515119)
+@@ -267,8 +267,8 @@
+ 				       "certificate.<p> "
+ 				       "Hint: If the image shows a closed lock, the page has been transmitted over a "
+ 				       "secure connection.") );
+-  d->m_paDebugRenderTree = new KAction( i18n( "Print Rendering Tree to STDOUT" ), 0, this, SLOT( slotDebugRenderTree() ), actionCollection(), "debugRenderTree" );
+-  d->m_paDebugDOMTree = new KAction( i18n( "Print DOM Tree to STDOUT" ), 0, this, SLOT( slotDebugDOMTree() ), actionCollection(), "debugDOMTree" );
++  d->m_paDebugRenderTree = new KAction( i18n( "Print Rendering Tree to STDOUT" ), ALT + CTRL + SHIFT + Key_A, this, SLOT( slotDebugRenderTree() ), actionCollection(), "debugRenderTree" );
++  d->m_paDebugDOMTree = new KAction( i18n( "Print DOM Tree to STDOUT" ), ALT + CTRL + SHIFT + Key_D, this, SLOT( slotDebugDOMTree() ), actionCollection(), "debugDOMTree" );
+   d->m_paStopAnimations = new KAction( i18n( "Stop Animated Images" ), 0, this, SLOT( slotStopAnimations() ), actionCollection(), "stopAnimations" );
+ 
+   d->m_paSetEncoding = new KActionMenu( i18n( "Set &Encoding" ), "charset", actionCollection(), "setEncoding" );
+@@ -2804,7 +2804,7 @@
+ // Old method (its API limits the available features - remove in KDE-4)
+ bool KHTMLPart::findTextNext( const QString &str, bool forward, bool caseSensitive, bool isRegExp )
+ {
+-    if ( !initFindNode( false, !forward, false ) )
++    if ( !initFindNode( false, !forward, d->m_findNode ) )
+       return false;
+     while(1)
+     {
+--- khtml/khtmlview.cpp	(revision 506549)
++++ khtml/khtmlview.cpp	(revision 515119)
+@@ -2640,7 +2640,7 @@
+             QString url = (*it).url;
+             it = data.remove( it );
+             // assign the same accesskey also to other elements pointing to the same url
+-            if( !url.isEmpty()) {
++            if( !url.isEmpty() && !url.startsWith( "javascript:", false )) {
+                 for( QValueList< AccessKeyData >::Iterator it2 = data.begin();
+                      it2 != data.end();
+                      ) {                   
+--- khtml/html/html_formimpl.cpp	(revision 506549)
++++ khtml/html/html_formimpl.cpp	(revision 515119)
+@@ -66,6 +66,7 @@
+ 
+ #include <assert.h>
+ 
++
+ using namespace DOM;
+ using namespace khtml;
+ 
+@@ -1279,6 +1280,12 @@
+             setAttribute(ATTR_TYPE, type());
+         } else {
+             m_type = newType;
++
++            // force reattach if need be.
++            if (attached()) {
++                detach();
++                attach();
++            }
+         }
+     }
+     m_haveType = true;
+@@ -1365,8 +1372,11 @@
+         parseType(attr->value());
+         break;
+     case ATTR_VALUE:
+-        if (m_value.isNull()) // We only need to setChanged if the form is looking
+-            setChanged();     // at the default value right now.
++        if (m_value.isNull()) {// We only need to setChanged if the form is looking
++            setChanged();      // at the default value right now.
++            if (m_type == TEXT && m_render)
++                m_render->updateFromElement();
++        }
+         break;
+     case ATTR_CHECKED:
+         // WebCore has m_defaultChecked and m_useDefaultChecked code here....
+@@ -1678,6 +1688,8 @@
+     if (m_type == FILE) return;
+ 
+     m_value = (val.isNull() ? DOMString("") : val);
++    if (m_type == TEXT && m_render)
++        m_render->updateFromElement();
+     setChanged();
+ }
+ 
+@@ -1779,6 +1791,36 @@
+     return ((m_type == TEXT) || (m_type == PASSWORD) || (m_type == ISINDEX) || (m_type == FILE));
+ }
+ 
++long HTMLInputElementImpl::selectionStart()
++{
++    if (m_type != TEXT || !m_render) return -1;
++    return static_cast<RenderLineEdit*>(m_render)->selectionStart();
++}
++
++long HTMLInputElementImpl::selectionEnd()
++{
++    if (m_type != TEXT || !m_render) return -1;
++    return static_cast<RenderLineEdit*>(m_render)->selectionEnd();
++}
++
++void HTMLInputElementImpl::setSelectionStart(long pos)
++{
++    if (m_type != TEXT || !m_render) return;
++    static_cast<RenderLineEdit*>(m_render)->setSelectionStart(pos);
++}
++
++void HTMLInputElementImpl::setSelectionEnd  (long pos)
++{
++    if (m_type != TEXT || !m_render) return;
++    static_cast<RenderLineEdit*>(m_render)->setSelectionEnd(pos);
++}
++
++void HTMLInputElementImpl::setSelectionRange(long start, long end)
++{
++    if (m_type != TEXT || !m_render) return;
++    static_cast<RenderLineEdit*>(m_render)->setSelectionRange(start, end);
++}
++
+ // -------------------------------------------------------------------------
+ 
+ HTMLLabelElementImpl::HTMLLabelElementImpl(DocumentPtr *doc)
+@@ -1996,7 +2038,7 @@
+     //anyway if the item was selected, since we may want to set 
+     //a different one
+     bool fastRemoveLast = false;
+-    if ((listIndex == items.size() - 1) && !m_recalcListItems && 
++    if ((listIndex == (signed)items.size() - 1) && !m_recalcListItems && 
+         (m_multiple || !static_cast<HTMLOptionElementImpl*>(items[listIndex])->selected()))
+             fastRemoveLast = true;
+ 
+@@ -2168,6 +2210,7 @@
+     {
+     case ATTR_SIZE:
+         m_size = kMax( attr->val()->toInt(), 1 );
++        setChanged();
+         break;
+     case ATTR_WIDTH:
+         m_minwidth = kMax( attr->val()->toInt(), 0 );
+@@ -2550,7 +2593,8 @@
+     m_rows = 2;
+     m_cols = 20;
+     m_wrap = ta_Virtual;
+-    m_dirtyvalue = true;
++    m_changed     = false;
++    m_dirtyvalue  = true;
+     m_initialized = false;
+     m_unsubmittedFormChange = false;
+ }
+@@ -2594,12 +2638,18 @@
+     switch(attr->id())
+     {
+     case ATTR_ROWS:
+-        m_rows = attr->val() ? attr->val()->toInt() : 3;
++        m_rows = 0;
++        if (attr->val())
++            m_rows = DOMString(attr->val()).string().toInt();
++        if (!m_rows) m_rows = 2;
+         if (renderer())
+             renderer()->setNeedsLayoutAndMinMaxRecalc();
+         break;
+     case ATTR_COLS:
+-        m_cols = attr->val() ? attr->val()->toInt() : 60;
++        m_cols = 0;
++        if (attr->val())
++            m_cols = DOMString(attr->val()).string().toInt();
++        if (!m_cols) m_cols = 20;
+         if (renderer())
+             renderer()->setNeedsLayoutAndMinMaxRecalc();
+         break;
+@@ -2649,12 +2699,47 @@
+     _style->deref();
+ }
+ 
++
++static QString expandLF(const QString& s)
++{
++    // LF -> CRLF
++    unsigned crs = s.contains( '\n' );
++    if (crs == 0)
++	return s;
++    unsigned len = s.length();
++
++    QString r;
++    r.reserve(len + crs + 1);
++    unsigned pos2 = 0;
++    for(unsigned pos = 0; pos < len; pos++)
++    {
++       QChar c = s.at(pos);
++       switch(c.unicode())
++       {
++         case '\n':
++           r[pos2++] = '\r';
++           r[pos2++] = '\n';
++           break;
++
++         case '\r':
++           break;
++
++         default:
++           r[pos2++]= c;
++           break;
++       }
++    }
++    r.squeeze();
++    return r;
++}
++
++
+ bool HTMLTextAreaElementImpl::encoding(const QTextCodec* codec, encodingList& encoding, bool)
+ {
+     if (name().isEmpty()) return false;
+ 
+     encoding += fixUpfromUnicode(codec, name().string());
+-    encoding += fixUpfromUnicode(codec, value().string());
++    encoding += fixUpfromUnicode(codec, expandLF(value().string()));
+ 
+     return true;
+ }
+@@ -2664,14 +2749,14 @@
+     setValue(defaultValue());
+ }
+ 
++
+ DOMString HTMLTextAreaElementImpl::value()
+ {
+     if ( m_dirtyvalue) {
+         if ( m_render && m_initialized ) {
+             RenderTextArea* renderArea = static_cast<RenderTextArea*>( m_render );
+             m_value = renderArea->text();
+-            m_dirtyvalue = false; // before onChange (#100963)
+-            onChange();
++            m_dirtyvalue = false;
+         } else {
+             m_value = defaultValue().string();
+             m_initialized = true;
+@@ -2785,21 +2870,17 @@
+     }
+ }
+ 
+-long HTMLTextAreaElementImpl::textLength()
++void HTMLTextAreaElementImpl::setSelectionRange(long start, long end)
+ {
+-    //First, get the value. This is like ::value, only pure.
+-    DOMString val = m_value;
+-    if (m_dirtyvalue) {
+-        if ( m_render && m_initialized ) {
+-            RenderTextArea* renderArea = static_cast<RenderTextArea*>( m_render );
+-            val = renderArea->text();
+-        } else {
+-            val = defaultValue();
+-        }
++    if (m_render) {
++        RenderTextArea* renderArea = static_cast<RenderTextArea*>( m_render );
++        renderArea->setSelectionRange( start, end );
+     }
++}
+ 
+-    //now we can get the length.
+-    return val.length();
++long HTMLTextAreaElementImpl::textLength()
++{
++    return value().length();
+ }
+ 
+ // -------------------------------------------------------------------------
+--- khtml/html/html_baseimpl.cpp	(revision 506549)
++++ khtml/html/html_baseimpl.cpp	(revision 515119)
+@@ -360,8 +360,6 @@
+ 
+ void HTMLFrameElementImpl::setLocation( const DOMString& str )
+ {
+-    if ( url == str )
+-        return;
+ 
+     url = str;
+ 
+--- khtml/html/html_imageimpl.cpp	(revision 506549)
++++ khtml/html/html_imageimpl.cpp	(revision 515119)
+@@ -91,11 +91,12 @@
+         if (!url.isEmpty()) { //### why do we not hide or something when setting this?
+             CachedImage* newImage = getDocument()->docLoader()->requestImage(khtml::parseURL(url));
+             if (newImage && newImage != m_image) {
++                CachedImage* oldImage = m_image;
+                 loadEventSent = false;
+-                if (m_image)
+-                    m_image->deref(this);
+                 m_image = newImage;
+                 m_image->ref(this);
++                if (oldImage)
++                    oldImage->deref(this);
+             }
+         }
+     }
+@@ -144,7 +145,7 @@
+         break;
+     case ATTR_USEMAP:
+         if ( attr->value()[0] == '#' )
+-            usemap = attr->value();
++            usemap = attr->value().lower();
+         else {
+             QString url = getDocument()->completeURL( khtml::parseURL( attr->value() ).string() );
+             // ### we remove the part before the anchor and hope
+@@ -412,9 +413,9 @@
+     {
+         DOMString s = attr->value();
+         if(*s.unicode() == '#')
+-            name = QString(s.unicode()+1, s.length()-1);
++            name = QString(s.unicode()+1, s.length()-1).lower();
+         else
+-            name = s.string();
++            name = s.string().lower();
+ 	// ### make this work for XML documents, e.g. in case of <html:map...>
+         if(getDocument()->isHTMLDocument())
+             static_cast<HTMLDocumentImpl*>(getDocument())->mapMap[name] = this;
+--- khtml/html/html_elementimpl.cpp	(revision 506549)
++++ khtml/html/html_elementimpl.cpp	(revision 515119)
+@@ -175,6 +175,16 @@
+         getDocument()->incDOMTreeVersion();
+         break;
+     case ATTR_CLASS:
++        if (attr->val()) {
++          DOMString v = attr->value();
++          const QChar* s = v.unicode();
++          int l = v.length();
++          while( l && !s->isSpace() )
++            l--,s++;
++          setHasClassList(l);
++        } else
++          setHasClassList(false);                 
++    // no break                                         
+     case ATTR_NAME:
+         setChanged(); // in case of a CSS selector on class/name
+         getDocument()->incDOMTreeVersion();
+--- khtml/html/html_formimpl.h	(revision 506549)
++++ khtml/html/html_formimpl.h	(revision 515119)
+@@ -311,6 +311,12 @@
+ 
+     void setUnsubmittedFormChange(bool unsubmitted) { m_unsubmittedFormChange = unsubmitted; }
+ 
++    //Mozilla extensions.
++    long selectionStart();
++    long selectionEnd();
++    void setSelectionStart(long pos);
++    void setSelectionEnd  (long pos);
++    void setSelectionRange(long start, long end);
+ protected:
+     void parseType(const DOMString& t);
+ 
+@@ -560,13 +566,15 @@
+     long selectionEnd();
+     void setSelectionStart(long pos);
+     void setSelectionEnd  (long pos);
++    void setSelectionRange(long start, long end);
+     long textLength();
+ protected:
+     int m_rows;
+     int m_cols;
+     WrapMethod m_wrap;
+     QString m_value;
+-    bool m_dirtyvalue: 1;
++    bool m_changed: 1;    //States whether the contents has been editted
++    bool m_dirtyvalue: 1; //States whether m_value is out-of-date compared to the renderer or default
+     bool m_unsubmittedFormChange: 1;
+     bool m_initialized: 1;
+ };
+--- khtml/html/html_tableimpl.cpp	(revision 506549)
++++ khtml/html/html_tableimpl.cpp	(revision 515119)
+@@ -308,7 +308,7 @@
+ NodeImpl *HTMLTableElementImpl::appendChild(NodeImpl *child, int &exceptioncode)
+ {
+     // #105586, allow javascript to insert a TR inside a TABLE, creation section as needed
+-    if(child->id() == ID_TR && (!getDocument()->parsing() || getDocument()->htmlMode() == DocumentImpl::XHtml)) {
++    if(child->id() == ID_TR && !getDocument()->parsing()) {
+         // See insertRow
+         if (!firstBody && !head && !foot && !hasChildNodes()) {
+             setTBody( new HTMLTableSectionElementImpl(docPtr(), ID_TBODY, true /* implicit */) );
+@@ -328,8 +328,7 @@
+     kdDebug( 6030 ) << nodeName().string() << "(Table)::addChild( " << child->nodeName().string() << " )" << endl;
+ #endif
+ 
+-    int exceptioncode = 0;
+-    NodeImpl *retval = appendChild( child, exceptioncode );
++    NodeImpl *retval = HTMLElementImpl::addChild( child );
+     if ( retval ) {
+ 	switch(child->id()) {
+ 	case ID_CAPTION:
+--- khtml/ecma/kjs_html.h	(revision 506549)
++++ khtml/ecma/kjs_html.h	(revision 515119)
+@@ -96,10 +96,11 @@
+            InputFocus, InputMaxLength, InputDefaultChecked, InputDisabled,
+            InputChecked, InputForm, InputAccessKey, InputAlign, InputAlt,
+            InputName, InputSrc, InputUseMap, InputSelect, InputClick,
++           InputSelectionStart, InputSelectionEnd, InputSetSelectionRange,
+            TextAreaAccessKey, TextAreaName, TextAreaDefaultValue, TextAreaSelect,
+            TextAreaCols, TextAreaDisabled, TextAreaForm, TextAreaType,
+            TextAreaTabIndex, TextAreaReadOnly, TextAreaRows, TextAreaValue,
+-           TextAreaBlur, TextAreaFocus, TextAreaSelectionStart, TextAreaSelectionEnd,
++           TextAreaBlur, TextAreaFocus, TextAreaSelectionStart, TextAreaSelectionEnd, TextAreaSetSelectionRange, 
+            TextAreaTextLength, ButtonBlur, ButtonFocus, ButtonForm, ButtonTabIndex, ButtonName,
+            ButtonDisabled, ButtonAccessKey, ButtonType, ButtonValue, LabelHtmlFor,
+            LabelForm, LabelAccessKey, FieldSetForm, LegendForm, LegendAccessKey,
+@@ -152,7 +153,8 @@
+            MarqueeStart, MarqueeStop,
+            LayerTop, LayerLeft, LayerVisibility, LayerBgColor, LayerClip, LayerDocument, LayerLayers,
+            ElementInnerHTML, ElementTitle, ElementId, ElementDir, ElementLang,
+-           ElementClassName, ElementInnerText, ElementDocument, ElementChildren, ElementAll };
++           ElementClassName, ElementInnerText, ElementDocument,
++	   ElementChildren, ElementAll, ElementScrollIntoView };
+ 
+     DOM::HTMLElement toElement() const { return static_cast<DOM::HTMLElement>(node); }
+   };
+--- khtml/ecma/kjs_css.cpp	(revision 506549)
++++ khtml/ecma/kjs_css.cpp	(revision 515119)
+@@ -550,8 +550,14 @@
+       return Undefined();
+     // IE extensions
+     case DOMCSSStyleSheet::AddRule: {
++      //Unpassed/-1 means append. Since insertRule is picky (throws exceptions)
++      //we adjust it to the desired length
++      unsigned long index  = args[2].toInteger(exec);
++      unsigned long length = styleSheet.cssRules().length();
++      if (args[2].type() == UndefinedType) index = length;
++      if (index > length)                  index = length;
+       DOM::DOMString str = args[0].toString(exec).string() + " { " + args[1].toString(exec).string() + " } ";
+-      return Number(styleSheet.insertRule(str,(long unsigned int)args[2].toInteger(exec)));
++      return Number(styleSheet.insertRule(str,index));
+     }
+     case DOMCSSStyleSheet::RemoveRule: {
+       int index = args.size() > 0 ? args[0].toInteger(exec) : 0 /*first one*/;
+--- khtml/ecma/kjs_html.cpp	(revision 506549)
++++ khtml/ecma/kjs_html.cpp	(revision 515119)
+@@ -640,6 +640,7 @@
+ # IE extension
+   children	KJS::HTMLElement::ElementChildren  DontDelete|ReadOnly
+   all           KJS::HTMLElement::ElementAll       DontDelete|ReadOnly
++  scrollIntoView KJS::HTMLElement::ElementScrollIntoView DontDelete|Function 0
+ @end
+ @begin HTMLHtmlElementTable 1
+   version	KJS::HTMLElement::HtmlVersion	DontDelete
+@@ -762,10 +763,13 @@
+   type		KJS::HTMLElement::InputType		DontDelete
+   useMap	KJS::HTMLElement::InputUseMap		DontDelete
+   value		KJS::HTMLElement::InputValue		DontDelete
++  selectionStart KJS::HTMLElement::InputSelectionStart  DontDelete
++  selectionEnd   KJS::HTMLElement::InputSelectionEnd    DontDelete
+   blur		KJS::HTMLElement::InputBlur		DontDelete|Function 0
+   focus		KJS::HTMLElement::InputFocus		DontDelete|Function 0
+   select	KJS::HTMLElement::InputSelect		DontDelete|Function 0
+   click		KJS::HTMLElement::InputClick		DontDelete|Function 0
++  setSelectionRange KJS::HTMLElement::InputSetSelectionRange DontDelete|Function 2
+ @end
+ @begin HTMLTextAreaElementTable 13
+   defaultValue	KJS::HTMLElement::TextAreaDefaultValue	DontDelete
+@@ -785,6 +789,7 @@
+   blur		KJS::HTMLElement::TextAreaBlur		DontDelete|Function 0
+   focus		KJS::HTMLElement::TextAreaFocus		DontDelete|Function 0
+   select	KJS::HTMLElement::TextAreaSelect	DontDelete|Function 0
++  setSelectionRange KJS::HTMLElement::TextAreaSetSelectionRange DontDelete|Function 2
+ @end
+ @begin HTMLButtonElementTable 9
+   form		KJS::HTMLElement::ButtonForm		DontDelete|ReadOnly
+@@ -1355,6 +1360,20 @@
+     case InputType:            return String(input.type());
+     case InputUseMap:          return String(input.useMap());
+     case InputValue:           return String(input.value());
++    case InputSelectionStart:  {
++        long val = input.selectionStart();
++        if (val != -1)
++          return Number(val);
++        else
++          return Undefined();
++      }
++    case InputSelectionEnd:  {
++        long val = input.selectionEnd();
++        if (val != -1)
++          return Number(val);
++        else
++          return Undefined();
++      }
+     }
+   }
+   break;
+@@ -2189,6 +2208,10 @@
+         input.click();
+         return Undefined();
+       }
++      else if (id == KJS::HTMLElement::InputSetSelectionRange) {
++        input.setSelectionRange(args[0].toNumber(exec), args[1].toNumber(exec));
++        return Undefined();
++      }
+     }
+     break;
+     case ID_BUTTON: {
+@@ -2217,6 +2240,11 @@
+         textarea.select();
+         return Undefined();
+       }
++      else if (id == KJS::HTMLElement::TextAreaSetSelectionRange) {
++        textarea.setSelectionRange(args[0].toNumber(exec), args[1].toNumber(exec));
++        return Undefined();
++      }
++
+     }
+     break;
+     case ID_A: {
+@@ -2302,6 +2330,13 @@
+     }
+   }
+ 
++  if (id == HTMLElement::ElementScrollIntoView) {
++    // ### implement
++    kdWarning() << "non-standard HTMLElement::scrollIntoView() not implemented"
++		<< endl;
++    return Undefined();
++  }
++
+   return Undefined();
+ }
+ 
+@@ -2578,6 +2613,8 @@
+       case InputType:            { input.setType(str); return; }
+       case InputUseMap:          { input.setUseMap(str); return; }
+       case InputValue:           { input.setValue(str); return; }
++      case InputSelectionStart:  { input.setSelectionStart(value.toInteger(exec)); return; }
++      case InputSelectionEnd:    { input.setSelectionEnd  (value.toInteger(exec)); return; }
+       }
+     }
+     break;
+--- khtml/ecma/kjs_events.cpp	(revision 506549)
++++ khtml/ecma/kjs_events.cpp	(revision 515119)
+@@ -868,8 +868,9 @@
+                             args[4].toString(exec).string(), // keyIdentifierArg
+                             args[5].toInteger(exec),         // keyLocationArg
+                             args[6].toString(exec).string()); //modifiersList
+-
+-      return Undefined();
++      break;
++    case DOMKeyboardEvent::GetModifierState:
++      return Boolean(keyEvent->getModifierState(args[0].toString(exec).string()));
+   }
+   return Undefined();
+ }
+--- khtml/rendering/render_form.h	(revision 506549)
++++ khtml/rendering/render_form.h	(revision 515119)
+@@ -238,6 +238,11 @@
+     { return static_cast<DOM::HTMLInputElementImpl*>(RenderObject::element()); }
+     void highLightWord( unsigned int length, unsigned int pos );
+ 
++    long selectionStart();
++    long selectionEnd();
++    void setSelectionStart(long pos);
++    void setSelectionEnd(long pos);
++    void setSelectionRange(long start, long end);
+ public slots:
+     void slotReturnPressed();
+     void slotTextChanged(const QString &string);
+@@ -476,6 +481,7 @@
+     long selectionEnd();
+     void setSelectionStart(long pos);
+     void setSelectionEnd(long pos);
++    void setSelectionRange(long start, long end);
+ protected slots:
+     void slotTextChanged();
+ 
+--- khtml/rendering/render_list.cpp	(revision 506549)
++++ khtml/rendering/render_list.cpp	(revision 515119)
+@@ -203,6 +203,8 @@
+ {
+     if(m_listImage)
+         m_listImage->deref(this);
++    if (m_listItem)
++        m_listItem->resetListMarker();
+ }
+ 
+ void RenderListMarker::setStyle(RenderStyle *s)
+--- khtml/rendering/render_layer.h	(revision 506549)
++++ khtml/rendering/render_layer.h	(revision 515119)
+@@ -185,6 +185,7 @@
+     // Scrolling methods for layers that can scroll their overflow.
+     void scrollOffset(int& x, int& y);
+     void subtractScrollOffset(int& x, int& y);
++    void checkInlineRelOffset(const RenderObject* o, int& x, int& y);
+     short scrollXOffset() { return m_scrollX; }
+     int scrollYOffset() { return m_scrollY; }
+     void scrollToOffset(int x, int y, bool updateScrollbars = true, bool repaint = true);
+--- khtml/rendering/render_replaced.h	(revision 506549)
++++ khtml/rendering/render_replaced.h	(revision 515119)
+@@ -131,6 +131,11 @@
+     QWidget *m_widget;
+     KHTMLView* m_view;
+ 
++    //Because we mess with normal detach due to ref/deref,
++    //we need to keep track of the arena ourselves
++    //so it doesn't get yanked from us, etc.
++    SharedPtr<RenderArena> m_arena; 
++
+     bool m_resizePending;
+     bool m_discardResizes;
+ 
+--- khtml/rendering/render_arena.cpp	(revision 506549)
++++ khtml/rendering/render_arena.cpp	(revision 515119)
+@@ -51,6 +51,15 @@
+     size_t size;
+ } RenderArenaDebugHeader;
+ 
++#ifdef VALGRIND_SUPPORT
++Arena* findContainingArena(ArenaPool* pool, void* ptr) {
++    uword ptrBits = reinterpret_cast<uword>(ptr);
++    for (Arena* a = &pool->first; a; a = a->next)
++        if (ptrBits >= a->base && ptrBits < a->limit)
++            return a;
++    return 0; //Should not happen
++}
++#endif
+ 
+ RenderArena::RenderArena(unsigned int arenaSize)
+ {
+@@ -88,6 +97,9 @@
+ 
+         result = m_recyclers[index];
+         if (result) {
++#ifdef VALGRIND_SUPPORT
++            VALGRIND_MEMPOOL_ALLOC(findContainingArena(&m_pool, result)->base, result, size);
++#endif
+             // Need to move to the next object
+             void* next = *((void**)result);
+             m_recyclers[index] = next;
+@@ -113,6 +125,11 @@
+     assert(header->arena == this);
+     ::free(header);
+ #else
++
++#ifdef VALGRIND_SUPPORT
++    VALGRIND_MEMPOOL_FREE(findContainingArena(&m_pool, ptr)->base, ptr);
++#endif
++
+     // Ensure we have correct alignment for pointers.  Important for Tru64
+     size = KHTML_ROUNDUP(size, sizeof(void*));
+ 
+--- khtml/rendering/render_table.h	(revision 506549)
++++ khtml/rendering/render_table.h	(revision 515119)
+@@ -262,6 +262,10 @@
+ 	return (*(grid[row].row))[col];
+     }
+ 
++    virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
++    virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
++    virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
++
+     virtual void paint( PaintInfo& i, int tx, int ty);
+ 
+     int numRows() const { return grid.size(); }
+--- khtml/rendering/render_form.cpp	(revision 506549)
++++ khtml/rendering/render_form.cpp	(revision 515119)
+@@ -541,9 +541,9 @@
+     if ( ml < 0 || ml > 1024 )
+         ml = 1024;
+ 
+-     if ( widget()->maxLength() != ml )  {
+-         widget()->setMaxLength( ml );
+-     }
++    if ( widget()->maxLength() != ml )  {
++        widget()->setMaxLength( ml );
++    }
+ 
+     if (element()->value().string() != widget()->text()) {
+         widget()->blockSignals(true);
+@@ -572,6 +572,53 @@
+     static_cast<LineEditWidget*>(m_widget)->selectAll();
+ }
+ 
++long RenderLineEdit::selectionStart()
++{
++    LineEditWidget* w = static_cast<LineEditWidget*>(m_widget);
++    if (w->hasSelectedText())
++        return w->selectionStart();
++    else
++        return w->cursorPosition();
++}
++
++
++long RenderLineEdit::selectionEnd()
++{
++    LineEditWidget* w = static_cast<LineEditWidget*>(m_widget);
++    if (w->hasSelectedText())
++        return w->selectionStart() + w->selectedText().length();
++    else
++        return w->cursorPosition();
++}
++
++void RenderLineEdit::setSelectionStart(long pos)
++{
++    LineEditWidget* w = static_cast<LineEditWidget*>(m_widget);
++    //See whether we have a non-empty selection now.
++    long end = selectionEnd();
++    if (end > pos)
++        w->setSelection(pos, end - pos);
++    w->setCursorPosition(pos);
++}
++
++void RenderLineEdit::setSelectionEnd(long pos)
++{
++    LineEditWidget* w = static_cast<LineEditWidget*>(m_widget);
++    //See whether we have a non-empty selection now.
++    long start = selectionStart();
++    if (start < pos)
++        w->setSelection(start, pos - start);
++
++    w->setCursorPosition(pos);
++}
++
++void RenderLineEdit::setSelectionRange(long start, long end)
++{
++    LineEditWidget* w = static_cast<LineEditWidget*>(m_widget);
++    w->setCursorPosition(end);
++    w->setSelection(start, end - start);
++}
++
+ // ---------------------------------------------------------------------------
+ 
+ RenderFieldset::RenderFieldset(HTMLGenericFormElementImpl *element)
+@@ -767,10 +814,6 @@
+     edit->blockSignals(true);
+     edit->setText(element()->value().string());
+     edit->blockSignals(false);
+-    int ml = element()->maxLength();
+-    if ( ml < 0 || ml > 1024 )
+-        ml = 1024;
+-    edit->setMaxLength( ml );
+     edit->setEdited( false );
+ 
+     RenderFormElement::updateFromElement();
+@@ -1570,6 +1613,10 @@
+     if ( w && element()->m_dirtyvalue ) {
+         element()->m_value = text();
+         element()->m_dirtyvalue = false;
++    }
++
++    if ( w && element()->m_changed ) {
++        element()->m_changed = false;
+         element()->onChange();
+     }
+ }
+@@ -1653,39 +1700,7 @@
+     RenderFormElement::close();
+ }
+ 
+-static QString expandLF(const QString& s)
+-{
+-    // LF -> CRLF
+-    unsigned crs = s.contains( '\n' );
+-    if (crs == 0)
+-	return s;
+-    unsigned len = s.length();
+ 
+-    QString r;
+-    r.reserve(len + crs + 1);
+-    unsigned pos2 = 0;
+-    for(unsigned pos = 0; pos < len; pos++)
+-    {
+-       QChar c = s.at(pos);
+-       switch(c.unicode())
+-       {
+-         case '\n':
+-           r[pos2++] = '\r';
+-           r[pos2++] = '\n';
+-           break;
+-
+-         case '\r':
+-           break;
+-
+-         default:
+-           r[pos2++]= c;
+-           break;
+-       }
+-    }
+-    r.squeeze();
+-    return r;
+-}
+-
+ QString RenderTextArea::text()
+ {
+     QString txt;
+@@ -1713,19 +1728,9 @@
+     else
+         txt = w->text();
+ 
+-    return expandLF(txt);
++    return txt;
+ }
+ 
+-static int expandedCnt(unsigned short code)
+-{
+-    if (code == '\n')
+-        return 2;
+-    else if (code == '\r')
+-        return 0;
+-    else
+-        return 1;
+-}
+-
+ int RenderTextArea::queryParagraphInfo(int para, Mode m, int param) {
+     /* We have to be a bit careful here, as we need to match up the positions
+     to what our value returns here*/
+@@ -1736,6 +1741,7 @@
+ 
+     QString paragraphText = w->text(para);
+     int pl                = w->paragraphLength(para);
++    int physicalPL        = pl;
+     if (m == ParaPortionLength)
+         pl = param;
+ 
+@@ -1743,25 +1749,28 @@
+         //Go through all the chars of paragraph, and count line changes, chars, etc.
+         int lindex = w->lineOfChar(para, 0);
+         for (int c = 0; c < pl; ++c) {
+-            if (lindex != w->lineOfChar(para, c)) {
+-                length += 2;
+-                lindex =  w->lineOfChar(para, c);
++            ++length;
++            // Is there a change after this char?
++            if (c+1 < physicalPL && lindex != w->lineOfChar(para, c+1)) {
++                lindex =  w->lineOfChar(para, c+1);
++                ++length;
+             }
+-            length += expandedCnt(paragraphText.at(c).unicode());
+             if (m == ParaPortionOffset && length > param)
+                 return c;
+         }
+     } else {
+-        //Make sure to count the LF, CR as appropriate..
++        //Make sure to count the LF, CR as appropriate. ### this is stupid now, simplify
+         for (int c = 0; c < pl; ++c) {
+-            length += expandedCnt(paragraphText.at(c).unicode());
++            ++length;
+             if (m == ParaPortionOffset && length > param)
+                 return c;
+         }
+     }
+     if (m == ParaPortionOffset)
+         return pl;
+-    return length;
++    if (m == ParaPortionLength)
++        return length;
++    return length + 1;
+ }
+ 
+ long RenderTextArea::computeCharOffset(int para, int index) {
+@@ -1770,7 +1779,7 @@
+ 
+     long pos = 0;
+     for (int cp = 0; cp < para; ++cp)
+-        pos += queryParagraphInfo(cp, ParaLength) + 2;
++        pos += queryParagraphInfo(cp, ParaLength);
+ 
+     if (index >= 0)
+         pos += queryParagraphInfo(para, ParaPortionLength, index);
+@@ -1791,7 +1800,7 @@
+     long endPos       = 0;
+     long startPos     = 0;
+     for (int p = 0; p < w->paragraphs(); ++p) {
+-        int len = queryParagraphInfo(p, ParaLength) + 2;
++        int len = queryParagraphInfo(p, ParaLength);
+         endPos += len;
+         if (endPos > offset) {
+             containingPar = p;
+@@ -1819,6 +1828,7 @@
+ void RenderTextArea::slotTextChanged()
+ {
+     element()->m_dirtyvalue = true;
++    element()->m_changed    = true;
+     if (element()->m_value != text())
+         element()->m_unsubmittedFormChange = true;
+ }
+@@ -1870,7 +1880,13 @@
+     w->setSelection(fromPara, fromIndex, toPara, toIndex);
+ }
+ 
+-
++void RenderTextArea::setSelectionRange(long start, long end) {
++    TextAreaWidget* w = static_cast<TextAreaWidget*>(m_widget);
++    int fromPara, fromIndex, toPara, toIndex;
++    computeParagraphAndIndex(start, &fromPara, &fromIndex);
++    computeParagraphAndIndex(end,   &toPara,   &toIndex);
++    w->setSelection(fromPara, fromIndex, toPara, toIndex);
++}
+ // ---------------------------------------------------------------------------
+ 
+ #include "render_form.moc"
+--- khtml/rendering/render_object.cpp	(revision 506549)
++++ khtml/rendering/render_object.cpp	(revision 515119)
+@@ -438,12 +438,14 @@
+ 
+ RenderObject* RenderObject::offsetParent() const
+ {
++    // can't really use containing blocks here (#113280)
+     bool skipTables = isPositioned() || isRelPositioned();
+     bool strict = !style()->htmlHacks();
+     RenderObject* curr = parent();
+-    while (curr && !curr->isPositioned() && !curr->isRelPositioned() && 
+-                   !(strict && skipTables ? curr->isRoot() : curr->isBody())) {
+-        if (!skipTables && (curr->isTableCell() || curr->isTable()))
++    while (curr && (!curr->element() || 
++                    (!curr->isPositioned() && !curr->isRelPositioned() && 
++                        !(strict && skipTables ? curr->isRoot() : curr->isBody())))) {
++        if (!skipTables && curr->element() && (curr->isTableCell() || curr->isTable()))
+             break;
+         curr = curr->parent();
+     }
+@@ -477,14 +479,12 @@
+ 
+ bool RenderObject::hasStaticX() const
+ {
+-    return (style()->left().isVariable() && style()->right().isVariable()) ||
+-            style()->left().isStatic() ||
+-            style()->right().isStatic();
++    return (style()->left().isVariable() && style()->right().isVariable());
+ }
+ 
+ bool RenderObject::hasStaticY() const
+ {
+-    return (style()->top().isVariable() && style()->bottom().isVariable()) || style()->top().isStatic();
++    return (style()->top().isVariable() && style()->bottom().isVariable());
+ }
+ 
+ void RenderObject::setPixmap(const QPixmap&, const QRect& /*r*/, CachedImage* image)
+@@ -1291,9 +1291,17 @@
+     m_markedForRepaint = true;
+     if (layer() && (style()->position() == FIXED || style()->position() == ABSOLUTE))
+         return;
+-    if (m_parent && (checkContainer || style()->width().isVariable() || style()->height().isVariable() ||
+-                     !(isFloating() || flowAroundFloats() || isTableCell())))
+-        m_parent->dirtyFormattingContext(false);
++    if (m_parent) {
++         if (isInlineFlow()) {
++             if (!checkContainer && !m_parent->isInline())
++                 return;
++             else
++                 m_parent->dirtyFormattingContext(false);
++         } 
++         else if (checkContainer || style()->width().isVariable() || style()->height().isVariable() ||
++                     !(isFloating() || flowAroundFloats() || isTableCell()))
++             m_parent->dirtyFormattingContext(false);
++    }
+ }
+ 
+ void RenderObject::repaintDuringLayout()
+--- khtml/rendering/render_canvas.cpp	(revision 506549)
++++ khtml/rendering/render_canvas.cpp	(revision 515119)
+@@ -216,9 +216,6 @@
+         setHeight( m_viewportHeight = s.height() );
+     }
+ 
+-    // ### we could maybe do the call below better and only pass true if the docsize changed.
+-    layoutPositionedObjects( true );
+-
+ #ifdef SPEED_DEBUG
+     kdDebug() << "RenderCanvas::end time used=" << qt.elapsed() << endl;
+ #endif
+--- khtml/rendering/render_layer.cpp	(revision 506549)
++++ khtml/rendering/render_layer.cpp	(revision 515119)
+@@ -141,41 +141,8 @@
+         RenderLayer* positionedParent = enclosingPositionedAncestor();
+ 
+         // For positioned layers, we subtract out the enclosing positioned layer's scroll offset.
+-        positionedParent->subtractScrollOffset(x, y);
+-        
+-        if (positionedParent->renderer()->isRelPositioned() &&
+-            positionedParent->renderer()->isInlineFlow()) {
+-            // When we have an enclosing relpositioned inline, we need to add in the offset of the first line
+-            // box from the rest of the content, but only in the cases where we know we're positioned
+-            // relative to the inline itself.
+-            RenderFlow* flow = static_cast<RenderFlow*>(positionedParent->renderer());
+-            int sx = 0, sy = 0;
+-            if (flow->firstLineBox()) {
+-                if (flow->style()->direction() == LTR)
+-                    sx = flow->firstLineBox()->xPos();
+-                else
+-                    sx = flow->lastLineBox()->xPos();
+-                sy = flow->firstLineBox()->yPos();
+-            } else {
+-                sx = flow->staticX(); // ###
+-                sy = flow->staticY();
+-            }
+-            bool isInlineType = m_object->style()->isOriginalDisplayInlineType();
+-            
+-            if (!m_object->hasStaticX())
+-                x += sx;
+-            
+-            // This is not terribly intuitive, but we have to match other browsers.  Despite being a block display type inside
+-            // an inline, we still keep our x locked to the left of the relative positioned inline.  Arguably the correct
+-            // behavior would be to go flush left to the block that contains the inline, but that isn't what other browsers
+-            // do.
+-            if (m_object->hasStaticX() && !isInlineType)
+-                // Avoid adding in the left border/padding of the containing block twice.  Subtract it out.
+-                x += sx - (m_object->containingBlock()->borderLeft() + m_object->containingBlock()->paddingLeft());
+-            
+-            if (!m_object->hasStaticY())
+-                y += sy;
+-        }
++        positionedParent->subtractScrollOffset(x, y);        
++        positionedParent->checkInlineRelOffset(m_object, x, y);        
+     }
+     else if (parent())
+         parent()->subtractScrollOffset(x, y);
+@@ -452,6 +419,44 @@
+     y -= scrollYOffset();
+ }
+ 
++void RenderLayer::checkInlineRelOffset(const RenderObject* o, int& x, int& y)
++{
++    if(o->style()->position() != ABSOLUTE || !renderer()->isRelPositioned() || !renderer()->isInlineFlow())
++        return;
++
++    // Our renderer is an enclosing relpositioned inline, we need to add in the offset of the first line
++    // box from the rest of the content, but only in the cases where we know our descendant is positioned
++    // relative to the inline itself.
++    assert( o->container() == m_object );
++
++    RenderFlow* flow = static_cast<RenderFlow*>(m_object);
++    int sx = 0, sy = 0;
++    if (flow->firstLineBox()) {
++        if (flow->style()->direction() == LTR)
++            sx = flow->firstLineBox()->xPos();
++        else
++            sx = flow->lastLineBox()->xPos();
++        sy = flow->firstLineBox()->yPos();
++    } else {
++        sx = flow->staticX(); // ###
++        sy = flow->staticY();
++    }
++    bool isInlineType = o->style()->isOriginalDisplayInlineType();
++            
++    if (!o->hasStaticX())
++        x += sx;
++            
++    // Despite the positioned child being a block display type inside an inline, we still keep
++    // its x locked to our left.  Arguably the correct behavior would be to go flush left to 
++    // the block that contains us, but that isn't what other browsers do.
++    if (o->hasStaticX() && !isInlineType)
++        // Avoid adding in the left border/padding of the containing block twice.  Subtract it out.
++        x += sx - (o->containingBlock()->borderLeft() + o->containingBlock()->paddingLeft());
++            
++    if (!o->hasStaticY())
++        y += sy;
++}
++
+ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repaint)
+ {
+     if (renderer()->style()->overflow() != OMARQUEE) {
+--- khtml/rendering/render_replaced.cpp	(revision 506549)
++++ khtml/rendering/render_replaced.cpp	(revision 515119)
+@@ -97,7 +97,8 @@
+     m_widget = 0;
+     // a widget doesn't support being anonymous
+     assert(!isAnonymous());
+-    m_view = node->getDocument()->view();
++    m_view  = node->getDocument()->view();
++    m_arena.reset(renderArena());
+     m_resizePending = false;
+     m_discardResizes = false;
+ 
+@@ -199,7 +200,8 @@
+         if (m_widget) {
+             m_widget->removeEventFilter(this);
+             disconnect( m_widget, SIGNAL( destroyed()), this, SLOT( slotWidgetDestructed()));
+-            delete m_widget;
++            m_widget->hide();
++            m_widget->deleteLater(); //Might happen due to event on the widget, so be careful
+             m_widget = 0;
+         }
+         m_widget = widget;
+@@ -809,8 +811,11 @@
+ {
+     if (_ref) _ref--;
+ //     qDebug( "deref(%p): width get count is %d", this, _ref);
+-    if (!_ref)
+-        arenaDelete(renderArena());
++    if (!_ref) {
++        khtml::SharedPtr<RenderArena> guard(m_arena); //Since delete on us gets called -first-,
++                                                      //before the arena free
++        arenaDelete(m_arena.get());
++    }
+ }
+ 
+ FindSelectionResult RenderReplaced::checkSelectionPoint(int _x, int _y, int _tx, int _ty, DOM::NodeImpl*& node, int &offset, SelPointState &)
+--- khtml/rendering/render_list.h	(revision 506549)
++++ khtml/rendering/render_list.h	(revision 515119)
+@@ -69,6 +69,7 @@
+ protected:
+ 
+     void updateMarkerLocation();
++    void resetListMarker() { m_marker = 0; }
+ 
+     RenderListMarker *m_marker;
+     CounterNode *m_counter;
+--- khtml/rendering/render_table.cpp	(revision 506549)
++++ khtml/rendering/render_table.cpp	(revision 515119)
+@@ -303,6 +303,8 @@
+     m_height += bpTop;
+ 
+     int oldHeight = m_height;
++    if (isPositioned())
++        m_height += calculatedHeight + bpBottom;
+     calcHeight();
+     int newHeight = m_height;
+     m_height = oldHeight;
+@@ -310,7 +312,7 @@
+     Length h = style()->height();
+     int th = -(bpTop + bpBottom); // Tables size as though CSS height includes border/padding.
+     if (isPositioned())
+-        th = newHeight; // FIXME: Leave this alone for now but investigate later.
++        th += newHeight;
+     else if (h.isFixed())
+         th += h.value();
+     else if (h.isPercent())
+@@ -625,7 +627,9 @@
+ 	    if ( !next && child->parent()->isTableCol() )
+ 		next = child->parent()->nextSibling();
+ 	    child = next;
+-	} else
++	} else if (child == tCaption) {
++	    child = child->nextSibling();
++        } else
+ 	    break;
+     }
+     return 0;
+@@ -1493,6 +1497,57 @@
+     return static_cast<RenderTableRow *>(row);
+ }
+ 
++int RenderTableSection::lowestPosition(bool includeOverflowInterior, bool includeSelf) const
++{
++    int bottom = RenderContainer::lowestPosition(includeOverflowInterior, includeSelf);
++    if (!includeOverflowInterior && hasOverflowClip())
++        return bottom;
++
++    for (RenderObject *row = firstChild(); row; row = row->nextSibling()) {
++        for (RenderObject *cell = row->firstChild(); cell; cell = cell->nextSibling())
++            if (cell->isTableCell()) {
++                int bp = cell->yPos() + cell->lowestPosition(false);
++                bottom = kMax(bottom, bp);
++        }
++    }
++    
++    return bottom;
++}
++
++int RenderTableSection::rightmostPosition(bool includeOverflowInterior, bool includeSelf) const
++{
++    int right = RenderContainer::rightmostPosition(includeOverflowInterior, includeSelf);
++    if (!includeOverflowInterior && hasOverflowClip())
++        return right;
++
++    for (RenderObject *row = firstChild(); row; row = row->nextSibling()) {
++        for (RenderObject *cell = row->firstChild(); cell; cell = cell->nextSibling())
++            if (cell->isTableCell()) {
++                int rp = cell->xPos() + cell->rightmostPosition(false);
++                right = kMax(right, rp);
++        }
++    }
++    
++    return right;
++}
++
++int RenderTableSection::leftmostPosition(bool includeOverflowInterior, bool includeSelf) const
++{
++    int left = RenderContainer::leftmostPosition(includeOverflowInterior, includeSelf);
++    if (!includeOverflowInterior && hasOverflowClip())
++        return left;
++    
++    for (RenderObject *row = firstChild(); row; row = row->nextSibling()) {
++        for (RenderObject *cell = row->firstChild(); cell; cell = cell->nextSibling())
++            if (cell->isTableCell()) {
++                int lp = cell->xPos() + cell->leftmostPosition(false);
++                left = kMin(left, lp);
++        }
++    }
++    
++    return left;
++}
++
+ void RenderTableSection::paint( PaintInfo& pI, int tx, int ty )
+ {
+     unsigned int totalRows = grid.size();
+@@ -1839,7 +1894,12 @@
+         if( last && last->isAnonymous() && last->isTableCell() )
+             cell = static_cast<RenderTableCell *>(last);
+         else {
+-	    cell = new (renderArena()) RenderTableCell(document() /* anonymous object */);
++            // If beforeChild is inside an anonymous cell, insert into the cell.
++            if (last && !last->isTableCell() && last->parent() && last->parent()->isAnonymous()) {
++                last->parent()->addChild(child, beforeChild);
++                return;
++            }
++            cell = new (renderArena()) RenderTableCell(document() /* anonymous object */);
+ 	    RenderStyle *newStyle = new RenderStyle();
+ 	    newStyle->inheritFrom(style());
+ 	    newStyle->setDisplay( TABLE_CELL );
+--- khtml/rendering/render_box.cpp	(revision 506549)
++++ khtml/rendering/render_box.cpp	(revision 515119)
+@@ -642,8 +642,12 @@
+     RenderObject *o = container();
+     if( o && o->absolutePosition(xPos, yPos, f))
+     {
+-        if ( o->style()->hidesOverflow() && o->layer() )
+-            o->layer()->subtractScrollOffset( xPos, yPos );
++        if ( o->layer() ) {
++            if (o->style()->hidesOverflow())
++                o->layer()->subtractScrollOffset( xPos, yPos );
++            if (isPositioned())
++                o->layer()->checkInlineRelOffset(this, xPos, yPos);
++        }            
+ 
+         if(!isInline() || isReplaced())
+             xPos += m_x, yPos += m_y;
+@@ -705,19 +709,24 @@
+     x += m_x;
+     y += m_y;
+ 
+-    // Apply the relative position offset when invalidating a
+-    // rectangle.  The layer is translated, but the render box isn't,
+-    // so we need to do this to get the right dirty rect.
+-    if (isRelPositioned())
++    // Apply the relative position offset when invalidating a rectangle.  The layer
++    // is translated, but the render box isn't, so we need to do this to get the
++    // right dirty rect.  Since this is called from RenderObject::setStyle, the relative position
++    // flag on the RenderObject has been cleared, so use the one on the style().
++    if (style()->position() == RELATIVE && m_layer)
+         relativePositionOffset(x,y);
+ 
+-    if (style()->position()==FIXED) f=true;
++    if (style()->position() == FIXED) f=true;
+ 
+     // kdDebug( 6040 ) << "RenderBox(" <<this << ", " << renderName() << ")::repaintRectangle (" << x << "/" << y << ") (" << w << "/" << h << ")" << endl;
+     RenderObject *o = container();
+     if( o ) {
+-        if (o->style()->hidesOverflow() && o->layer())
+-            o->layer()->subtractScrollOffset(x,y); // For overflow:auto/scroll/hidden.
++         if (o->layer()) {
++             if (o->style()->hidesOverflow())
++                 o->layer()->subtractScrollOffset(x,y); // For overflow:auto/scroll/hidden.
++             if (style()->position() == ABSOLUTE)
++                 o->layer()->checkInlineRelOffset(this,x,y);
++        }
+         o->repaintRectangle(x, y, w, h, immediate, f);
+     }
+ }
+@@ -1024,7 +1033,7 @@
+     }
+     if (result != -1) {
+         result = height.width(result);
+-        if (cb->isTableCell() && !isTable() && style()->boxSizing() != BORDER_BOX) {
++        if (cb->isTableCell() && style()->boxSizing() != BORDER_BOX) {
+             result -= (borderTop() + paddingTop() + borderBottom() + paddingBottom());
+             result = kMax(0, result);
+         }
+@@ -1192,8 +1201,7 @@
+         r = style()->right().width(cw);
+ 
+     int static_distance=0;
+-    if ((parent()->style()->direction()==LTR && (l==AUTO && r==AUTO ))
+-            || style()->left().isStatic())
++    if (parent()->style()->direction()==LTR && (l==AUTO && r==AUTO ))
+     {
+         // calc hypothetical location in the normal flow
+         // used for 1) left=static-position
+@@ -1203,23 +1211,22 @@
+         // all positioned elements are blocks, so that
+         // would be at the left edge
+ 
++        RenderObject* po = parent();
+         static_distance = m_staticX - cb->borderLeft(); // Should already have been set through layout of the parent().
+-        for (RenderObject* po = parent(); po && po != cb; po = po->parent())
++        for (; po && po != cb; po = po->parent())
+             static_distance += po->xPos();
+ 
+-        if (l==AUTO || style()->left().isStatic())
+-            l = static_distance;
++        l = static_distance;
+     }
+ 
+-    else if ((parent()->style()->direction()==RTL && (l==AUTO && r==AUTO ))
+-            || style()->right().isStatic())
++    else if (parent()->style()->direction()==RTL && (l==AUTO && r==AUTO ))
+     {
+-        static_distance = m_staticX - cb->borderLeft(); // Should already have been set through layout of the parent().
+-        for (RenderObject* po = parent(); po && po != cb; po = po->parent())
+-            static_distance += po->xPos();
++        RenderObject* po = parent();
++        static_distance = m_staticX + cw + cb->borderRight() - po->width(); // Should already have been set through layout of the parent().
++        for (; po && po != cb; po = po->parent())
++            static_distance -= po->xPos();
+ 
+-        if (r==AUTO || style()->right().isStatic())
+-            r = static_distance;
++        r = static_distance;
+     }
+ 
+     int w = m_width, ml, mr, x;
+@@ -1460,14 +1467,18 @@
+     else if (!height.isVariable())
+     {
+         h = height.width(ch);
+-        if (ourHeight - pab > h)
+-            ourHeight = h + pab;
++        if (ourHeight - pab > h) {
++            if (!isTable())
++                ourHeight = h + pab;
++            else
++                h = ourHeight - pab;
++        }
+     }
+     else if (isReplaced())
+         h = intrinsicHeight();
+ 
+     int static_top=0;
+-    if ((t==AUTO && b==AUTO ) || style()->top().isStatic())
++    if (t==AUTO && b==AUTO)
+     {
+         // calc hypothetical location in the normal flow
+         // used for 1) top=static-position
+@@ -1478,7 +1489,7 @@
+         for (; po && po != cb; po = po->parent())
+             static_top += po->yPos();
+ 
+-        if (h==AUTO || style()->top().isStatic())
++        if (h==AUTO)
+             t = static_top;
+     }
+ 
+--- khtml/rendering/render_block.cpp	(revision 506549)
++++ khtml/rendering/render_block.cpp	(revision 515119)
+@@ -224,20 +224,27 @@
+ 
+     // If the requested beforeChild is not one of our children, then this is most likely because
+     // there is an anonymous block box within this object that contains the beforeChild. So
+-    // just insert the child into the anonymous block box instead of here.
++    // just insert the child into the anonymous block box instead of here. This may also be 
++    // needed in cases of things like anonymous tables.
+     if (beforeChild && beforeChild->parent() != this) {
+ 
+         KHTMLAssert(beforeChild->parent());
+-        KHTMLAssert(beforeChild->parent()->isAnonymousBlock());
++        
++        // In the special case where we are prepending a block-level element before
++        // something contained inside an anonymous block, we can just prepend it before
++        // the anonymous block.
++        if (!newChild->isInline() && beforeChild->parent()->isAnonymousBlock() &&
++            beforeChild->parent()->parent() == this && 
++            beforeChild->parent()->firstChild() == beforeChild)
++            return addChildToFlow(newChild, beforeChild->parent());
+ 
+-        if (newChild->isInline()) {
+-            beforeChild->parent()->addChild(newChild,beforeChild);
+-            return;
+-        }
+-        else if (beforeChild->parent()->firstChild() != beforeChild)
+-            return beforeChild->parent()->addChild(newChild, beforeChild);
+-        else
+-            return addChildToFlow(newChild, beforeChild->parent());
++        // Otherwise find our kid inside which the beforeChild is, and delegate to it.
++        // This may be many levels deep due to anonymous tables, table sections, etc.
++        RenderObject* responsible = beforeChild->parent();
++        while (responsible->parent() != this)
++            responsible = responsible->parent();
++
++        return responsible->addChild(newChild,beforeChild);
+     }
+ 
+     // prevent elements that haven't received a layout yet from getting painted by pushing
+@@ -286,7 +293,15 @@
+             RenderBlock* newBox = createAnonymousBlock();
+             RenderBox::addChild(newBox,beforeChild);
+             newBox->addChild(newChild);
+-            newBox->setPos(newBox->xPos(), -500000);
++
++            //the above may actually destroy newBox in case an anonymous
++            //table got created, and made the anonymous block redundant.
++            //so look up what to hide indirectly.
++            RenderObject* toHide = newChild;
++            while (toHide->parent() != this)
++                toHide = toHide->parent();
++
++            toHide->setPos(toHide->xPos(), -500000);
+             return;
+         }
+         else {
+@@ -588,6 +603,7 @@
+ 
+     clearFloats();
+ 
++    int previousHeight = m_height;
+     m_height = 0;
+     m_overflowHeight = 0;
+     m_clearStatus = CNONE;
+@@ -648,14 +664,14 @@
+     int oldHeight = m_height;
+     calcHeight();
+     if (oldHeight != m_height) {
+-        relayoutChildren = true;
+-
+         // If the block got expanded in size, then increase our overflowheight to match.
+         if (m_overflowHeight > m_height)
+             m_overflowHeight -= (borderBottom()+paddingBottom());
+         if (m_overflowHeight < m_height)
+             m_overflowHeight = m_height;
+     }
++    if (previousHeight != m_height)
++        relayoutChildren = true;
+ 
+     if (isTableCell()) {
+         // Table cells need to grow to accommodate both overhanging floats and
+@@ -737,19 +753,22 @@
+     }
+ 
+     if (child->isBox() && child->hasStaticY()) {
+-        int marginOffset = 0;
++        int y = m_height;
+         if (!marginInfo.canCollapseWithTop()) {
++            child->calcVerticalMargins();
++            int marginTop = child->marginTop(); 
+             int collapsedTopPos = marginInfo.posMargin();
+             int collapsedTopNeg = marginInfo.negMargin();
+-            bool posMargin = child->marginTop() >= 0;
+-            if (posMargin && child->marginTop() > collapsedTopPos)
+-                collapsedTopPos = child->marginTop();
+-            else if (!posMargin && child->marginTop() > collapsedTopNeg)
+-                collapsedTopNeg = child->marginTop();
+-            marginOffset += (collapsedTopPos - collapsedTopNeg) - child->marginTop();
++            if (marginTop > 0) {
++                if (marginTop > collapsedTopPos)
++                    collapsedTopPos = marginTop;
++            } else {
++                if (-marginTop > collapsedTopNeg)
++                    collapsedTopNeg = -marginTop;
++            }
++            y += (collapsedTopPos - collapsedTopNeg) - marginTop;
+         }
+-
+-        static_cast<RenderBox*>(child)->setStaticY(m_height + marginOffset);
++        static_cast<RenderBox*>(child)->setStaticY(y);
+     }
+ }
+ 
+@@ -1031,7 +1050,7 @@
+             // So go ahead and mark the item as dirty.
+             child->setChildNeedsLayout(true);
+ 
+-        if (!child->flowAroundFloats() || child->hasFloats())
++        if (!child->flowAroundFloats() && child->hasFloats())
+             child->markAllDescendantsWithFloatsForLayout();
+ 
+         // Our guess was wrong. Make the child lay itself out again.
+@@ -1304,9 +1323,9 @@
+         int oldTopNegMargin = m_maxTopNegMargin;
+ 
+         // make sure we relayout children if we need it.
+-        if (relayoutChildren ||
++        if (!isPositioned() && (relayoutChildren ||
+             (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())) ||
+-            (child->isRenderBlock() && child->style()->height().isPercent()))
++            (child->isRenderBlock() && child->style()->height().isPercent())))
+             child->setChildNeedsLayout(true);
+ 
+         // Handle the four types of special elements first.  These include positioned content, floating content, compacts and
+@@ -1388,7 +1407,7 @@
+ 
+         // See if this child has made our overflow need to grow.
+         int rightChildPos = child->xPos() + kMax(child->effectiveWidth(), (int)child->width());
+-        if (child->isRelPositioned()) {
++        if (child->isRelPositioned() && (hasOverflowClip() || !isTableCell())) {
+             // CSS 2.1-9.4.3 - allow access to relatively positioned content
+             // ### left overflow support
+             int xoff = 0, yoff = 0;
+@@ -1520,7 +1539,7 @@
+                 r->repaintDuringLayout();
+                 r->setMarkedForRepaint(false);
+             }
+-            if ( relayoutChildren || (r->hasStaticY() && r->parent() != this && r->parent()->isBlockFlow()) )
++            if ( relayoutChildren || ((r->hasStaticY()||r->hasStaticX()) && r->parent() != this && r->parent()->isBlockFlow()) )
+                 r->setChildNeedsLayout(true);
+             r->layoutIfNeeded();
+             if (adjOverflow && r->style()->position() == ABSOLUTE) {
+--- khtml/rendering/render_arena.h	(revision 506549)
++++ khtml/rendering/render_arena.h	(revision 515119)
+@@ -37,6 +37,7 @@
+ #define RENDERARENA_H
+ 
+ #include "misc/arena.h"
++#include "misc/shared.h"
+ 
+ #include <stdlib.h>
+ 
+@@ -45,7 +46,7 @@
+ #define KHTML_MAX_RECYCLED_SIZE 400
+ #define KHTML_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
+ 
+-class RenderArena {
++class RenderArena: public Shared<RenderArena> {
+ public:
+    RenderArena(unsigned int arenaSize = 4096);
+     ~RenderArena();
+--- khtml/dom/html_form.h	(revision 506549)
++++ khtml/dom/html_form.h	(revision 515119)
+@@ -640,6 +640,52 @@
+      * "Button", "Checkbox", "Radio", "Reset", or "Submit".
+      */
+     void click (  );
++
++
++    /**
++     * Returns the character offset of beginning of selection, or if none,
++     * the cursor position.
++     * This operation is only supported if the type of this element is text;
++     * otherwise -1 is returned.
++     * NOTE: this method is not part of the DOM, but a Mozilla extension
++     * @since 3.5.2
++     */
++    long selectionStart();
++
++     /**
++      * Move the beginning of the selection to the given offset in text
++      * This call has no effect if the type of this input element isn't text
++      * NOTE: this method is not part of the DOM, but a Mozilla extension
++      * @since 3.5.2
++      */
++    void setSelectionStart(long offset);
++
++    /**
++     * Returns the character offset of end of selection, or if none,
++     * the cursor position.
++     * This operation is only supported if the type of this element is text;
++     * otherwise -1 is returned.
++     * NOTE: this method is not part of the DOM, but a Mozilla extension
++     * @since 3.5.2
++     */
++     long selectionEnd();
++
++     /**
++      * Move the end of the selection (and the cursor) to the given offset in text
++      * This call has no effect if the type of this input element isn't text
++      * NOTE: this method is not part of the DOM, but a Mozilla extension
++      * @since 3.5.2
++      */
++    void setSelectionEnd(long offset);
++
++     /**
++      * Makes the position span from start to end, and positions the cursor after the selection.
++      * This call has no effect if the type of this input element isn't text or if it is not rendered.
++      * NOTE: this method is not part of the DOM, but a Mozilla extension
++      * @since 3.5.2
++      */
++    void setSelectionRange(long start, long end);
++
+ };
+ 
+ // --------------------------------------------------------------------------
+@@ -1186,6 +1232,12 @@
+       */
+     void setSelectionEnd(long offset);
+ 
++     /**
++      * Selects the text from start to end, and positions the cursor after the selection.
++      * NOTE: this method is not part of the DOM, but a Mozilla extension
++      * @since 3.5.2
++      */
++    void setSelectionRange(long start, long end);
+ 
+      /**
+       * Returns the length of the text.
+--- khtml/dom/html_form.cpp	(revision 506549)
++++ khtml/dom/html_form.cpp	(revision 515119)
+@@ -570,6 +570,38 @@
+ 	((HTMLInputElementImpl *)impl)->click(  );
+ }
+ 
++long HTMLInputElement::selectionStart()
++{
++    if (impl)
++	return ((HTMLInputElementImpl *)impl)->selectionStart(  );
++    return -1;
++}
++
++long HTMLInputElement::selectionEnd()
++{
++    if (impl)
++	return ((HTMLInputElementImpl *)impl)->selectionEnd(  );
++    return -1;
++}
++
++void HTMLInputElement::setSelectionStart(long pos)
++{
++    if (impl)
++	((HTMLInputElementImpl *)impl)->setSelectionStart( pos );
++}
++
++void HTMLInputElement::setSelectionEnd(long pos)
++{
++    if (impl)
++	((HTMLInputElementImpl *)impl)->setSelectionEnd( pos );
++}
++
++void HTMLInputElement::setSelectionRange(long start, long end)
++{
++    if (impl)
++	((HTMLInputElementImpl *)impl)->setSelectionRange( start, end );
++}
++
+ // --------------------------------------------------------------------------
+ 
+ HTMLLabelElement::HTMLLabelElement() : HTMLElement()
+@@ -1098,6 +1130,11 @@
+ 	((HTMLTextAreaElementImpl *)impl)->setSelectionEnd( pos );
+ }
+ 
++void HTMLTextAreaElement::setSelectionRange(long start, long end)
++{
++    if (impl)
++	((HTMLTextAreaElementImpl *)impl)->setSelectionRange( start, end );
++}
+ 
+ // --------------------------------------------------------------------------
+ 
+--- khtml/khtml_browser.rc	(revision 506549)
++++ khtml/khtml_browser.rc	(revision 515119)
+@@ -27,10 +27,11 @@
+   <Action name="useStylesheet" />
+   <ActionList name="debugScriptList" />
+ 
++<!--
+   <Separator />
+   <Action name="debugRenderTree" />
+   <Action name="debugDOMTree" />
+-
++-->
+  </Menu>
+ </MenuBar>
+ <ToolBar name="mainToolBar"><text>Main Toolbar</text>
+--- khtml/ChangeLog	(revision 506549)
++++ khtml/ChangeLog	(revision 515119)
+@@ -1,3 +1,31 @@
++2006-03-01  Germain Garand  <germain at ebooksfrance.org>
++
++        Improve selectorText
++
++        * css/css_base.cpp (extractPseudoType): don't reset 'value' after parsing the pseudo-style, we need it for selectorText.
++          (selectorText): - correctly handle CSS3 pseudo selectors,
++                          - merge some improvements from WebCore (Mitz Pettel sub-selector patch + fix ::Set handling)
++        * css/css_ruleimpl.cpp (selectorText): handle of multiple, comma-separated selectors
++
++2006-02-28  Germain Garand  <germain at ebooksfrance.org>
++         
++        Common-case style selection optimisation inspired from WebCore.
++
++        * css/css_base.cpp/.h: add 'Class' to possible matching modes
++        * css/cssstyleselector.cpp: treat 'Class' extra, not anymore as an ordinary List.
++        * css/parser.cpp/y: use 'Class' matching mode 
++        * html/html_elementimpl.cpp: when parsing ATTR_CLASS, set a boolean to remember if it is or not a class list.
++        * xml/dom_elementimpl.{cpp,h}: add m_hasClassList boolean + setter/getter
++
++2006-02-28  Germain Garand  <germain at ebooksfrance.org>
++
++        * rendering/render_object.cpp (dirtyFormattingContext): be more efficient with inlineflow objects.
++        * rendering/render_block.cpp (layoutBlockChildren): be more efficient with regard to positioned objects relayout. 
++        Merge WC margin-collapse regression fix (WC/#3508). 
++        (layoutPositionedObjects) Objects with staticX() need a relayout too.
++        * rendering/render_canvas.cpp (layout): no need to relayout positioned objects here. This would mark entire branches of the tree 
++        as needing a layout, thus stalling update requests in those branches (#116626)
++
+ 2006-01-14  Allan Sandfeld Jensen <kde at carewolf.com>
+ 
+         * rendering/render_image.cpp (calcReplacedWidth,calcReplacedHeight):
+--- khtml/css/html4.css	(revision 506549)
++++ khtml/css/html4.css	(revision 515119)
+@@ -173,6 +173,7 @@
+ 	text-align: -khtml-auto;
+ 	border-spacing: 2px;
+         -khtml-flow-mode: -khtml-around-floats;
++        box-sizing: border-box;
+ }
+ 
+ TABLE[align="center"] {
+--- khtml/css/css_renderstyledeclarationimpl.h	(revision 506549)
++++ khtml/css/css_renderstyledeclarationimpl.h	(revision 515119)
+@@ -25,7 +25,6 @@
+ #include "dom/dom_string.h"
+ #include "rendering/render_style.h"
+ 
+-class RenderObject;
+ 
+ namespace DOM {
+     class NodeImpl;
+@@ -33,6 +32,9 @@
+ 
+ namespace khtml {
+ 
++class RenderObject;
++
++
+ // Used by DOM::Counter::listStyle()
+ DOM::DOMString stringForListStyleType(khtml::EListStyleType type);
+ 
+@@ -48,6 +50,7 @@
+     DOM::CSSValueImpl *getPropertyCSSValue( int propertyID ) const;
+     DOM::DOMString getPropertyValue( int propertyID ) const;
+     bool getPropertyPriority( int propertyID ) const;
++    unsigned long length() const;
+ 
+     DOM::DOMString removeProperty( int propertyID, bool NonCSSHints = false );
+     bool setProperty ( int propertyId, const DOM::DOMString &value, bool important = false,
+--- khtml/css/css_valueimpl.cpp	(revision 506549)
++++ khtml/css/css_valueimpl.cpp	(revision 515119)
+@@ -2,7 +2,7 @@
+  * This file is part of the DOM implementation for KDE.
+  *
+  * Copyright (C) 1999-2003 Lars Knoll (knoll at kde.org)
+- *           (C) 2002 Apple Computer, Inc.
++ *           (C) 2004 Apple Computer, Inc.
+  *           (C) 2005 Allan Sandfeld Jensen (kde at carewolf.com)
+  *
+  * This library is free software; you can redistribute it and/or
+@@ -52,6 +52,17 @@
+ 
+ using namespace DOM;
+ 
++// Quotes the string if it needs quoting.
++static DOMString quoteStringIfNeeded(const DOMString &string)
++{
++    // FIXME: Also need to transform control characters into \ sequences.
++    QString s = string.string();
++    s.replace('\\', "\\\\");
++    s.replace('\'', "\\'");
++    return '\'' + s + '\'';
++}
++
++
+ CSSStyleDeclarationImpl::CSSStyleDeclarationImpl(CSSRuleImpl *parent)
+     : StyleBaseImpl(parent)
+ {
+@@ -701,7 +712,7 @@
+ 	    // ###
+ 	    break;
+ 	case CSSPrimitiveValue::CSS_STRING:
+-	    // ###
++	    text = quoteStringIfNeeded(m_value.string);
+ 	    break;
+ 	case CSSPrimitiveValue::CSS_URI:
+             text  = "url(";
+--- khtml/css/cssstyleselector.h	(revision 506549)
++++ khtml/css/cssstyleselector.h	(revision 515119)
+@@ -149,7 +149,7 @@
+ 	    with given relationships matches the given Element */
+ 	void checkSelector(int selector, DOM::ElementImpl *e);
+ 	/* checks if the selector matches the given Element */
+-	bool checkOneSelector(DOM::CSSSelector *selector, DOM::ElementImpl *e);
++	bool checkOneSelector(DOM::CSSSelector *selector, DOM::ElementImpl *e, bool isSubSelector = false);
+ 
+ #ifdef APPLE_CHANGES
+ 	/* This function fixes up the default font size if it detects that the
+--- khtml/css/parser.y	(revision 506549)
++++ khtml/css/parser.y	(revision 515119)
+@@ -691,7 +691,7 @@
+ class:
+     '.' IDENT {
+ 	$$ = new CSSSelector();
+-	$$->match = CSSSelector::List;
++	$$->match = CSSSelector::Class;
+ 	$$->attr = ATTR_CLASS;
+ 	$$->value = domString($2);
+     }
+--- khtml/css/css_base.cpp	(revision 506549)
++++ khtml/css/css_base.cpp	(revision 515119)
+@@ -144,6 +144,7 @@
+     case Exact:
+     case Set:
+     case List:
++    case Class:
+     case Hyphen:
+     case PseudoClass:
+     case PseudoElement:
+@@ -278,7 +279,6 @@
+     else
+     if (match == PseudoElement && !element)
+         _pseudoType = PseudoOther;
+-    value = DOMString();
+ }
+ 
+ 
+@@ -312,38 +312,19 @@
+     DOMString str;
+     const CSSSelector* cs = this;
+     Q_UINT16 tag = localNamePart(cs->tag);
+-    if ( tag == anyLocalName && cs->attr == ATTR_ID && cs->match == CSSSelector::Id )
+-    {
+-        str = "#";
+-        str += cs->value;
+-    }
+-    else if ( tag == anyLocalName && cs->attr == ATTR_CLASS && cs->match == CSSSelector::List )
+-    {
+-        str = ".";
+-        str += cs->value;
+-    }
+-    else if ( tag == anyLocalName && cs->match == CSSSelector::PseudoClass )
+-    {
+-        str = ":";
+-        str += cs->value;
+-    }
+-    else if ( tag == anyLocalName && cs->match == CSSSelector::PseudoElement )
+-    {
+-        str = "::";
+-        str += cs->value;
+-    }
+-    else
+-    {
+-        if ( tag == anyLocalName )
+-            str = "*";
+-        else if ( tag != anyLocalName )
+-            str = getTagName( cs->tag );
++    if (tag == anyLocalName && cs->match == CSSSelector::None)
++        str = "*";
++    else if (tag != anyLocalName)
++        str = getTagName( cs->tag );
++          
++    const CSSSelector* op = 0;
++    while (true) {
+         if ( cs->attr == ATTR_ID && cs->match == CSSSelector::Id )
+         {
+             str += "#";
+             str += cs->value;
+         }
+-        else if ( cs->attr == ATTR_CLASS && cs->match == CSSSelector::List )
++        else if ( cs->match == CSSSelector::Class )
+         {
+             str += ".";
+             str += cs->value;
+@@ -352,6 +333,14 @@
+         {
+             str += ":";
+             str += cs->value;
++            if (!cs->string_arg.isEmpty()) { // e.g :nth-child(...)
++                str += cs->string_arg;
++                str += ")";
++            } else if (cs->simpleSelector && !op) { // :not(...)
++                op = cs;
++                cs = cs->simpleSelector;
++                continue;
++            }
+         }
+         else if ( cs->match == CSSSelector::PseudoElement )
+         {
+@@ -368,7 +357,6 @@
+                 str += "=";
+                 break;
+             case CSSSelector::Set:
+-                str += " "; // ## correct?
+                 break;
+             case CSSSelector::List:
+                 str += "~=";
+@@ -388,11 +376,24 @@
+             default:
+                 kdWarning(6080) << "Unhandled case in CSSStyleRuleImpl::selectorText : match=" << cs->match << endl;
+             }
+-            str += "\"";
+-            str += cs->value;
+-            str += "\"]";
++            if (cs->match != CSSSelector::Set) {
++                str += "\"";
++                str += cs->value;
++                str += "\"";
++            }
++            str += "]";
+         }
++        if (op && !cs->tagHistory) {
++            cs=op;
++            op=0;
++            str += ")";
++        }
++            
++        if ((cs->relation != CSSSelector::SubSelector && !op) || !cs->tagHistory)
++            break;
++        cs = cs->tagHistory;
+     }
++    
+     if ( cs->tagHistory ) {
+         DOMString tagHistoryText = cs->tagHistory->selectorText();
+         if ( cs->relation == DirectAdjacent )
+@@ -401,8 +402,6 @@
+             str = tagHistoryText + " ~ " + str;
+         else if ( cs->relation == Child )
+             str = tagHistoryText + " > " + str;
+-        else if ( cs->relation == SubSelector )
+-            str += tagHistoryText; // the ":" is provided by selectorText()
+         else // Descendant
+             str = tagHistoryText + " " + str;
+     }
+--- khtml/css/parser.cpp	(revision 506549)
++++ khtml/css/parser.cpp	(revision 515119)
+@@ -2072,7 +2072,7 @@
+ 
+     {
+ 	yyval.selector = new CSSSelector();
+-	yyval.selector->match = CSSSelector::List;
++	yyval.selector->match = CSSSelector::Class;
+ 	yyval.selector->attr = ATTR_CLASS;
+ 	yyval.selector->value = domString(yyvsp[0].string);
+     ;}
+--- khtml/css/css_renderstyledeclarationimpl.cpp	(revision 506549)
++++ khtml/css/css_renderstyledeclarationimpl.cpp	(revision 515119)
+@@ -2,7 +2,7 @@
+  * css_renderstyledeclarationimpl.cpp
+  *
+  * Copyright (C)  2004  Zack Rusin <zack at kde.org>
+- * Copyright (C)  2004  Apple Computer, Inc.
++ * Copyright (C)  2004,2005 Apple Computer, Inc.
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -25,11 +25,102 @@
+ #include "rendering/render_object.h"
+ 
+ #include "cssproperties.h"
++#include "cssvalues.h"
+ 
+ using namespace DOM;
+ using namespace khtml;
+ 
++// List of all properties we know how to compute, omitting shorthands.
++static const int computedProperties[] = {
++    CSS_PROP_BACKGROUND_COLOR,
++    CSS_PROP_BACKGROUND_IMAGE,
++    CSS_PROP_BACKGROUND_REPEAT,
++    CSS_PROP_BACKGROUND_ATTACHMENT,
++    CSS_PROP_BACKGROUND_POSITION,
++    CSS_PROP_BACKGROUND_POSITION_X,
++    CSS_PROP_BACKGROUND_POSITION_Y,
++    CSS_PROP_BORDER_COLLAPSE,
++    CSS_PROP_BORDER_SPACING,
++    CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING,
++    CSS_PROP__KHTML_BORDER_VERTICAL_SPACING,
++    CSS_PROP_BORDER_TOP_COLOR,
++    CSS_PROP_BORDER_RIGHT_COLOR,
++    CSS_PROP_BORDER_BOTTOM_COLOR,
++    CSS_PROP_BORDER_LEFT_COLOR,
++    CSS_PROP_BORDER_TOP_STYLE,
++    CSS_PROP_BORDER_RIGHT_STYLE,
++    CSS_PROP_BORDER_BOTTOM_STYLE,
++    CSS_PROP_BORDER_LEFT_STYLE,
++    CSS_PROP_BORDER_TOP_WIDTH,
++    CSS_PROP_BORDER_RIGHT_WIDTH,
++    CSS_PROP_BORDER_BOTTOM_WIDTH,
++    CSS_PROP_BORDER_LEFT_WIDTH,
++    CSS_PROP_BOTTOM,
++    CSS_PROP_CAPTION_SIDE,
++    CSS_PROP_CLEAR,
++    CSS_PROP_COLOR,
++    CSS_PROP_CURSOR,
++    CSS_PROP_DIRECTION,
++    CSS_PROP_DISPLAY,
++    CSS_PROP_EMPTY_CELLS,
++    CSS_PROP_FLOAT,
++    CSS_PROP_FONT_FAMILY,
++    CSS_PROP_FONT_SIZE,
++    CSS_PROP_FONT_STYLE,
++    CSS_PROP_FONT_VARIANT,
++    CSS_PROP_FONT_WEIGHT,
++    CSS_PROP_HEIGHT,
++    CSS_PROP_LEFT,
++    CSS_PROP_LETTER_SPACING,
++    CSS_PROP_LINE_HEIGHT,
++    CSS_PROP_LIST_STYLE_IMAGE,
++    CSS_PROP_LIST_STYLE_POSITION,
++    CSS_PROP_LIST_STYLE_TYPE,
++    CSS_PROP_MARGIN_TOP,
++    CSS_PROP_MARGIN_RIGHT,
++    CSS_PROP_MARGIN_BOTTOM,
++    CSS_PROP_MARGIN_LEFT,
++    CSS_PROP__KHTML_MARQUEE_DIRECTION,
++    CSS_PROP__KHTML_MARQUEE_INCREMENT,
++    CSS_PROP__KHTML_MARQUEE_REPETITION,
++    CSS_PROP__KHTML_MARQUEE_STYLE,
++    CSS_PROP_MAX_HEIGHT,
++    CSS_PROP_MAX_WIDTH,
++    CSS_PROP_MIN_HEIGHT,
++    CSS_PROP_MIN_WIDTH,
++    CSS_PROP_OPACITY,
++    CSS_PROP_ORPHANS,
++    CSS_PROP_OUTLINE_STYLE,
++    CSS_PROP_OVERFLOW,
++    CSS_PROP_PADDING_TOP,
++    CSS_PROP_PADDING_RIGHT,
++    CSS_PROP_PADDING_BOTTOM,
++    CSS_PROP_PADDING_LEFT,
++    CSS_PROP_PAGE_BREAK_AFTER,
++    CSS_PROP_PAGE_BREAK_BEFORE,
++    CSS_PROP_PAGE_BREAK_INSIDE,
++    CSS_PROP_POSITION,
++    CSS_PROP_RIGHT,
++    CSS_PROP_TABLE_LAYOUT,
++    CSS_PROP_TEXT_ALIGN,
++    CSS_PROP_TEXT_DECORATION,
++    CSS_PROP_TEXT_INDENT,
++    CSS_PROP_TEXT_SHADOW,
++    CSS_PROP_TEXT_TRANSFORM,
++    CSS_PROP_TOP,
++    CSS_PROP_UNICODE_BIDI,
++    CSS_PROP_VERTICAL_ALIGN,
++    CSS_PROP_VISIBILITY,
++    CSS_PROP_WHITE_SPACE,
++    CSS_PROP_WIDOWS,
++    CSS_PROP_WIDTH,
++    CSS_PROP_WORD_SPACING,
++    CSS_PROP_Z_INDEX,
++};
+ 
++const unsigned numComputedProperties = sizeof(computedProperties) / sizeof(computedProperties[0]);
++
++
+ static CSSValueImpl *valueForLength(const Length &length, int max)
+ {
+     if (length.isPercent()) {
+@@ -40,58 +131,58 @@
+     }
+ }
+ 
+-static DOMString stringForBorderStyle(EBorderStyle style)
++static CSSValueImpl *valueForBorderStyle(EBorderStyle style)
+ {
+     switch (style) {
+     case khtml::BNATIVE:
+-        return "-khtml-native";
++        return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_NATIVE);
+     case khtml::BNONE:
+-        return "none";
++        return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
+     case khtml::BHIDDEN:
+-        return "hidden";
++        return new CSSPrimitiveValueImpl(CSS_VAL_HIDDEN);
+     case khtml::INSET:
+-        return "inset";
++        return new CSSPrimitiveValueImpl(CSS_VAL_INSET);
+     case khtml::GROOVE:
+-        return "groove";
++        return new CSSPrimitiveValueImpl(CSS_VAL_GROOVE);
+     case khtml::RIDGE:
+-        return "ridge";
++         return new CSSPrimitiveValueImpl(CSS_VAL_RIDGE);
+     case khtml::OUTSET:
+-        return "outset";
++        return new CSSPrimitiveValueImpl(CSS_VAL_OUTSET);
+     case khtml::DOTTED:
+-        return "dotted";
++        return new CSSPrimitiveValueImpl(CSS_VAL_DOTTED);
+     case khtml::DASHED:
+-        return "dashed";
++        return new CSSPrimitiveValueImpl(CSS_VAL_DASHED);
+     case khtml::SOLID:
+-        return "solid";
++        return new CSSPrimitiveValueImpl(CSS_VAL_SOLID);
+     case khtml::DOUBLE:
+-        return "double";
++        return new CSSPrimitiveValueImpl(CSS_VAL_DOUBLE);
+     }
+     Q_ASSERT( 0 );
+-    return "";
++    return 0;
+ }
+ 
+-static DOMString stringForTextAlign(ETextAlign align)
++static CSSValueImpl *valueForTextAlign(ETextAlign align)
+ {
+     switch (align) {
+     case khtml::TAAUTO:
+-        return "auto";
++        return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
+     case khtml::LEFT:
+-        return "left";
++        return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
+     case khtml::RIGHT:
+-        return "right";
++        return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
+     case khtml::CENTER:
+-        return "center";
++        return new CSSPrimitiveValueImpl(CSS_VAL_CENTER);
+     case khtml::JUSTIFY:
+-        return "justify";
++        return new CSSPrimitiveValueImpl(CSS_VAL_JUSTIFY);
+     case khtml::KHTML_LEFT:
+-        return "-khtml-left";
++        return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_LEFT);
+     case khtml::KHTML_RIGHT:
+-        return "-khtml-right";
++        return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_RIGHT);
+     case khtml::KHTML_CENTER:
+-        return "-khtml-center";
++        return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_CENTER);
+     }
+     Q_ASSERT( 0 );
+-    return "";
++    return 0;
+ }
+ 
+ DOMString khtml::stringForListStyleType(EListStyleType type)
+@@ -174,6 +265,61 @@
+     return "";
+ }
+ 
++static CSSValueImpl* valueForShadow(const ShadowData *shadow)
++{
++    if (!shadow)
++        return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
++    CSSValueListImpl *list = new CSSValueListImpl;
++    for (const ShadowData *s = shadow; s; s = s->next) {
++        CSSPrimitiveValueImpl *x = new CSSPrimitiveValueImpl(s->x, CSSPrimitiveValue::CSS_PX);
++        CSSPrimitiveValueImpl *y = new CSSPrimitiveValueImpl(s->y, CSSPrimitiveValue::CSS_PX);
++        CSSPrimitiveValueImpl *blur = new CSSPrimitiveValueImpl(s->blur, CSSPrimitiveValue::CSS_PX);
++        CSSPrimitiveValueImpl *color = new CSSPrimitiveValueImpl(s->color.rgb());
++        list->append(new ShadowValueImpl(x, y, blur, color));
++    }
++    return list;
++}
++
++static CSSValueImpl *getPositionOffsetValue(RenderObject *renderer, int propertyID)
++{
++    if (!renderer)
++        return 0;
++
++    RenderStyle *style = renderer->style();
++    if (!style)
++        return 0;
++
++    Length l;
++    switch (propertyID) {
++    case CSS_PROP_LEFT:
++        l = style->left();
++        break;
++    case CSS_PROP_RIGHT:
++        l = style->right();
++        break;
++    case CSS_PROP_TOP:
++        l = style->top();
++        break;
++    case CSS_PROP_BOTTOM:
++        l = style->bottom();
++        break;
++    default:
++        return 0;
++    }
++
++    if (renderer->isPositioned())
++        return valueForLength(l, renderer->contentWidth());
++    
++    if (renderer->isRelPositioned())
++        // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
++        // In other words if left is auto and right is not auto, then left's computed value is negative right.
++        // So we should get the opposite length unit and see if it is auto.
++        return valueForLength(l, renderer->contentWidth());
++    
++    return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++ }
++
++
+ RenderStyleDeclarationImpl::RenderStyleDeclarationImpl( DOM::NodeImpl *node )
+     : CSSStyleDeclarationImpl(0), m_node(node)
+ {
+@@ -187,7 +333,18 @@
+ 
+ DOM::DOMString RenderStyleDeclarationImpl::cssText() const
+ {
+-    return DOMString();
++    DOMString result;
++
++    for (unsigned i = 0; i < numComputedProperties; i++) {
++        if (i != 0)
++            result += " ";
++        result += getPropertyName(computedProperties[i]);
++        result += ": ";
++        result += getPropertyValue(computedProperties[i]);
++        result += ";";
++    }
++
++    return result;
+ }
+ 
+ void RenderStyleDeclarationImpl::setCssText( DOM::DOMString )
+@@ -222,25 +379,25 @@
+         if (style->backgroundImage())
+             return new CSSPrimitiveValueImpl(style->backgroundImage()->url(),
+                                              CSSPrimitiveValue::CSS_URI);
+-        return 0;
++        return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
+     case CSS_PROP_BACKGROUND_REPEAT:
+         switch (style->backgroundRepeat()) {
+         case khtml::REPEAT:
+-            return new CSSPrimitiveValueImpl("repeat", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_REPEAT);
+         case khtml::REPEAT_X:
+-            return new CSSPrimitiveValueImpl("repeat-x", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_REPEAT_X);
+         case khtml::REPEAT_Y:
+-            return new CSSPrimitiveValueImpl("repeat-y", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_REPEAT_Y);
+         case khtml::NO_REPEAT:
+-            return new CSSPrimitiveValueImpl("no-repeat", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_NO_REPEAT);
+         default:
+             Q_ASSERT( 0 );
+         }
+     case CSS_PROP_BACKGROUND_ATTACHMENT:
+         if (style->backgroundAttachment())
+-            return new CSSPrimitiveValueImpl("scroll", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_SCROLL);
+         else
+-            return new CSSPrimitiveValueImpl("fixed", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_FIXED);
+     case CSS_PROP_BACKGROUND_POSITION:
+     {
+         DOMString string;
+@@ -263,9 +420,9 @@
+         return valueForLength(style->backgroundYPosition(), renderer->contentHeight());
+     case CSS_PROP_BORDER_COLLAPSE:
+         if (style->borderCollapse())
+-            return new CSSPrimitiveValueImpl("collapse", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_COLLAPSE);
+         else
+-            return new CSSPrimitiveValueImpl("separate", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_SEPARATE);
+     case CSS_PROP_BORDER_SPACING:
+     {
+         QString string(QString::number(style->borderHorizontalSpacing()) +
+@@ -281,7 +438,7 @@
+         return new CSSPrimitiveValueImpl(style->borderVerticalSpacing(),
+                                          CSSPrimitiveValue::CSS_PX);
+     case CSS_PROP_BORDER_TOP_COLOR:
+-        return new CSSPrimitiveValueImpl(style->borderLeftColor().rgb());
++        return new CSSPrimitiveValueImpl(style->borderTopColor().rgb());
+     case CSS_PROP_BORDER_RIGHT_COLOR:
+         return new CSSPrimitiveValueImpl(style->borderRightColor().rgb());
+     case CSS_PROP_BORDER_BOTTOM_COLOR:
+@@ -289,17 +446,13 @@
+     case CSS_PROP_BORDER_LEFT_COLOR:
+         return new CSSPrimitiveValueImpl(style->borderLeftColor().rgb());
+     case CSS_PROP_BORDER_TOP_STYLE:
+-        return new CSSPrimitiveValueImpl(stringForBorderStyle(style->borderTopStyle()),
+-                                         CSSPrimitiveValue::CSS_STRING);
++        return valueForBorderStyle(style->borderTopStyle());
+     case CSS_PROP_BORDER_RIGHT_STYLE:
+-        return new CSSPrimitiveValueImpl(stringForBorderStyle(style->borderRightStyle()),
+-                                         CSSPrimitiveValue::CSS_STRING);
++        return valueForBorderStyle(style->borderRightStyle());
+     case CSS_PROP_BORDER_BOTTOM_STYLE:
+-        return new CSSPrimitiveValueImpl(stringForBorderStyle(style->borderBottomStyle()),
+-                                         CSSPrimitiveValue::CSS_STRING);
++        return valueForBorderStyle(style->borderBottomStyle());
+     case CSS_PROP_BORDER_LEFT_STYLE:
+-        return new CSSPrimitiveValueImpl(stringForBorderStyle(style->borderLeftStyle()),
+-                                         CSSPrimitiveValue::CSS_STRING);
++        return valueForBorderStyle(style->borderLeftStyle());
+     case CSS_PROP_BORDER_TOP_WIDTH:
+         return new CSSPrimitiveValueImpl( style->borderTopWidth(), CSSPrimitiveValue::CSS_PX );
+     case CSS_PROP_BORDER_RIGHT_WIDTH:
+@@ -309,10 +462,32 @@
+     case CSS_PROP_BORDER_LEFT_WIDTH:
+         return new CSSPrimitiveValueImpl( style->borderLeftWidth(), CSSPrimitiveValue::CSS_PX );
+     case CSS_PROP_BOTTOM:
+-        break;
++        return getPositionOffsetValue(renderer, CSS_PROP_BOTTOM);
+     case CSS_PROP_CAPTION_SIDE:
++        switch (style->captionSide()) {
++        case CAPLEFT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
++        case CAPRIGHT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
++        case CAPTOP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TOP);
++        case CAPBOTTOM:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BOTTOM);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_CLEAR:
++        switch (style->clear()) {
++        case CNONE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
++        case CLEFT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
++        case CRIGHT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
++        case CBOTH:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BOTH);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_CLIP:
+         break;
+@@ -325,69 +500,114 @@
+     case CSS_PROP_COUNTER_RESET:
+         break;
+     case CSS_PROP_CURSOR:
++        switch (style->cursor()) {
++        case CURSOR_AUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case CURSOR_CROSS:
++            return new CSSPrimitiveValueImpl(CSS_VAL_CROSSHAIR);
++        case CURSOR_DEFAULT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_DEFAULT);
++        case CURSOR_POINTER:
++            return new CSSPrimitiveValueImpl(CSS_VAL_POINTER);
++        case CURSOR_MOVE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_MOVE);
++        case CURSOR_PROGRESS:
++            return new CSSPrimitiveValueImpl(CSS_VAL_PROGRESS);
++        case CURSOR_E_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_E_RESIZE);
++        case CURSOR_NE_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NE_RESIZE);
++        case CURSOR_NW_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NW_RESIZE);
++        case CURSOR_N_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_N_RESIZE);
++        case CURSOR_SE_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SE_RESIZE);
++        case CURSOR_SW_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SW_RESIZE);
++        case CURSOR_S_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_S_RESIZE);
++        case CURSOR_W_RESIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_W_RESIZE);
++        case CURSOR_TEXT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TEXT);
++        case CURSOR_WAIT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_WAIT);
++        case CURSOR_HELP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_HELP);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_DIRECTION:
++        switch (style->direction()) {
++        case LTR:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LTR);
++        case RTL:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RTL);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_DISPLAY:
+         switch (style->display()) {
+-        case khtml::INLINE:
+-            return new CSSPrimitiveValueImpl("inline", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::BLOCK:
+-            return new CSSPrimitiveValueImpl("block", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::LIST_ITEM:
+-            return new CSSPrimitiveValueImpl("list-item", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::RUN_IN:
+-            return new CSSPrimitiveValueImpl("run-in", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::COMPACT:
+-            return new CSSPrimitiveValueImpl("compact", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::INLINE_BLOCK:
+-            return new CSSPrimitiveValueImpl("inline-block", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE:
+-            return new CSSPrimitiveValueImpl("table", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::INLINE_TABLE:
+-            return new CSSPrimitiveValueImpl("inline-table", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_ROW_GROUP:
+-            return new CSSPrimitiveValueImpl("table-row-group", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_HEADER_GROUP:
+-            return new CSSPrimitiveValueImpl("table-header-group", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_FOOTER_GROUP:
+-            return new CSSPrimitiveValueImpl("table-footer-group", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_ROW:
+-            return new CSSPrimitiveValueImpl("table-row", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_COLUMN_GROUP:
+-            return new CSSPrimitiveValueImpl("table-column-group", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_COLUMN:
+-            return new CSSPrimitiveValueImpl("table-column", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_CELL:
+-            return new CSSPrimitiveValueImpl("table-cell", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TABLE_CAPTION:
+-            return new CSSPrimitiveValueImpl("table-caption", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::NONE:
+-            return new CSSPrimitiveValueImpl("none", CSSPrimitiveValue::CSS_STRING);
+-        default:
+-            Q_ASSERT( 0 );
++        case INLINE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_INLINE);
++        case BLOCK:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BLOCK);
++        case LIST_ITEM:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LIST_ITEM);
++        case RUN_IN:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RUN_IN);
++        case COMPACT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_COMPACT);
++        case INLINE_BLOCK:
++            return new CSSPrimitiveValueImpl(CSS_VAL_INLINE_BLOCK);
++        case TABLE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE);
++        case INLINE_TABLE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_INLINE_TABLE);
++        case TABLE_ROW_GROUP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_ROW_GROUP);
++        case TABLE_HEADER_GROUP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_HEADER_GROUP);
++        case TABLE_FOOTER_GROUP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_FOOTER_GROUP);
++        case TABLE_ROW:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_ROW);
++        case TABLE_COLUMN_GROUP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_COLUMN_GROUP);
++        case TABLE_COLUMN:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_COLUMN);
++        case TABLE_CELL:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_CELL);
++        case TABLE_CAPTION:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_CAPTION);
++        case NONE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
+         }
++        Q_ASSERT( 0 );
++        break;
+     case CSS_PROP_EMPTY_CELLS:
+         switch (style->emptyCells()) {
+-            case khtml::SHOW:
+-                return new CSSPrimitiveValueImpl("show", CSSPrimitiveValue::CSS_STRING);
+-            case khtml::HIDE:
+-                return new CSSPrimitiveValueImpl("hide", CSSPrimitiveValue::CSS_STRING);
++        case SHOW:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SHOW);
++        case HIDE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_HIDE);
+         }
++        Q_ASSERT( 0 );
+         break;
+     case CSS_PROP_FLOAT:
+     {
+         switch (style->floating()) {
+-        case khtml::FNONE:
+-            return new CSSPrimitiveValueImpl("none", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::FLEFT:
+-            return new CSSPrimitiveValueImpl("left", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::FRIGHT:
+-            return new CSSPrimitiveValueImpl("right", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::FLEFT_ALIGN:
+-            return new CSSPrimitiveValueImpl("-khtml-left", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::FRIGHT_ALIGN:
+-            return new CSSPrimitiveValueImpl("-khtml-right", CSSPrimitiveValue::CSS_STRING);
++        case FNONE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
++        case FLEFT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
++        case FRIGHT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
++        case FLEFT_ALIGN:
++            return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_LEFT);
++        case FRIGHT_ALIGN:
++            return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_RIGHT);
+         }
+     }
+     case CSS_PROP_FONT_FAMILY:
+@@ -405,17 +625,17 @@
+         // FIXME: handle oblique
+         FontDef def = style->htmlFont().getFontDef();
+         if (def.italic)
+-            return new CSSPrimitiveValueImpl("italic", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_ITALIC);
+         else
+-            return new CSSPrimitiveValueImpl("normal", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
+     }
+     case CSS_PROP_FONT_VARIANT:
+     {
+         FontDef def = style->htmlFont().getFontDef();
+         if (def.smallCaps)
+-            return new CSSPrimitiveValueImpl("small-caps", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_SMALL_CAPS);
+         else
+-            return new CSSPrimitiveValueImpl("normal", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
+     }
+     case CSS_PROP_FONT_WEIGHT:
+     {
+@@ -423,21 +643,23 @@
+         // that can be expressed with CSS
+         FontDef def = style->htmlFont().getFontDef();
+         if (def.weight == QFont::Bold)
+-            return new CSSPrimitiveValueImpl("bold", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_BOLD);
+         else
+-            return new CSSPrimitiveValueImpl("normal", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
+     }
+     case CSS_PROP_HEIGHT:
+         return new CSSPrimitiveValueImpl(renderer->contentHeight(), CSSPrimitiveValue::CSS_PX);
+     case CSS_PROP_LEFT:
+-        break;
++        return getPositionOffsetValue(renderer, CSS_PROP_LEFT);
+     case CSS_PROP_LETTER_SPACING:
+         if (style->letterSpacing() == 0)
+-            return new CSSPrimitiveValueImpl("normal", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
+         return new CSSPrimitiveValueImpl(style->letterSpacing(), CSSPrimitiveValue::CSS_PX);
+     case CSS_PROP_LINE_HEIGHT:
+     {
+         Length length(style->lineHeight());
++        if (length.value() < 0)
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
+         if (length.isPercent()) {
+             //XXX: merge from webcore the computedStyle/specifiedStyle distinction in rendering/font.h
+             float computedSize = style->htmlFont().getFontDef().size;
+@@ -448,13 +670,15 @@
+         }
+     }
+     case CSS_PROP_LIST_STYLE_IMAGE:
+-        break;
++        if (style->listStyleImage())
++            return new CSSPrimitiveValueImpl(style->listStyleImage()->url(), CSSPrimitiveValue::CSS_URI);
++        return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
+     case CSS_PROP_LIST_STYLE_POSITION:
+         switch (style->listStylePosition()) {
+         case OUTSIDE:
+-            return new CSSPrimitiveValueImpl("outside", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_OUTSIDE);
+         case INSIDE:
+-            return new CSSPrimitiveValueImpl("inside", CSSPrimitiveValue::CSS_STRING);
++            return new CSSPrimitiveValueImpl(CSS_VAL_INSIDE);
+         }
+         Q_ASSERT( 0 );
+         break;
+@@ -468,6 +692,52 @@
+         return valueForLength(style->marginBottom(), renderer->contentHeight());
+     case CSS_PROP_MARGIN_LEFT:
+         return valueForLength(style->marginLeft(), renderer->contentWidth());
++    case CSS_PROP__KHTML_MARQUEE:
++        // FIXME: unimplemented
++        break;
++    case CSS_PROP__KHTML_MARQUEE_DIRECTION:
++        switch (style->marqueeDirection()) {
++        case MFORWARD:
++            return new CSSPrimitiveValueImpl(CSS_VAL_FORWARDS);
++        case MBACKWARD:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BACKWARDS);
++        case MAUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case MUP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_UP);
++        case MDOWN:
++            return new CSSPrimitiveValueImpl(CSS_VAL_DOWN);
++        case MLEFT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
++        case MRIGHT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
++        }
++        Q_ASSERT(0);
++        return 0;
++    case CSS_PROP__KHTML_MARQUEE_INCREMENT:
++        return valueForLength(style->marqueeIncrement(), renderer->contentWidth());
++    case CSS_PROP__KHTML_MARQUEE_REPETITION:
++        if (style->marqueeLoopCount() < 0)
++            return new CSSPrimitiveValueImpl(CSS_VAL_INFINITE);
++        return new CSSPrimitiveValueImpl(style->marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER);
++    case CSS_PROP__KHTML_MARQUEE_SPEED:
++        // FIXME: unimplemented
++        break;
++    case CSS_PROP__KHTML_MARQUEE_STYLE:
++        switch (style->marqueeBehavior()) {
++        case MNONE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
++        case MSCROLL:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SCROLL);
++        case MSLIDE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SLIDE);
++        case MALTERNATE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_ALTERNATE);
++        case MUNFURL:
++            return new CSSPrimitiveValueImpl(CSS_VAL_UNFURL);
++        }
++        Q_ASSERT(0);
++        return 0;
+     case CSS_PROP_MAX_HEIGHT:
+         return new CSSPrimitiveValueImpl( renderer->availableHeight(),
+                                           CSSPrimitiveValue::CSS_PX );
+@@ -485,31 +755,35 @@
+                                           CSSPrimitiveValue::CSS_PX );
+         break;
+     case CSS_PROP_OPACITY:
+-        break;
++        return new CSSPrimitiveValueImpl(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
+     case CSS_PROP_ORPHANS:
+-        break;
++        return new CSSPrimitiveValueImpl(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
+     case CSS_PROP_OUTLINE_COLOR:
+         break;
+     case CSS_PROP_OUTLINE_OFFSET:
+         break;
+     case CSS_PROP_OUTLINE_STYLE:
+-        break;
++        if (style->outlineStyleIsAuto())
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        return valueForBorderStyle(style->outlineStyle());
+     case CSS_PROP_OUTLINE_WIDTH:
+         break;
+     case CSS_PROP_OVERFLOW:
+     {
+         switch (style->overflow()) {
+-        case khtml::OVISIBLE:
+-            return new CSSPrimitiveValueImpl("visible", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::OHIDDEN:
+-            return new CSSPrimitiveValueImpl("hidden", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::OSCROLL:
+-            return new CSSPrimitiveValueImpl("scroll", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::OAUTO:
+-            return new CSSPrimitiveValueImpl("auto", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::OMARQUEE:
+-            return new CSSPrimitiveValueImpl("marquee", CSSPrimitiveValue::CSS_STRING);
++        case OVISIBLE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_VISIBLE);
++        case OHIDDEN:
++            return new CSSPrimitiveValueImpl(CSS_VAL_HIDDEN);
++        case OSCROLL:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SCROLL);
++        case OAUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case OMARQUEE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_MARQUEE);
+         }
++        Q_ASSERT(0);
++        return 0;
+     }
+     case CSS_PROP_PADDING_TOP:
+         return valueForLength(style->paddingTop(), renderer->contentHeight());
+@@ -520,23 +794,75 @@
+     case CSS_PROP_PADDING_LEFT:
+         return valueForLength(style->paddingLeft(), renderer->contentWidth());
+     case CSS_PROP_PAGE_BREAK_AFTER:
++        switch (style->pageBreakAfter()) {
++        case PBAUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case PBALWAYS:
++            return new CSSPrimitiveValueImpl(CSS_VAL_ALWAYS);
++        case PBAVOID:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AVOID);
++        case PBLEFT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
++        case PBRIGHT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_PAGE_BREAK_BEFORE:
++        switch (style->pageBreakBefore()) {
++        case PBAUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case PBALWAYS:
++            return new CSSPrimitiveValueImpl(CSS_VAL_ALWAYS);
++        case PBAVOID:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AVOID);
++        case PBLEFT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LEFT);
++        case PBRIGHT:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_PAGE_BREAK_INSIDE:
++        switch (style->pageBreakInside()) {
++        case PBAUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case PBAVOID:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AVOID);
++        case PBALWAYS:
++            break; // not allowed
++        }
+         break;
+     case CSS_PROP_POSITION:
++        switch (style->position()) {
++        case STATIC:
++            return new CSSPrimitiveValueImpl(CSS_VAL_STATIC);
++        case RELATIVE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_RELATIVE);
++        case ABSOLUTE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_ABSOLUTE);
++        case FIXED:
++            return new CSSPrimitiveValueImpl(CSS_VAL_FIXED);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_QUOTES:
+         break;
+     case CSS_PROP_RIGHT:
+-        break;
++        return getPositionOffsetValue(renderer, CSS_PROP_RIGHT);
+     case CSS_PROP_SIZE:
+         break;
+     case CSS_PROP_TABLE_LAYOUT:
++        switch (style->tableLayout()) {
++        case TAUTO:
++            return new CSSPrimitiveValueImpl(CSS_VAL_AUTO);
++        case TFIXED:
++            return new CSSPrimitiveValueImpl(CSS_VAL_FIXED);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_TEXT_ALIGN:
+-        return new CSSPrimitiveValueImpl(stringForTextAlign(style->textAlign()), CSSPrimitiveValue::CSS_STRING);
++        return valueForTextAlign(style->textAlign());
+     case CSS_PROP_TEXT_DECORATION:
+     {
+         QString string;
+@@ -563,74 +889,102 @@
+     }
+     case CSS_PROP_TEXT_INDENT:
+         return valueForLength(style->textIndent(), renderer->contentWidth());
++    case CSS_PROP_TEXT_SHADOW:
++        return valueForShadow(style->textShadow());
+     case CSS_PROP_TEXT_TRANSFORM:
++        switch (style->textTransform()) {
++        case CAPITALIZE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_CAPITALIZE);
++        case UPPERCASE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_UPPERCASE);
++        case LOWERCASE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_LOWERCASE);
++        case TTNONE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NONE);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_TOP:
+-        break;
++        return getPositionOffsetValue(renderer, CSS_PROP_TOP);
+     case CSS_PROP_UNICODE_BIDI:
++        switch (style->unicodeBidi()) {
++        case UBNormal:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
++        case Embed:
++            return new CSSPrimitiveValueImpl(CSS_VAL_EMBED);
++        case Override:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BIDI_OVERRIDE);
++        }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_VERTICAL_ALIGN:
+     {
+         switch (style->verticalAlign()) {
+-        case khtml::BASELINE:
+-            return new CSSPrimitiveValueImpl("baseline", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::MIDDLE:
+-            return new CSSPrimitiveValueImpl("middle", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::SUB:
+-            return new CSSPrimitiveValueImpl("sub", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::SUPER:
+-            return new CSSPrimitiveValueImpl("super", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TEXT_TOP:
+-            return new CSSPrimitiveValueImpl("text-top", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TEXT_BOTTOM:
+-            return new CSSPrimitiveValueImpl("text-bottom", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::TOP:
+-            return new CSSPrimitiveValueImpl("top", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::BOTTOM:
+-            return new CSSPrimitiveValueImpl("bottom", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::BASELINE_MIDDLE:
+-            return new CSSPrimitiveValueImpl("baseline-middle", CSSPrimitiveValue::CSS_STRING);
+-        case khtml::LENGTH:
++        case BASELINE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BASELINE);
++        case MIDDLE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_MIDDLE);
++        case SUB:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SUB);
++        case SUPER:
++            return new CSSPrimitiveValueImpl(CSS_VAL_SUPER);
++        case TEXT_TOP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TEXT_TOP);
++        case TEXT_BOTTOM:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TEXT_BOTTOM);
++        case TOP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_TOP);
++        case BOTTOM:
++            return new CSSPrimitiveValueImpl(CSS_VAL_BOTTOM);
++        case BASELINE_MIDDLE:
++            return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_BASELINE_MIDDLE);
++        case LENGTH:
+             return valueForLength(style->verticalAlignLength(), renderer->contentWidth());
+         }
++        Q_ASSERT(0);
++        break;
+     }
+     case CSS_PROP_VISIBILITY:
+         switch (style->visibility()) {
+             case khtml::VISIBLE:
+-                return new CSSPrimitiveValueImpl("visible", CSSPrimitiveValue::CSS_STRING);
++                return new CSSPrimitiveValueImpl(CSS_VAL_VISIBLE);
+             case khtml::HIDDEN:
+-                return new CSSPrimitiveValueImpl("hidden", CSSPrimitiveValue::CSS_STRING);
++                return new CSSPrimitiveValueImpl(CSS_VAL_HIDDEN);
+             case khtml::COLLAPSE:
+-                return new CSSPrimitiveValueImpl("collapse", CSSPrimitiveValue::CSS_STRING);
++                return new CSSPrimitiveValueImpl(CSS_VAL_COLLAPSE);
+         }
++        Q_ASSERT(0);
+         break;
+     case CSS_PROP_WHITE_SPACE:
+     {
+         switch (style->whiteSpace()) {
+-            case khtml::NORMAL:
+-                return new CSSPrimitiveValueImpl("normal", CSSPrimitiveValue::CSS_STRING);
+-            case khtml::NOWRAP:
+-                return new CSSPrimitiveValueImpl("nowrap", CSSPrimitiveValue::CSS_STRING);
+-            case khtml::PRE:
+-                return new CSSPrimitiveValueImpl("pre", CSSPrimitiveValue::CSS_STRING);
+-            case khtml::PRE_WRAP:
+-                return new CSSPrimitiveValueImpl("pre-wrap", CSSPrimitiveValue::CSS_STRING);
+-            case khtml::PRE_LINE:
+-                return new CSSPrimitiveValueImpl("pre-line", CSSPrimitiveValue::CSS_STRING);
+-            case khtml::KHTML_NOWRAP:
+-                return new CSSPrimitiveValueImpl("-khtml-nowrap", CSSPrimitiveValue::CSS_STRING);
++        case NORMAL:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
++        case PRE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_PRE);
++        case PRE_WRAP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_PRE_WRAP);
++        case PRE_LINE:
++            return new CSSPrimitiveValueImpl(CSS_VAL_PRE_LINE);
++        case NOWRAP:
++            return new CSSPrimitiveValueImpl(CSS_VAL_NOWRAP);
++        case KHTML_NOWRAP:
++            return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_NOWRAP);
+         }
++        Q_ASSERT(0);
+         break;
+     }
+     case CSS_PROP_WIDOWS:
+-        break;
++        return new CSSPrimitiveValueImpl(style->widows(), CSSPrimitiveValue::CSS_NUMBER);
+     case CSS_PROP_WIDTH:
+         return new CSSPrimitiveValueImpl( renderer->contentWidth(),
+                                          CSSPrimitiveValue::CSS_PX );
+     case CSS_PROP_WORD_SPACING:
+         return new CSSPrimitiveValueImpl(style->wordSpacing(), CSSPrimitiveValue::CSS_PX);
+     case CSS_PROP_Z_INDEX:
+-        break;
++        if (style->hasAutoZIndex())
++            return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL);
++        return new CSSPrimitiveValueImpl(style->zIndex(), CSSPrimitiveValue::CSS_NUMBER);
+     case CSS_PROP_BACKGROUND:
+         break;
+     case CSS_PROP_BORDER:
+@@ -697,15 +1051,17 @@
+ DOMString RenderStyleDeclarationImpl::getPropertyValue( int propertyID ) const
+ {
+     CSSValueImpl* value = getPropertyCSSValue(propertyID);
+-    if (value)
+-        return value->cssText();
++    if (value) {
++        DOMString val = value->cssText();
++        delete value;
++        return val;
++    }
+     return "";
+ }
+ 
+ bool RenderStyleDeclarationImpl::getPropertyPriority( int ) const
+ {
+-    // This class does not support the notion of priority, since the object
+-    // is a computed value.
++    // All computed styles have a priority of false (not "important").
+     return false;
+ }
+ 
+@@ -739,13 +1095,19 @@
+     // ### emit error since we're read-only
+ }
+ 
+-DOM::DOMString RenderStyleDeclarationImpl::item( unsigned long ) const
++unsigned long RenderStyleDeclarationImpl::length() const
+ {
+-    // ###
+-    return DOMString();
++    return numComputedProperties;
+ }
+ 
++DOM::DOMString RenderStyleDeclarationImpl::item( unsigned long i ) const
++{
++    if (i >= numComputedProperties)
++        return DOMString();
+ 
++    return getPropertyName(computedProperties[i]);
++}
++
+ CSSProperty RenderStyleDeclarationImpl::property( int id ) const
+ {
+     CSSProperty prop;
+@@ -759,3 +1121,4 @@
+     prop.setValue( v );
+     return prop;
+ }
++
+--- khtml/css/css_ruleimpl.cpp	(revision 506549)
++++ khtml/css/css_ruleimpl.cpp	(revision 515119)
+@@ -325,11 +325,14 @@
+ 
+ DOM::DOMString CSSStyleRuleImpl::selectorText() const
+ {
+-    if ( m_selector && m_selector->first() ) {
+-        // ### m_selector will be a single selector hopefully. so ->first() will disappear
+-        CSSSelector* cs = m_selector->first();
+-        //cs->print(); // debug
+-        return cs->selectorText();
++    if (m_selector) {
++        DOMString str;
++        for (CSSSelector *s = m_selector->first(); s; s = m_selector->next()) {
++            if (s != m_selector->getFirst())
++                str += ", ";
++            str += s->selectorText();
++        }
++        return str;
+     }
+     return DOMString();
+ }
+--- khtml/css/cssstyleselector.cpp	(revision 506549)
++++ khtml/css/cssstyleselector.cpp	(revision 515119)
+@@ -748,6 +748,7 @@
+ 	case CSS_PROP_FONT_SIZE:
+ 	case CSS_PROP_FONT_WEIGHT:
+         case CSS_PROP_FONT_FAMILY:
++        case CSS_PROP_FONT_VARIANT:
+         case CSS_PROP_FONT:
+         case CSS_PROP_COLOR:
+         case CSS_PROP_DIRECTION:
+@@ -990,7 +991,7 @@
+ 	    if ( dynamicPseudo != RenderStyle::NOPSEUDO ) {
+ 		return;
+ 	    }
+-	    if(!checkOneSelector(sel, elem)) return;
++	    if(!checkOneSelector(sel, elem, true)) return;
+ 	    //kdDebug() << "CSSOrderedRule::checkSelector: passed" << endl;
+ 	    break;
+ 	}
+@@ -1022,7 +1023,7 @@
+     return;
+ }
+ 
+-bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl *e)
++bool CSSStyleSelector::checkOneSelector(DOM::CSSSelector *sel, DOM::ElementImpl *e, bool isSubSelector)
+ {
+     if(!e)
+         return false;
+@@ -1068,25 +1069,35 @@
+             break;
+         case CSSSelector::Set:
+             break;
++        case CSSSelector::Class:
++            if (!e->hasClassList()) {
++                if( (strictParsing && strcmp(sel->value, value) ) ||
++                    (!strictParsing && strcasecmp(sel->value, value)))
++                    return false;
++               return true;
++            }
++            // no break    
+         case CSSSelector::List:
+         {
+-            const QChar* s = value.unicode();
+-            int l = value.length();
+-            while( l && !s->isSpace() )
+-              l--,s++;
+-	    if (!l) {
+-		// There is no list, just a single item.  We can avoid
+-		// allocing QStrings and just treat this as an exact
+-		// match check.
+-		if( (strictParsing && strcmp(sel->value, value) ) ||
+-		    (!strictParsing && strcasecmp(sel->value, value)))
+-		    return false;
+-		break;
+-	    }
++            if (sel->match != CSSSelector::Class) {
++                const QChar* s = value.unicode();
++                int l = value.length();
++                while( l && !s->isSpace() )
++                    l--,s++;
++                if (!l) {
++		    // There is no list, just a single item.  We can avoid
++		    // allocing QStrings and just treat this as an exact
++		    // match check.
++		    if( (strictParsing && strcmp(sel->value, value) ) ||
++		        (!strictParsing && strcasecmp(sel->value, value)))
++		        return false;
++		    break;
++	        }
++            }
+ 
+             // The selector's value can't contain a space, or it's totally bogus.
+-            l = sel->value.find(' ');
+-            if (l != -1)
++            // ### check if this can still happen
++            if (sel->value.find(' ') != -1)
+                 return false;
+ 
+             QString str = value.string();
+@@ -1361,8 +1372,8 @@
+ 	    break;
+         case CSSSelector::PseudoHover: {
+ 	    // If we're in quirks mode, then hover should never match anchors with no
+-	    // href.  This is important for sites like wsj.com.
+-	    if (strictParsing || e->id() != ID_A || e->hasAnchor()) {
++	    // href and *:hover should not match anything. This is important for sites like wsj.com.
++	    if (strictParsing || isSubSelector || sel->relation == CSSSelector::SubSelector || (sel->tag != anyQName && e->id() != ID_A) || e->hasAnchor()) {
+ 		if (element == e)
+ 		    style->setAffectedByHoverRules(true);
+ 		if (e->renderer()) {
+@@ -1382,7 +1393,7 @@
+ 	case CSSSelector::PseudoActive:
+ 	    // If we're in quirks mode, then :active should never match anchors with no
+ 	    // href.
+-	    if (strictParsing || e->id() != ID_A || e->hasAnchor()) {
++	    if (strictParsing || isSubSelector || sel->relation == CSSSelector::SubSelector || (sel->tag != anyQName && e->id() != ID_A) || e->hasAnchor()) {
+ 		if (element == e)
+ 		    style->setAffectedByActiveRules(true);
+ 		else if (e->renderer())
+@@ -1764,6 +1775,7 @@
+ 	case CSS_PROP_FONT_SIZE:
+ 	case CSS_PROP_FONT_WEIGHT:
+         case CSS_PROP_FONT_FAMILY:
++        case CSS_PROP_FONT_VARIANT:
+         case CSS_PROP_FONT:
+         case CSS_PROP_COLOR:
+         case CSS_PROP_BACKGROUND_IMAGE:
+--- khtml/css/css_valueimpl.h	(revision 506549)
++++ khtml/css/css_valueimpl.h	(revision 515119)
+@@ -54,7 +54,7 @@
+ 
+     CSSStyleDeclarationImpl& operator=( const CSSStyleDeclarationImpl&);
+ 
+-    unsigned long length() const;
++    virtual unsigned long length() const;
+     CSSRuleImpl *parentRule() const;
+     virtual DOM::DOMString removeProperty( int propertyID, bool NonCSSHints = false );
+     virtual bool setProperty ( int propertyId, const DOM::DOMString &value, bool important = false, bool nonCSSHint = false);
+--- khtml/css/css_base.h	(revision 506549)
++++ khtml/css/css_base.h	(revision 515119)
+@@ -107,6 +107,7 @@
+ 	    Id,
+ 	    Exact,
+ 	    Set,
++	    Class,
+ 	    List,
+ 	    Hyphen,
+ 	    PseudoClass,
+--- khtml/configure.in.in	(revision 506549)
++++ khtml/configure.in.in	(revision 515119)
+@@ -52,5 +52,6 @@
+ AC_MSG_RESULT($ac_libthai)
+ ])
+ 
++KDE_CHECK_LIBTHAI
+ 
+-KDE_CHECK_LIBTHAI
++KDE_CHECK_HEADERS(valgrind/memcheck.h)
+--- khtml/misc/arena.cpp	(revision 506549)
++++ khtml/misc/arena.cpp	(revision 515119)
+@@ -153,6 +153,7 @@
+                 pool->current = a;
+                 rp = (char *)a->avail;
+                 a->avail += nb;
++                VALGRIND_MEMPOOL_ALLOC(a->base, rp, nb);
+                 return rp;
+             }
+         } while( NULL != (a = a->next) );
+@@ -171,6 +172,7 @@
+                 a->avail = a->base;
+                 rp = (char *)a->avail;
+                 a->avail += nb;
++                VALGRIND_MEMPOOL_ALLOC(a->base, rp, nb);
+                 /* the newly allocated arena is linked after pool->current
+                  *  and becomes pool->current */
+                 a->next = pool->current->next;
+@@ -205,8 +207,11 @@
+         if (a)  {
+             a->limit = (uword)a + sz;
+             a->base = a->avail = (uword)ARENA_ALIGN(pool, a + 1);
++            VALGRIND_CREATE_MEMPOOL(a->base, 0, 0);
+             rp = (char *)a->avail;
+             a->avail += nb;
++            VALGRIND_MEMPOOL_ALLOC(a->base, rp, nb);
++
+             /* the newly allocated arena is linked after pool->current
+             *  and becomes pool->current */
+             a->next = pool->current->next;
+@@ -222,16 +227,6 @@
+     return(0);
+ } /* --- end ArenaAllocate() --- */
+ 
+-void* ArenaGrow(ArenaPool *pool, void *p, unsigned int size, unsigned int incr)
+-{
+-    void *newp;
+-
+-    ARENA_ALLOCATE(newp, pool, size + incr);
+-    if (newp)
+-        memcpy(newp, p, size);
+-    return newp;
+-}
+-
+ /*
+  * Free tail arenas linked after head, which may not be the true list head.
+  * Reset pool->current to point to head in case it pointed at a tail arena.
+@@ -260,6 +255,7 @@
+     if (reallyFree) {
+         do {
+             *ap = a->next;
++            VALGRIND_DESTROY_MEMPOOL(a->base);
+             CLEAR_ARENA(a);
+ #ifdef DEBUG_ARENA_MALLOC
+             if (a) {
+@@ -280,6 +276,7 @@
+         if (*ap) {
+             Arena *xa, *n;
+             for (xa = *ap; xa; xa = n) {
++                VALGRIND_DESTROY_MEMPOOL(xa->base);
+                 n = xa->next;
+ #ifdef DEBUG_ARENA_MALLOC
+                 i--;
+--- khtml/misc/arena.h	(revision 506549)
++++ khtml/misc/arena.h	(revision 515119)
+@@ -39,6 +39,22 @@
+ #ifndef ARENA_H
+ #define ARENA_H
+ 
++
++#if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG)
++
++#include <valgrind/memcheck.h>
++#define VALGRIND_SUPPORT
++
++#else
++
++#define VALGRIND_CREATE_MEMPOOL(base, redZone, zeroed)
++#define VALGRIND_DESTROY_MEMPOOL(base)
++#define VALGRIND_MEMPOOL_ALLOC(base, addr, size)
++#define VALGRIND_MEMPOOL_FREE(base, addr)
++
++#endif
++
++
+ #define ARENA_ALIGN_MASK 3
+ 
+ typedef unsigned long uword;
+@@ -79,21 +95,12 @@
+         uword _q = _p + _nb; \
+         if (_q > _a->limit) \
+             _p = (uword)ArenaAllocate(pool, _nb); \
+-        else \
++        else { \
++            VALGRIND_MEMPOOL_ALLOC(_a->base, p, nb); \
+             _a->avail = _q; \
++        } \
+         p = (void *)_p;
+ 
+-#define ARENA_GROW(p, pool, size, incr) \
+-        Arena *_a = (pool)->current; \
+-        unsigned int _incr = ARENA_ALIGN(pool, incr); \
+-        uword _p = _a->avail; \
+-        uword _q = _p + _incr; \
+-        if (_p == (uword)(p) + ARENA_ALIGN(pool, size) && \
+-            _q <= _a->limit) { \
+-            _a->avail = _q; \
+-        } else { \
+-            p = ArenaGrow(pool, p, size, incr); \
+-        }
+ 
+ #define ARENA_MARK(pool) ((void *) (pool)->current->avail)
+ #define UPTRDIFF(p,q) ((uword)(p) - (uword)(q))
+@@ -110,23 +117,7 @@
+ #define CLEAR_ARENA(a)
+ #endif
+ 
+-#define ARENA_RELEASE(pool, mark) \
+-         char *_m = (char *)(mark); \
+-         Arena *_a = (pool)->current; \
+-         if (UPTRDIFF(_m, _a->base) <= UPTRDIFF(_a->avail, _a->base)) { \
+-             _a->avail = (uword)ARENA_ALIGN(pool, _m); \
+-             CLEAR_UNUSED(_a); \
+-         } else { \
+-             ArenaRelease(pool, _m); \
+-         }
+ 
+-#define ARENA_DESTROY(pool, a, pnext) \
+-         if ((pool)->current == (a)) (pool)->current = &(pool)->first; \
+-         *(pnext) = (a)->next; \
+-         CLEAR_ARENA(a); \
+-         free(a); \
+-         (a) = 0;
+-
+ } // namespace
+ 
+ #endif
+--- khtml/xml/dom_nodeimpl.cpp	(revision 506549)
++++ khtml/xml/dom_nodeimpl.cpp	(revision 515119)
+@@ -738,7 +738,7 @@
+         // newChild is a DocumentFragment... check all its children instead of newChild itself
+         NodeImpl *child;
+         for (child = newChild->firstChild(); child; child = child->nextSibling()) {
+-            if (!childAllowed(child)) {
++            if (!childTypeAllowed(child->nodeType())) {
+                 exceptioncode = DOMException::HIERARCHY_REQUEST_ERR;
+                 return;
+             }
+@@ -746,7 +746,7 @@
+     }
+     else {
+         // newChild is not a DocumentFragment... check if it's allowed directly
+-        if(!childAllowed(newChild)) {
++        if(!childTypeAllowed(newChild->nodeType())) {
+             exceptioncode = DOMException::HIERARCHY_REQUEST_ERR;
+             return;
+         }
+@@ -1311,7 +1311,7 @@
+     // do not add applyChanges here! This function is only used during parsing
+ 
+     // short check for consistency with DTD
+-    if(!isXMLElementNode() && !newChild->isXMLElementNode() && !childAllowed(newChild))
++    if(getDocument()->isHTMLDocument() && !childAllowed(newChild))
+     {
+         //kdDebug( 6020 ) << "AddChild failed! id=" << id() << ", child->id=" << newChild->id() << endl;
+         return 0;
+--- khtml/xml/dom2_eventsimpl.cpp	(revision 506549)
++++ khtml/xml/dom2_eventsimpl.cpp	(revision 515119)
+@@ -640,12 +640,10 @@
+     delete m_keyEvent;
+ 
+     assert(m_synthetic);
+-    //IMPORTANT: we ignore Ctrl, Alt, and Meta modifers on purpose.
+-    //this is to prevent a website from synthesizing something like Ctrl-V
+-    //and stealing contents of the user's clipboard.
++    //IMPORTANT: we ignore modifers on purpose.
++    //this is to prevent a website from synthesizing something
++    //like Ctrl-V or Shift-Insert and stealing contents of the user's clipboard.
+     unsigned modifiers = 0;
+-    if (m_modifier & Qt::ShiftButton)
+-        modifiers |= Qt::ShiftButton;
+ 
+     int key   = 0;
+     int ascii = 0;
+@@ -800,11 +798,8 @@
+ }
+ 
+ KeyboardEventImpl::KeyboardEventImpl(QKeyEvent* key, DOM::AbstractViewImpl* view) :
+-    KeyEventBaseImpl(KEYDOWN_EVENT, true, true, view, key)
++    KeyEventBaseImpl(key->type() == QEvent::KeyRelease ? KEYUP_EVENT : KEYDOWN_EVENT, true, true, view, key)
+ {
+-    if (key->type() == QEvent::KeyRelease)
+-        m_id = KEYUP_EVENT;
+-
+     //Try to put something reasonable in location...
+     //we don't know direction, so guess left
+     m_keyLocation = DOM_KEY_LOCATION_STANDARD;
+--- khtml/xml/dom_elementimpl.cpp	(revision 506549)
++++ khtml/xml/dom_elementimpl.cpp	(revision 515119)
+@@ -308,6 +308,7 @@
+     m_restyleLate = false;
+     m_restyleSelfLate = false;
+     m_restyleChildrenLate = false;
++    m_hasClassList = false;
+ }
+ 
+ ElementImpl::~ElementImpl()
+--- khtml/xml/dom_elementimpl.h	(revision 506549)
++++ khtml/xml/dom_elementimpl.h	(revision 515119)
+@@ -141,7 +141,7 @@
+ public:
+     ElementImpl(DocumentPtr *doc);
+     ~ElementImpl();
+-
++    
+     DOMString getAttribute( NodeImpl::Id id, bool nsAware = 0, const DOMString& qName = DOMString() ) const;
+     void setAttribute( NodeImpl::Id id, const DOMString &value, const DOMString &qName,
+                        int &exceptioncode );
+@@ -224,16 +224,21 @@
+      */
+     DOMString openTagStartToString(bool expandurls = false) const;
+     
+-    bool restyleLate() { return m_restyleLate; };
++    bool restyleLate() const { return m_restyleLate; };
+     void setRestyleLate(bool b=true) { m_restyleLate = b; };
+     void setRestyleSelfLate() { m_restyleSelfLate = true; };
+     void setRestyleChildrenLate() { m_restyleChildrenLate = true; };
+ 
++    // for style selection performance: whether the element matches several CSS Classes
++    bool hasClassList() const { return m_hasClassList; }
++    void setHasClassList(bool b) { m_hasClassList = b; }
++
+     void updateId(DOMStringImpl* oldId, DOMStringImpl* newId);
+     //Called when mapping from id to this node in document should be removed
+     virtual void removeId(const QString& id);
+     //Called when mapping from id to this node in document should be added
+     virtual void addId   (const QString& id);
++
+ protected:
+     void createAttributeMap() const;
+     void createDecl();
+@@ -253,6 +258,7 @@
+     bool m_restyleLate;
+     bool m_restyleSelfLate;
+     bool m_restyleChildrenLate;
++    bool m_hasClassList;
+ };
+ 
+ 
+--- khtml/xml/dom_docimpl.cpp	(revision 506549)
++++ khtml/xml/dom_docimpl.cpp	(revision 515119)
+@@ -296,7 +296,7 @@
+     m_textColor = Qt::black;
+ 
+     m_view = v;
+-    m_renderArena = 0;
++    m_renderArena.reset();
+ 
+     KHTMLFactory::ref();
+ 
+@@ -393,10 +393,7 @@
+     if ( m_hoverNode )
+         m_hoverNode->deref();
+ 
+-    if (m_renderArena){
+-	delete m_renderArena;
+-	m_renderArena = 0;
+-    }
++    m_renderArena.reset();
+ 
+     KHTMLFactory::deref();
+ }
+@@ -1160,13 +1157,13 @@
+         setPaintDevice( m_view );
+ 
+     if (!m_renderArena)
+-	m_renderArena = new RenderArena();
++	m_renderArena.reset(new RenderArena());
+ 
+     // Create the rendering tree
+     assert(!m_styleSelector);
+     m_styleSelector = new CSSStyleSelector( this, m_usersheet, m_styleSheets, m_url,
+                                             !inCompatMode() );
+-    m_render = new (m_renderArena) RenderCanvas(this, m_view);
++    m_render = new (m_renderArena.get()) RenderCanvas(this, m_view);
+     m_styleSelector->computeFontSizes(paintDeviceMetrics(), m_view ? m_view->part()->zoomFactor() : 100);
+     recalcStyle( Force );
+ 
+@@ -1197,10 +1194,7 @@
+ 
+     m_view = 0;
+ 
+-    if ( m_renderArena ) {
+-	delete m_renderArena;
+-	m_renderArena = 0;
+-    }
++    m_renderArena.reset();
+ }
+ 
+ void DocumentImpl::setVisuallyOrdered()
+--- khtml/xml/xml_tokenizer.cpp	(revision 506549)
++++ khtml/xml/xml_tokenizer.cpp	(revision 515119)
+@@ -232,11 +232,6 @@
+ 
+ bool XMLHandler::characters( const QString& ch )
+ {
+-    //this is needed for xhtml parsing. otherwise we try to attach
+-    //"\n\t" to html, head and other nodes which don't accept textchildren
+-    if ( ch.stripWhiteSpace().isEmpty() )
+-        return true;
+-
+     if (currentNode()->nodeType() == Node::TEXT_NODE ||
+         currentNode()->nodeType() == Node::CDATA_SECTION_NODE ||
+         enterText()) {
+--- khtml/xml/dom_docimpl.h	(revision 506549)
++++ khtml/xml/dom_docimpl.h	(revision 515119)
+@@ -295,7 +295,7 @@
+     virtual void attach();
+     virtual void detach();
+ 
+-    khtml::RenderArena* renderArena() { return m_renderArena; }
++    khtml::RenderArena* renderArena() { return m_renderArena.get(); }
+ 
+     // to get visually ordered hebrew and arabic pages right
+     void setVisuallyOrdered();
+@@ -654,7 +654,7 @@
+     //Cache for getElementById
+     mutable ElementMappingCache m_getElementByIdCache;
+ 
+-    khtml::RenderArena* m_renderArena;
++    khtml::SharedPtr<khtml::RenderArena> m_renderArena;
+ private:
+     mutable DOMString m_domain;
+ };
+--- dcop/dcopidlng/kalyptusCxxToDcopIDL.pm	(revision 506549)
++++ dcop/dcopidlng/kalyptusCxxToDcopIDL.pm	(revision 515119)
+@@ -172,6 +172,7 @@
+     $returnType = "void" unless $returnType;
+     $returnType =~ s/</&lt;/g;
+     $returnType =~ s/>/&gt;/g;
++    $returnType =~ s/^\s*const\s*//;
+ 
+     my $methodCode = "";
+ 
+--- dcop/dcopclient.cpp	(revision 506549)
++++ dcop/dcopclient.cpp	(revision 515119)
+@@ -809,7 +809,7 @@
+     if ((d->iceConn = IceOpenConnection(const_cast<char*>(d->serverAddr),
+                                         static_cast<IcePointer>(this), False, d->majorOpcode,
+                                         sizeof(errBuf), errBuf)) == 0L) {
+-        qDebug("DCOPClient::attachInternal. Attach failed %s", errBuf ? errBuf : "");
++        qDebug("DCOPClient::attachInternal. Attach failed %s", errBuf);
+         d->iceConn = 0;
+         if (bClearServerAddr) {
+            delete [] d->serverAddr;
+--- dcop/dcopidl/dcopidl_output.kidl	(revision 506549)
++++ dcop/dcopidl/dcopidl_output.kidl	(revision 515119)
+@@ -57,6 +57,10 @@
+         <TYPE>QValueList&lt;DCOPRef&gt;</TYPE>
+         <NAME>getWindows</NAME>
+      </FUNC>
++    <FUNC>
++        <TYPE>QStringList</TYPE>
++        <NAME>remotes</NAME>
++     </FUNC>
+     <SIGNAL>
+         <TYPE>void</TYPE>
+         <NAME>blah_signal</NAME>
+--- dcop/dcopidl/dcopidl_test.h	(revision 506549)
++++ dcop/dcopidl/dcopidl_test.h	(revision 515119)
+@@ -50,6 +50,7 @@
+     SomeForwardFooPrivate *d;
+     static const int AUDIO_CD = 1;
+     static const int AUDIO_CD = 1 << 6;
++    static const int m_number0[ 20 ];
+     enum { Enum1, Enum2 };
+     enum NamedEnum { Enum3, Enum4 };
+ k_dcop:
+@@ -68,6 +69,7 @@
+     int getPageOfObj( int obj );
+     void setCell( const int& point = 3 );
+     QValueList<DCOPRef> getWindows();
++    const QStringList remotes(); // returns const type, but shouldn't use const var for it in stub
+ 
+ k_dcop_signals:
+     void blah_signal();
+--- kjs/regexp_object.cpp	(revision 506549)
++++ kjs/regexp_object.cpp	(revision 515119)
+@@ -59,6 +59,9 @@
+ 	    new RegExpProtoFuncImp(exec,funcProto,RegExpProtoFuncImp::Test,     0, testPropertyName), DontEnum);
+   putDirect(toStringPropertyName,
+ 	    new RegExpProtoFuncImp(exec,funcProto,RegExpProtoFuncImp::ToString, 0, toStringPropertyName), DontEnum);
++  static const Identifier compilePropertyName("compile");
++  putDirect(compilePropertyName,
++            new RegExpProtoFuncImp(exec,funcProto,RegExpProtoFuncImp::Compile,  1, compilePropertyName), DontEnum);
+ }
+ 
+ // ------------------------------ RegExpProtoFuncImp ---------------------------
+@@ -152,7 +155,15 @@
+       str += "m";
+     }
+     return String(str);
++  case Compile: {
++      RegExp* newEngine = RegExpObjectImp::makeEngine(exec, args[0].toString(exec), args[1]);
++      if (!newEngine)
++        return exec->exception();
++      reimp->setRegExp(newEngine);
++      return Value(reimp);
++    }
+   }
++  
+ 
+   return Undefined();
+ }
+@@ -171,6 +182,23 @@
+   delete reg;
+ }
+ 
++void RegExpImp::setRegExp(RegExp *r)
++{
++  delete reg;
++  reg = r;
++
++  Object protect(this);//Protect self from GC (we are allocating a StringImp, and may be new)
++  putDirect("global", (r->flags() & RegExp::Global) ? BooleanImp::staticTrue : BooleanImp::staticFalse, 
++            DontDelete | ReadOnly | DontEnum);
++  putDirect("ignoreCase", (r->flags() & RegExp::IgnoreCase) ? BooleanImp::staticTrue : BooleanImp::staticFalse, 
++            DontDelete | ReadOnly | DontEnum);
++  putDirect("multiline", (r->flags() & RegExp::Multiline) ? BooleanImp::staticTrue : BooleanImp::staticFalse, 
++            DontDelete | ReadOnly | DontEnum);
++
++  putDirect("source", new StringImp(r->pattern()), DontDelete | ReadOnly | DontEnum);
++  putDirect("lastIndex", NumberImp::zero(), DontDelete | DontEnum);
++}
++
+ // ------------------------------ RegExpObjectImp ------------------------------
+ 
+ RegExpObjectImp::RegExpObjectImp(ExecState * /*exec*/,
+@@ -243,6 +271,49 @@
+   return true;
+ }
+ 
++RegExp* RegExpObjectImp::makeEngine(ExecState *exec, const UString &p, const Value &flagsInput)
++{
++  UString flags = flagsInput.type() == UndefinedType ? UString("") : flagsInput.toString(exec);
++
++  // Check for validity of flags
++  for (int pos = 0; pos < flags.size(); ++pos) {
++    switch (flags[pos].unicode()) {
++    case 'g':
++    case 'i':
++    case 'm':
++      break;
++    default: {
++        Object err = Error::create(exec, SyntaxError,
++                    "Invalid regular expression flags");
++        exec->setException(err);
++        return 0;
++      }
++    }
++  }
++
++  bool global = (flags.find("g") >= 0);
++  bool ignoreCase = (flags.find("i") >= 0);
++  bool multiline = (flags.find("m") >= 0);
++
++  int reflags = RegExp::None;
++  if (global)
++      reflags |= RegExp::Global;
++  if (ignoreCase)
++      reflags |= RegExp::IgnoreCase;
++  if (multiline)
++      reflags |= RegExp::Multiline;
++
++  RegExp *re = new RegExp(p, reflags);
++  if (!re->isValid()) {
++    Object err = Error::create(exec, SyntaxError,
++                               "Invalid regular expression");
++    exec->setException(err);
++    delete re;
++    return 0;
++  }
++  return re;
++}
++
+ // ECMA 15.10.4
+ Object RegExpObjectImp::construct(ExecState *exec, const List &args)
+ {
+@@ -264,38 +335,14 @@
+       p = a0.toString(exec);
+     }
+   }
+-  UString flags = args[1].type() == UndefinedType ? UString("") : args[1].toString(exec);
+ 
++  RegExp* re = makeEngine(exec, p, args[1]);
++  if (!re)
++    return exec->exception().toObject(exec);
++
+   RegExpPrototypeImp *proto = static_cast<RegExpPrototypeImp*>(exec->lexicalInterpreter()->builtinRegExpPrototype().imp());
+   RegExpImp *dat = new RegExpImp(proto);
+   Object obj(dat); // protect from GC
+-
+-  bool global = (flags.find("g") >= 0);
+-  bool ignoreCase = (flags.find("i") >= 0);
+-  bool multiline = (flags.find("m") >= 0);
+-  // TODO: throw a syntax error on invalid flags
+-
+-  dat->putDirect("global", global ? BooleanImp::staticTrue : BooleanImp::staticFalse, DontDelete | ReadOnly | DontEnum);
+-  dat->putDirect("ignoreCase", ignoreCase ? BooleanImp::staticTrue : BooleanImp::staticFalse, DontDelete | ReadOnly | DontEnum);
+-  dat->putDirect("multiline", multiline ? BooleanImp::staticTrue : BooleanImp::staticFalse, DontDelete | ReadOnly | DontEnum);
+-
+-  dat->putDirect("source", new StringImp(p), DontDelete | ReadOnly | DontEnum);
+-  dat->putDirect("lastIndex", NumberImp::zero(), DontDelete | DontEnum);
+-
+-  int reflags = RegExp::None;
+-  if (global)
+-      reflags |= RegExp::Global;
+-  if (ignoreCase)
+-      reflags |= RegExp::IgnoreCase;
+-  if (multiline)
+-      reflags |= RegExp::Multiline;
+-  RegExp *re = new RegExp(p, reflags);
+-  if (!re->isValid()) {
+-    Object err = Error::create(exec, SyntaxError,
+-                               "Invalid regular expression");
+-    exec->setException(err);
+-    return err;
+-  }
+   dat->setRegExp(re);
+ 
+   return obj;
+--- kjs/grammar.cpp	(revision 506549)
++++ kjs/grammar.cpp	(revision 515119)
+@@ -1,7 +1,7 @@
+-/* A Bison parser, made by GNU Bison 1.875.  */
++/* A Bison parser, made by GNU Bison 2.1.  */
+ 
+ /* Skeleton parser for Yacc-like parsing with Bison,
+-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
++   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+@@ -36,6 +36,9 @@
+ /* Identify Bison output.  */
+ #define YYBISON 1
+ 
++/* Bison version.  */
++#define YYBISON_VERSION "2.1"
++
+ /* Skeleton name.  */
+ #define YYSKELETON_NAME "yacc.c"
+ 
+@@ -45,8 +48,7 @@
+ /* Using locations.  */
+ #define YYLSP_NEEDED 1
+ 
+-/* If NAME_PREFIX is specified substitute the variables and functions
+-   names.  */
++/* Substitute the variable and function names.  */
+ #define yyparse kjsyyparse
+ #define yylex   kjsyylex
+ #define yyerror kjsyyerror
+@@ -123,6 +125,7 @@
+      AUTOMINUSMINUS = 316
+    };
+ #endif
++/* Tokens.  */
+ #define NULLTOKEN 258
+ #define TRUETOKEN 259
+ #define FALSETOKEN 260
+@@ -250,6 +253,11 @@
+ # define YYERROR_VERBOSE 0
+ #endif
+ 
++/* Enabling the token table.  */
++#ifndef YYTOKEN_TABLE
++# define YYTOKEN_TABLE 0
++#endif
++
+ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+ #line 50 "grammar.y"
+ typedef union YYSTYPE {
+@@ -280,8 +288,8 @@
+   CatchNode           *cnode;
+   FinallyNode         *fnode;
+ } YYSTYPE;
+-/* Line 191 of yacc.c.  */
+-#line 284 "grammar.tab.c"
++/* Line 196 of yacc.c.  */
++#line 293 "grammar.tab.c"
+ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+ # define YYSTYPE_IS_DECLARED 1
+ # define YYSTYPE_IS_TRIVIAL 1
+@@ -304,22 +312,48 @@
+ /* Copy the second part of user declarations.  */
+ 
+ 
+-/* Line 214 of yacc.c.  */
+-#line 308 "grammar.tab.c"
++/* Line 219 of yacc.c.  */
++#line 317 "grammar.tab.c"
+ 
++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
++# define YYSIZE_T __SIZE_TYPE__
++#endif
++#if ! defined (YYSIZE_T) && defined (size_t)
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
++# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T)
++# define YYSIZE_T unsigned int
++#endif
++
++#ifndef YY_
++# if YYENABLE_NLS
++#  if ENABLE_NLS
++#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
++#   define YY_(msgid) dgettext ("bison-runtime", msgid)
++#  endif
++# endif
++# ifndef YY_
++#  define YY_(msgid) msgid
++# endif
++#endif
++
+ #if ! defined (yyoverflow) || YYERROR_VERBOSE
+ 
+ /* The parser invokes alloca or malloc; define the necessary symbols.  */
+ 
+-# if YYSTACK_USE_ALLOCA
+-#  define YYSTACK_ALLOC alloca
+-# else
+-#  ifndef YYSTACK_USE_ALLOCA
+-#   if defined (alloca) || defined (_ALLOCA_H)
++# ifdef YYSTACK_USE_ALLOCA
++#  if YYSTACK_USE_ALLOCA
++#   ifdef __GNUC__
++#    define YYSTACK_ALLOC __builtin_alloca
++#   else
+ #    define YYSTACK_ALLOC alloca
+-#   else
+-#    ifdef __GNUC__
+-#     define YYSTACK_ALLOC __builtin_alloca
++#    if defined (__STDC__) || defined (__cplusplus)
++#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++#     define YYINCLUDED_STDLIB_H
+ #    endif
+ #   endif
+ #  endif
+@@ -328,25 +362,52 @@
+ # ifdef YYSTACK_ALLOC
+    /* Pacify GCC's `empty if-body' warning. */
+ #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
++#  ifndef YYSTACK_ALLOC_MAXIMUM
++    /* The OS might guarantee only one guard page at the bottom of the stack,
++       and a page size can be as small as 4096 bytes.  So we cannot safely
++       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
++       to allow for a few compiler-allocated temporary stack slots.  */
++#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
++#  endif
+ # else
+-#  if defined (__STDC__) || defined (__cplusplus)
+-#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+-#   define YYSIZE_T size_t
++#  define YYSTACK_ALLOC YYMALLOC
++#  define YYSTACK_FREE YYFREE
++#  ifndef YYSTACK_ALLOC_MAXIMUM
++#   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
+ #  endif
+-#  define YYSTACK_ALLOC malloc
+-#  define YYSTACK_FREE free
++#  ifdef __cplusplus
++extern "C" {
++#  endif
++#  ifndef YYMALLOC
++#   define YYMALLOC malloc
++#   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
++	&& (defined (__STDC__) || defined (__cplusplus)))
++void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
++#   endif
++#  endif
++#  ifndef YYFREE
++#   define YYFREE free
++#   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
++	&& (defined (__STDC__) || defined (__cplusplus)))
++void free (void *); /* INFRINGES ON USER NAME SPACE */
++#   endif
++#  endif
++#  ifdef __cplusplus
++}
++#  endif
+ # endif
+ #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+ 
+ 
+ #if (! defined (yyoverflow) \
+      && (! defined (__cplusplus) \
+-	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
++	 || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
++             && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+ 
+ /* A type that is properly aligned for any stack member.  */
+ union yyalloc
+ {
+-  short yyss;
++  short int yyss;
+   YYSTYPE yyvs;
+     YYLTYPE yyls;
+ };
+@@ -357,20 +418,20 @@
+ /* The size of an array large to enough to hold all stacks, each with
+    N elements.  */
+ # define YYSTACK_BYTES(N) \
+-     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
++     ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
+       + 2 * YYSTACK_GAP_MAXIMUM)
+ 
+ /* Copy COUNT objects from FROM to TO.  The source and destination do
+    not overlap.  */
+ # ifndef YYCOPY
+-#  if 1 < __GNUC__
++#  if defined (__GNUC__) && 1 < __GNUC__
+ #   define YYCOPY(To, From, Count) \
+       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+ #  else
+ #   define YYCOPY(To, From, Count)		\
+       do					\
+ 	{					\
+-	  register YYSIZE_T yyi;		\
++	  YYSIZE_T yyi;				\
+ 	  for (yyi = 0; yyi < (Count); yyi++)	\
+ 	    (To)[yyi] = (From)[yyi];		\
+ 	}					\
+@@ -399,28 +460,28 @@
+ #if defined (__STDC__) || defined (__cplusplus)
+    typedef signed char yysigned_char;
+ #else
+-   typedef short yysigned_char;
++   typedef short int yysigned_char;
+ #endif
+ 
+ /* YYFINAL -- State number of the termination state. */
+ #define YYFINAL  191
+ /* YYLAST -- Last index in YYTABLE.  */
+-#define YYLAST   1380
++#define YYLAST   1387
+ 
+ /* YYNTOKENS -- Number of terminals. */
+ #define YYNTOKENS  86
+ /* YYNNTS -- Number of nonterminals. */
+ #define YYNNTS  69
+ /* YYNRULES -- Number of rules. */
+-#define YYNRULES  206
++#define YYNRULES  207
+ /* YYNRULES -- Number of states. */
+-#define YYNSTATES  372
++#define YYNSTATES  373
+ 
+ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+ #define YYUNDEFTOK  2
+ #define YYMAXUTOK   316
+ 
+-#define YYTRANSLATE(YYX) 						\
++#define YYTRANSLATE(YYX)						\
+   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ 
+ /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+@@ -430,12 +491,12 @@
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+        2,     2,     2,    75,     2,     2,     2,    77,    80,     2,
+-      63,    64,    76,    72,    69,    73,    71,    62,     2,     2,
++      63,    64,    76,    72,    67,    73,    71,    62,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,    70,    85,
+       78,    84,    79,    83,     2,     2,     2,     2,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+-       2,    67,     2,    68,    81,     2,     2,     2,     2,     2,
++       2,    68,     2,    69,    81,     2,     2,     2,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+        2,     2,     2,    65,    82,    66,    74,     2,     2,     2,
+@@ -463,165 +524,166 @@
+ #if YYDEBUG
+ /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+    YYRHS.  */
+-static const unsigned short yyprhs[] =
++static const unsigned short int yyprhs[] =
+ {
+        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
+-      19,    21,    23,    25,    29,    32,    36,    40,    44,    50,
+-      53,    58,    59,    61,    63,    66,    70,    76,    78,    80,
+-      82,    84,    86,    91,    95,    99,   101,   104,   107,   110,
+-     115,   119,   122,   126,   128,   132,   134,   136,   138,   141,
+-     144,   146,   149,   152,   155,   158,   161,   164,   167,   170,
+-     173,   176,   179,   181,   185,   189,   193,   195,   199,   203,
+-     205,   209,   213,   217,   219,   223,   227,   231,   235,   239,
+-     243,   245,   249,   253,   257,   261,   263,   267,   269,   273,
+-     275,   279,   281,   285,   287,   291,   293,   299,   301,   305,
+-     307,   309,   311,   313,   315,   317,   319,   321,   323,   325,
+-     327,   329,   331,   335,   337,   339,   341,   343,   345,   347,
+-     349,   351,   353,   355,   357,   359,   361,   363,   365,   368,
+-     372,   374,   377,   381,   385,   387,   391,   393,   396,   400,
+-     404,   406,   410,   412,   415,   418,   420,   423,   426,   432,
+-     440,   447,   453,   463,   474,   482,   491,   501,   502,   504,
+-     507,   510,   514,   518,   521,   524,   528,   532,   535,   538,
+-     542,   546,   552,   558,   562,   568,   569,   571,   573,   576,
+-     580,   585,   588,   592,   596,   600,   604,   608,   612,   617,
+-     623,   626,   628,   631,   637,   644,   649,   655,   657,   661,
+-     664,   668,   669,   671,   673,   676,   678
++      19,    21,    23,    25,    29,    32,    36,    41,    45,    49,
++      55,    58,    63,    64,    66,    68,    71,    75,    81,    83,
++      85,    87,    89,    91,    96,   100,   104,   106,   109,   112,
++     115,   120,   124,   127,   131,   133,   137,   139,   141,   143,
++     146,   149,   151,   154,   157,   160,   163,   166,   169,   172,
++     175,   178,   181,   184,   186,   190,   194,   198,   200,   204,
++     208,   210,   214,   218,   222,   224,   228,   232,   236,   240,
++     244,   248,   250,   254,   258,   262,   266,   268,   272,   274,
++     278,   280,   284,   286,   290,   292,   296,   298,   304,   306,
++     310,   312,   314,   316,   318,   320,   322,   324,   326,   328,
++     330,   332,   334,   336,   340,   342,   344,   346,   348,   350,
++     352,   354,   356,   358,   360,   362,   364,   366,   368,   370,
++     373,   377,   379,   382,   386,   390,   392,   396,   398,   401,
++     405,   409,   411,   415,   417,   420,   423,   425,   428,   431,
++     437,   445,   452,   458,   468,   479,   487,   496,   506,   507,
++     509,   512,   515,   519,   523,   526,   529,   533,   537,   540,
++     543,   547,   551,   557,   563,   567,   573,   574,   576,   578,
++     581,   585,   590,   593,   597,   601,   605,   609,   613,   617,
++     622,   628,   631,   633,   636,   642,   649,   654,   660,   662,
++     666,   669,   673,   674,   676,   678,   681,   683
+ };
+ 
+ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
+-static const short yyrhs[] =
++static const short int yyrhs[] =
+ {
+      152,     0,    -1,     3,    -1,     4,    -1,     5,    -1,     7,
+       -1,     6,    -1,    62,    -1,    51,    -1,    21,    -1,    59,
+       -1,    87,    -1,    89,    -1,    63,   116,    64,    -1,    65,
+-      66,    -1,    65,    93,    66,    -1,    67,    91,    68,    -1,
+-      67,    90,    68,    -1,    67,    90,    69,    91,    68,    -1,
+-      91,   114,    -1,    90,    69,    91,   114,    -1,    -1,    92,
+-      -1,    69,    -1,    92,    69,    -1,    94,    70,   114,    -1,
+-      93,    69,    94,    70,   114,    -1,    59,    -1,     6,    -1,
+-       7,    -1,    88,    -1,   149,    -1,    95,    67,   116,    68,
+-      -1,    95,    71,    59,    -1,    12,    95,    98,    -1,    95,
+-      -1,    12,    96,    -1,    95,    98,    -1,    97,    98,    -1,
+-      97,    67,   116,    68,    -1,    97,    71,    59,    -1,    63,
+-      64,    -1,    63,    99,    64,    -1,   114,    -1,    99,    69,
+-     114,    -1,    96,    -1,    97,    -1,   100,    -1,   100,    43,
+-      -1,   100,    44,    -1,   101,    -1,    19,   102,    -1,    18,
+-     102,    -1,    27,   102,    -1,    43,   102,    -1,    60,   102,
+-      -1,    44,   102,    -1,    61,   102,    -1,    72,   102,    -1,
+-      73,   102,    -1,    74,   102,    -1,    75,   102,    -1,   102,
+-      -1,   103,    76,   102,    -1,   103,    62,   102,    -1,   103,
+-      77,   102,    -1,   103,    -1,   104,    72,   103,    -1,   104,
+-      73,   103,    -1,   104,    -1,   105,    45,   104,    -1,   105,
+-      46,   104,    -1,   105,    47,   104,    -1,   105,    -1,   106,
+-      78,   105,    -1,   106,    79,   105,    -1,   106,    39,   105,
+-      -1,   106,    40,   105,    -1,   106,    26,   105,    -1,   106,
+-      25,   105,    -1,   106,    -1,   107,    35,   106,    -1,   107,
+-      36,   106,    -1,   107,    37,   106,    -1,   107,    38,   106,
+-      -1,   107,    -1,   108,    80,   107,    -1,   108,    -1,   109,
+-      81,   108,    -1,   109,    -1,   110,    82,   109,    -1,   110,
+-      -1,   111,    42,   110,    -1,   111,    -1,   112,    41,   111,
+-      -1,   112,    -1,   112,    83,   114,    70,   114,    -1,   113,
+-      -1,   100,   115,   114,    -1,    84,    -1,    48,    -1,    49,
+-      -1,    50,    -1,    51,    -1,    52,    -1,    53,    -1,    54,
+-      -1,    55,    -1,    57,    -1,    58,    -1,    56,    -1,   114,
+-      -1,   116,    69,   114,    -1,   118,    -1,   120,    -1,   123,
+-      -1,   127,    -1,   128,    -1,   129,    -1,   130,    -1,   132,
+-      -1,   133,    -1,   134,    -1,   135,    -1,   136,    -1,   142,
+-      -1,   143,    -1,   144,    -1,    65,    66,    -1,    65,   153,
+-      66,    -1,   117,    -1,   119,   117,    -1,    13,   121,    85,
+-      -1,    13,   121,     1,    -1,   122,    -1,   121,    69,   122,
+-      -1,    59,    -1,    59,   126,    -1,    14,   124,    85,    -1,
+-      14,   124,     1,    -1,   125,    -1,   124,    69,   122,    -1,
+-      59,    -1,    59,   126,    -1,    84,   114,    -1,    85,    -1,
+-     116,    85,    -1,   116,     1,    -1,    20,    63,   116,    64,
+-     117,    -1,    20,    63,   116,    64,   117,    24,   117,    -1,
+-      22,   117,    23,    63,   116,    64,    -1,    23,    63,   116,
+-      64,   117,    -1,    11,    63,   131,    85,   131,    85,   131,
+-      64,   117,    -1,    11,    63,    13,   121,    85,   131,    85,
+-     131,    64,   117,    -1,    11,    63,   100,    25,   116,    64,
+-     117,    -1,    11,    63,    13,    59,    25,   116,    64,   117,
+-      -1,    11,    63,    13,    59,   126,    25,   116,    64,   117,
+-      -1,    -1,   116,    -1,    15,    85,    -1,    15,     1,    -1,
+-      15,    59,    85,    -1,    15,    59,     1,    -1,     8,    85,
+-      -1,     8,     1,    -1,     8,    59,    85,    -1,     8,    59,
+-       1,    -1,    17,    85,    -1,    17,     1,    -1,    17,   116,
+-      85,    -1,    17,   116,     1,    -1,    29,    63,   116,    64,
+-     117,    -1,    28,    63,   116,    64,   137,    -1,    65,   138,
+-      66,    -1,    65,   138,   141,   138,    66,    -1,    -1,   139,
+-      -1,   140,    -1,   139,   140,    -1,     9,   116,    70,    -1,
+-       9,   116,    70,   119,    -1,    10,    70,    -1,    10,    70,
+-     119,    -1,    59,    70,   117,    -1,    31,   116,    85,    -1,
+-      31,   116,     1,    -1,    32,   118,   145,    -1,    32,   118,
+-     146,    -1,    32,   118,   145,   146,    -1,    33,    63,    59,
+-      64,   118,    -1,    34,   118,    -1,   148,    -1,    18,   148,
+-      -1,    16,    59,    63,    64,   151,    -1,    16,    59,    63,
+-     150,    64,   151,    -1,    16,    63,    64,   151,    -1,    16,
+-      63,   150,    64,   151,    -1,    59,    -1,   150,    69,    59,
+-      -1,    65,    66,    -1,    65,   153,    66,    -1,    -1,   153,
+-      -1,   154,    -1,   153,   154,    -1,   117,    -1,   147,    -1
++      66,    -1,    65,    93,    66,    -1,    65,    93,    67,    66,
++      -1,    68,    91,    69,    -1,    68,    90,    69,    -1,    68,
++      90,    67,    91,    69,    -1,    91,   114,    -1,    90,    67,
++      91,   114,    -1,    -1,    92,    -1,    67,    -1,    92,    67,
++      -1,    94,    70,   114,    -1,    93,    67,    94,    70,   114,
++      -1,    59,    -1,     6,    -1,     7,    -1,    88,    -1,   149,
++      -1,    95,    68,   116,    69,    -1,    95,    71,    59,    -1,
++      12,    95,    98,    -1,    95,    -1,    12,    96,    -1,    95,
++      98,    -1,    97,    98,    -1,    97,    68,   116,    69,    -1,
++      97,    71,    59,    -1,    63,    64,    -1,    63,    99,    64,
++      -1,   114,    -1,    99,    67,   114,    -1,    96,    -1,    97,
++      -1,   100,    -1,   100,    43,    -1,   100,    44,    -1,   101,
++      -1,    19,   102,    -1,    18,   102,    -1,    27,   102,    -1,
++      43,   102,    -1,    60,   102,    -1,    44,   102,    -1,    61,
++     102,    -1,    72,   102,    -1,    73,   102,    -1,    74,   102,
++      -1,    75,   102,    -1,   102,    -1,   103,    76,   102,    -1,
++     103,    62,   102,    -1,   103,    77,   102,    -1,   103,    -1,
++     104,    72,   103,    -1,   104,    73,   103,    -1,   104,    -1,
++     105,    45,   104,    -1,   105,    46,   104,    -1,   105,    47,
++     104,    -1,   105,    -1,   106,    78,   105,    -1,   106,    79,
++     105,    -1,   106,    39,   105,    -1,   106,    40,   105,    -1,
++     106,    26,   105,    -1,   106,    25,   105,    -1,   106,    -1,
++     107,    35,   106,    -1,   107,    36,   106,    -1,   107,    37,
++     106,    -1,   107,    38,   106,    -1,   107,    -1,   108,    80,
++     107,    -1,   108,    -1,   109,    81,   108,    -1,   109,    -1,
++     110,    82,   109,    -1,   110,    -1,   111,    42,   110,    -1,
++     111,    -1,   112,    41,   111,    -1,   112,    -1,   112,    83,
++     114,    70,   114,    -1,   113,    -1,   100,   115,   114,    -1,
++      84,    -1,    48,    -1,    49,    -1,    50,    -1,    51,    -1,
++      52,    -1,    53,    -1,    54,    -1,    55,    -1,    57,    -1,
++      58,    -1,    56,    -1,   114,    -1,   116,    67,   114,    -1,
++     118,    -1,   120,    -1,   123,    -1,   127,    -1,   128,    -1,
++     129,    -1,   130,    -1,   132,    -1,   133,    -1,   134,    -1,
++     135,    -1,   136,    -1,   142,    -1,   143,    -1,   144,    -1,
++      65,    66,    -1,    65,   153,    66,    -1,   117,    -1,   119,
++     117,    -1,    13,   121,    85,    -1,    13,   121,     1,    -1,
++     122,    -1,   121,    67,   122,    -1,    59,    -1,    59,   126,
++      -1,    14,   124,    85,    -1,    14,   124,     1,    -1,   125,
++      -1,   124,    67,   122,    -1,    59,    -1,    59,   126,    -1,
++      84,   114,    -1,    85,    -1,   116,    85,    -1,   116,     1,
++      -1,    20,    63,   116,    64,   117,    -1,    20,    63,   116,
++      64,   117,    24,   117,    -1,    22,   117,    23,    63,   116,
++      64,    -1,    23,    63,   116,    64,   117,    -1,    11,    63,
++     131,    85,   131,    85,   131,    64,   117,    -1,    11,    63,
++      13,   121,    85,   131,    85,   131,    64,   117,    -1,    11,
++      63,   100,    25,   116,    64,   117,    -1,    11,    63,    13,
++      59,    25,   116,    64,   117,    -1,    11,    63,    13,    59,
++     126,    25,   116,    64,   117,    -1,    -1,   116,    -1,    15,
++      85,    -1,    15,     1,    -1,    15,    59,    85,    -1,    15,
++      59,     1,    -1,     8,    85,    -1,     8,     1,    -1,     8,
++      59,    85,    -1,     8,    59,     1,    -1,    17,    85,    -1,
++      17,     1,    -1,    17,   116,    85,    -1,    17,   116,     1,
++      -1,    29,    63,   116,    64,   117,    -1,    28,    63,   116,
++      64,   137,    -1,    65,   138,    66,    -1,    65,   138,   141,
++     138,    66,    -1,    -1,   139,    -1,   140,    -1,   139,   140,
++      -1,     9,   116,    70,    -1,     9,   116,    70,   119,    -1,
++      10,    70,    -1,    10,    70,   119,    -1,    59,    70,   117,
++      -1,    31,   116,    85,    -1,    31,   116,     1,    -1,    32,
++     118,   145,    -1,    32,   118,   146,    -1,    32,   118,   145,
++     146,    -1,    33,    63,    59,    64,   118,    -1,    34,   118,
++      -1,   148,    -1,    18,   148,    -1,    16,    59,    63,    64,
++     151,    -1,    16,    59,    63,   150,    64,   151,    -1,    16,
++      63,    64,   151,    -1,    16,    63,   150,    64,   151,    -1,
++      59,    -1,   150,    67,    59,    -1,    65,    66,    -1,    65,
++     153,    66,    -1,    -1,   153,    -1,   154,    -1,   153,   154,
++      -1,   117,    -1,   147,    -1
+ };
+ 
+ /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+-static const unsigned short yyrline[] =
++static const unsigned short int yyrline[] =
+ {
+        0,   165,   165,   166,   167,   168,   169,   170,   173,   180,
+-     181,   182,   183,   184,   185,   186,   190,   191,   192,   196,
+-     197,   202,   203,   207,   208,   212,   213,   218,   219,   220,
+-     224,   225,   226,   227,   228,   232,   233,   237,   238,   239,
+-     240,   244,   245,   249,   250,   254,   255,   259,   260,   261,
+-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+-     275,   276,   280,   281,   282,   283,   287,   288,   289,   293,
+-     294,   295,   296,   300,   301,   303,   305,   307,   309,   311,
+-     316,   317,   318,   319,   320,   324,   325,   329,   330,   334,
+-     335,   339,   340,   345,   346,   351,   352,   357,   358,   363,
++     181,   182,   183,   184,   185,   186,   187,   191,   192,   193,
++     197,   198,   203,   204,   208,   209,   213,   214,   219,   220,
++     221,   225,   226,   227,   228,   229,   233,   234,   238,   239,
++     240,   241,   245,   246,   250,   251,   255,   256,   260,   261,
++     262,   266,   267,   268,   269,   270,   271,   272,   273,   274,
++     275,   276,   277,   281,   282,   283,   284,   288,   289,   290,
++     294,   295,   296,   297,   301,   302,   304,   306,   308,   310,
++     312,   317,   318,   319,   320,   321,   325,   326,   330,   331,
++     335,   336,   340,   341,   346,   347,   352,   353,   358,   359,
+      364,   365,   366,   367,   368,   369,   370,   371,   372,   373,
+-     374,   378,   379,   383,   384,   385,   386,   387,   388,   389,
+-     390,   391,   392,   393,   394,   395,   396,   397,   401,   402,
+-     406,   407,   411,   413,   423,   424,   429,   430,   434,   436,
+-     446,   447,   452,   453,   457,   461,   465,   467,   475,   476,
+-     481,   482,   483,   486,   489,   492,   495,   501,   502,   506,
+-     507,   511,   512,   519,   520,   524,   525,   533,   534,   538,
+-     539,   547,   552,   557,   558,   563,   564,   568,   569,   573,
+-     574,   578,   579,   583,   588,   589,   596,   597,   598,   602,
+-     607,   611,   613,   617,   618,   623,   624,   630,   631,   635,
+-     637,   642,   645,   650,   651,   655,   656
++     374,   375,   379,   380,   384,   385,   386,   387,   388,   389,
++     390,   391,   392,   393,   394,   395,   396,   397,   398,   402,
++     403,   407,   408,   412,   414,   424,   425,   430,   431,   435,
++     437,   447,   448,   453,   454,   458,   462,   466,   468,   476,
++     477,   482,   483,   484,   487,   490,   493,   496,   502,   503,
++     507,   508,   512,   513,   520,   521,   525,   526,   534,   535,
++     539,   540,   548,   553,   558,   559,   564,   565,   569,   570,
++     574,   575,   579,   580,   584,   589,   590,   597,   598,   599,
++     603,   608,   612,   614,   618,   619,   624,   625,   631,   632,
++     636,   638,   643,   646,   651,   652,   656,   657
+ };
+ #endif
+ 
+-#if YYDEBUG || YYERROR_VERBOSE
+-/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
++#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
++/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+ static const char *const yytname[] =
+ {
+-  "$end", "error", "$undefined", "NULLTOKEN", "TRUETOKEN", "FALSETOKEN", 
+-  "STRING", "NUMBER", "BREAK", "CASE", "DEFAULT", "FOR", "NEW", "VAR", 
+-  "CONST", "CONTINUE", "FUNCTION", "RETURN", "VOID", "DELETE", "IF", 
+-  "THIS", "DO", "WHILE", "ELSE", "IN", "INSTANCEOF", "TYPEOF", "SWITCH", 
+-  "WITH", "RESERVED", "THROW", "TRY", "CATCH", "FINALLY", "EQEQ", "NE", 
+-  "STREQ", "STRNEQ", "LE", "GE", "OR", "AND", "PLUSPLUS", "MINUSMINUS", 
+-  "LSHIFT", "RSHIFT", "URSHIFT", "PLUSEQUAL", "MINUSEQUAL", "MULTEQUAL", 
+-  "DIVEQUAL", "LSHIFTEQUAL", "RSHIFTEQUAL", "URSHIFTEQUAL", "ANDEQUAL", 
+-  "MODEQUAL", "XOREQUAL", "OREQUAL", "IDENT", "AUTOPLUSPLUS", 
+-  "AUTOMINUSMINUS", "'/'", "'('", "')'", "'{'", "'}'", "'['", "']'", 
+-  "','", "':'", "'.'", "'+'", "'-'", "'~'", "'!'", "'*'", "'%'", "'<'", 
+-  "'>'", "'&'", "'^'", "'|'", "'?'", "'='", "';'", "$accept", "Literal", 
+-  "PrimaryExpr", "ArrayLiteral", "ElementList", "ElisionOpt", "Elision", 
+-  "PropertyNameAndValueList", "PropertyName", "MemberExpr", "NewExpr", 
+-  "CallExpr", "Arguments", "ArgumentList", "LeftHandSideExpr", 
+-  "PostfixExpr", "UnaryExpr", "MultiplicativeExpr", "AdditiveExpr", 
+-  "ShiftExpr", "RelationalExpr", "EqualityExpr", "BitwiseANDExpr", 
+-  "BitwiseXORExpr", "BitwiseORExpr", "LogicalANDExpr", "LogicalORExpr", 
+-  "ConditionalExpr", "AssignmentExpr", "AssignmentOperator", "Expr", 
+-  "Statement", "Block", "StatementList", "VariableStatement", 
+-  "VariableDeclarationList", "VariableDeclaration", "ConstStatement", 
+-  "ConstDeclarationList", "ConstDeclaration", "Initializer", 
+-  "EmptyStatement", "ExprStatement", "IfStatement", "IterationStatement", 
+-  "ExprOpt", "ContinueStatement", "BreakStatement", "ReturnStatement", 
+-  "WithStatement", "SwitchStatement", "CaseBlock", "CaseClausesOpt", 
+-  "CaseClauses", "CaseClause", "DefaultClause", "LabelledStatement", 
+-  "ThrowStatement", "TryStatement", "Catch", "Finally", 
+-  "FunctionDeclaration", "FunctionDeclarationInternal", "FunctionExpr", 
+-  "FormalParameterList", "FunctionBody", "Program", "SourceElements", 
++  "$end", "error", "$undefined", "NULLTOKEN", "TRUETOKEN", "FALSETOKEN",
++  "STRING", "NUMBER", "BREAK", "CASE", "DEFAULT", "FOR", "NEW", "VAR",
++  "CONST", "CONTINUE", "FUNCTION", "RETURN", "VOID", "DELETE", "IF",
++  "THIS", "DO", "WHILE", "ELSE", "IN", "INSTANCEOF", "TYPEOF", "SWITCH",
++  "WITH", "RESERVED", "THROW", "TRY", "CATCH", "FINALLY", "EQEQ", "NE",
++  "STREQ", "STRNEQ", "LE", "GE", "OR", "AND", "PLUSPLUS", "MINUSMINUS",
++  "LSHIFT", "RSHIFT", "URSHIFT", "PLUSEQUAL", "MINUSEQUAL", "MULTEQUAL",
++  "DIVEQUAL", "LSHIFTEQUAL", "RSHIFTEQUAL", "URSHIFTEQUAL", "ANDEQUAL",
++  "MODEQUAL", "XOREQUAL", "OREQUAL", "IDENT", "AUTOPLUSPLUS",
++  "AUTOMINUSMINUS", "'/'", "'('", "')'", "'{'", "'}'", "','", "'['", "']'",
++  "':'", "'.'", "'+'", "'-'", "'~'", "'!'", "'*'", "'%'", "'<'", "'>'",
++  "'&'", "'^'", "'|'", "'?'", "'='", "';'", "$accept", "Literal",
++  "PrimaryExpr", "ArrayLiteral", "ElementList", "ElisionOpt", "Elision",
++  "PropertyNameAndValueList", "PropertyName", "MemberExpr", "NewExpr",
++  "CallExpr", "Arguments", "ArgumentList", "LeftHandSideExpr",
++  "PostfixExpr", "UnaryExpr", "MultiplicativeExpr", "AdditiveExpr",
++  "ShiftExpr", "RelationalExpr", "EqualityExpr", "BitwiseANDExpr",
++  "BitwiseXORExpr", "BitwiseORExpr", "LogicalANDExpr", "LogicalORExpr",
++  "ConditionalExpr", "AssignmentExpr", "AssignmentOperator", "Expr",
++  "Statement", "Block", "StatementList", "VariableStatement",
++  "VariableDeclarationList", "VariableDeclaration", "ConstStatement",
++  "ConstDeclarationList", "ConstDeclaration", "Initializer",
++  "EmptyStatement", "ExprStatement", "IfStatement", "IterationStatement",
++  "ExprOpt", "ContinueStatement", "BreakStatement", "ReturnStatement",
++  "WithStatement", "SwitchStatement", "CaseBlock", "CaseClausesOpt",
++  "CaseClauses", "CaseClause", "DefaultClause", "LabelledStatement",
++  "ThrowStatement", "TryStatement", "Catch", "Finally",
++  "FunctionDeclaration", "FunctionDeclarationInternal", "FunctionExpr",
++  "FormalParameterList", "FunctionBody", "Program", "SourceElements",
+   "SourceElement", 0
+ };
+ #endif
+@@ -629,7 +691,7 @@
+ # ifdef YYPRINT
+ /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+    token YYLEX-NUM.  */
+-static const unsigned short yytoknum[] =
++static const unsigned short int yytoknum[] =
+ {
+        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
+      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+@@ -637,7 +699,7 @@
+      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
+      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
+-     315,   316,    47,    40,    41,   123,   125,    91,    93,    44,
++     315,   316,    47,    40,    41,   123,   125,    44,    91,    93,
+       58,    46,    43,    45,   126,    33,    42,    37,    60,    62,
+       38,    94,   124,    63,    61,    59
+ };
+@@ -647,52 +709,52 @@
+ static const unsigned char yyr1[] =
+ {
+        0,    86,    87,    87,    87,    87,    87,    87,    87,    88,
+-      88,    88,    88,    88,    88,    88,    89,    89,    89,    90,
+-      90,    91,    91,    92,    92,    93,    93,    94,    94,    94,
+-      95,    95,    95,    95,    95,    96,    96,    97,    97,    97,
+-      97,    98,    98,    99,    99,   100,   100,   101,   101,   101,
+-     102,   102,   102,   102,   102,   102,   102,   102,   102,   102,
+-     102,   102,   103,   103,   103,   103,   104,   104,   104,   105,
+-     105,   105,   105,   106,   106,   106,   106,   106,   106,   106,
+-     107,   107,   107,   107,   107,   108,   108,   109,   109,   110,
+-     110,   111,   111,   112,   112,   113,   113,   114,   114,   115,
++      88,    88,    88,    88,    88,    88,    88,    89,    89,    89,
++      90,    90,    91,    91,    92,    92,    93,    93,    94,    94,
++      94,    95,    95,    95,    95,    95,    96,    96,    97,    97,
++      97,    97,    98,    98,    99,    99,   100,   100,   101,   101,
++     101,   102,   102,   102,   102,   102,   102,   102,   102,   102,
++     102,   102,   102,   103,   103,   103,   103,   104,   104,   104,
++     105,   105,   105,   105,   106,   106,   106,   106,   106,   106,
++     106,   107,   107,   107,   107,   107,   108,   108,   109,   109,
++     110,   110,   111,   111,   112,   112,   113,   113,   114,   114,
+      115,   115,   115,   115,   115,   115,   115,   115,   115,   115,
+-     115,   116,   116,   117,   117,   117,   117,   117,   117,   117,
+-     117,   117,   117,   117,   117,   117,   117,   117,   118,   118,
+-     119,   119,   120,   120,   121,   121,   122,   122,   123,   123,
+-     124,   124,   125,   125,   126,   127,   128,   128,   129,   129,
+-     130,   130,   130,   130,   130,   130,   130,   131,   131,   132,
+-     132,   132,   132,   133,   133,   133,   133,   134,   134,   134,
+-     134,   135,   136,   137,   137,   138,   138,   139,   139,   140,
+-     140,   141,   141,   142,   143,   143,   144,   144,   144,   145,
+-     146,   147,   147,   148,   148,   149,   149,   150,   150,   151,
+-     151,   152,   152,   153,   153,   154,   154
++     115,   115,   116,   116,   117,   117,   117,   117,   117,   117,
++     117,   117,   117,   117,   117,   117,   117,   117,   117,   118,
++     118,   119,   119,   120,   120,   121,   121,   122,   122,   123,
++     123,   124,   124,   125,   125,   126,   127,   128,   128,   129,
++     129,   130,   130,   130,   130,   130,   130,   130,   131,   131,
++     132,   132,   132,   132,   133,   133,   133,   133,   134,   134,
++     134,   134,   135,   136,   137,   137,   138,   138,   139,   139,
++     140,   140,   141,   141,   142,   143,   143,   144,   144,   144,
++     145,   146,   147,   147,   148,   148,   149,   149,   150,   150,
++     151,   151,   152,   152,   153,   153,   154,   154
+ };
+ 
+ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+ static const unsigned char yyr2[] =
+ {
+        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
+-       1,     1,     1,     3,     2,     3,     3,     3,     5,     2,
+-       4,     0,     1,     1,     2,     3,     5,     1,     1,     1,
+-       1,     1,     4,     3,     3,     1,     2,     2,     2,     4,
+-       3,     2,     3,     1,     3,     1,     1,     1,     2,     2,
+-       1,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+-       2,     2,     1,     3,     3,     3,     1,     3,     3,     1,
+-       3,     3,     3,     1,     3,     3,     3,     3,     3,     3,
+-       1,     3,     3,     3,     3,     1,     3,     1,     3,     1,
+-       3,     1,     3,     1,     3,     1,     5,     1,     3,     1,
++       1,     1,     1,     3,     2,     3,     4,     3,     3,     5,
++       2,     4,     0,     1,     1,     2,     3,     5,     1,     1,
++       1,     1,     1,     4,     3,     3,     1,     2,     2,     2,
++       4,     3,     2,     3,     1,     3,     1,     1,     1,     2,
++       2,     1,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     1,     3,     3,     3,     1,     3,     3,
++       1,     3,     3,     3,     1,     3,     3,     3,     3,     3,
++       3,     1,     3,     3,     3,     3,     1,     3,     1,     3,
++       1,     3,     1,     3,     1,     3,     1,     5,     1,     3,
+        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+-       1,     1,     3,     1,     1,     1,     1,     1,     1,     1,
+-       1,     1,     1,     1,     1,     1,     1,     1,     2,     3,
+-       1,     2,     3,     3,     1,     3,     1,     2,     3,     3,
+-       1,     3,     1,     2,     2,     1,     2,     2,     5,     7,
+-       6,     5,     9,    10,     7,     8,     9,     0,     1,     2,
+-       2,     3,     3,     2,     2,     3,     3,     2,     2,     3,
+-       3,     5,     5,     3,     5,     0,     1,     1,     2,     3,
+-       4,     2,     3,     3,     3,     3,     3,     3,     4,     5,
+-       2,     1,     2,     5,     6,     4,     5,     1,     3,     2,
+-       3,     0,     1,     1,     2,     1,     1
++       1,     1,     1,     3,     1,     1,     1,     1,     1,     1,
++       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
++       3,     1,     2,     3,     3,     1,     3,     1,     2,     3,
++       3,     1,     3,     1,     2,     2,     1,     2,     2,     5,
++       7,     6,     5,     9,    10,     7,     8,     9,     0,     1,
++       2,     2,     3,     3,     2,     2,     3,     3,     2,     2,
++       3,     3,     5,     5,     3,     5,     0,     1,     1,     2,
++       3,     4,     2,     3,     3,     3,     3,     3,     3,     4,
++       5,     2,     1,     2,     5,     6,     4,     5,     1,     3,
++       2,     3,     0,     1,     1,     2,     1,     1
+ };
+ 
+ /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+@@ -700,158 +762,158 @@
+    means the default is an error.  */
+ static const unsigned char yydefact[] =
+ {
+-     201,     2,     3,     4,     6,     5,     0,     0,     0,     0,
++     202,     2,     3,     4,     6,     5,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     9,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     8,    10,     0,
+-       0,     7,     0,     0,    21,     0,     0,     0,     0,   145,
+-      11,    30,    12,    35,    45,    46,    47,    50,    62,    66,
+-      69,    73,    80,    85,    87,    89,    91,    93,    95,    97,
+-     111,     0,   205,   113,   114,   115,   116,   117,   118,   119,
+-     120,   121,   122,   123,   124,   125,   126,   127,   206,   191,
+-      31,     0,   202,   203,   164,     0,   163,   157,     0,    10,
+-       0,    35,    36,   136,     0,   134,   142,     0,   140,   160,
+-       0,   159,     0,     0,   168,     0,   167,     0,    47,    52,
+-     192,    51,     0,     0,     0,    53,     0,     0,     0,     0,
+-       0,    54,    56,     0,    55,    57,     0,     6,     5,    10,
+-      14,     0,     0,     0,    23,     0,     0,    22,    58,    59,
+-      60,    61,     0,     0,     0,    37,     0,     0,    38,    48,
+-      49,   100,   101,   102,   103,   104,   105,   106,   107,   110,
+-     108,   109,    99,     0,     0,     0,     0,     0,     0,     0,
++       0,     7,     0,     0,    22,     0,     0,     0,     0,   146,
++      11,    31,    12,    36,    46,    47,    48,    51,    63,    67,
++      70,    74,    81,    86,    88,    90,    92,    94,    96,    98,
++     112,     0,   206,   114,   115,   116,   117,   118,   119,   120,
++     121,   122,   123,   124,   125,   126,   127,   128,   207,   192,
++      32,     0,   203,   204,   165,     0,   164,   158,     0,    10,
++       0,    36,    37,   137,     0,   135,   143,     0,   141,   161,
++       0,   160,     0,     0,   169,     0,   168,     0,    48,    53,
++     193,    52,     0,     0,     0,    54,     0,     0,     0,     0,
++       0,    55,    57,     0,    56,    58,     0,     6,     5,    10,
++      14,     0,     0,     0,    24,     0,     0,    23,    59,    60,
++      61,    62,     0,     0,     0,    38,     0,     0,    39,    49,
++      50,   101,   102,   103,   104,   105,   106,   107,   108,   111,
++     109,   110,   100,     0,     0,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,     0,     0,   147,     0,
+-     146,     1,   204,   166,   165,     0,    47,   158,     0,    28,
+-      29,    27,    14,    34,     0,   137,   133,     0,   132,   143,
+-     139,     0,   138,   162,   161,     0,   197,     0,     0,   170,
+-     169,     0,     0,     0,     0,     0,   185,   184,   128,     0,
+-       0,   186,   187,   183,    13,    15,     0,     0,   129,    17,
+-      21,    16,    19,    24,    41,     0,    43,     0,    33,     0,
+-      40,    98,    64,    63,    65,    67,    68,    70,    71,    72,
+-      79,    78,    76,    77,    74,    75,    81,    82,    83,    84,
+-      86,    88,    90,    92,    94,     0,   112,   136,     0,     0,
+-     157,   144,   135,   141,     0,     0,     0,   195,     0,     0,
+-       0,     0,     0,     0,     0,     0,   190,   188,     0,    25,
+-       0,    42,     0,    32,    39,     0,     0,   137,   157,     0,
+-       0,   193,     0,   199,     0,   196,   198,   148,     0,   151,
+-     175,   172,   171,     0,     0,    18,    20,    44,    96,     0,
+-       0,     0,     0,   157,   194,   200,     0,   150,     0,     0,
+-     176,   177,     0,    26,     0,     0,   157,   154,     0,   149,
+-       0,     0,   173,   175,   178,   189,   155,     0,     0,     0,
+-     179,   181,     0,   156,     0,   152,   130,   180,   182,   174,
+-     153,   131
++       0,     0,     0,     0,     0,     0,     0,     0,   148,     0,
++     147,     1,   205,   167,   166,     0,    48,   159,     0,    29,
++      30,    28,    14,    35,     0,   138,   134,     0,   133,   144,
++     140,     0,   139,   163,   162,     0,   198,     0,     0,   171,
++     170,     0,     0,     0,     0,     0,   186,   185,   129,     0,
++       0,   187,   188,   184,    13,    15,     0,     0,   130,    22,
++      18,    17,    20,    25,    42,     0,    44,     0,    34,     0,
++      41,    99,    65,    64,    66,    68,    69,    71,    72,    73,
++      80,    79,    77,    78,    75,    76,    82,    83,    84,    85,
++      87,    89,    91,    93,    95,     0,   113,   137,     0,     0,
++     158,   145,   136,   142,     0,     0,     0,   196,     0,     0,
++       0,     0,     0,     0,     0,     0,   191,   189,    16,     0,
++      26,     0,    43,     0,    33,    40,     0,     0,   138,   158,
++       0,     0,   194,     0,   200,     0,   197,   199,   149,     0,
++     152,   176,   173,   172,     0,     0,    19,    21,    45,    97,
++       0,     0,     0,     0,   158,   195,   201,     0,   151,     0,
++       0,   177,   178,     0,    27,     0,     0,   158,   155,     0,
++     150,     0,     0,   174,   176,   179,   190,   156,     0,     0,
++       0,   180,   182,     0,   157,     0,   153,   131,   181,   183,
++     175,   154,   132
+ };
+ 
+ /* YYDEFGOTO[NTERM-NUM]. */
+-static const short yydefgoto[] =
++static const short int yydefgoto[] =
+ {
+       -1,    40,    41,    42,   135,   136,   137,   131,   132,    43,
+       44,    45,   145,   245,    46,    47,    48,    49,    50,    51,
+       52,    53,    54,    55,    56,    57,    58,    59,    60,   163,
+-      61,    62,    63,   367,    64,    94,    95,    65,    97,    98,
++      61,    62,    63,   368,    64,    94,    95,    65,    97,    98,
+      205,    66,    67,    68,    69,   198,    70,    71,    72,    73,
+-      74,   321,   339,   340,   341,   353,    75,    76,    77,   231,
++      74,   322,   340,   341,   342,   354,    75,    76,    77,   231,
+      232,    78,    79,    80,   218,   287,    81,   133,    83
+ };
+ 
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+    STATE-NUM.  */
+-#define YYPACT_NINF -265
+-static const short yypact[] =
++#define YYPACT_NINF -233
++static const short int yypact[] =
+ {
+-     747,  -265,  -265,  -265,  -265,  -265,     5,   -45,   176,   -31,
+-      30,     6,    -3,    67,  1232,  1305,   -14,  -265,   822,    12,
+-    1305,    15,    74,  1305,   -13,  1305,  1305,  -265,    44,  1305,
+-    1305,  -265,  1305,   372,    84,  1305,  1305,  1305,  1305,  -265,
+-    -265,  -265,  -265,   -26,  -265,   -17,   251,  -265,  -265,   -19,
+-      50,   159,   131,   184,   115,   156,   158,   200,    -2,  -265,
+-    -265,    11,  -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,
+-    -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,
+-    -265,   244,   747,  -265,  -265,    10,  -265,   940,   182,  -265,
+-      92,   -26,  -265,   178,    18,  -265,   178,    28,  -265,  -265,
+-      16,  -265,   201,   -11,  -265,  1305,  -265,    39,    19,  -265,
+-    -265,  -265,  1305,   240,  1305,  -265,  1305,  1305,    46,   447,
+-     132,  -265,  -265,   822,  -265,  -265,    48,   195,   196,    44,
+-     905,    69,   197,   522,  -265,   107,  1013,   199,  -265,  -265,
+-    -265,  -265,  1086,  1305,   212,  -265,  1305,   214,  -265,  -265,
+-    -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,  -265,
+-    -265,  -265,  -265,  1305,  1305,  1305,  1305,  1305,  1305,  1305,
+-    1305,  1305,  1305,  1305,  1305,  1305,  1305,  1305,  1305,  1305,
+-    1305,  1305,  1305,  1305,  1305,  1305,  1305,  1305,  -265,  1305,
+-    -265,  -265,  -265,  -265,  -265,   218,   203,   209,   194,  -265,
+-    -265,  -265,  -265,  -265,  1305,  -265,  -265,   -31,  -265,  -265,
+-    -265,   -31,  -265,  -265,  -265,    57,  -265,   215,    56,  -265,
+-    -265,    85,   219,    86,    98,    99,  -265,  -265,  -265,   220,
+-     -13,   250,  -265,  -265,  -265,  -265,    60,  1305,  -265,  -265,
+-      84,  -265,  -265,  -265,  -265,   100,  -265,   143,  -265,   147,
+-    -265,  -265,  -265,  -265,  -265,   -19,   -19,    50,    50,    50,
+-     159,   159,   159,   159,   159,   159,   131,   131,   131,   131,
+-     184,   115,   156,   158,   200,   216,  -265,     9,   -43,  1305,
+-    1305,  -265,  -265,  -265,   215,   109,   597,  -265,   215,   226,
+-     822,  1305,   822,   224,   822,   231,  -265,  -265,   221,  -265,
+-    1159,  -265,  1305,  -265,  -265,  1305,  1305,   267,  1305,   120,
+-     225,  -265,   215,  -265,   672,  -265,  -265,   273,   121,  -265,
+-     302,  -265,  -265,   248,  1305,  -265,  -265,  -265,  -265,   129,
+-    1305,   228,   822,  1305,  -265,  -265,   822,  -265,  1305,    26,
+-     302,  -265,   -13,  -265,   822,   130,  1305,  -265,   252,  -265,
+-     164,   245,  -265,   302,  -265,  -265,  -265,   822,   253,   822,
+-     822,   822,   255,  -265,   822,  -265,  -265,   822,   822,  -265,
+-    -265,  -265
++     747,  -233,  -233,  -233,  -233,  -233,     5,   -44,  1280,   -33,
++     -25,     6,    34,    67,  1188,  1261,     3,  -233,   822,    45,
++    1261,    54,    60,  1261,    -7,  1261,  1261,  -233,    55,  1261,
++    1261,  -233,  1261,   372,    31,  1261,  1261,  1261,  1261,  -233,
++    -233,  -233,  -233,   -20,  -233,   -14,   876,  -233,  -233,   -35,
++     139,   154,   131,     9,    51,   -21,    85,    96,    -3,  -233,
++    -233,    11,  -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,
++    -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,
++    -233,   233,   747,  -233,  -233,    16,  -233,   896,   109,  -233,
++      33,   -20,  -233,   150,    28,  -233,   150,    36,  -233,  -233,
++      27,  -233,   173,    23,  -233,  1261,  -233,    49,   172,  -233,
++    -233,  -233,  1261,   237,  1261,  -233,  1261,  1261,    52,   447,
++     194,  -233,  -233,   822,  -233,  -233,    86,   191,   195,    55,
++     235,   163,   198,   522,  -233,   127,   969,   204,  -233,  -233,
++    -233,  -233,  1042,  1261,   214,  -233,  1261,   218,  -233,  -233,
++    -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,  -233,
++    -233,  -233,  -233,  1261,  1261,  1261,  1261,  1261,  1261,  1261,
++    1261,  1261,  1261,  1261,  1261,  1261,  1261,  1261,  1261,  1261,
++    1261,  1261,  1261,  1261,  1261,  1261,  1261,  1261,  -233,  1261,
++    -233,  -233,  -233,  -233,  -233,   219,  1303,   212,   197,  -233,
++    -233,  -233,  -233,  -233,  1261,  -233,  -233,   -33,  -233,  -233,
++    -233,   -33,  -233,  -233,  -233,    25,  -233,   215,    87,  -233,
++    -233,    91,   220,   102,   110,   112,  -233,  -233,  -233,   221,
++      -7,   251,  -233,  -233,  -233,  -233,    56,  1261,  -233,    31,
++    -233,  -233,  -233,  -233,  -233,   116,  -233,   152,  -233,   153,
++    -233,  -233,  -233,  -233,  -233,   -35,   -35,   139,   139,   139,
++     154,   154,   154,   154,   154,   154,   131,   131,   131,   131,
++       9,    51,   -21,    85,    96,   216,  -233,    -9,   -49,  1261,
++    1261,  -233,  -233,  -233,   215,   118,   597,  -233,   215,   228,
++     822,  1261,   822,   224,   822,   231,  -233,  -233,  -233,   222,
++    -233,  1115,  -233,  1261,  -233,  -233,  1261,  1261,   266,  1261,
++     120,   213,  -233,   215,  -233,   672,  -233,  -233,   278,   124,
++    -233,   294,  -233,  -233,   240,  1261,  -233,  -233,  -233,  -233,
++     125,  1261,   223,   822,  1261,  -233,  -233,   822,  -233,  1261,
++       1,   294,  -233,    -7,  -233,   822,   126,  1261,  -233,   241,
++    -233,   128,   236,  -233,   294,  -233,  -233,  -233,   822,   243,
++     822,   822,   822,   245,  -233,   822,  -233,  -233,   822,   822,
++    -233,  -233,  -233
+ };
+ 
+ /* YYPGOTO[NTERM-NUM].  */
+-static const short yypgoto[] =
++static const short int yypgoto[] =
+ {
+-    -265,  -265,  -265,  -265,  -265,    82,  -265,  -265,    88,   317,
+-     319,  -265,    -7,  -265,   188,  -265,    -5,    33,    79,   -29,
+-      51,   148,   146,   149,   152,   145,  -265,  -265,  -128,  -265,
+-     -10,   -18,   -23,   -27,  -265,   137,   -20,  -265,  -265,  -265,
+-     -91,  -265,  -265,  -265,  -265,  -264,  -265,  -265,  -265,  -265,
+-    -265,  -265,   -15,  -265,     0,  -265,  -265,  -265,  -265,  -265,
+-     113,  -265,   331,  -265,   133,  -261,  -265,     2,   -78
++    -233,  -233,  -233,  -233,  -233,    73,  -233,  -233,    77,   306,
++     308,  -233,   -22,  -233,   188,  -233,    -5,    64,    35,   -28,
++     -16,   135,   140,   134,   137,   142,  -233,  -233,  -128,  -233,
++     -10,   -18,   -23,   -37,  -233,   136,   -87,  -233,  -233,  -233,
++     -91,  -233,  -233,  -233,  -233,  -166,  -233,  -233,  -233,  -233,
++    -233,  -233,   -24,  -233,   -15,  -233,  -233,  -233,  -233,  -233,
++     101,  -233,   319,  -233,   119,  -232,  -233,     2,   -78
+ };
+ 
+ /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+    positive, shift that token.  If negative, reduce the rule which
+    number is the opposite.  If zero, do what YYDEFACT says.
+    If YYTABLE_NINF, syntax error.  */
+-#define YYTABLE_NINF -129
+-static const short yytable[] =
++#define YYTABLE_NINF -130
++static const short int yytable[] =
+ {
+      113,   120,    82,   107,   192,   209,    84,    99,   242,   109,
+-     111,   193,   188,   118,   246,   115,   310,   213,    87,   206,
+-     121,   122,   126,   311,   124,   125,   207,   315,    93,   210,
+-     138,   139,   140,   141,   306,   251,   351,   142,   148,   186,
+-     219,   143,   308,   164,   331,   144,   142,   226,   216,   112,
+-     146,   334,   119,   217,   147,   192,   102,   165,   166,   275,
+-     103,   276,   149,   150,    85,   100,   199,   200,   104,   348,
+-       1,     2,     3,     4,     5,   114,   281,   197,   116,     8,
+-     189,   187,   358,    88,   203,   105,    15,   207,    17,    96,
+-      86,   101,   352,   204,    20,   194,   190,   211,   199,   200,
+-     109,   214,   221,   208,   223,   233,   224,   225,   189,   299,
+-      25,    26,   234,   212,   123,   189,   216,   189,    27,   201,
+-     288,   284,   167,   168,   220,   289,    89,    29,    30,    31,
+-      32,   227,    90,   247,    34,   235,   249,   117,   236,    35,
+-      36,    37,    38,   260,   261,   262,   263,   264,   265,   290,
+-     292,   201,   106,   134,   189,   189,   172,   173,   202,   252,
+-     253,   254,   293,   294,   301,   229,   230,   189,   189,   302,
+-     174,   175,   326,   312,   327,   239,   240,   328,   289,     1,
+-       2,     3,     4,     5,   332,   337,   307,   282,     8,   189,
+-     189,   283,    88,   344,   357,   182,   343,    17,   189,   189,
+-     255,   256,   108,   108,   169,   170,   171,   296,   108,   176,
+-     177,   303,   189,   108,   108,   304,   189,   108,   108,   178,
+-     179,   180,   181,   108,   108,   108,   108,    27,   279,   266,
+-     267,   268,   269,   189,   360,    89,   192,   183,    31,    32,
+-     184,    90,   185,    34,   191,   103,   149,   150,   257,   258,
+-     259,   151,   152,   153,   154,   155,   156,   157,   158,   159,
+-     160,   161,   204,   222,   215,   -28,   -29,   237,   243,   309,
+-     197,   248,   317,   250,   319,   196,   322,   277,   189,   280,
+-     286,   318,   291,   295,   230,   316,   305,   162,   314,   320,
+-     323,   324,   330,   108,   149,   150,   329,   336,   197,   151,
+-     152,   153,   154,   155,   156,   157,   158,   159,   160,   161,
+-     333,   338,   342,   346,   347,   361,   359,   364,   349,   355,
+-     345,   369,   300,   197,   298,    91,   356,    92,   350,   271,
+-     270,   274,   278,   272,   368,   162,   197,   273,   362,   363,
+-     354,   365,   366,   366,   297,   110,   370,     0,   285,   371,
+-     371,     0,   108,   108,   108,   108,   108,   108,   108,   108,
++     111,   352,   188,   118,   246,   115,   307,   193,   207,    87,
++     121,   122,   126,   148,   124,   125,    93,   164,   213,   206,
++     138,   139,   140,   141,    96,   251,   309,   210,   186,   199,
++     200,   165,   166,   142,   178,   179,   180,   181,   143,   142,
++     219,   144,   312,   226,   146,   192,   316,   147,   119,   275,
++     183,   276,   199,   200,    85,   100,   112,   353,   104,   203,
++       1,     2,     3,     4,     5,   204,   281,   197,   189,     8,
++     187,   335,   216,    88,   216,   105,    15,   217,    17,   284,
++      86,   101,   201,   102,    20,   207,   190,   103,   134,   202,
++     109,   194,   221,   211,   223,   233,   224,   225,   114,   300,
++      25,    26,   214,   208,   311,   201,   189,   116,    27,   189,
++     282,   212,   298,   117,   283,   123,    89,    29,    30,    31,
++      32,   182,    90,   247,   220,    34,   249,   227,   185,    35,
++      36,    37,    38,   332,   260,   261,   262,   263,   264,   265,
++     234,   288,   106,   189,   289,   290,   172,   173,   189,   252,
++     253,   254,   266,   267,   268,   269,   292,   184,   349,   189,
++     174,   175,   103,   327,   293,   328,   294,   189,   329,   189,
++     302,   359,   313,   303,   333,   289,   308,   189,   338,   345,
++     358,   189,   189,   189,   239,   189,   240,   344,   361,   169,
++     170,   171,   108,   108,   257,   258,   259,   296,   108,   176,
++     177,   167,   168,   108,   108,   149,   150,   108,   108,   189,
++     189,   304,   305,   108,   108,   108,   108,   229,   230,   235,
++     236,   255,   256,   191,   204,  -129,   215,   192,  -129,  -129,
++    -129,  -129,  -129,  -129,  -129,  -129,  -129,  -129,  -129,  -129,
++    -129,  -129,  -129,  -129,  -129,  -129,  -129,  -129,  -129,  -129,
++     222,   -29,  -129,  -129,  -129,   -30,  -129,  -129,   237,   310,
++     197,   243,   318,   248,   320,   196,   323,   250,   277,   189,
++     286,   319,   280,   291,   295,   230,   306,   317,   315,   321,
++     324,   331,   325,   108,  -129,  -129,  -129,   330,   334,   197,
++    -129,  -129,   337,   339,   343,   360,   362,   365,   347,  -129,
++    -129,   370,   301,   299,    91,   348,    92,   270,   272,   350,
++     356,   346,   273,   271,   197,   369,   355,   357,   274,   351,
++     363,   278,   297,   110,   285,     0,     0,   197,     0,     0,
++     364,     0,   366,   367,   367,     0,     0,   371,     0,     0,
++     372,   372,   108,   108,   108,   108,   108,   108,   108,   108,
+      108,   108,   108,   108,   108,   108,   108,   108,   108,   108,
+      108,   108,   108,   108,   108,     1,     2,     3,   127,   128,
+        6,     0,     0,     7,     8,     9,    10,    11,    12,    13,
+@@ -859,142 +921,142 @@
+       21,    22,     0,    23,    24,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
+        0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
+-       0,   129,    29,    30,    31,    32,     0,    33,   130,    34,
+-       0,     0,     0,     0,    35,    36,    37,    38,     0,     0,
++       0,   129,    29,    30,    31,    32,     0,    33,   130,     0,
++      34,     0,     0,     0,    35,    36,    37,    38,     0,     0,
+        1,     2,     3,     4,     5,     6,     0,    39,     7,     8,
+        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
+       19,     0,     0,     0,    20,    21,    22,     0,    23,    24,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       25,    26,     0,     0,     0,     0,     0,     0,    27,     0,
+        0,     0,     0,     0,     0,     0,    28,    29,    30,    31,
+-      32,     0,    33,   228,    34,     0,     0,     0,     0,    35,
++      32,     0,    33,   228,     0,    34,     0,     0,     0,    35,
+       36,    37,    38,     0,     0,     1,     2,     3,     4,     5,
+        6,     0,    39,     7,     8,     9,    10,    11,    12,    13,
+       14,    15,    16,    17,    18,    19,     0,     0,     0,    20,
+       21,    22,     0,    23,    24,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
+        0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
+-       0,    28,    29,    30,    31,    32,     0,    33,   238,    34,
+-       0,     0,     0,     0,    35,    36,    37,    38,     0,     0,
++       0,    28,    29,    30,    31,    32,     0,    33,   238,     0,
++      34,     0,     0,     0,    35,    36,    37,    38,     0,     0,
+        1,     2,     3,     4,     5,     6,     0,    39,     7,     8,
+        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
+       19,     0,     0,     0,    20,    21,    22,     0,    23,    24,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       25,    26,     0,     0,     0,     0,     0,     0,    27,     0,
+        0,     0,     0,     0,     0,     0,    28,    29,    30,    31,
+-      32,     0,    33,   313,    34,     0,     0,     0,     0,    35,
++      32,     0,    33,   314,     0,    34,     0,     0,     0,    35,
+       36,    37,    38,     0,     0,     1,     2,     3,     4,     5,
+        6,     0,    39,     7,     8,     9,    10,    11,    12,    13,
+       14,    15,    16,    17,    18,    19,     0,     0,     0,    20,
+       21,    22,     0,    23,    24,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
+        0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
+-       0,    28,    29,    30,    31,    32,     0,    33,   335,    34,
+-       0,     0,     0,     0,    35,    36,    37,    38,     0,     0,
++       0,    28,    29,    30,    31,    32,     0,    33,   336,     0,
++      34,     0,     0,     0,    35,    36,    37,    38,     0,     0,
+        1,     2,     3,     4,     5,     6,     0,    39,     7,     8,
+        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
+       19,     0,     0,     0,    20,    21,    22,     0,    23,    24,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       25,    26,     0,     0,     0,     0,     0,     0,    27,     0,
+        0,     0,     0,     0,     0,     0,    28,    29,    30,    31,
+-      32,     0,    33,     0,    34,     0,     0,     0,     0,    35,
++      32,     0,    33,     0,     0,    34,     0,     0,     0,    35,
+       36,    37,    38,     0,     0,     1,     2,     3,     4,     5,
+        6,     0,    39,     7,     8,     9,    10,    11,    88,    13,
+      105,    15,    16,    17,    18,    19,     0,     0,     0,    20,
+       21,    22,     0,    23,    24,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
+        0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
+-       0,    28,    29,    30,    31,    32,     0,    33,     0,    34,
+-       0,     0,     0,     0,    35,    36,    37,    38,     0,     0,
+-       0,     0,     0,     0,     0,  -128,     0,    39,  -128,  -128,
+-    -128,  -128,  -128,  -128,  -128,  -128,  -128,  -128,  -128,  -128,
+-    -128,  -128,  -128,  -128,  -128,  -128,  -128,  -128,  -128,  -128,
+-       0,     0,  -128,  -128,  -128,     0,  -128,  -128,     0,     0,
+-       0,     0,     0,     1,     2,     3,     4,     5,     0,     0,
+-       0,     0,     8,   195,     0,     0,    88,     0,   105,    15,
+-       0,    17,     0,     0,  -128,  -128,  -128,    20,     0,     0,
+-    -128,  -128,     0,     0,     0,     0,     0,     0,     0,  -128,
+-    -128,     0,     0,    25,    26,     0,     0,     0,     0,     0,
+-       0,    27,     0,     0,     0,     0,     0,     0,     0,    89,
+-      29,    30,    31,    32,     0,    90,     0,    34,     0,     0,
+-       0,     0,    35,    36,    37,    38,     1,     2,     3,     4,
+-       5,     0,     0,     0,     0,     8,     0,     0,     0,    88,
+-       0,   105,    15,     0,    17,     0,     0,     0,     0,     0,
+-      20,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,    25,    26,     0,     0,
+-       0,     0,     0,     0,    27,     0,     0,     0,     0,     0,
+-       0,     0,    89,    29,    30,    31,    32,     0,    90,     0,
+-      34,   241,     0,     0,     0,    35,    36,    37,    38,     1,
+-       2,     3,     4,     5,     0,     0,     0,     0,     8,     0,
+-       0,     0,    88,     0,   105,    15,     0,    17,     0,     0,
+-       0,     0,     0,    20,     0,     0,     0,     0,     0,     0,
+-       0,     0,     0,     0,     0,     0,     0,     0,     0,    25,
++       0,    28,    29,    30,    31,    32,     0,    33,     0,     0,
++      34,     0,     0,     0,    35,    36,    37,    38,     0,     1,
++       2,     3,     4,     5,     0,     0,     0,    39,     8,   195,
++       0,     0,    88,     0,   105,    15,     0,    17,     0,   149,
++     150,     0,     0,    20,   151,   152,   153,   154,   155,   156,
++     157,   158,   159,   160,   161,     0,     0,     0,     0,    25,
+       26,     0,     0,     0,     0,     0,     0,    27,     0,     0,
+        0,     0,     0,     0,     0,    89,    29,    30,    31,    32,
+-     244,    90,     0,    34,     0,     0,     0,     0,    35,    36,
++     162,    90,     0,     0,    34,     0,     0,     0,    35,    36,
+       37,    38,     1,     2,     3,     4,     5,     0,     0,     0,
+        0,     8,     0,     0,     0,    88,     0,   105,    15,     0,
+       17,     0,     0,     0,     0,     0,    20,     0,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+        0,     0,    25,    26,     0,     0,     0,     0,     0,     0,
+       27,     0,     0,     0,     0,     0,     0,     0,    89,    29,
+-      30,    31,    32,     0,    90,     0,    34,   325,     0,     0,
++      30,    31,    32,     0,    90,     0,     0,    34,   241,     0,
+        0,    35,    36,    37,    38,     1,     2,     3,     4,     5,
+-       0,     0,     0,     0,     8,     0,     0,     0,    12,     0,
++       0,     0,     0,     0,     8,     0,     0,     0,    88,     0,
+      105,    15,     0,    17,     0,     0,     0,     0,     0,    20,
+        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,    25,    26,     0,     0,     0,
+        0,     0,     0,    27,     0,     0,     0,     0,     0,     0,
+-       0,    89,    29,    30,    31,    32,     0,    90,     0,    34,
+-       0,     0,     0,     0,    35,    36,    37,    38,     1,     2,
++       0,    89,    29,    30,    31,    32,   244,    90,     0,     0,
++      34,     0,     0,     0,    35,    36,    37,    38,     1,     2,
+        3,     4,     5,     0,     0,     0,     0,     8,     0,     0,
+        0,    88,     0,   105,    15,     0,    17,     0,     0,     0,
+        0,     0,    20,     0,     0,     0,     0,     0,     0,     0,
+        0,     0,     0,     0,     0,     0,     0,     0,    25,    26,
+        0,     0,     0,     0,     0,     0,    27,     0,     0,     0,
+        0,     0,     0,     0,    89,    29,    30,    31,    32,     0,
+-      90,     0,    34,     0,     0,     0,     0,    35,    36,    37,
+-      38
++      90,     0,     0,    34,   326,     0,     0,    35,    36,    37,
++      38,     1,     2,     3,     4,     5,     0,     0,     0,     0,
++       8,     0,     0,     0,    12,     0,   105,    15,     0,    17,
++       0,     0,     0,     0,     0,    20,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
++       0,    25,    26,     0,     0,     0,     0,     0,     0,    27,
++       0,     0,     0,     0,     0,     0,     0,    89,    29,    30,
++      31,    32,     0,    90,     0,     0,    34,     0,     0,     0,
++      35,    36,    37,    38,     1,     2,     3,     4,     5,     0,
++       0,     0,     0,     8,     0,     0,     0,    88,     0,   105,
++      15,     0,    17,     1,     2,     3,     4,     5,    20,     0,
++       0,     0,     8,     0,     0,     0,    88,     0,     0,     0,
++       0,    17,     0,     0,    25,    26,     0,     0,     0,     0,
++       0,     0,    27,     0,     0,     0,     0,     0,     0,     0,
++      89,    29,    30,    31,    32,     0,    90,     0,   279,    34,
++       0,    27,     0,    35,    36,    37,    38,     0,     0,    89,
++       0,     0,    31,    32,     0,    90,   149,   150,    34,     0,
++       0,   151,   152,   153,   154,   155,   156,   157,   158,   159,
++     160,   161,     0,     0,     0,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
++       0,     0,     0,     0,     0,     0,     0,   162
+ };
+ 
+-static const short yycheck[] =
++static const short int yycheck[] =
+ {
+       18,    24,     0,    13,    82,    96,     1,     1,   136,    14,
+-      15,     1,     1,    23,   142,    20,   280,     1,    63,     1,
+-      25,    26,    32,   284,    29,    30,    69,   288,    59,     1,
+-      35,    36,    37,    38,    25,   163,    10,    63,    45,    41,
+-       1,    67,    85,    62,   308,    71,    63,     1,    59,    63,
+-      67,   312,    65,    64,    71,   133,    59,    76,    77,   187,
+-      63,   189,    43,    44,    59,    59,     6,     7,     1,   333,
+-       3,     4,     5,     6,     7,    63,   204,    87,    63,    12,
+-      69,    83,   346,    16,    91,    18,    19,    69,    21,    59,
+-      85,    85,    66,    84,    27,    85,    85,    69,     6,     7,
+-     105,    85,   112,    85,   114,   123,   116,   117,    69,   237,
+-      43,    44,    64,    85,    70,    69,    59,    69,    51,    59,
+-      64,    64,    72,    73,    85,    69,    59,    60,    61,    62,
+-      63,    85,    65,   143,    67,    66,   146,    63,    69,    72,
+-      73,    74,    75,   172,   173,   174,   175,   176,   177,    64,
+-      64,    59,    85,    69,    69,    69,    25,    26,    66,   164,
+-     165,   166,    64,    64,    64,    33,    34,    69,    69,    69,
+-      39,    40,   300,    64,   302,    68,    69,   305,    69,     3,
+-       4,     5,     6,     7,    64,    64,   277,   207,    12,    69,
+-      69,   211,    16,    64,    64,    80,   324,    21,    69,    69,
+-     167,   168,    14,    15,    45,    46,    47,   230,    20,    78,
+-      79,    68,    69,    25,    26,    68,    69,    29,    30,    35,
+-      36,    37,    38,    35,    36,    37,    38,    51,    25,   178,
+-     179,   180,   181,    69,    70,    59,   314,    81,    62,    63,
+-      82,    65,    42,    67,     0,    63,    43,    44,   169,   170,
+-     171,    48,    49,    50,    51,    52,    53,    54,    55,    56,
+-      57,    58,    84,    23,    63,    70,    70,    70,    69,   279,
+-     280,    59,   290,    59,   292,    87,   294,    59,    69,    85,
+-      65,   291,    63,    63,    34,    59,    70,    84,   286,    65,
+-      59,    70,    25,   105,    43,    44,   306,    24,   308,    48,
+-      49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
+-      85,     9,    64,    85,   332,    70,    64,    64,   336,   342,
+-     330,    66,   240,   333,   236,     8,   344,     8,   338,   183,
+-     182,   186,   195,   184,   361,    84,   346,   185,   353,   357,
+-     340,   359,   360,   361,   231,    14,   364,    -1,   215,   367,
+-     368,    -1,   164,   165,   166,   167,   168,   169,   170,   171,
++      15,    10,     1,    23,   142,    20,    25,     1,    67,    63,
++      25,    26,    32,    45,    29,    30,    59,    62,     1,     1,
++      35,    36,    37,    38,    59,   163,    85,     1,    41,     6,
++       7,    76,    77,    63,    35,    36,    37,    38,    68,    63,
++       1,    71,   284,     1,    68,   133,   288,    71,    65,   187,
++      81,   189,     6,     7,    59,    59,    63,    66,     1,    91,
++       3,     4,     5,     6,     7,    84,   204,    87,    67,    12,
++      83,   313,    59,    16,    59,    18,    19,    64,    21,    64,
++      85,    85,    59,    59,    27,    67,    85,    63,    67,    66,
++     105,    85,   112,    67,   114,   123,   116,   117,    63,   237,
++      43,    44,    85,    85,   280,    59,    67,    63,    51,    67,
++     207,    85,    66,    63,   211,    70,    59,    60,    61,    62,
++      63,    80,    65,   143,    85,    68,   146,    85,    42,    72,
++      73,    74,    75,   309,   172,   173,   174,   175,   176,   177,
++      64,    64,    85,    67,    67,    64,    25,    26,    67,   164,
++     165,   166,   178,   179,   180,   181,    64,    82,   334,    67,
++      39,    40,    63,   301,    64,   303,    64,    67,   306,    67,
++      64,   347,    64,    67,    64,    67,   277,    67,    64,    64,
++      64,    67,    67,    67,    67,    67,    69,   325,    70,    45,
++      46,    47,    14,    15,   169,   170,   171,   230,    20,    78,
++      79,    72,    73,    25,    26,    43,    44,    29,    30,    67,
++      67,    69,    69,    35,    36,    37,    38,    33,    34,    66,
++      67,   167,   168,     0,    84,     0,    63,   315,     3,     4,
++       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
++      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
++      23,    70,    27,    28,    29,    70,    31,    32,    70,   279,
++     280,    67,   290,    59,   292,    87,   294,    59,    59,    67,
++      65,   291,    85,    63,    63,    34,    70,    59,   286,    65,
++      59,    25,    70,   105,    59,    60,    61,   307,    85,   309,
++      65,    66,    24,     9,    64,    64,    70,    64,    85,    74,
++      75,    66,   239,   236,     8,   333,     8,   182,   184,   337,
++     343,   331,   185,   183,   334,   362,   341,   345,   186,   339,
++     354,   195,   231,    14,   215,    -1,    -1,   347,    -1,    -1,
++     358,    -1,   360,   361,   362,    -1,    -1,   365,    -1,    -1,
++     368,   369,   164,   165,   166,   167,   168,   169,   170,   171,
+      172,   173,   174,   175,   176,   177,   178,   179,   180,   181,
+      182,   183,   184,   185,   186,     3,     4,     5,     6,     7,
+        8,    -1,    -1,    11,    12,    13,    14,    15,    16,    17,
+@@ -1002,102 +1064,102 @@
+       28,    29,    -1,    31,    32,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,    -1,
+       -1,    -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    59,    60,    61,    62,    63,    -1,    65,    66,    67,
+-      -1,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
++      -1,    59,    60,    61,    62,    63,    -1,    65,    66,    -1,
++      68,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
+        3,     4,     5,     6,     7,     8,    -1,    85,    11,    12,
+       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
+       23,    -1,    -1,    -1,    27,    28,    29,    -1,    31,    32,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+       43,    44,    -1,    -1,    -1,    -1,    -1,    -1,    51,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    59,    60,    61,    62,
+-      63,    -1,    65,    66,    67,    -1,    -1,    -1,    -1,    72,
++      63,    -1,    65,    66,    -1,    68,    -1,    -1,    -1,    72,
+       73,    74,    75,    -1,    -1,     3,     4,     5,     6,     7,
+        8,    -1,    85,    11,    12,    13,    14,    15,    16,    17,
+       18,    19,    20,    21,    22,    23,    -1,    -1,    -1,    27,
+       28,    29,    -1,    31,    32,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,    -1,
+       -1,    -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    59,    60,    61,    62,    63,    -1,    65,    66,    67,
+-      -1,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
++      -1,    59,    60,    61,    62,    63,    -1,    65,    66,    -1,
++      68,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
+        3,     4,     5,     6,     7,     8,    -1,    85,    11,    12,
+       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
+       23,    -1,    -1,    -1,    27,    28,    29,    -1,    31,    32,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+       43,    44,    -1,    -1,    -1,    -1,    -1,    -1,    51,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    59,    60,    61,    62,
+-      63,    -1,    65,    66,    67,    -1,    -1,    -1,    -1,    72,
++      63,    -1,    65,    66,    -1,    68,    -1,    -1,    -1,    72,
+       73,    74,    75,    -1,    -1,     3,     4,     5,     6,     7,
+        8,    -1,    85,    11,    12,    13,    14,    15,    16,    17,
+       18,    19,    20,    21,    22,    23,    -1,    -1,    -1,    27,
+       28,    29,    -1,    31,    32,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,    -1,
+       -1,    -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    59,    60,    61,    62,    63,    -1,    65,    66,    67,
+-      -1,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
++      -1,    59,    60,    61,    62,    63,    -1,    65,    66,    -1,
++      68,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
+        3,     4,     5,     6,     7,     8,    -1,    85,    11,    12,
+       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
+       23,    -1,    -1,    -1,    27,    28,    29,    -1,    31,    32,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+       43,    44,    -1,    -1,    -1,    -1,    -1,    -1,    51,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    59,    60,    61,    62,
+-      63,    -1,    65,    -1,    67,    -1,    -1,    -1,    -1,    72,
++      63,    -1,    65,    -1,    -1,    68,    -1,    -1,    -1,    72,
+       73,    74,    75,    -1,    -1,     3,     4,     5,     6,     7,
+        8,    -1,    85,    11,    12,    13,    14,    15,    16,    17,
+       18,    19,    20,    21,    22,    23,    -1,    -1,    -1,    27,
+       28,    29,    -1,    31,    32,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,    -1,
+       -1,    -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    59,    60,    61,    62,    63,    -1,    65,    -1,    67,
+-      -1,    -1,    -1,    -1,    72,    73,    74,    75,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,     0,    -1,    85,     3,     4,
+-       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
+-      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+-      -1,    -1,    27,    28,    29,    -1,    31,    32,    -1,    -1,
+-      -1,    -1,    -1,     3,     4,     5,     6,     7,    -1,    -1,
+-      -1,    -1,    12,    13,    -1,    -1,    16,    -1,    18,    19,
+-      -1,    21,    -1,    -1,    59,    60,    61,    27,    -1,    -1,
+-      65,    66,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    74,
+-      75,    -1,    -1,    43,    44,    -1,    -1,    -1,    -1,    -1,
+-      -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    59,
+-      60,    61,    62,    63,    -1,    65,    -1,    67,    -1,    -1,
+-      -1,    -1,    72,    73,    74,    75,     3,     4,     5,     6,
+-       7,    -1,    -1,    -1,    -1,    12,    -1,    -1,    -1,    16,
+-      -1,    18,    19,    -1,    21,    -1,    -1,    -1,    -1,    -1,
+-      27,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,
+-      -1,    -1,    -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    59,    60,    61,    62,    63,    -1,    65,    -1,
+-      67,    68,    -1,    -1,    -1,    72,    73,    74,    75,     3,
+-       4,     5,     6,     7,    -1,    -1,    -1,    -1,    12,    -1,
+-      -1,    -1,    16,    -1,    18,    19,    -1,    21,    -1,    -1,
+-      -1,    -1,    -1,    27,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    43,
++      -1,    59,    60,    61,    62,    63,    -1,    65,    -1,    -1,
++      68,    -1,    -1,    -1,    72,    73,    74,    75,    -1,     3,
++       4,     5,     6,     7,    -1,    -1,    -1,    85,    12,    13,
++      -1,    -1,    16,    -1,    18,    19,    -1,    21,    -1,    43,
++      44,    -1,    -1,    27,    48,    49,    50,    51,    52,    53,
++      54,    55,    56,    57,    58,    -1,    -1,    -1,    -1,    43,
+       44,    -1,    -1,    -1,    -1,    -1,    -1,    51,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    59,    60,    61,    62,    63,
+-      64,    65,    -1,    67,    -1,    -1,    -1,    -1,    72,    73,
++      84,    65,    -1,    -1,    68,    -1,    -1,    -1,    72,    73,
+       74,    75,     3,     4,     5,     6,     7,    -1,    -1,    -1,
+       -1,    12,    -1,    -1,    -1,    16,    -1,    18,    19,    -1,
+       21,    -1,    -1,    -1,    -1,    -1,    27,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    43,    44,    -1,    -1,    -1,    -1,    -1,    -1,
+       51,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    59,    60,
+-      61,    62,    63,    -1,    65,    -1,    67,    68,    -1,    -1,
++      61,    62,    63,    -1,    65,    -1,    -1,    68,    69,    -1,
+       -1,    72,    73,    74,    75,     3,     4,     5,     6,     7,
+       -1,    -1,    -1,    -1,    12,    -1,    -1,    -1,    16,    -1,
+       18,    19,    -1,    21,    -1,    -1,    -1,    -1,    -1,    27,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    43,    44,    -1,    -1,    -1,
+       -1,    -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,
+-      -1,    59,    60,    61,    62,    63,    -1,    65,    -1,    67,
+-      -1,    -1,    -1,    -1,    72,    73,    74,    75,     3,     4,
++      -1,    59,    60,    61,    62,    63,    64,    65,    -1,    -1,
++      68,    -1,    -1,    -1,    72,    73,    74,    75,     3,     4,
+        5,     6,     7,    -1,    -1,    -1,    -1,    12,    -1,    -1,
+       -1,    16,    -1,    18,    19,    -1,    21,    -1,    -1,    -1,
+       -1,    -1,    27,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    43,    44,
+       -1,    -1,    -1,    -1,    -1,    -1,    51,    -1,    -1,    -1,
+       -1,    -1,    -1,    -1,    59,    60,    61,    62,    63,    -1,
+-      65,    -1,    67,    -1,    -1,    -1,    -1,    72,    73,    74,
+-      75
++      65,    -1,    -1,    68,    69,    -1,    -1,    72,    73,    74,
++      75,     3,     4,     5,     6,     7,    -1,    -1,    -1,    -1,
++      12,    -1,    -1,    -1,    16,    -1,    18,    19,    -1,    21,
++      -1,    -1,    -1,    -1,    -1,    27,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    43,    44,    -1,    -1,    -1,    -1,    -1,    -1,    51,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    59,    60,    61,
++      62,    63,    -1,    65,    -1,    -1,    68,    -1,    -1,    -1,
++      72,    73,    74,    75,     3,     4,     5,     6,     7,    -1,
++      -1,    -1,    -1,    12,    -1,    -1,    -1,    16,    -1,    18,
++      19,    -1,    21,     3,     4,     5,     6,     7,    27,    -1,
++      -1,    -1,    12,    -1,    -1,    -1,    16,    -1,    -1,    -1,
++      -1,    21,    -1,    -1,    43,    44,    -1,    -1,    -1,    -1,
++      -1,    -1,    51,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      59,    60,    61,    62,    63,    -1,    65,    -1,    25,    68,
++      -1,    51,    -1,    72,    73,    74,    75,    -1,    -1,    59,
++      -1,    -1,    62,    63,    -1,    65,    43,    44,    68,    -1,
++      -1,    48,    49,    50,    51,    52,    53,    54,    55,    56,
++      57,    58,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
++      -1,    -1,    -1,    -1,    -1,    -1,    -1,    84
+ };
+ 
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+@@ -1107,7 +1169,7 @@
+        0,     3,     4,     5,     6,     7,     8,    11,    12,    13,
+       14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+       27,    28,    29,    31,    32,    43,    44,    51,    59,    60,
+-      61,    62,    63,    65,    67,    72,    73,    74,    75,    85,
++      61,    62,    63,    65,    68,    72,    73,    74,    75,    85,
+       87,    88,    89,    95,    96,    97,   100,   101,   102,   103,
+      104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
+      114,   116,   117,   118,   120,   123,   127,   128,   129,   130,
+@@ -1117,49 +1179,33 @@
+       59,    85,    59,    63,     1,    18,    85,   116,   100,   102,
+      148,   102,    63,   117,    63,   102,    63,    63,   116,    65,
+      118,   102,   102,    70,   102,   102,   116,     6,     7,    59,
+-      66,    93,    94,   153,    69,    90,    91,    92,   102,   102,
+-     102,   102,    63,    67,    71,    98,    67,    71,    98,    43,
++      66,    93,    94,   153,    67,    90,    91,    92,   102,   102,
++     102,   102,    63,    68,    71,    98,    68,    71,    98,    43,
+       44,    48,    49,    50,    51,    52,    53,    54,    55,    56,
+       57,    58,    84,   115,    62,    76,    77,    72,    73,    45,
+       46,    47,    25,    26,    39,    40,    78,    79,    35,    36,
+-      37,    38,    80,    81,    82,    42,    41,    83,     1,    69,
++      37,    38,    80,    81,    82,    42,    41,    83,     1,    67,
+       85,     0,   154,     1,    85,    13,   100,   116,   131,     6,
+-       7,    59,    66,    98,    84,   126,     1,    69,    85,   126,
+-       1,    69,    85,     1,    85,    63,    59,    64,   150,     1,
++       7,    59,    66,    98,    84,   126,     1,    67,    85,   126,
++       1,    67,    85,     1,    85,    63,    59,    64,   150,     1,
+       85,   116,    23,   116,   116,   116,     1,    85,    66,    33,
+-      34,   145,   146,   117,    64,    66,    69,    70,    66,    68,
+-      69,    68,   114,    69,    64,    99,   114,   116,    59,   116,
++      34,   145,   146,   117,    64,    66,    67,    70,    66,    67,
++      69,    69,   114,    67,    64,    99,   114,   116,    59,   116,
+       59,   114,   102,   102,   102,   103,   103,   104,   104,   104,
+      105,   105,   105,   105,   105,   105,   106,   106,   106,   106,
+      107,   108,   109,   110,   111,   114,   114,    59,   121,    25,
+-      85,   114,   122,   122,    64,   150,    65,   151,    64,    69,
+-      64,    63,    64,    64,    64,    63,   118,   146,    94,   114,
+-      91,    64,    69,    68,    68,    70,    25,   126,    85,   116,
+-     131,   151,    64,    66,   153,   151,    59,   117,   116,   117,
+-      65,   137,   117,    59,    70,    68,   114,   114,   114,   116,
+-      25,   131,    64,    85,   151,    66,    24,    64,     9,   138,
+-     139,   140,    64,   114,    64,   116,    85,   117,   131,   117,
+-     116,    10,    66,   141,   140,   118,   117,    64,   131,    64,
+-      70,    70,   138,   117,    64,   117,   117,   119,   119,    66,
+-     117,   117
++      85,   114,   122,   122,    64,   150,    65,   151,    64,    67,
++      64,    63,    64,    64,    64,    63,   118,   146,    66,    94,
++     114,    91,    64,    67,    69,    69,    70,    25,   126,    85,
++     116,   131,   151,    64,    66,   153,   151,    59,   117,   116,
++     117,    65,   137,   117,    59,    70,    69,   114,   114,   114,
++     116,    25,   131,    64,    85,   151,    66,    24,    64,     9,
++     138,   139,   140,    64,   114,    64,   116,    85,   117,   131,
++     117,   116,    10,    66,   141,   140,   118,   117,    64,   131,
++      64,    70,    70,   138,   117,    64,   117,   117,   119,   119,
++      66,   117,   117
+ };
+ 
+-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+-# define YYSIZE_T __SIZE_TYPE__
+-#endif
+-#if ! defined (YYSIZE_T) && defined (size_t)
+-# define YYSIZE_T size_t
+-#endif
+-#if ! defined (YYSIZE_T)
+-# if defined (__STDC__) || defined (__cplusplus)
+-#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+-#  define YYSIZE_T size_t
+-# endif
+-#endif
+-#if ! defined (YYSIZE_T)
+-# define YYSIZE_T unsigned int
+-#endif
+-
+ #define yyerrok		(yyerrstatus = 0)
+ #define yyclearin	(yychar = YYEMPTY)
+ #define YYEMPTY		(-2)
+@@ -1167,8 +1213,9 @@
+ 
+ #define YYACCEPT	goto yyacceptlab
+ #define YYABORT		goto yyabortlab
+-#define YYERROR		goto yyerrlab1
++#define YYERROR		goto yyerrorlab
+ 
++
+ /* Like YYERROR except do call yyerror.  This remains here temporarily
+    to ease the transition to the new meaning of YYERROR, for GCC.
+    Once GCC version 2 has supplanted version 1, this can go.  */
+@@ -1188,26 +1235,59 @@
+       goto yybackup;						\
+     }								\
+   else								\
+-    { 								\
+-      yyerror ("syntax error: cannot back up");\
++    {								\
++      yyerror (YY_("syntax error: cannot back up")); \
+       YYERROR;							\
+     }								\
+ while (0)
+ 
++
+ #define YYTERROR	1
+ #define YYERRCODE	256
+ 
+-/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+-   are run).  */
+ 
++/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
++   If N is 0, then set CURRENT to the empty location which ends
++   the previous symbol: RHS[0] (always defined).  */
++
++#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+ #ifndef YYLLOC_DEFAULT
+-# define YYLLOC_DEFAULT(Current, Rhs, N)         \
+-  Current.first_line   = Rhs[1].first_line;      \
+-  Current.first_column = Rhs[1].first_column;    \
+-  Current.last_line    = Rhs[N].last_line;       \
+-  Current.last_column  = Rhs[N].last_column;
++# define YYLLOC_DEFAULT(Current, Rhs, N)				\
++    do									\
++      if (N)								\
++	{								\
++	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
++	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
++	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
++	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
++	}								\
++      else								\
++	{								\
++	  (Current).first_line   = (Current).last_line   =		\
++	    YYRHSLOC (Rhs, 0).last_line;				\
++	  (Current).first_column = (Current).last_column =		\
++	    YYRHSLOC (Rhs, 0).last_column;				\
++	}								\
++    while (0)
+ #endif
+ 
++
++/* YY_LOCATION_PRINT -- Print the location on the stream.
++   This macro was not mandated originally: define only if we know
++   we won't break user code: when these are the locations we know.  */
++
++#ifndef YY_LOCATION_PRINT
++# if YYLTYPE_IS_TRIVIAL
++#  define YY_LOCATION_PRINT(File, Loc)			\
++     fprintf (File, "%d.%d-%d.%d",			\
++              (Loc).first_line, (Loc).first_column,	\
++              (Loc).last_line,  (Loc).last_column)
++# else
++#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
++# endif
++#endif
++
++
+ /* YYLEX -- calling `yylex' with the right arguments.  */
+ 
+ #ifdef YYLEX_PARAM
+@@ -1230,36 +1310,30 @@
+     YYFPRINTF Args;				\
+ } while (0)
+ 
+-# define YYDSYMPRINT(Args)			\
+-do {						\
+-  if (yydebug)					\
+-    yysymprint Args;				\
+-} while (0)
+-
+-# define YYDSYMPRINTF(Title, Token, Value, Location)		\
++# define YY_SYMBOL_PRINT(Title, Type, Value, Location)		\
+ do {								\
+   if (yydebug)							\
+     {								\
+       YYFPRINTF (stderr, "%s ", Title);				\
+-      yysymprint (stderr, 					\
+-                  Token, Value, Location);	\
++      yysymprint (stderr,					\
++                  Type, Value, Location);	\
+       YYFPRINTF (stderr, "\n");					\
+     }								\
+ } while (0)
+ 
+ /*------------------------------------------------------------------.
+ | yy_stack_print -- Print the state stack from its BOTTOM up to its |
+-| TOP (cinluded).                                                   |
++| TOP (included).                                                   |
+ `------------------------------------------------------------------*/
+ 
+ #if defined (__STDC__) || defined (__cplusplus)
+ static void
+-yy_stack_print (short *bottom, short *top)
++yy_stack_print (short int *bottom, short int *top)
+ #else
+ static void
+ yy_stack_print (bottom, top)
+-    short *bottom;
+-    short *top;
++    short int *bottom;
++    short int *top;
+ #endif
+ {
+   YYFPRINTF (stderr, "Stack now");
+@@ -1289,13 +1363,13 @@
+ #endif
+ {
+   int yyi;
+-  unsigned int yylineno = yyrline[yyrule];
+-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+-             yyrule - 1, yylineno);
++  unsigned long int yylno = yyrline[yyrule];
++  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
++             yyrule - 1, yylno);
+   /* Print the symbols being reduced, and their result.  */
+   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+-    YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+-  YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
++    YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
++  YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
+ }
+ 
+ # define YY_REDUCE_PRINT(Rule)		\
+@@ -1309,8 +1383,7 @@
+ int yydebug;
+ #else /* !YYDEBUG */
+ # define YYDPRINTF(Args)
+-# define YYDSYMPRINT(Args)
+-# define YYDSYMPRINTF(Title, Token, Value, Location)
++# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+ # define YY_STACK_PRINT(Bottom, Top)
+ # define YY_REDUCE_PRINT(Rule)
+ #endif /* !YYDEBUG */
+@@ -1325,13 +1398,9 @@
+    if the built-in stack extension method is used).
+ 
+    Do not make this value too large; the results are undefined if
+-   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
++   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+    evaluated with infinite-precision integer arithmetic.  */
+ 
+-#if YYMAXDEPTH == 0
+-# undef YYMAXDEPTH
+-#endif
+-
+ #ifndef YYMAXDEPTH
+ # define YYMAXDEPTH 10000
+ #endif
+@@ -1353,7 +1422,7 @@
+      const char *yystr;
+ #   endif
+ {
+-  register const char *yys = yystr;
++  const char *yys = yystr;
+ 
+   while (*yys++ != '\0')
+     continue;
+@@ -1378,8 +1447,8 @@
+      const char *yysrc;
+ #   endif
+ {
+-  register char *yyd = yydest;
+-  register const char *yys = yysrc;
++  char *yyd = yydest;
++  const char *yys = yysrc;
+ 
+   while ((*yyd++ = *yys++) != '\0')
+     continue;
+@@ -1389,8 +1458,56 @@
+ #  endif
+ # endif
+ 
+-#endif /* !YYERROR_VERBOSE */
++# ifndef yytnamerr
++/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
++   quotes and backslashes, so that it's suitable for yyerror.  The
++   heuristic is that double-quoting is unnecessary unless the string
++   contains an apostrophe, a comma, or backslash (other than
++   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
++   null, do not copy; instead, return the length of what the result
++   would have been.  */
++static YYSIZE_T
++yytnamerr (char *yyres, const char *yystr)
++{
++  if (*yystr == '"')
++    {
++      size_t yyn = 0;
++      char const *yyp = yystr;
+ 
++      for (;;)
++	switch (*++yyp)
++	  {
++	  case '\'':
++	  case ',':
++	    goto do_not_strip_quotes;
++
++	  case '\\':
++	    if (*++yyp != '\\')
++	      goto do_not_strip_quotes;
++	    /* Fall through.  */
++	  default:
++	    if (yyres)
++	      yyres[yyn] = *yyp;
++	    yyn++;
++	    break;
++
++	  case '"':
++	    if (yyres)
++	      yyres[yyn] = '\0';
++	    return yyn;
++	  }
++    do_not_strip_quotes: ;
++    }
++
++  if (! yyres)
++    return yystrlen (yystr);
++
++  return yystpcpy (yyres, yystr) - yyres;
++}
++# endif
++
++#endif /* YYERROR_VERBOSE */
++
+ 
+ 
+ #if YYDEBUG
+@@ -1415,15 +1532,17 @@
+   (void) yylocationp;
+ 
+   if (yytype < YYNTOKENS)
+-    {
+-      YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+-# ifdef YYPRINT
+-      YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+-# endif
+-    }
++    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+   else
+     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ 
++  YY_LOCATION_PRINT (yyoutput, *yylocationp);
++  YYFPRINTF (yyoutput, ": ");
++
++# ifdef YYPRINT
++  if (yytype < YYNTOKENS)
++    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
++# endif
+   switch (yytype)
+     {
+       default:
+@@ -1439,10 +1558,11 @@
+ 
+ #if defined (__STDC__) || defined (__cplusplus)
+ static void
+-yydestruct (int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
++yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
+ #else
+ static void
+-yydestruct (yytype, yyvaluep, yylocationp)
++yydestruct (yymsg, yytype, yyvaluep, yylocationp)
++    const char *yymsg;
+     int yytype;
+     YYSTYPE *yyvaluep;
+     YYLTYPE *yylocationp;
+@@ -1452,6 +1572,10 @@
+   (void) yyvaluep;
+   (void) yylocationp;
+ 
++  if (!yymsg)
++    yymsg = "Deleting";
++  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
++
+   switch (yytype)
+     {
+ 
+@@ -1479,15 +1603,15 @@
+ 
+ 
+ 
+-/* The lookahead symbol.  */
++/* The look-ahead symbol.  */
+ int yychar;
+ 
+-/* The semantic value of the lookahead symbol.  */
++/* The semantic value of the look-ahead symbol.  */
+ YYSTYPE yylval;
+ 
+ /* Number of syntax errors so far.  */
+ int yynerrs;
+-/* Location data for the lookahead symbol.  */
++/* Location data for the look-ahead symbol.  */
+ YYLTYPE yylloc;
+ 
+ 
+@@ -1510,17 +1634,17 @@
+ #else
+ int
+ yyparse ()
+-
++    ;
+ #endif
+ #endif
+ {
+   
+-  register int yystate;
+-  register int yyn;
++  int yystate;
++  int yyn;
+   int yyresult;
+   /* Number of tokens to shift before error messages enabled.  */
+   int yyerrstatus;
+-  /* Lookahead token as an internal (translated) token number.  */
++  /* Look-ahead token as an internal (translated) token number.  */
+   int yytoken = 0;
+ 
+   /* Three stacks and their tools:
+@@ -1532,20 +1656,21 @@
+      to reallocate them elsewhere.  */
+ 
+   /* The state stack.  */
+-  short	yyssa[YYINITDEPTH];
+-  short *yyss = yyssa;
+-  register short *yyssp;
++  short int yyssa[YYINITDEPTH];
++  short int *yyss = yyssa;
++  short int *yyssp;
+ 
+   /* The semantic value stack.  */
+   YYSTYPE yyvsa[YYINITDEPTH];
+   YYSTYPE *yyvs = yyvsa;
+-  register YYSTYPE *yyvsp;
++  YYSTYPE *yyvsp;
+ 
+   /* The location stack.  */
+   YYLTYPE yylsa[YYINITDEPTH];
+   YYLTYPE *yyls = yylsa;
+   YYLTYPE *yylsp;
+-  YYLTYPE *yylerrsp;
++  /* The locations where the error started and ended. */
++  YYLTYPE yyerror_range[2];
+ 
+ #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
+ 
+@@ -1575,6 +1700,12 @@
+   yyssp = yyss;
+   yyvsp = yyvs;
+   yylsp = yyls;
++#if YYLTYPE_IS_TRIVIAL
++  /* Initialize the default location before parsing starts.  */
++  yylloc.first_line   = yylloc.last_line   = 1;
++  yylloc.first_column = yylloc.last_column = 0;
++#endif
++
+   goto yysetstate;
+ 
+ /*------------------------------------------------------------.
+@@ -1600,14 +1731,14 @@
+ 	   these so that the &'s don't force the real ones into
+ 	   memory.  */
+ 	YYSTYPE *yyvs1 = yyvs;
+-	short *yyss1 = yyss;
++	short int *yyss1 = yyss;
+ 	YYLTYPE *yyls1 = yyls;
+ 
+ 	/* Each stack pointer address is followed by the size of the
+ 	   data in use in that stack, in bytes.  This used to be a
+ 	   conditional around just the two extra args, but that might
+ 	   be undefined if yyoverflow is a macro.  */
+-	yyoverflow ("parser stack overflow",
++	yyoverflow (YY_("memory exhausted"),
+ 		    &yyss1, yysize * sizeof (*yyssp),
+ 		    &yyvs1, yysize * sizeof (*yyvsp),
+ 		    &yyls1, yysize * sizeof (*yylsp),
+@@ -1618,21 +1749,21 @@
+       }
+ #else /* no yyoverflow */
+ # ifndef YYSTACK_RELOCATE
+-      goto yyoverflowlab;
++      goto yyexhaustedlab;
+ # else
+       /* Extend the stack our own way.  */
+       if (YYMAXDEPTH <= yystacksize)
+-	goto yyoverflowlab;
++	goto yyexhaustedlab;
+       yystacksize *= 2;
+       if (YYMAXDEPTH < yystacksize)
+ 	yystacksize = YYMAXDEPTH;
+ 
+       {
+-	short *yyss1 = yyss;
++	short int *yyss1 = yyss;
+ 	union yyalloc *yyptr =
+ 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ 	if (! yyptr)
+-	  goto yyoverflowlab;
++	  goto yyexhaustedlab;
+ 	YYSTACK_RELOCATE (yyss);
+ 	YYSTACK_RELOCATE (yyvs);
+ 	YYSTACK_RELOCATE (yyls);
+@@ -1664,18 +1795,18 @@
+ yybackup:
+ 
+ /* Do appropriate processing given the current state.  */
+-/* Read a lookahead token if we need one and don't already have one.  */
++/* Read a look-ahead token if we need one and don't already have one.  */
+ /* yyresume: */
+ 
+-  /* First try to decide what to do without reference to lookahead token.  */
++  /* First try to decide what to do without reference to look-ahead token.  */
+ 
+   yyn = yypact[yystate];
+   if (yyn == YYPACT_NINF)
+     goto yydefault;
+ 
+-  /* Not known => get a lookahead token if don't already have one.  */
++  /* Not known => get a look-ahead token if don't already have one.  */
+ 
+-  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
++  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
+   if (yychar == YYEMPTY)
+     {
+       YYDPRINTF ((stderr, "Reading a token: "));
+@@ -1690,7 +1821,7 @@
+   else
+     {
+       yytoken = YYTRANSLATE (yychar);
+-      YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
++      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+     }
+ 
+   /* If the proper action on seeing token YYTOKEN is to reduce or to
+@@ -1710,8 +1841,8 @@
+   if (yyn == YYFINAL)
+     YYACCEPT;
+ 
+-  /* Shift the lookahead token.  */
+-  YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
++  /* Shift the look-ahead token.  */
++  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+ 
+   /* Discard the token being shifted unless it is eof.  */
+   if (yychar != YYEOF)
+@@ -1757,895 +1888,901 @@
+   yyval = yyvsp[1-yylen];
+ 
+   /* Default location. */
+-  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
++  YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
+   YY_REDUCE_PRINT (yyn);
+   switch (yyn)
+     {
+         case 2:
+ #line 165 "grammar.y"
+-    { yyval.node = new NullNode(); ;}
++    { (yyval.node) = new NullNode(); ;}
+     break;
+ 
+   case 3:
+ #line 166 "grammar.y"
+-    { yyval.node = new BooleanNode(true); ;}
++    { (yyval.node) = new BooleanNode(true); ;}
+     break;
+ 
+   case 4:
+ #line 167 "grammar.y"
+-    { yyval.node = new BooleanNode(false); ;}
++    { (yyval.node) = new BooleanNode(false); ;}
+     break;
+ 
+   case 5:
+ #line 168 "grammar.y"
+-    { yyval.node = new NumberNode(yyvsp[0].dval); ;}
++    { (yyval.node) = new NumberNode((yyvsp[0].dval)); ;}
+     break;
+ 
+   case 6:
+ #line 169 "grammar.y"
+-    { yyval.node = new StringNode(yyvsp[0].ustr); ;}
++    { (yyval.node) = new StringNode((yyvsp[0].ustr)); ;}
+     break;
+ 
+   case 7:
+ #line 170 "grammar.y"
+     { Lexer *l = Lexer::curr();
+                                      if (!l->scanRegExp()) YYABORT;
+-                                     yyval.node = new RegExpNode(l->pattern,l->flags);;}
++                                     (yyval.node) = new RegExpNode(l->pattern,l->flags);;}
+     break;
+ 
+   case 8:
+ #line 174 "grammar.y"
+     { Lexer *l = Lexer::curr();
+                                      if (!l->scanRegExp()) YYABORT;
+-                                     yyval.node = new RegExpNode(UString('=')+l->pattern,l->flags);;}
++                                     (yyval.node) = new RegExpNode(UString('=')+l->pattern,l->flags);;}
+     break;
+ 
+   case 9:
+ #line 180 "grammar.y"
+-    { yyval.node = new ThisNode(); ;}
++    { (yyval.node) = new ThisNode(); ;}
+     break;
+ 
+   case 10:
+ #line 181 "grammar.y"
+-    { yyval.node = new ResolveNode(*yyvsp[0].ident); ;}
++    { (yyval.node) = new ResolveNode(*(yyvsp[0].ident)); ;}
+     break;
+ 
+   case 13:
+ #line 184 "grammar.y"
+-    { yyval.node = new GroupNode(yyvsp[-1].node); ;}
++    { (yyval.node) = new GroupNode((yyvsp[-1].node)); ;}
+     break;
+ 
+   case 14:
+ #line 185 "grammar.y"
+-    { yyval.node = new ObjectLiteralNode(); ;}
++    { (yyval.node) = new ObjectLiteralNode(); ;}
+     break;
+ 
+   case 15:
+ #line 186 "grammar.y"
+-    { yyval.node = new ObjectLiteralNode(yyvsp[-1].plist); ;}
++    { (yyval.node) = new ObjectLiteralNode((yyvsp[-1].plist)); ;}
+     break;
+ 
+   case 16:
+-#line 190 "grammar.y"
+-    { yyval.node = new ArrayNode(yyvsp[-1].ival); ;}
++#line 187 "grammar.y"
++    { (yyval.node) = new ObjectLiteralNode((yyvsp[-2].plist)); ;}
+     break;
+ 
+   case 17:
+ #line 191 "grammar.y"
+-    { yyval.node = new ArrayNode(yyvsp[-1].elm); ;}
++    { (yyval.node) = new ArrayNode((yyvsp[-1].ival)); ;}
+     break;
+ 
+   case 18:
+ #line 192 "grammar.y"
+-    { yyval.node = new ArrayNode(yyvsp[-1].ival, yyvsp[-3].elm); ;}
++    { (yyval.node) = new ArrayNode((yyvsp[-1].elm)); ;}
+     break;
+ 
+   case 19:
+-#line 196 "grammar.y"
+-    { yyval.elm = new ElementNode(yyvsp[-1].ival, yyvsp[0].node); ;}
++#line 193 "grammar.y"
++    { (yyval.node) = new ArrayNode((yyvsp[-1].ival), (yyvsp[-3].elm)); ;}
+     break;
+ 
+   case 20:
+-#line 198 "grammar.y"
+-    { yyval.elm = new ElementNode(yyvsp[-3].elm, yyvsp[-1].ival, yyvsp[0].node); ;}
++#line 197 "grammar.y"
++    { (yyval.elm) = new ElementNode((yyvsp[-1].ival), (yyvsp[0].node)); ;}
+     break;
+ 
+   case 21:
+-#line 202 "grammar.y"
+-    { yyval.ival = 0; ;}
++#line 199 "grammar.y"
++    { (yyval.elm) = new ElementNode((yyvsp[-3].elm), (yyvsp[-1].ival), (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 23:
+-#line 207 "grammar.y"
+-    { yyval.ival = 1; ;}
++  case 22:
++#line 203 "grammar.y"
++    { (yyval.ival) = 0; ;}
+     break;
+ 
+   case 24:
+ #line 208 "grammar.y"
+-    { yyval.ival = yyvsp[-1].ival + 1; ;}
++    { (yyval.ival) = 1; ;}
+     break;
+ 
+   case 25:
+-#line 212 "grammar.y"
+-    { yyval.plist = new PropertyValueNode(yyvsp[-2].pnode, yyvsp[0].node); ;}
++#line 209 "grammar.y"
++    { (yyval.ival) = (yyvsp[-1].ival) + 1; ;}
+     break;
+ 
+   case 26:
+-#line 214 "grammar.y"
+-    { yyval.plist = new PropertyValueNode(yyvsp[-2].pnode, yyvsp[0].node, yyvsp[-4].plist); ;}
++#line 213 "grammar.y"
++    { (yyval.plist) = new PropertyValueNode((yyvsp[-2].pnode), (yyvsp[0].node)); ;}
+     break;
+ 
+   case 27:
+-#line 218 "grammar.y"
+-    { yyval.pnode = new PropertyNode(*yyvsp[0].ident); ;}
++#line 215 "grammar.y"
++    { (yyval.plist) = new PropertyValueNode((yyvsp[-2].pnode), (yyvsp[0].node), (yyvsp[-4].plist)); ;}
+     break;
+ 
+   case 28:
+ #line 219 "grammar.y"
+-    { yyval.pnode = new PropertyNode(Identifier(*yyvsp[0].ustr)); ;}
++    { (yyval.pnode) = new PropertyNode(*(yyvsp[0].ident)); ;}
+     break;
+ 
+   case 29:
+ #line 220 "grammar.y"
+-    { yyval.pnode = new PropertyNode(yyvsp[0].dval); ;}
++    { (yyval.pnode) = new PropertyNode(Identifier(*(yyvsp[0].ustr))); ;}
+     break;
+ 
+-  case 32:
+-#line 226 "grammar.y"
+-    { yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;}
++  case 30:
++#line 221 "grammar.y"
++    { (yyval.pnode) = new PropertyNode((yyvsp[0].dval)); ;}
+     break;
+ 
+   case 33:
+ #line 227 "grammar.y"
+-    { yyval.node = new AccessorNode2(yyvsp[-2].node, *yyvsp[0].ident); ;}
++    { (yyval.node) = new AccessorNode1((yyvsp[-3].node), (yyvsp[-1].node)); ;}
+     break;
+ 
+   case 34:
+ #line 228 "grammar.y"
+-    { yyval.node = new NewExprNode(yyvsp[-1].node, yyvsp[0].args); ;}
++    { (yyval.node) = new AccessorNode2((yyvsp[-2].node), *(yyvsp[0].ident)); ;}
+     break;
+ 
+-  case 36:
+-#line 233 "grammar.y"
+-    { yyval.node = new NewExprNode(yyvsp[0].node); ;}
++  case 35:
++#line 229 "grammar.y"
++    { (yyval.node) = new NewExprNode((yyvsp[-1].node), (yyvsp[0].args)); ;}
+     break;
+ 
+   case 37:
+-#line 237 "grammar.y"
+-    { yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;}
++#line 234 "grammar.y"
++    { (yyval.node) = new NewExprNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 38:
+ #line 238 "grammar.y"
+-    { yyval.node = new FunctionCallNode(yyvsp[-1].node, yyvsp[0].args); ;}
++    { (yyval.node) = new FunctionCallNode((yyvsp[-1].node), (yyvsp[0].args)); ;}
+     break;
+ 
+   case 39:
+ #line 239 "grammar.y"
+-    { yyval.node = new AccessorNode1(yyvsp[-3].node, yyvsp[-1].node); ;}
++    { (yyval.node) = new FunctionCallNode((yyvsp[-1].node), (yyvsp[0].args)); ;}
+     break;
+ 
+   case 40:
+ #line 240 "grammar.y"
+-    { yyval.node = new AccessorNode2(yyvsp[-2].node, *yyvsp[0].ident); ;}
++    { (yyval.node) = new AccessorNode1((yyvsp[-3].node), (yyvsp[-1].node)); ;}
+     break;
+ 
+   case 41:
+-#line 244 "grammar.y"
+-    { yyval.args = new ArgumentsNode(); ;}
++#line 241 "grammar.y"
++    { (yyval.node) = new AccessorNode2((yyvsp[-2].node), *(yyvsp[0].ident)); ;}
+     break;
+ 
+   case 42:
+ #line 245 "grammar.y"
+-    { yyval.args = new ArgumentsNode(yyvsp[-1].alist); ;}
++    { (yyval.args) = new ArgumentsNode(); ;}
+     break;
+ 
+   case 43:
+-#line 249 "grammar.y"
+-    { yyval.alist = new ArgumentListNode(yyvsp[0].node); ;}
++#line 246 "grammar.y"
++    { (yyval.args) = new ArgumentsNode((yyvsp[-1].alist)); ;}
+     break;
+ 
+   case 44:
+ #line 250 "grammar.y"
+-    { yyval.alist = new ArgumentListNode(yyvsp[-2].alist, yyvsp[0].node); ;}
++    { (yyval.alist) = new ArgumentListNode((yyvsp[0].node)); ;}
+     break;
+ 
+-  case 48:
+-#line 260 "grammar.y"
+-    { yyval.node = new PostfixNode(yyvsp[-1].node, OpPlusPlus); ;}
++  case 45:
++#line 251 "grammar.y"
++    { (yyval.alist) = new ArgumentListNode((yyvsp[-2].alist), (yyvsp[0].node)); ;}
+     break;
+ 
+   case 49:
+ #line 261 "grammar.y"
+-    { yyval.node = new PostfixNode(yyvsp[-1].node, OpMinusMinus); ;}
++    { (yyval.node) = new PostfixNode((yyvsp[-1].node), OpPlusPlus); ;}
+     break;
+ 
+-  case 51:
+-#line 266 "grammar.y"
+-    { yyval.node = new DeleteNode(yyvsp[0].node); ;}
++  case 50:
++#line 262 "grammar.y"
++    { (yyval.node) = new PostfixNode((yyvsp[-1].node), OpMinusMinus); ;}
+     break;
+ 
+   case 52:
+ #line 267 "grammar.y"
+-    { yyval.node = new VoidNode(yyvsp[0].node); ;}
++    { (yyval.node) = new DeleteNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 53:
+ #line 268 "grammar.y"
+-    { yyval.node = new TypeOfNode(yyvsp[0].node); ;}
++    { (yyval.node) = new VoidNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 54:
+ #line 269 "grammar.y"
+-    { yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ;}
++    { (yyval.node) = new TypeOfNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 55:
+ #line 270 "grammar.y"
+-    { yyval.node = new PrefixNode(OpPlusPlus, yyvsp[0].node); ;}
++    { (yyval.node) = new PrefixNode(OpPlusPlus, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 56:
+ #line 271 "grammar.y"
+-    { yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ;}
++    { (yyval.node) = new PrefixNode(OpPlusPlus, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 57:
+ #line 272 "grammar.y"
+-    { yyval.node = new PrefixNode(OpMinusMinus, yyvsp[0].node); ;}
++    { (yyval.node) = new PrefixNode(OpMinusMinus, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 58:
+ #line 273 "grammar.y"
+-    { yyval.node = new UnaryPlusNode(yyvsp[0].node); ;}
++    { (yyval.node) = new PrefixNode(OpMinusMinus, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 59:
+ #line 274 "grammar.y"
+-    { yyval.node = new NegateNode(yyvsp[0].node); ;}
++    { (yyval.node) = new UnaryPlusNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 60:
+ #line 275 "grammar.y"
+-    { yyval.node = new BitwiseNotNode(yyvsp[0].node); ;}
++    { (yyval.node) = new NegateNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 61:
+ #line 276 "grammar.y"
+-    { yyval.node = new LogicalNotNode(yyvsp[0].node); ;}
++    { (yyval.node) = new BitwiseNotNode((yyvsp[0].node)); ;}
+     break;
+ 
+-  case 63:
+-#line 281 "grammar.y"
+-    { yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '*'); ;}
++  case 62:
++#line 277 "grammar.y"
++    { (yyval.node) = new LogicalNotNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 64:
+ #line 282 "grammar.y"
+-    { yyval.node = new MultNode(yyvsp[-2].node, yyvsp[0].node, '/'); ;}
++    { (yyval.node) = new MultNode((yyvsp[-2].node), (yyvsp[0].node), '*'); ;}
+     break;
+ 
+   case 65:
+ #line 283 "grammar.y"
+-    { yyval.node = new MultNode(yyvsp[-2].node,yyvsp[0].node,'%'); ;}
++    { (yyval.node) = new MultNode((yyvsp[-2].node), (yyvsp[0].node), '/'); ;}
+     break;
+ 
+-  case 67:
+-#line 288 "grammar.y"
+-    { yyval.node = AddNode::create(yyvsp[-2].node, yyvsp[0].node, '+'); ;}
++  case 66:
++#line 284 "grammar.y"
++    { (yyval.node) = new MultNode((yyvsp[-2].node),(yyvsp[0].node),'%'); ;}
+     break;
+ 
+   case 68:
+ #line 289 "grammar.y"
+-    { yyval.node = AddNode::create(yyvsp[-2].node, yyvsp[0].node, '-'); ;}
++    { (yyval.node) = AddNode::create((yyvsp[-2].node), (yyvsp[0].node), '+'); ;}
+     break;
+ 
+-  case 70:
+-#line 294 "grammar.y"
+-    { yyval.node = new ShiftNode(yyvsp[-2].node, OpLShift, yyvsp[0].node); ;}
++  case 69:
++#line 290 "grammar.y"
++    { (yyval.node) = AddNode::create((yyvsp[-2].node), (yyvsp[0].node), '-'); ;}
+     break;
+ 
+   case 71:
+ #line 295 "grammar.y"
+-    { yyval.node = new ShiftNode(yyvsp[-2].node, OpRShift, yyvsp[0].node); ;}
++    { (yyval.node) = new ShiftNode((yyvsp[-2].node), OpLShift, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 72:
+ #line 296 "grammar.y"
+-    { yyval.node = new ShiftNode(yyvsp[-2].node, OpURShift, yyvsp[0].node); ;}
++    { (yyval.node) = new ShiftNode((yyvsp[-2].node), OpRShift, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 74:
+-#line 302 "grammar.y"
+-    { yyval.node = new RelationalNode(yyvsp[-2].node, OpLess, yyvsp[0].node); ;}
++  case 73:
++#line 297 "grammar.y"
++    { (yyval.node) = new ShiftNode((yyvsp[-2].node), OpURShift, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 75:
+-#line 304 "grammar.y"
+-    { yyval.node = new RelationalNode(yyvsp[-2].node, OpGreater, yyvsp[0].node); ;}
++#line 303 "grammar.y"
++    { (yyval.node) = new RelationalNode((yyvsp[-2].node), OpLess, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 76:
+-#line 306 "grammar.y"
+-    { yyval.node = new RelationalNode(yyvsp[-2].node, OpLessEq, yyvsp[0].node); ;}
++#line 305 "grammar.y"
++    { (yyval.node) = new RelationalNode((yyvsp[-2].node), OpGreater, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 77:
+-#line 308 "grammar.y"
+-    { yyval.node = new RelationalNode(yyvsp[-2].node, OpGreaterEq, yyvsp[0].node); ;}
++#line 307 "grammar.y"
++    { (yyval.node) = new RelationalNode((yyvsp[-2].node), OpLessEq, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 78:
+-#line 310 "grammar.y"
+-    { yyval.node = new RelationalNode(yyvsp[-2].node, OpInstanceOf, yyvsp[0].node); ;}
++#line 309 "grammar.y"
++    { (yyval.node) = new RelationalNode((yyvsp[-2].node), OpGreaterEq, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 79:
+-#line 312 "grammar.y"
+-    { yyval.node = new RelationalNode(yyvsp[-2].node, OpIn, yyvsp[0].node); ;}
++#line 311 "grammar.y"
++    { (yyval.node) = new RelationalNode((yyvsp[-2].node), OpInstanceOf, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 81:
+-#line 317 "grammar.y"
+-    { yyval.node = new EqualNode(yyvsp[-2].node, OpEqEq, yyvsp[0].node); ;}
++  case 80:
++#line 313 "grammar.y"
++    { (yyval.node) = new RelationalNode((yyvsp[-2].node), OpIn, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 82:
+ #line 318 "grammar.y"
+-    { yyval.node = new EqualNode(yyvsp[-2].node, OpNotEq, yyvsp[0].node); ;}
++    { (yyval.node) = new EqualNode((yyvsp[-2].node), OpEqEq, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 83:
+ #line 319 "grammar.y"
+-    { yyval.node = new EqualNode(yyvsp[-2].node, OpStrEq, yyvsp[0].node); ;}
++    { (yyval.node) = new EqualNode((yyvsp[-2].node), OpNotEq, (yyvsp[0].node)); ;}
+     break;
+ 
+   case 84:
+ #line 320 "grammar.y"
+-    { yyval.node = new EqualNode(yyvsp[-2].node, OpStrNEq, yyvsp[0].node);;}
++    { (yyval.node) = new EqualNode((yyvsp[-2].node), OpStrEq, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 86:
+-#line 325 "grammar.y"
+-    { yyval.node = new BitOperNode(yyvsp[-2].node, OpBitAnd, yyvsp[0].node); ;}
++  case 85:
++#line 321 "grammar.y"
++    { (yyval.node) = new EqualNode((yyvsp[-2].node), OpStrNEq, (yyvsp[0].node));;}
+     break;
+ 
+-  case 88:
+-#line 330 "grammar.y"
+-    { yyval.node = new BitOperNode(yyvsp[-2].node, OpBitXOr, yyvsp[0].node); ;}
++  case 87:
++#line 326 "grammar.y"
++    { (yyval.node) = new BitOperNode((yyvsp[-2].node), OpBitAnd, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 90:
+-#line 335 "grammar.y"
+-    { yyval.node = new BitOperNode(yyvsp[-2].node, OpBitOr, yyvsp[0].node); ;}
++  case 89:
++#line 331 "grammar.y"
++    { (yyval.node) = new BitOperNode((yyvsp[-2].node), OpBitXOr, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 92:
+-#line 341 "grammar.y"
+-    { yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpAnd, yyvsp[0].node); ;}
++  case 91:
++#line 336 "grammar.y"
++    { (yyval.node) = new BitOperNode((yyvsp[-2].node), OpBitOr, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 94:
+-#line 347 "grammar.y"
+-    { yyval.node = new BinaryLogicalNode(yyvsp[-2].node, OpOr, yyvsp[0].node); ;}
++  case 93:
++#line 342 "grammar.y"
++    { (yyval.node) = new BinaryLogicalNode((yyvsp[-2].node), OpAnd, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 96:
+-#line 353 "grammar.y"
+-    { yyval.node = new ConditionalNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].node); ;}
++  case 95:
++#line 348 "grammar.y"
++    { (yyval.node) = new BinaryLogicalNode((yyvsp[-2].node), OpOr, (yyvsp[0].node)); ;}
+     break;
+ 
+-  case 98:
+-#line 359 "grammar.y"
+-    { yyval.node = new AssignNode(yyvsp[-2].node, yyvsp[-1].op, yyvsp[0].node);;}
++  case 97:
++#line 354 "grammar.y"
++    { (yyval.node) = new ConditionalNode((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); ;}
+     break;
+ 
+   case 99:
+-#line 363 "grammar.y"
+-    { yyval.op = OpEqual; ;}
++#line 360 "grammar.y"
++    { (yyval.node) = new AssignNode((yyvsp[-2].node), (yyvsp[-1].op), (yyvsp[0].node));;}
+     break;
+ 
+   case 100:
+ #line 364 "grammar.y"
+-    { yyval.op = OpPlusEq; ;}
++    { (yyval.op) = OpEqual; ;}
+     break;
+ 
+   case 101:
+ #line 365 "grammar.y"
+-    { yyval.op = OpMinusEq; ;}
++    { (yyval.op) = OpPlusEq; ;}
+     break;
+ 
+   case 102:
+ #line 366 "grammar.y"
+-    { yyval.op = OpMultEq; ;}
++    { (yyval.op) = OpMinusEq; ;}
+     break;
+ 
+   case 103:
+ #line 367 "grammar.y"
+-    { yyval.op = OpDivEq; ;}
++    { (yyval.op) = OpMultEq; ;}
+     break;
+ 
+   case 104:
+ #line 368 "grammar.y"
+-    { yyval.op = OpLShift; ;}
++    { (yyval.op) = OpDivEq; ;}
+     break;
+ 
+   case 105:
+ #line 369 "grammar.y"
+-    { yyval.op = OpRShift; ;}
++    { (yyval.op) = OpLShift; ;}
+     break;
+ 
+   case 106:
+ #line 370 "grammar.y"
+-    { yyval.op = OpURShift; ;}
++    { (yyval.op) = OpRShift; ;}
+     break;
+ 
+   case 107:
+ #line 371 "grammar.y"
+-    { yyval.op = OpAndEq; ;}
++    { (yyval.op) = OpURShift; ;}
+     break;
+ 
+   case 108:
+ #line 372 "grammar.y"
+-    { yyval.op = OpXOrEq; ;}
++    { (yyval.op) = OpAndEq; ;}
+     break;
+ 
+   case 109:
+ #line 373 "grammar.y"
+-    { yyval.op = OpOrEq; ;}
++    { (yyval.op) = OpXOrEq; ;}
+     break;
+ 
+   case 110:
+ #line 374 "grammar.y"
+-    { yyval.op = OpModEq; ;}
++    { (yyval.op) = OpOrEq; ;}
+     break;
+ 
+-  case 112:
+-#line 379 "grammar.y"
+-    { yyval.node = new CommaNode(yyvsp[-2].node, yyvsp[0].node); ;}
++  case 111:
++#line 375 "grammar.y"
++    { (yyval.op) = OpModEq; ;}
+     break;
+ 
+-  case 128:
+-#line 401 "grammar.y"
+-    { yyval.stat = new BlockNode(0); DBG(yyval.stat, yylsp[0], yylsp[0]); ;}
++  case 113:
++#line 380 "grammar.y"
++    { (yyval.node) = new CommaNode((yyvsp[-2].node), (yyvsp[0].node)); ;}
+     break;
+ 
+   case 129:
+ #line 402 "grammar.y"
+-    { yyval.stat = new BlockNode(yyvsp[-1].srcs); DBG(yyval.stat, yylsp[0], yylsp[0]); ;}
++    { (yyval.stat) = new BlockNode(0); DBG((yyval.stat), (yylsp[0]), (yylsp[0])); ;}
+     break;
+ 
+   case 130:
+-#line 406 "grammar.y"
+-    { yyval.slist = new StatListNode(yyvsp[0].stat); ;}
++#line 403 "grammar.y"
++    { (yyval.stat) = new BlockNode((yyvsp[-1].srcs)); DBG((yyval.stat), (yylsp[0]), (yylsp[0])); ;}
+     break;
+ 
+   case 131:
+ #line 407 "grammar.y"
+-    { yyval.slist = new StatListNode(yyvsp[-1].slist, yyvsp[0].stat); ;}
++    { (yyval.slist) = new StatListNode((yyvsp[0].stat)); ;}
+     break;
+ 
+   case 132:
+-#line 411 "grammar.y"
+-    { yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
+-                                      DBG(yyval.stat, yylsp[-2], yylsp[0]); ;}
++#line 408 "grammar.y"
++    { (yyval.slist) = new StatListNode((yyvsp[-1].slist), (yyvsp[0].stat)); ;}
+     break;
+ 
+   case 133:
+-#line 413 "grammar.y"
++#line 412 "grammar.y"
++    { (yyval.stat) = new VarStatementNode((yyvsp[-1].vlist));
++                                      DBG((yyval.stat), (yylsp[-2]), (yylsp[0])); ;}
++    break;
++
++  case 134:
++#line 414 "grammar.y"
+     { if (automatic()) {
+-                                          yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
+-					  DBG(yyval.stat, yylsp[-2], yylsp[-1]);
++                                          (yyval.stat) = new VarStatementNode((yyvsp[-1].vlist));
++					  DBG((yyval.stat), (yylsp[-2]), (yylsp[-1]));
+                                         } else {
+ 					  YYABORT;
+ 					}
+                                       ;}
+     break;
+ 
+-  case 134:
+-#line 423 "grammar.y"
+-    { yyval.vlist = new VarDeclListNode(yyvsp[0].decl); ;}
+-    break;
+-
+   case 135:
+-#line 425 "grammar.y"
+-    { yyval.vlist = new VarDeclListNode(yyvsp[-2].vlist, yyvsp[0].decl); ;}
++#line 424 "grammar.y"
++    { (yyval.vlist) = new VarDeclListNode((yyvsp[0].decl)); ;}
+     break;
+ 
+   case 136:
+-#line 429 "grammar.y"
+-    { yyval.decl = new VarDeclNode(*yyvsp[0].ident, 0, VarDeclNode::Variable); ;}
++#line 426 "grammar.y"
++    { (yyval.vlist) = new VarDeclListNode((yyvsp[-2].vlist), (yyvsp[0].decl)); ;}
+     break;
+ 
+   case 137:
+ #line 430 "grammar.y"
+-    { yyval.decl = new VarDeclNode(*yyvsp[-1].ident, yyvsp[0].init, VarDeclNode::Variable); ;}
++    { (yyval.decl) = new VarDeclNode(*(yyvsp[0].ident), 0, VarDeclNode::Variable); ;}
+     break;
+ 
+   case 138:
+-#line 434 "grammar.y"
+-    { yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
+-                                      DBG(yyval.stat, yylsp[-2], yylsp[0]); ;}
++#line 431 "grammar.y"
++    { (yyval.decl) = new VarDeclNode(*(yyvsp[-1].ident), (yyvsp[0].init), VarDeclNode::Variable); ;}
+     break;
+ 
+   case 139:
+-#line 436 "grammar.y"
++#line 435 "grammar.y"
++    { (yyval.stat) = new VarStatementNode((yyvsp[-1].vlist));
++                                      DBG((yyval.stat), (yylsp[-2]), (yylsp[0])); ;}
++    break;
++
++  case 140:
++#line 437 "grammar.y"
+     { if (automatic()) {
+-                                          yyval.stat = new VarStatementNode(yyvsp[-1].vlist);
+-					  DBG(yyval.stat, yylsp[-2], yylsp[-1]);
++                                          (yyval.stat) = new VarStatementNode((yyvsp[-1].vlist));
++					  DBG((yyval.stat), (yylsp[-2]), (yylsp[-1]));
+                                         } else {
+ 					  YYABORT;
+ 					}
+                                       ;}
+     break;
+ 
+-  case 140:
+-#line 446 "grammar.y"
+-    { yyval.vlist = new VarDeclListNode(yyvsp[0].decl); ;}
+-    break;
+-
+   case 141:
+-#line 448 "grammar.y"
+-    { yyval.vlist = new VarDeclListNode(yyvsp[-2].vlist, yyvsp[0].decl); ;}
++#line 447 "grammar.y"
++    { (yyval.vlist) = new VarDeclListNode((yyvsp[0].decl)); ;}
+     break;
+ 
+   case 142:
+-#line 452 "grammar.y"
+-    { yyval.decl = new VarDeclNode(*yyvsp[0].ident, 0, VarDeclNode::Constant); ;}
++#line 449 "grammar.y"
++    { (yyval.vlist) = new VarDeclListNode((yyvsp[-2].vlist), (yyvsp[0].decl)); ;}
+     break;
+ 
+   case 143:
+ #line 453 "grammar.y"
+-    { yyval.decl = new VarDeclNode(*yyvsp[-1].ident, yyvsp[0].init, VarDeclNode::Constant); ;}
++    { (yyval.decl) = new VarDeclNode(*(yyvsp[0].ident), 0, VarDeclNode::Constant); ;}
+     break;
+ 
+   case 144:
+-#line 457 "grammar.y"
+-    { yyval.init = new AssignExprNode(yyvsp[0].node); ;}
++#line 454 "grammar.y"
++    { (yyval.decl) = new VarDeclNode(*(yyvsp[-1].ident), (yyvsp[0].init), VarDeclNode::Constant); ;}
+     break;
+ 
+   case 145:
+-#line 461 "grammar.y"
+-    { yyval.stat = new EmptyStatementNode(); DBG(yyval.stat, yylsp[0], yylsp[0]); ;}
++#line 458 "grammar.y"
++    { (yyval.init) = new AssignExprNode((yyvsp[0].node)); ;}
+     break;
+ 
+   case 146:
+-#line 465 "grammar.y"
+-    { yyval.stat = new ExprStatementNode(yyvsp[-1].node);
+-                                     DBG(yyval.stat, yylsp[-1], yylsp[0]); ;}
++#line 462 "grammar.y"
++    { (yyval.stat) = new EmptyStatementNode(); DBG((yyval.stat), (yylsp[0]), (yylsp[0])); ;}
+     break;
+ 
+   case 147:
+-#line 467 "grammar.y"
++#line 466 "grammar.y"
++    { (yyval.stat) = new ExprStatementNode((yyvsp[-1].node));
++                                     DBG((yyval.stat), (yylsp[-1]), (yylsp[0])); ;}
++    break;
++
++  case 148:
++#line 468 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new ExprStatementNode(yyvsp[-1].node);
+-				       DBG(yyval.stat, yylsp[-1], yylsp[-1]);
++                                       (yyval.stat) = new ExprStatementNode((yyvsp[-1].node));
++				       DBG((yyval.stat), (yylsp[-1]), (yylsp[-1]));
+                                      } else
+ 				       YYABORT; ;}
+     break;
+ 
+-  case 148:
+-#line 475 "grammar.y"
+-    { yyval.stat = new IfNode(yyvsp[-2].node,yyvsp[0].stat,0);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ;}
+-    break;
+-
+   case 149:
+-#line 477 "grammar.y"
+-    { yyval.stat = new IfNode(yyvsp[-4].node,yyvsp[-2].stat,yyvsp[0].stat);DBG(yyval.stat,yylsp[-6],yylsp[-3]); ;}
++#line 476 "grammar.y"
++    { (yyval.stat) = new IfNode((yyvsp[-2].node),(yyvsp[0].stat),0);DBG((yyval.stat),(yylsp[-4]),(yylsp[-1])); ;}
+     break;
+ 
+   case 150:
+-#line 481 "grammar.y"
+-    { yyval.stat=new DoWhileNode(yyvsp[-4].stat,yyvsp[-1].node);DBG(yyval.stat,yylsp[-5],yylsp[-3]);;}
++#line 478 "grammar.y"
++    { (yyval.stat) = new IfNode((yyvsp[-4].node),(yyvsp[-2].stat),(yyvsp[0].stat));DBG((yyval.stat),(yylsp[-6]),(yylsp[-3])); ;}
+     break;
+ 
+   case 151:
+ #line 482 "grammar.y"
+-    { yyval.stat = new WhileNode(yyvsp[-2].node,yyvsp[0].stat);DBG(yyval.stat,yylsp[-4],yylsp[-1]); ;}
++    { (yyval.stat)=new DoWhileNode((yyvsp[-4].stat),(yyvsp[-1].node));DBG((yyval.stat),(yylsp[-5]),(yylsp[-3]));;}
+     break;
+ 
+   case 152:
+-#line 484 "grammar.y"
+-    { yyval.stat = new ForNode(yyvsp[-6].node,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat);
+-	                             DBG(yyval.stat,yylsp[-8],yylsp[-1]); ;}
++#line 483 "grammar.y"
++    { (yyval.stat) = new WhileNode((yyvsp[-2].node),(yyvsp[0].stat));DBG((yyval.stat),(yylsp[-4]),(yylsp[-1])); ;}
+     break;
+ 
+   case 153:
+-#line 487 "grammar.y"
+-    { yyval.stat = new ForNode(yyvsp[-6].vlist,yyvsp[-4].node,yyvsp[-2].node,yyvsp[0].stat);
+-	                             DBG(yyval.stat,yylsp[-9],yylsp[-1]); ;}
++#line 485 "grammar.y"
++    { (yyval.stat) = new ForNode((yyvsp[-6].node),(yyvsp[-4].node),(yyvsp[-2].node),(yyvsp[0].stat));
++	                             DBG((yyval.stat),(yylsp[-8]),(yylsp[-1])); ;}
+     break;
+ 
+   case 154:
+-#line 490 "grammar.y"
+-    { yyval.stat = new ForInNode(yyvsp[-4].node, yyvsp[-2].node, yyvsp[0].stat);
+-	                             DBG(yyval.stat,yylsp[-6],yylsp[-1]); ;}
++#line 488 "grammar.y"
++    { (yyval.stat) = new ForNode((yyvsp[-6].vlist),(yyvsp[-4].node),(yyvsp[-2].node),(yyvsp[0].stat));
++	                             DBG((yyval.stat),(yylsp[-9]),(yylsp[-1])); ;}
+     break;
+ 
+   case 155:
+-#line 493 "grammar.y"
+-    { yyval.stat = new ForInNode(*yyvsp[-4].ident,0,yyvsp[-2].node,yyvsp[0].stat);
+-	                             DBG(yyval.stat,yylsp[-7],yylsp[-1]); ;}
++#line 491 "grammar.y"
++    { (yyval.stat) = new ForInNode((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].stat));
++	                             DBG((yyval.stat),(yylsp[-6]),(yylsp[-1])); ;}
+     break;
+ 
+   case 156:
+-#line 496 "grammar.y"
+-    { yyval.stat = new ForInNode(*yyvsp[-5].ident,yyvsp[-4].init,yyvsp[-2].node,yyvsp[0].stat);
+-	                             DBG(yyval.stat,yylsp[-8],yylsp[-1]); ;}
++#line 494 "grammar.y"
++    { (yyval.stat) = new ForInNode(*(yyvsp[-4].ident),0,(yyvsp[-2].node),(yyvsp[0].stat));
++	                             DBG((yyval.stat),(yylsp[-7]),(yylsp[-1])); ;}
+     break;
+ 
+   case 157:
+-#line 501 "grammar.y"
+-    { yyval.node = 0; ;}
++#line 497 "grammar.y"
++    { (yyval.stat) = new ForInNode(*(yyvsp[-5].ident),(yyvsp[-4].init),(yyvsp[-2].node),(yyvsp[0].stat));
++	                             DBG((yyval.stat),(yylsp[-8]),(yylsp[-1])); ;}
+     break;
+ 
+-  case 159:
+-#line 506 "grammar.y"
+-    { yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;}
++  case 158:
++#line 502 "grammar.y"
++    { (yyval.node) = 0; ;}
+     break;
+ 
+   case 160:
+ #line 507 "grammar.y"
++    { (yyval.stat) = new ContinueNode(); DBG((yyval.stat),(yylsp[-1]),(yylsp[0])); ;}
++    break;
++
++  case 161:
++#line 508 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new ContinueNode(); DBG(yyval.stat,yylsp[-1],yylsp[0]);
++                                       (yyval.stat) = new ContinueNode(); DBG((yyval.stat),(yylsp[-1]),(yylsp[0]));
+                                      } else
+ 				       YYABORT; ;}
+     break;
+ 
+-  case 161:
+-#line 511 "grammar.y"
+-    { yyval.stat = new ContinueNode(*yyvsp[-1].ident); DBG(yyval.stat,yylsp[-2],yylsp[0]); ;}
++  case 162:
++#line 512 "grammar.y"
++    { (yyval.stat) = new ContinueNode(*(yyvsp[-1].ident)); DBG((yyval.stat),(yylsp[-2]),(yylsp[0])); ;}
+     break;
+ 
+-  case 162:
+-#line 512 "grammar.y"
++  case 163:
++#line 513 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new ContinueNode(*yyvsp[-1].ident);DBG(yyval.stat,yylsp[-2],yylsp[-1]);
++                                       (yyval.stat) = new ContinueNode(*(yyvsp[-1].ident));DBG((yyval.stat),(yylsp[-2]),(yylsp[-1]));
+                                      } else
+ 				       YYABORT; ;}
+     break;
+ 
+-  case 163:
+-#line 519 "grammar.y"
+-    { yyval.stat = new BreakNode();DBG(yyval.stat,yylsp[-1],yylsp[0]); ;}
++  case 164:
++#line 520 "grammar.y"
++    { (yyval.stat) = new BreakNode();DBG((yyval.stat),(yylsp[-1]),(yylsp[0])); ;}
+     break;
+ 
+-  case 164:
+-#line 520 "grammar.y"
++  case 165:
++#line 521 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new BreakNode(); DBG(yyval.stat,yylsp[-1],yylsp[-1]);
++                                       (yyval.stat) = new BreakNode(); DBG((yyval.stat),(yylsp[-1]),(yylsp[-1]));
+                                      } else
+ 				       YYABORT; ;}
+     break;
+ 
+-  case 165:
+-#line 524 "grammar.y"
+-    { yyval.stat = new BreakNode(*yyvsp[-1].ident); DBG(yyval.stat,yylsp[-2],yylsp[0]); ;}
++  case 166:
++#line 525 "grammar.y"
++    { (yyval.stat) = new BreakNode(*(yyvsp[-1].ident)); DBG((yyval.stat),(yylsp[-2]),(yylsp[0])); ;}
+     break;
+ 
+-  case 166:
+-#line 525 "grammar.y"
++  case 167:
++#line 526 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new BreakNode(*yyvsp[-1].ident); DBG(yyval.stat,yylsp[-2],yylsp[-1]);
++                                       (yyval.stat) = new BreakNode(*(yyvsp[-1].ident)); DBG((yyval.stat),(yylsp[-2]),(yylsp[-1]));
+                                      } else
+ 				       YYABORT;
+                                    ;}
+     break;
+ 
+-  case 167:
+-#line 533 "grammar.y"
+-    { yyval.stat = new ReturnNode(0); DBG(yyval.stat,yylsp[-1],yylsp[0]); ;}
++  case 168:
++#line 534 "grammar.y"
++    { (yyval.stat) = new ReturnNode(0); DBG((yyval.stat),(yylsp[-1]),(yylsp[0])); ;}
+     break;
+ 
+-  case 168:
+-#line 534 "grammar.y"
++  case 169:
++#line 535 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new ReturnNode(0); DBG(yyval.stat,yylsp[-1],yylsp[-1]);
++                                       (yyval.stat) = new ReturnNode(0); DBG((yyval.stat),(yylsp[-1]),(yylsp[-1]));
+                                      } else
+ 				       YYABORT; ;}
+     break;
+ 
+-  case 169:
+-#line 538 "grammar.y"
+-    { yyval.stat = new ReturnNode(yyvsp[-1].node); DBG(yyval.stat,yylsp[-2],yylsp[0]); ;}
++  case 170:
++#line 539 "grammar.y"
++    { (yyval.stat) = new ReturnNode((yyvsp[-1].node)); DBG((yyval.stat),(yylsp[-2]),(yylsp[0])); ;}
+     break;
+ 
+-  case 170:
+-#line 539 "grammar.y"
++  case 171:
++#line 540 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new ReturnNode(yyvsp[-1].node); DBG(yyval.stat,yylsp[-2],yylsp[-2]);
++                                       (yyval.stat) = new ReturnNode((yyvsp[-1].node)); DBG((yyval.stat),(yylsp[-2]),(yylsp[-2]));
+                                      }
+                                      else
+ 				       YYABORT; ;}
+     break;
+ 
+-  case 171:
+-#line 547 "grammar.y"
+-    { yyval.stat = new WithNode(yyvsp[-2].node,yyvsp[0].stat);
+-                                     DBG(yyval.stat, yylsp[-4], yylsp[-1]); ;}
+-    break;
+-
+   case 172:
+-#line 552 "grammar.y"
+-    { yyval.stat = new SwitchNode(yyvsp[-2].node, yyvsp[0].cblk);
+-                                     DBG(yyval.stat, yylsp[-4], yylsp[-1]); ;}
++#line 548 "grammar.y"
++    { (yyval.stat) = new WithNode((yyvsp[-2].node),(yyvsp[0].stat));
++                                     DBG((yyval.stat), (yylsp[-4]), (yylsp[-1])); ;}
+     break;
+ 
+   case 173:
+-#line 557 "grammar.y"
+-    { yyval.cblk = new CaseBlockNode(yyvsp[-1].clist, 0, 0); ;}
++#line 553 "grammar.y"
++    { (yyval.stat) = new SwitchNode((yyvsp[-2].node), (yyvsp[0].cblk));
++                                     DBG((yyval.stat), (yylsp[-4]), (yylsp[-1])); ;}
+     break;
+ 
+   case 174:
+-#line 559 "grammar.y"
+-    { yyval.cblk = new CaseBlockNode(yyvsp[-3].clist, yyvsp[-2].ccl, yyvsp[-1].clist); ;}
++#line 558 "grammar.y"
++    { (yyval.cblk) = new CaseBlockNode((yyvsp[-1].clist), 0, 0); ;}
+     break;
+ 
+   case 175:
+-#line 563 "grammar.y"
+-    { yyval.clist = 0; ;}
++#line 560 "grammar.y"
++    { (yyval.cblk) = new CaseBlockNode((yyvsp[-3].clist), (yyvsp[-2].ccl), (yyvsp[-1].clist)); ;}
+     break;
+ 
+-  case 177:
+-#line 568 "grammar.y"
+-    { yyval.clist = new ClauseListNode(yyvsp[0].ccl); ;}
++  case 176:
++#line 564 "grammar.y"
++    { (yyval.clist) = 0; ;}
+     break;
+ 
+   case 178:
+ #line 569 "grammar.y"
+-    { yyval.clist = new ClauseListNode(yyvsp[-1].clist, yyvsp[0].ccl); ;}
++    { (yyval.clist) = new ClauseListNode((yyvsp[0].ccl)); ;}
+     break;
+ 
+   case 179:
+-#line 573 "grammar.y"
+-    { yyval.ccl = new CaseClauseNode(yyvsp[-1].node); ;}
++#line 570 "grammar.y"
++    { (yyval.clist) = new ClauseListNode((yyvsp[-1].clist), (yyvsp[0].ccl)); ;}
+     break;
+ 
+   case 180:
+ #line 574 "grammar.y"
+-    { yyval.ccl = new CaseClauseNode(yyvsp[-2].node, yyvsp[0].slist); ;}
++    { (yyval.ccl) = new CaseClauseNode((yyvsp[-1].node)); ;}
+     break;
+ 
+   case 181:
+-#line 578 "grammar.y"
+-    { yyval.ccl = new CaseClauseNode(0); ;}
++#line 575 "grammar.y"
++    { (yyval.ccl) = new CaseClauseNode((yyvsp[-2].node), (yyvsp[0].slist)); ;}
+     break;
+ 
+   case 182:
+ #line 579 "grammar.y"
+-    { yyval.ccl = new CaseClauseNode(0, yyvsp[0].slist); ;}
++    { (yyval.ccl) = new CaseClauseNode(0); ;}
+     break;
+ 
+   case 183:
+-#line 583 "grammar.y"
+-    { yyvsp[0].stat->pushLabel(*yyvsp[-2].ident);
+-                                     yyval.stat = new LabelNode(*yyvsp[-2].ident, yyvsp[0].stat); DBG(yyval.stat,yylsp[-2],yylsp[-1]); ;}
++#line 580 "grammar.y"
++    { (yyval.ccl) = new CaseClauseNode(0, (yyvsp[0].slist)); ;}
+     break;
+ 
+   case 184:
+-#line 588 "grammar.y"
+-    { yyval.stat = new ThrowNode(yyvsp[-1].node); DBG(yyval.stat,yylsp[-2],yylsp[0]); ;}
++#line 584 "grammar.y"
++    { (yyvsp[0].stat)->pushLabel(*(yyvsp[-2].ident));
++                                     (yyval.stat) = new LabelNode(*(yyvsp[-2].ident), (yyvsp[0].stat)); DBG((yyval.stat),(yylsp[-2]),(yylsp[-1])); ;}
+     break;
+ 
+   case 185:
+ #line 589 "grammar.y"
++    { (yyval.stat) = new ThrowNode((yyvsp[-1].node)); DBG((yyval.stat),(yylsp[-2]),(yylsp[0])); ;}
++    break;
++
++  case 186:
++#line 590 "grammar.y"
+     { if (automatic()) {
+-                                       yyval.stat = new ThrowNode(yyvsp[-1].node); DBG(yyval.stat,yylsp[-2],yylsp[-2]);
++                                       (yyval.stat) = new ThrowNode((yyvsp[-1].node)); DBG((yyval.stat),(yylsp[-2]),(yylsp[-2]));
+                                      } else {
+ 				       YYABORT; } ;}
+     break;
+ 
+-  case 186:
+-#line 596 "grammar.y"
+-    { yyval.stat = new TryNode(yyvsp[-1].stat, yyvsp[0].cnode); DBG(yyval.stat,yylsp[-2],yylsp[-2]); ;}
+-    break;
+-
+   case 187:
+ #line 597 "grammar.y"
+-    { yyval.stat = new TryNode(yyvsp[-1].stat, yyvsp[0].fnode); DBG(yyval.stat,yylsp[-2],yylsp[-2]); ;}
++    { (yyval.stat) = new TryNode((yyvsp[-1].stat), (yyvsp[0].cnode)); DBG((yyval.stat),(yylsp[-2]),(yylsp[-2])); ;}
+     break;
+ 
+   case 188:
+ #line 598 "grammar.y"
+-    { yyval.stat = new TryNode(yyvsp[-2].stat, yyvsp[-1].cnode, yyvsp[0].fnode); DBG(yyval.stat,yylsp[-3],yylsp[-3]); ;}
++    { (yyval.stat) = new TryNode((yyvsp[-1].stat), (yyvsp[0].fnode)); DBG((yyval.stat),(yylsp[-2]),(yylsp[-2])); ;}
+     break;
+ 
+   case 189:
+-#line 602 "grammar.y"
+-    { CatchNode *c; yyval.cnode = c = new CatchNode(*yyvsp[-2].ident, yyvsp[0].stat);
+-				     DBG(c,yylsp[-4],yylsp[-1]); ;}
++#line 599 "grammar.y"
++    { (yyval.stat) = new TryNode((yyvsp[-2].stat), (yyvsp[-1].cnode), (yyvsp[0].fnode)); DBG((yyval.stat),(yylsp[-3]),(yylsp[-3])); ;}
+     break;
+ 
+   case 190:
+-#line 607 "grammar.y"
+-    { FinallyNode *f; yyval.fnode = f = new FinallyNode(yyvsp[0].stat); DBG(f,yylsp[-1],yylsp[-1]); ;}
++#line 603 "grammar.y"
++    { CatchNode *c; (yyval.cnode) = c = new CatchNode(*(yyvsp[-2].ident), (yyvsp[0].stat));
++				     DBG(c,(yylsp[-4]),(yylsp[-1])); ;}
+     break;
+ 
+-  case 192:
+-#line 613 "grammar.y"
+-    { yyval.func = yyvsp[0].func; ;}
++  case 191:
++#line 608 "grammar.y"
++    { FinallyNode *f; (yyval.fnode) = f = new FinallyNode((yyvsp[0].stat)); DBG(f,(yylsp[-1]),(yylsp[-1])); ;}
+     break;
+ 
+   case 193:
+-#line 617 "grammar.y"
+-    { yyval.func = new FuncDeclNode(*yyvsp[-3].ident, yyvsp[0].body); DBG(yyval.func,yylsp[-4],yylsp[-1]); ;}
++#line 614 "grammar.y"
++    { (yyval.func) = (yyvsp[0].func); ;}
+     break;
+ 
+   case 194:
+-#line 619 "grammar.y"
+-    { yyval.func = new FuncDeclNode(*yyvsp[-4].ident, yyvsp[-2].param, yyvsp[0].body); DBG(yyval.func,yylsp[-5],yylsp[-1]); ;}
++#line 618 "grammar.y"
++    { (yyval.func) = new FuncDeclNode(*(yyvsp[-3].ident), (yyvsp[0].body)); DBG((yyval.func),(yylsp[-4]),(yylsp[-1])); ;}
+     break;
+ 
+   case 195:
+-#line 623 "grammar.y"
+-    { yyval.node = new FuncExprNode(yyvsp[0].body); ;}
++#line 620 "grammar.y"
++    { (yyval.func) = new FuncDeclNode(*(yyvsp[-4].ident), (yyvsp[-2].param), (yyvsp[0].body)); DBG((yyval.func),(yylsp[-5]),(yylsp[-1])); ;}
+     break;
+ 
+   case 196:
+-#line 625 "grammar.y"
+-    { yyval.node = new FuncExprNode(yyvsp[-2].param, yyvsp[0].body); ;}
++#line 624 "grammar.y"
++    { (yyval.node) = new FuncExprNode((yyvsp[0].body)); ;}
+     break;
+ 
+   case 197:
+-#line 630 "grammar.y"
+-    { yyval.param = new ParameterNode(*yyvsp[0].ident); ;}
++#line 626 "grammar.y"
++    { (yyval.node) = new FuncExprNode((yyvsp[-2].param), (yyvsp[0].body)); ;}
+     break;
+ 
+   case 198:
+ #line 631 "grammar.y"
+-    { yyval.param = new ParameterNode(yyvsp[-2].param, *yyvsp[0].ident); ;}
++    { (yyval.param) = new ParameterNode(*(yyvsp[0].ident)); ;}
+     break;
+ 
+   case 199:
+-#line 635 "grammar.y"
+-    { yyval.body = new FunctionBodyNode(0);
+-	                             DBG(yyval.body, yylsp[-1], yylsp[0]);;}
++#line 632 "grammar.y"
++    { (yyval.param) = new ParameterNode((yyvsp[-2].param), *(yyvsp[0].ident)); ;}
+     break;
+ 
+   case 200:
+-#line 637 "grammar.y"
+-    { yyval.body = new FunctionBodyNode(yyvsp[-1].srcs);
+-	                             DBG(yyval.body, yylsp[-2], yylsp[0]);;}
++#line 636 "grammar.y"
++    { (yyval.body) = new FunctionBodyNode(0);
++	                             DBG((yyval.body), (yylsp[-1]), (yylsp[0]));;}
+     break;
+ 
+   case 201:
+-#line 642 "grammar.y"
+-    { yyval.prog = new FunctionBodyNode(0);
+-                                     yyval.prog->setLoc(0, 0, Parser::source);
+-                                     Parser::progNode = yyval.prog; ;}
++#line 638 "grammar.y"
++    { (yyval.body) = new FunctionBodyNode((yyvsp[-1].srcs));
++	                             DBG((yyval.body), (yylsp[-2]), (yylsp[0]));;}
+     break;
+ 
+   case 202:
+-#line 645 "grammar.y"
+-    { yyval.prog = new FunctionBodyNode(yyvsp[0].srcs);
+-                                     Parser::progNode = yyval.prog; ;}
++#line 643 "grammar.y"
++    { (yyval.prog) = new FunctionBodyNode(0);
++                                     (yyval.prog)->setLoc(0, 0, Parser::source);
++                                     Parser::progNode = (yyval.prog); ;}
+     break;
+ 
+   case 203:
+-#line 650 "grammar.y"
+-    { yyval.srcs = new SourceElementsNode(yyvsp[0].stat); ;}
++#line 646 "grammar.y"
++    { (yyval.prog) = new FunctionBodyNode((yyvsp[0].srcs));
++                                     Parser::progNode = (yyval.prog); ;}
+     break;
+ 
+   case 204:
+ #line 651 "grammar.y"
+-    { yyval.srcs = new SourceElementsNode(yyvsp[-1].srcs, yyvsp[0].stat); ;}
++    { (yyval.srcs) = new SourceElementsNode((yyvsp[0].stat)); ;}
+     break;
+ 
+   case 205:
+-#line 655 "grammar.y"
+-    { yyval.stat = yyvsp[0].stat; ;}
++#line 652 "grammar.y"
++    { (yyval.srcs) = new SourceElementsNode((yyvsp[-1].srcs), (yyvsp[0].stat)); ;}
+     break;
+ 
+   case 206:
+ #line 656 "grammar.y"
+-    { yyval.stat = yyvsp[0].func; ;}
++    { (yyval.stat) = (yyvsp[0].stat); ;}
+     break;
+ 
++  case 207:
++#line 657 "grammar.y"
++    { (yyval.stat) = (yyvsp[0].func); ;}
++    break;
+ 
++
++      default: break;
+     }
+ 
+-/* Line 991 of yacc.c.  */
+-#line 2648 "grammar.tab.c"
++/* Line 1126 of yacc.c.  */
++#line 2786 "grammar.tab.c"
+ 
+   yyvsp -= yylen;
+   yyssp -= yylen;
+@@ -2684,105 +2821,155 @@
+ 
+       if (YYPACT_NINF < yyn && yyn < YYLAST)
+ 	{
+-	  YYSIZE_T yysize = 0;
+ 	  int yytype = YYTRANSLATE (yychar);
+-	  char *yymsg;
+-	  int yyx, yycount;
++	  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
++	  YYSIZE_T yysize = yysize0;
++	  YYSIZE_T yysize1;
++	  int yysize_overflow = 0;
++	  char *yymsg = 0;
++#	  define YYERROR_VERBOSE_ARGS_MAXIMUM 5
++	  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
++	  int yyx;
+ 
+-	  yycount = 0;
++#if 0
++	  /* This is so xgettext sees the translatable formats that are
++	     constructed on the fly.  */
++	  YY_("syntax error, unexpected %s");
++	  YY_("syntax error, unexpected %s, expecting %s");
++	  YY_("syntax error, unexpected %s, expecting %s or %s");
++	  YY_("syntax error, unexpected %s, expecting %s or %s or %s");
++	  YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
++#endif
++	  char *yyfmt;
++	  char const *yyf;
++	  static char const yyunexpected[] = "syntax error, unexpected %s";
++	  static char const yyexpecting[] = ", expecting %s";
++	  static char const yyor[] = " or %s";
++	  char yyformat[sizeof yyunexpected
++			+ sizeof yyexpecting - 1
++			+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
++			   * (sizeof yyor - 1))];
++	  char const *yyprefix = yyexpecting;
++
+ 	  /* Start YYX at -YYN if negative to avoid negative indexes in
+ 	     YYCHECK.  */
+-	  for (yyx = yyn < 0 ? -yyn : 0;
+-	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
++	  int yyxbegin = yyn < 0 ? -yyn : 0;
++
++	  /* Stay within bounds of both yycheck and yytname.  */
++	  int yychecklim = YYLAST - yyn;
++	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
++	  int yycount = 1;
++
++	  yyarg[0] = yytname[yytype];
++	  yyfmt = yystpcpy (yyformat, yyunexpected);
++
++	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ 	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+-	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
+-	  yysize += yystrlen ("syntax error, unexpected ") + 1;
+-	  yysize += yystrlen (yytname[yytype]);
+-	  yymsg = (char *) YYSTACK_ALLOC (yysize);
+-	  if (yymsg != 0)
++	      {
++		if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
++		  {
++		    yycount = 1;
++		    yysize = yysize0;
++		    yyformat[sizeof yyunexpected - 1] = '\0';
++		    break;
++		  }
++		yyarg[yycount++] = yytname[yyx];
++		yysize1 = yysize + yytnamerr (0, yytname[yyx]);
++		yysize_overflow |= yysize1 < yysize;
++		yysize = yysize1;
++		yyfmt = yystpcpy (yyfmt, yyprefix);
++		yyprefix = yyor;
++	      }
++
++	  yyf = YY_(yyformat);
++	  yysize1 = yysize + yystrlen (yyf);
++	  yysize_overflow |= yysize1 < yysize;
++	  yysize = yysize1;
++
++	  if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
++	    yymsg = (char *) YYSTACK_ALLOC (yysize);
++	  if (yymsg)
+ 	    {
+-	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+-	      yyp = yystpcpy (yyp, yytname[yytype]);
+-
+-	      if (yycount < 5)
++	      /* Avoid sprintf, as that infringes on the user's name space.
++		 Don't have undefined behavior even if the translation
++		 produced a string with the wrong number of "%s"s.  */
++	      char *yyp = yymsg;
++	      int yyi = 0;
++	      while ((*yyp = *yyf))
+ 		{
+-		  yycount = 0;
+-		  for (yyx = yyn < 0 ? -yyn : 0;
+-		       yyx < (int) (sizeof (yytname) / sizeof (char *));
+-		       yyx++)
+-		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+-		      {
+-			const char *yyq = ! yycount ? ", expecting " : " or ";
+-			yyp = yystpcpy (yyp, yyq);
+-			yyp = yystpcpy (yyp, yytname[yyx]);
+-			yycount++;
+-		      }
++		  if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
++		    {
++		      yyp += yytnamerr (yyp, yyarg[yyi++]);
++		      yyf += 2;
++		    }
++		  else
++		    {
++		      yyp++;
++		      yyf++;
++		    }
+ 		}
+ 	      yyerror (yymsg);
+ 	      YYSTACK_FREE (yymsg);
+ 	    }
+ 	  else
+-	    yyerror ("syntax error; also virtual memory exhausted");
++	    {
++	      yyerror (YY_("syntax error"));
++	      goto yyexhaustedlab;
++	    }
+ 	}
+       else
+ #endif /* YYERROR_VERBOSE */
+-	yyerror ("syntax error");
++	yyerror (YY_("syntax error"));
+     }
+ 
+-  yylerrsp = yylsp;
++  yyerror_range[0] = yylloc;
+ 
+   if (yyerrstatus == 3)
+     {
+-      /* If just tried and failed to reuse lookahead token after an
++      /* If just tried and failed to reuse look-ahead token after an
+ 	 error, discard it.  */
+ 
+-      /* Return failure if at end of input.  */
+-      if (yychar == YYEOF)
++      if (yychar <= YYEOF)
+         {
+-	  /* Pop the error token.  */
+-          YYPOPSTACK;
+-	  /* Pop the rest of the stack.  */
+-	  while (yyss < yyssp)
+-	    {
+-	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+-	      yydestruct (yystos[*yyssp], yyvsp, yylsp);
+-	      YYPOPSTACK;
+-	    }
+-	  YYABORT;
++	  /* Return failure if at end of input.  */
++	  if (yychar == YYEOF)
++	    YYABORT;
+         }
+-
+-      YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+-      yydestruct (yytoken, &yylval, &yylloc);
+-      yychar = YYEMPTY;
+-      *++yylerrsp = yylloc;
++      else
++	{
++	  yydestruct ("Error: discarding", yytoken, &yylval, &yylloc);
++	  yychar = YYEMPTY;
++	}
+     }
+ 
+-  /* Else will try to reuse lookahead token after shifting the error
++  /* Else will try to reuse look-ahead token after shifting the error
+      token.  */
+-  goto yyerrlab2;
++  goto yyerrlab1;
+ 
+ 
+-/*----------------------------------------------------.
+-| yyerrlab1 -- error raised explicitly by an action.  |
+-`----------------------------------------------------*/
+-yyerrlab1:
++/*---------------------------------------------------.
++| yyerrorlab -- error raised explicitly by YYERROR.  |
++`---------------------------------------------------*/
++yyerrorlab:
+ 
+-  /* Suppress GCC warning that yyerrlab1 is unused when no action
+-     invokes YYERROR.  */
+-#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \
+-    && !defined __cplusplus
+-  __attribute__ ((__unused__))
+-#endif
++  /* Pacify compilers like GCC when the user code never invokes
++     YYERROR and the label yyerrorlab therefore never appears in user
++     code.  */
++  if (0)
++     goto yyerrorlab;
+ 
+-  yylerrsp = yylsp;
+-  *++yylerrsp = yyloc;
+-  goto yyerrlab2;
++  yyerror_range[0] = yylsp[1-yylen];
++  yylsp -= yylen;
++  yyvsp -= yylen;
++  yyssp -= yylen;
++  yystate = *yyssp;
++  goto yyerrlab1;
+ 
+ 
+-/*---------------------------------------------------------------.
+-| yyerrlab2 -- pop states until the error token can be shifted.  |
+-`---------------------------------------------------------------*/
+-yyerrlab2:
++/*-------------------------------------------------------------.
++| yyerrlab1 -- common code for both syntax error and YYERROR.  |
++`-------------------------------------------------------------*/
++yyerrlab1:
+   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+ 
+   for (;;)
+@@ -2803,23 +2990,27 @@
+       if (yyssp == yyss)
+ 	YYABORT;
+ 
+-      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+-      yydestruct (yystos[yystate], yyvsp, yylsp);
+-      yyvsp--;
+-      yystate = *--yyssp;
+-      yylsp--;
++      yyerror_range[0] = *yylsp;
++      yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp);
++      YYPOPSTACK;
++      yystate = *yyssp;
+       YY_STACK_PRINT (yyss, yyssp);
+     }
+ 
+   if (yyn == YYFINAL)
+     YYACCEPT;
+ 
+-  YYDPRINTF ((stderr, "Shifting error token, "));
++  *++yyvsp = yylval;
+ 
+-  *++yyvsp = yylval;
+-  YYLLOC_DEFAULT (yyloc, yylsp, (yylerrsp - yylsp));
++  yyerror_range[1] = yylloc;
++  /* Using YYLLOC is tempting, but would change the location of
++     the look-ahead.  YYLOC is available though. */
++  YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
+   *++yylsp = yyloc;
+ 
++  /* Shift the error token. */
++  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
++
+   yystate = yyn;
+   goto yynewstate;
+ 
+@@ -2839,16 +3030,25 @@
+   goto yyreturn;
+ 
+ #ifndef yyoverflow
+-/*----------------------------------------------.
+-| yyoverflowlab -- parser overflow comes here.  |
+-`----------------------------------------------*/
+-yyoverflowlab:
+-  yyerror ("parser stack overflow");
++/*-------------------------------------------------.
++| yyexhaustedlab -- memory exhaustion comes here.  |
++`-------------------------------------------------*/
++yyexhaustedlab:
++  yyerror (YY_("memory exhausted"));
+   yyresult = 2;
+   /* Fall through.  */
+ #endif
+ 
+ yyreturn:
++  if (yychar != YYEOF && yychar != YYEMPTY)
++     yydestruct ("Cleanup: discarding lookahead",
++		 yytoken, &yylval, &yylloc);
++  while (yyssp != yyss)
++    {
++      yydestruct ("Cleanup: popping",
++		  yystos[*yyssp], yyvsp, yylsp);
++      YYPOPSTACK;
++    }
+ #ifndef yyoverflow
+   if (yyss != yyssa)
+     YYSTACK_FREE (yyss);
+@@ -2857,7 +3057,7 @@
+ }
+ 
+ 
+-#line 659 "grammar.y"
++#line 660 "grammar.y"
+ 
+ 
+ int yyerror (const char * /* s */)  /* Called by yyparse on error */
+--- kjs/object.cpp	(revision 506549)
++++ kjs/object.cpp	(revision 515119)
+@@ -59,10 +59,13 @@
+ #ifndef NDEBUG
+     fprintf(stderr, "Exceeded maximum function call depth\n");
+ #endif
+-    --depth;
++    int saveDepth = depth - 1;
+     Object err = Error::create(exec, RangeError,
+                                "Exceeded maximum function call depth.");
++    depth = depth - 10; //Give some room for the debugger to operate,
++                        //so if it tries to examine things we don't get here again
+     exec->setException(err);
++    depth         = saveDepth;
+     return err;
+   }
+ #endif
+--- kjs/regexp_object.h	(revision 506549)
++++ kjs/regexp_object.h	(revision 515119)
+@@ -45,7 +45,7 @@
+     virtual bool implementsCall() const;
+     virtual Value call(ExecState *exec, Object &thisObj, const List &args);
+ 
+-    enum { Exec, Test, ToString };
++    enum { Exec, Test, ToString, Compile };
+   private:
+     int id;
+   };
+@@ -54,7 +54,7 @@
+   public:
+     RegExpImp(RegExpPrototypeImp *regexpProto);
+     ~RegExpImp();
+-    void setRegExp(RegExp *r) { reg = r; }
++    void setRegExp(RegExp *r);
+     RegExp* regExp() { return reg; }
+ 
+     virtual const ClassInfo *classInfo() const { return &info; }
+@@ -78,6 +78,13 @@
+     int ** registerRegexp( const RegExp* re, const UString& s );
+     void setSubPatterns(int num) { lastNrSubPatterns = num; }
+     Object arrayOfMatches(ExecState *exec, const UString &result) const;
++
++    /*
++     Attempts to create a new regular expression engine for the string p
++     and the flags stored in flagsInput. If this succeeds, it returns the 
++     engine. If not, it returns 0, and raises an exception in exec
++    */
++    static RegExp* makeEngine(ExecState *exec, const UString &p, const Value &flagsInput);
+   private:
+     UString lastString;
+     int *lastOvector;
+--- kjs/grammar.h	(revision 506549)
++++ kjs/grammar.h	(revision 515119)
+@@ -1,7 +1,7 @@
+-/* A Bison parser, made by GNU Bison 1.875.  */
++/* A Bison parser, made by GNU Bison 2.1.  */
+ 
+ /* Skeleton parser for Yacc-like parsing with Bison,
+-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
++   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+@@ -90,6 +90,7 @@
+      AUTOMINUSMINUS = 316
+    };
+ #endif
++/* Tokens.  */
+ #define NULLTOKEN 258
+ #define TRUETOKEN 259
+ #define FALSETOKEN 260
+@@ -183,8 +184,8 @@
+   CatchNode           *cnode;
+   FinallyNode         *fnode;
+ } YYSTYPE;
+-/* Line 1249 of yacc.c.  */
+-#line 187 "grammar.tab.h"
++/* Line 1447 of yacc.c.  */
++#line 189 "grammar.tab.h"
+ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
+ # define YYSTYPE_IS_DECLARED 1
+ # define YYSTYPE_IS_TRIVIAL 1
+--- kjs/grammar.y	(revision 506549)
++++ kjs/grammar.y	(revision 515119)
+@@ -184,6 +184,7 @@
+   | '(' Expr ')'                   { $$ = new GroupNode($2); }
+   | '{' '}'                        { $$ = new ObjectLiteralNode(); }
+   | '{' PropertyNameAndValueList '}'   { $$ = new ObjectLiteralNode($2); }
++  | '{' PropertyNameAndValueList ',' '}'   { $$ = new ObjectLiteralNode($2); }
+ ;
+ 
+ ArrayLiteral:
+--- kdoctools/customization/fr/user.entities	(revision 506549)
++++ kdoctools/customization/fr/user.entities	(revision 515119)
+@@ -139,6 +139,9 @@
+ <!ENTITY traducteurPatricePawlak    '<othercredit role="translator"><firstname>Patrice</firstname><surname>Pawlak</surname><affiliation><address><email>patrice.pawlak at free.fr</email></address></affiliation><contrib>Traduction française</contrib></othercredit>'>
+ <!ENTITY relecteurPatricePawlak   '<othercredit role="reviewer"><firstname>Patrice</firstname><surname>Pawlak</surname><affiliation><address><email>patrice.pawlak at free.fr</email></address></affiliation><contrib>Relecture de la documentation française</contrib></othercredit>'>
+ 
++<!ENTITY traducteurRomainPelisse        '<othercredit role="translator"><firstname>Romain</firstname><surname>Pelisse</surname><affiliation><address><email>belaran at gmail.com</email></address></affiliation><contrib>Traduction française</contrib></othercredit>'>
++<!ENTITY relecteurRomainPelisse        '<othercredit role="reviewer"><firstname>Romain</firstname><surname>Pelisse</surname><affiliation><address><email>belaran at gmail.com</email></address></affiliation><contrib>Relecture de la documentation française</contrib></othercredit>'>
++
+ <!ENTITY traducteurBrunoPinaud        '<othercredit role="translator"><firstname>Bruno</firstname><surname>Pinaud</surname><affiliation><address><email>bpinaud at ifrance.com</email></address></affiliation><contrib>Traduction française</contrib></othercredit>'>
+ <!ENTITY relecteurBrunoPinaud        '<othercredit role="reviewer"><firstname>Bruno</firstname><surname>Pinaud</surname><affiliation><address><email>bpinaud at ifrance.com</email></address></affiliation><contrib>Relecture de la documentation française</contrib></othercredit>'>
+ 
+@@ -221,6 +224,7 @@
+ <!ENTITY Pierre-EmmanuelMuller 'Pierre-Emmanuel Müller <email>pem at levillage.org</email>'>
+ <!ENTITY CedricPasteur 'Cédric Pasteur <email>cedric.pasteur at free.fr</email>'>
+ <!ENTITY PatricePawlak 'Patrice Pawlak <email>patrice.pawlak at free.fr</email>'>
++<!ENTITY RomainPelisse 'Romain Pelisse <email>belaran at gmail.com</email>'>
+ <!ENTITY BrunoPinaud       'Bruno Pinaud <email>bpinaud at ifrance.com</email>'>
+ <!ENTITY RomainQuidet      'Romain Quidet <email>rquidet at yahoo.com</email>'>
+ <!ENTITY LaurentRathle     'Laurent Rathle <email>lrathle at kde-france.org</email>'>
+--- kdoctools/customization/pl/user.entities	(revision 506549)
++++ kdoctools/customization/pl/user.entities	(revision 515119)
+@@ -62,6 +62,7 @@
+ <!ENTITY GUI-dopelniacz    'graficznego interfejsu użytkownika'>
+ <!ENTITY GUI-celownik    'graficznemu interfejsowi użytkownika'>
+ <!ENTITY GUI-biernik    'graficzny interfejs użytkownika'>
++<!ENTITY GUI-narzednik    'graficznym interfejsem użytkownika'>
+ <!ENTITY GUI-miejscownik    'graficznym interfejsie użytkownika'>
+ 
+ <!ENTITY juk-mianownik    '<application>Juk</application>'>
+@@ -71,6 +72,14 @@
+ <!ENTITY juk-narzednik    '<application>Jukiem</application>'>
+ <!ENTITY juk-miejscownik    '<application>Juku</application>'>
+ 
++<!ENTITY kaddressbook-mianownik    '<application>Książka adresowa</application>'>
++<!ENTITY kaddressbook-dopelniacz    '<application>Książki adresowej</application>'>
++<!ENTITY kaddressbook-celownik    '<application>Książce adresowej</application>'>
++<!ENTITY kaddressbook-biernik    '<application>Książkę adresową</application>'>
++<!ENTITY kaddressbook-narzednik    '<application>Książką adresową</application>'>
++<!ENTITY kaddressbook-miejscownik    '<application>Książce adresowej</application>'>
++
++
+ <!ENTITY kappfinder-mianownik    '<application>Kappfinder</application>'>
+ <!ENTITY kappfinder-dopelniacz    '<application>Kappfinder</application>'>
+ <!ENTITY kappfinder-celownik    '<application>Kappfinder</application>'>
+@@ -90,18 +99,21 @@
+ <!ENTITY kcontrolcenter-dopelniacz    '<application>Centrum sterowania &kde;</application>'>
+ <!ENTITY kcontrolcenter-celownik    '<application>Centrum sterowania &kde;</application>'>
+ <!ENTITY kcontrolcenter-biernik    '<application>Centrum sterowania &kde;</application>'>
++<!ENTITY kcontrolcenter-narzednik    '<application>Centrum sterowania &kde;</application>'>
+ <!ENTITY kcontrolcenter-miejscownik    '<application>Centrum sterowania &kde;</application>'>
+ 
+ <!ENTITY kdm-mianownik    '<application>KDM</application>'>
+ <!ENTITY kdm-dopelniacz    '<application>KDM</application>'>
+ <!ENTITY kdm-celownik    '<application>KDM</application>'>
+ <!ENTITY kdm-biernik    '<application>KDM</application>'>
++<!ENTITY kdm-narzednik    '<application>KDM</application>'>
+ <!ENTITY kdm-miejscownik    '<application>KDM</application>'>
+ 
+ <!ENTITY khelpcenter-mianownik    '<application>Centrum pomocy &kde;</application>'>
+ <!ENTITY khelpcenter-dopelniacz    '<application>Centrum pomocy &kde;</application>'>
+ <!ENTITY khelpcenter-celownik    '<application>Centrum pomocy &kde;</application>'>
+ <!ENTITY khelpcenter-biernik    '<application>Centrum pomocy &kde;</application>'>
++<!ENTITY khelpcenter-narzednik    '<application>Centrum pomocy &kde;</application>'>
+ <!ENTITY khelpcenter-miejscownik    '<application>Centrum pomocy &kde;</application>'>
+ 
+ <!ENTITY kicker-mianownik    '<application>Kicker</application>'>
+@@ -141,6 +153,7 @@
+ <!ENTITY kmenu-dopelniacz    '&kmenu-mianownik;'>
+ <!ENTITY kmenu-celownik    '&kmenu-mianownik;'>
+ <!ENTITY kmenu-biernik    '&kmenu-mianownik;'>
++<!ENTITY kmenu-narzednik    '&kmenu-mianownik;'>
+ <!ENTITY kmenu-miejscownik    '&kmenu-mianownik;'>
+ 
+ <!ENTITY knode-mianownik    '<application>Knode</application>'>
+--- kdoctools/customization/es/user.entities	(revision 506549)
++++ kdoctools/customization/es/user.entities	(revision 515119)
+@@ -40,5 +40,6 @@
+ <!ENTITY RMB    "<mousebutton>botón derecho</mousebutton>">
+ <!ENTITY Shift "<keycap>Mayúsculas</keycap>">
+ <!ENTITY Tab  "<keycap>Tab</keycap>">
++<!ENTITY the.framework "la estructura de Bluetooth para KDE">
+ <!ENTITY TODO "Pendiente">
+ <!ENTITY X-Windows      "Sistema de ventanas X">
+--- Makefile.am.in	(revision 506549)
++++ Makefile.am.in	(revision 515119)
+@@ -40,27 +40,27 @@
+ 
+ messages:
+ 	cd kabc/scripts && perl ./makeaddressee
+-	find . -type d | grep -v CVS | grep -v '\.svn' | sed -e 's,$$,/,' > dirs
++	find . -type d | grep -v '\.svn' | sed -e 's,$$,/,' > dirs
+ 	mfs=`find . -name Makefile.am | xargs egrep -l '^messages:'` ;\
+ 	for dir in $$mfs; do \
+-	  if test ! "$$dir" = "./Makefile.am"; then \
++	  if test "$$dir" != "./Makefile.am"; then \
+ 	    dir=`dirname $$dir` ;\
+ 	    egrep -v "^$$dir" dirs > dirs.new && mv dirs.new dirs ;\
+ 	  fi ;\
+ 	done
+-	egrep -v "/tests" dirs > dirs.new && mv dirs.new dirs ;\
++	fgrep -v "/tests" dirs > dirs.new && mv dirs.new dirs ;\
+ 	dirs=`cat dirs` ;\
+ 	find $$dirs -maxdepth 1 -name "*.cpp" -print > files ;\
+ 	find $$dirs -maxdepth 1 -name "*.cc" -print >> files ;\
+ 	find $$dirs -maxdepth 1 -name "*.h" -print >> files ;\
+ 	echo ./kdecore/kde-config.cpp.in >> files ;\
+-	$(EXTRACTRC) `find $$dirs -maxdepth 1 -name "*.rc" -o -name "*.ui"` > rc.cpp	;\
++	$(EXTRACTRC) `find $$dirs -maxdepth 1 \( -name "*.rc" -o -name "*.ui" \) ` ./dnssd/kcm_kdnssd.kcfg > rc.cpp; \
+ 	: > kde.pot ;\
+ 	$(XGETTEXT) -ktranslate -x qt-messages.pot rc.cpp `cat files` && cat messages.po qt-messages.pot > $(podir)/kdelibs.pot
+ 	$(XGETTEXT) common_texts.cpp -o kde.pot
+-	rm -f rc.cpp dirs
++	rm -f dirs
+ 
+-EXTRA_DIST = admin bsd-port debian kdelibs.spec.in kde.pot \
++EXTRA_DIST = admin kde.pot \
+ 	COMPILING COMPILING.html COPYING.BSD DEBUG \
+ 	KDE2PORTING.html NAMING common_texts.cpp kdelibs.lsm kdoc.rules \
+ 	qt-messages.pot configure.in.in configure.in.mid configure.in.bot
+--- kdeprint/lpr/lprhandler.cpp	(revision 506549)
++++ kdeprint/lpr/lprhandler.cpp	(revision 515119)
+@@ -147,6 +147,7 @@
+ 			lp.append( "%9100" );
+ 		else
+ 			lp.append( "%" ).append( QString::number( uri.port() ) );
++		entry->addField("lp", Field::String, lp);
+ 	}
+ 	else
+ 	{
+--- kdeui/kcolordialog.cpp	(revision 506549)
++++ kdeui/kcolordialog.cpp	(revision 515119)
+@@ -91,6 +91,7 @@
+ };
+ 
+ const int recentColorIndex = 0;
++const int customColorIndex = 1;
+ 
+ class KColorSpinBox : public QSpinBox
+ {
+@@ -869,12 +870,12 @@
+ void
+ KPaletteTable::addToCustomColors( const QColor &color)
+ {
+-  setPalette(i18n_customColors);
++  setPalette(i18n( "palette name", colorPaletteName[ customColorIndex ].m_displayName ));
+   mPalette->addColor( color );
+   mPalette->save();
+   delete mPalette;
+   mPalette = 0;
+-  setPalette(i18n_customColors);
++  setPalette(i18n( "palette name", colorPaletteName[ customColorIndex ].m_displayName ));
+ }
+ 
+ void
+--- kdeui/kdetrayproxy/kdetrayproxy.desktop	(revision 506549)
++++ kdeui/kdetrayproxy/kdetrayproxy.desktop	(revision 515119)
+@@ -21,7 +21,7 @@
+ Name[he]=מתווך מגש מערכת של KDE
+ Name[hi]=केडीई ट्रे प्रॉक्सी मॉड्यूल
+ Name[hu]=KDE paneltálca-proxy modul
+-Name[is]=KDE leppstjórneining spjaldsins
++Name[is]=KDE milliþjónseining spjaldsins
+ Name[it]=Modulo proxy per il vassoio di KDE
+ Name[ja]=KDE トレイプロキシモジュール
+ Name[km]=ម៉ូឌុល​ប្រូកស៊ី KDE Tray
+@@ -71,7 +71,7 @@
+ Comment[gl]=Proxy que permite que as aplicazón de KDE que usen a bandexa traballen sen KWin
+ Comment[hi]=प्रॉक्सी जो के-विन के बगैर कार्य करने के लिए केडीई सिस्ट्रे अनुप्रयोगों को सक्षम करता है
+ Comment[hu]=KDE-s paneltálca-alkalmazások futtatása a KWin-től eltérő ablakkezelőknél
+-Comment[is]=Leppstjórneining fyrir KDE spjaldið sem virkar án KWin
++Comment[is]=Milliþjónseining fyrir KDE spjaldið sem virkar án KWin
+ Comment[it]=Permette alle applicazioni per il vassoio di KDE di funzionare senza KWin
+ Comment[ja]=KWinなしでKDE systray アプリケーションを動作できるようにプロキシを有効にします。
+ Comment[km]=ប្រូកស៊ី​ដែល​អនុញ្ញាត​ឲ្យ​កម្មវិធី KDE systray ធ្វើការ​ដោយ​គ្មាន KWin
+--- kdeui/kselect.cpp	(revision 506549)
++++ kdeui/kselect.cpp	(revision 515119)
+@@ -20,6 +20,7 @@
+ #include <qimage.h>
+ #include <qpainter.h>
+ #include <qdrawutil.h>
++#include <qstyle.h>
+ #include <kimageeffect.h>
+ #include "kselect.h"
+ 
+@@ -52,8 +53,9 @@
+ 
+ void KXYSelector::setRange( int _minX, int _minY, int _maxX, int _maxY )
+ {
+-	px = 2;
+-	py = 2;
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	px = w;
++	py = w;
+ 	minX = _minX;
+ 	minY = _minY;
+ 	maxX = _maxX;
+@@ -72,6 +74,9 @@
+ 
+ void KXYSelector::setValues( int _xPos, int _yPos )
+ {
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	if (w < 5) w = 5;
++
+ 	xPos = _xPos;
+ 	yPos = _yPos;
+ 
+@@ -85,28 +90,41 @@
+ 	else if ( yPos < minY )
+ 		yPos = minY;
+ 
+-	int xp = 2 + (width() - 4) * xPos / (maxX - minX);
+-	int yp = height() - 2 - (height() - 4) * yPos / (maxY - minY);
++	int xp = w + (width() - 2 * w) * xPos / (maxX - minX);
++	int yp = height() - w - (height() - 2 * w) * yPos / (maxY - minY);
+ 
+ 	setPosition( xp, yp );
+ }
+ 
+ QRect KXYSelector::contentsRect() const
+ {
+-	return QRect( 2, 2, width()-4, height()-4 );
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	if (w < 5) {
++		w = 5;
++	}
++	QRect contents(rect());
++	contents.addCoords(w, w, -w, -w);
++	return contents;
+ }
+ 
+ void KXYSelector::paintEvent( QPaintEvent *ev )
+ {
+ 	QRect cursorRect( px - STORE_W, py - STORE_W, STORE_W2, STORE_W2);
+ 	QRect paintRect = ev->rect();
++	QRect borderRect = rect();
+ 
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	if (w < 5) {
++		w = 5 - w;
++	}
++	borderRect.addCoords(w, w, -w, -w);
++
+ 	QPainter painter;
+ 	painter.begin( this );
+ 
+-	QBrush brush;
+-	qDrawShadePanel( &painter, 0, 0, width(), height(), colorGroup(),
+-			true, 2, &brush );
++	style().drawPrimitive(QStyle::PE_Panel, &painter, 
++			      borderRect, colorGroup(), 
++			      QStyle::Style_Sunken);
+ 
+ 	drawContents( &painter );
+ 	if (paintRect.contains(cursorRect))
+@@ -125,19 +143,18 @@
+ 
+ void KXYSelector::mousePressEvent( QMouseEvent *e )
+ {
+-	int xVal, yVal;
+-	valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal );
+-	setValues( xVal, yVal );
+-
+-	emit valueChanged( xPos, yPos );
++	mouseMoveEvent(e);
+ }
+ 
+ void KXYSelector::mouseMoveEvent( QMouseEvent *e )
+ {
+ 	int xVal, yVal;
+-	valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal );
++
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	valuesFromPosition( e->pos().x() - w, e->pos().y() - w, xVal, yVal );
++	
+ 	setValues( xVal, yVal );
+-	
++
+ 	emit valueChanged( xPos, yPos );
+ }
+ 
+@@ -153,8 +170,10 @@
+ 
+ void KXYSelector::valuesFromPosition( int x, int y, int &xVal, int &yVal ) const
+ {
+-	xVal = ( (maxX-minX) * (x-2) ) / ( width()-4 );
+-	yVal = maxY - ( ( (maxY-minY) * (y-2) ) / ( height()-4 ) );
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	if (w < 5) w = 5;
++	xVal = ( (maxX-minX) * (x-w) ) / ( width()-2*w );
++	yVal = maxY - ( ( (maxY-minY) * (y-w) ) / ( height()-2*w ) );
+ 	
+ 	if ( xVal > maxX )
+ 		xVal = maxX;
+@@ -169,15 +188,17 @@
+ 
+ void KXYSelector::setPosition( int xp, int yp )
+ {
+-	if ( xp < 2 )
+-		xp = 2;
+-	else if ( xp > width() - 2 )
+-		xp = width() - 2;
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	if (w < 5) w = 5;
++	if ( xp < w )
++		xp = w;
++	else if ( xp > width() - w )
++		xp = width() - w;
+ 
+-	if ( yp < 2 )
+-		yp = 2;
+-	else if ( yp > height() - 2 )
+-		yp = height() - 2;
++	if ( yp < w )
++		yp = w;
++	else if ( yp > height() - w )
++		yp = height() - w;
+ 
+ 	QPainter painter;
+ 	painter.begin( this );
+@@ -235,30 +256,34 @@
+ 
+ QRect KSelector::contentsRect() const
+ {
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	int iw = (w < 5) ? 5 : w;
+ 	if ( orientation() == Vertical )
+-		return QRect( 2, 5, width()-9, height()-10 );
++		return QRect( w, iw, width() - w * 2 - 5, height() - 2 * iw );
+ 	else
+-		return QRect( 5, 2, width()-10, height()-9 );
++		return QRect( iw, w, width() - 2 * iw, height() - w * 2 - 5 );
+ }
+ 
+ void KSelector::paintEvent( QPaintEvent * )
+ {
+ 	QPainter painter;
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	int iw = (w < 5) ? 5 : w;
+ 
+ 	painter.begin( this );
+ 
+ 	drawContents( &painter );
+ 
+-	QBrush brush;
+-
+ 	if ( indent() )
+ 	{
++		QRect r = rect();
+ 		if ( orientation() == Vertical )
+-			qDrawShadePanel( &painter, 0, 3, width()-5, height()-6,
+-				colorGroup(), true, 2, &brush );
++			r.addCoords(0, iw - w, -iw, w - iw);
+ 		else
+-			qDrawShadePanel( &painter, 3, 0, width()-6, height()-5,
+-				colorGroup(), true, 2, &brush );
++			r.addCoords(iw - w, 0, w - iw, -iw);
++		style().drawPrimitive(QStyle::PE_Panel, &painter, 
++			r, colorGroup(), 
++			QStyle::Style_Sunken);
+ 	}
+ 
+ 	QPoint pos = calcArrowPos( value() );
+@@ -304,13 +329,15 @@
+ void KSelector::moveArrow( const QPoint &pos )
+ {
+ 	int val;
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	int iw = (w < 5) ? 5 : w;
+ 
+ 	if ( orientation() == Vertical )
+-		val = ( maxValue() - minValue() ) * (height()-pos.y()-3)
+-				/ (height()-10) + minValue();
++		val = ( maxValue() - minValue() ) * (height()-pos.y()-5+w)
++				/ (height()-iw*2) + minValue();
+ 	else
+-		val = ( maxValue() - minValue() ) * (width()-pos.x()-3)
+-				/ (width()-10) + minValue();
++		val = ( maxValue() - minValue() ) * (width()-pos.x()-5+w)
++				/ (width()-iw*2) + minValue();
+ 
+ 	setValue( val );
+ }
+@@ -319,15 +346,17 @@
+ {
+ 	QPoint p;
+ 
++	int w = style().pixelMetric(QStyle::PM_DefaultFrameWidth);
++	int iw = (w < 5) ? 5 : w;
+ 	if ( orientation() == Vertical )
+ 	{
+-		p.setY( height() - ( (height()-10) * val
++		p.setY( height() - ( (height()-2*iw) * val
+ 				/ ( maxValue() - minValue() ) + 5 ) );
+ 		p.setX( width() - 5 );
+ 	}
+ 	else
+ 	{
+-		p.setX( width() - ( (width()-10) * val
++		p.setX( width() - ( (width()-2*iw) * val
+ 				/ ( maxValue() - minValue() ) + 5 ) );
+ 		p.setY( height() - 5 );
+ 	}
+@@ -346,16 +375,14 @@
+ 
+     painter->setPen( QPen() );
+     painter->setBrush( QBrush( colorGroup().buttonText() ) );
++    array.setPoint( 0, pos.x()+0, pos.y()+0 );
++    array.setPoint( 1, pos.x()+5, pos.y()+5 );
+     if ( orientation() == Vertical )
+     {
+-      array.setPoint( 0, pos.x()+0, pos.y()+0 );
+-      array.setPoint( 1, pos.x()+5, pos.y()+5 );
+       array.setPoint( 2, pos.x()+5, pos.y()-5 );
+     }
+     else
+     {
+-      array.setPoint( 0, pos.x()+0, pos.y()+0 );
+-      array.setPoint( 1, pos.x()+5, pos.y()+5 );
+       array.setPoint( 2, pos.x()-5, pos.y()+5 );
+     }
+ 
+@@ -421,8 +448,8 @@
+ 		{
+ 			scale = 1.0 * y / image.height();
+ 			col.setRgb( color1.red() + int(redDiff*scale),
+-						color1.green() + int(greenDiff*scale),
+-						color1.blue() + int(blueDiff*scale) );
++				color1.green() + int(greenDiff*scale),
++				color1.blue() + int(blueDiff*scale) );
+ 
+ 			unsigned int *p = (uint *) image.scanLine( y );
+ 			for ( int x = 0; x < image.width(); x++ )
+@@ -437,8 +464,8 @@
+ 		{
+ 			scale = 1.0 * x / image.width();
+ 			col.setRgb( color1.red() + int(redDiff*scale),
+-						color1.green() + int(greenDiff*scale),
+-						color1.blue() + int(blueDiff*scale) );
++				color1.green() + int(greenDiff*scale),
++				color1.blue() + int(blueDiff*scale) );
+ 			*p++ = col.rgb();
+ 		}
+ 
+@@ -451,8 +478,8 @@
+ 
+ 	for ( int s = 0; s < 8; s++ )
+ 		ditherPalette[s].setRgb( color1.red() + redDiff * s / 8,
+-								color1.green() + greenDiff * s / 8,
+-								color1.blue() + blueDiff * s / 8 );
++			color1.green() + greenDiff * s / 8,
++			color1.blue() + blueDiff * s / 8 );
+ 
+ 	KImageEffect::dither( image, ditherPalette, 8 );
+ 
+--- kdeui/kmainwindow.cpp	(revision 506549)
++++ kdeui/kmainwindow.cpp	(revision 515119)
+@@ -1145,7 +1145,7 @@
+     KToolBar *tb = (KToolBar*)child( name, "KToolBar" );
+     if ( tb )
+         return tb;
+-    bool honor_mode = (name == "mainToolBar");
++    bool honor_mode = (!strcmp(name, "mainToolBar"));
+ 
+     if ( builderClient() )
+         return new KToolBar(this, name, honor_mode); // XMLGUI constructor
+--- kdeui/kcursor.cpp	(revision 506549)
++++ kdeui/kcursor.cpp	(revision 515119)
+@@ -294,6 +294,9 @@
+ 
+     QWidget* w = actualWidget();
+ 
++    if ( w->cursor().shape() != Qt::BlankCursor ) // someone messed with the cursor already
++	return;
++
+     if ( m_isOwnCursor )
+         w->setCursor( m_oldCursor );
+     else
+--- kdeui/keditcl1.cpp	(revision 506549)
++++ kdeui/keditcl1.cpp	(revision 515119)
+@@ -508,11 +508,21 @@
+     slotCursorPositionChanged();
+   }
+   else if ( KStdAccel::backwardWord().contains( key ) ) {
+-    moveCursor(MoveWordBackward, false );
++    CursorAction action = MoveWordBackward;
++    int para, index;
++    getCursorPosition( &para, & index );
++    if (text(para).isRightToLeft())
++       action = MoveWordForward;
++    moveCursor(action, false );
+     slotCursorPositionChanged();
+   }
+   else if ( KStdAccel::forwardWord().contains( key ) ) {
+-    moveCursor( MoveWordForward, false );
++    CursorAction action = MoveWordForward;
++    int para, index;
++    getCursorPosition( &para, & index );
++    if (text(para).isRightToLeft())
++      action = MoveWordBackward;
++    moveCursor( action, false );
+     slotCursorPositionChanged();
+   }
+   else if ( KStdAccel::next().contains( key ) ) {
+--- kdeui/tests/klistviewtest.cpp	(revision 506549)
++++ kdeui/tests/klistviewtest.cpp	(revision 515119)
+@@ -17,20 +17,20 @@
+ 	view->addColumn("Column 2");
+ 	view->addColumn("Column 3");
+ 
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 1");
+-	new QListViewItem( view, "Item 2", "Some more", "Hi Mom :)" );
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 1");
++	new KListViewItem( view, "Item 2", "Some more", "Hi Mom :)" );
+ 
+ 	view->restoreLayout( KGlobal::config(), "ListView" );
+ 
+-	new QListViewItem( view, "Item 3" );
++	new KListViewItem( view, "Item 3" );
+ 
+ 	dialog.exec();
+ 	view->saveLayout( KGlobal::config(), "ListView" );
+--- kdeui/kactionclasses.cpp	(revision 506549)
++++ kdeui/kactionclasses.cpp	(revision 515119)
+@@ -233,10 +233,6 @@
+ 
+ void KToggleAction::slotActivated()
+ {
+-  // don't toggle when already checked and part of exclusive group
+-  if ( isChecked() && !exclusiveGroup().isEmpty() )
+-    return;
+-
+   setChecked( !isChecked() );
+   KAction::slotActivated();
+   emit toggled( isChecked() );
+--- kdeui/klistview.cpp	(revision 506549)
++++ kdeui/klistview.cpp	(revision 515119)
+@@ -2323,17 +2323,18 @@
+ void KListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
+ {
+   QColorGroup _cg = cg;
+-  const QPixmap *pm = listView()->viewport()->backgroundPixmap();
++  QListView* lv = listView();
++  const QPixmap *pm = lv->viewport()->backgroundPixmap();
+ 
+   if (pm && !pm->isNull())
+   {
+     _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(column), *pm));
+     QPoint o = p->brushOrigin();
+-    p->setBrushOrigin( o.x()-listView()->contentsX(), o.y()-listView()->contentsY() );
++    p->setBrushOrigin( o.x()-lv->contentsX(), o.y()-lv->contentsY() );
+   }
+   else
+   {
+-    _cg.setColor((listView()->viewport()->backgroundMode() == Qt::FixedColor) ?
++    _cg.setColor((lv->viewport()->backgroundMode() == Qt::FixedColor) ?
+                  QColorGroup::Background : QColorGroup::Base,
+                  backgroundColor(column));
+   }




More information about the pkg-kde-commits mailing list