[packages/wkhtmltopdf] - updated to 0.12.5 - build against Qt4 modified by wkhtmltopdf project

bszx bszx at pld-linux.org
Wed Jul 4 11:22:01 CEST 2018


commit 0c8485594f929f5d39a8bf672e8c7e724cd7edc5
Author: Bartek Szady <bszx at bszx.eu>
Date:   Wed Jul 4 11:20:54 2018 +0200

    - updated to 0.12.5
    - build against Qt4 modified by wkhtmltopdf project

 qt.patch         | 7438 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 wkhtmltopdf.spec |  151 +-
 2 files changed, 7581 insertions(+), 8 deletions(-)
---
diff --git a/wkhtmltopdf.spec b/wkhtmltopdf.spec
index 6729ff9..21c2a93 100644
--- a/wkhtmltopdf.spec
+++ b/wkhtmltopdf.spec
@@ -1,17 +1,38 @@
 #
+#TODO
+# - check which simd instructions can be enabled (like in qt spec)
+#   patched qt does not compile with mmx, sse and sse2 enabled
+#
 # Conditional build:
-%bcond_with	qt5	# build against Qt5
+%bcond_without	patchedQt	# build against Qt4 modified by wkhtmltopdf project
+%bcond_with	qt5		# build against Qt5
 #
+
+%define		qt_ver	4.8.7
+
 Summary:	Programs capable of converting HTML documents into images or PDF documents
 Summary(pl.UTF-8):	Programy do konwersji dokumentów HTML do obrazów lub dokumentów PDF
 Name:		wkhtmltopdf
-Version:	0.12.2.4
+Version:	0.12.5
 Release:	1
 License:	LGPL v3+ (library), GPL v3+ (utilities)
 Group:		Applications/Graphics
 Source0:	https://github.com/wkhtmltopdf/wkhtmltopdf/archive/%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	c8555f1c66b61cb11c6c9ff37d0d2280
+# Source0-md5:	653b68fd0eccfa05d4016fe87f6abcc9
+Source1:	http://download.qt-project.org/official_releases/qt/4.8/%{qt_ver}/qt-everywhere-opensource-src-%{qt_ver}.tar.gz
+# Source1-md5:	d990ee66bf7ab0c785589776f35ba6ad
+#git clone https://github.com/wkhtmltopdf/qt.git; git diff origin/4.8..wk_4.8.7 > qt.patch
+Patch0:		qt.patch
 URL:		http://wkhtmltopdf.org/
+%if %{with patchedQt}
+BuildRequires:	fontconfig-devel
+BuildRequires:	freetype-devel >= 2.1.3
+BuildRequires:	libjpeg-devel
+BuildRequires:	libpng-devel >= 2:1.0.8
+BuildRequires:	libstdc++-devel
+BuildRequires:	xorg-lib-libXrender-devel
+BuildRequires:	zlib-devel
+%else
 %if %{with qt5}
 BuildRequires:	Qt5Core-devel >= 5
 BuildRequires:	Qt5Gui-devel >= 5
@@ -30,6 +51,7 @@ BuildRequires:	QtWebKit-devel >= 4
 BuildRequires:	QtXmlPatterns-devel >= 4
 BuildRequires:	qt4-qmake
 %endif
+%endif
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -62,10 +84,117 @@ Header files for wkhtmltox library.
 Pliki nagłówkowe biblioteki wkhtmltox.
 
 %prep
-%setup -q
+%setup -q %{?with_patchedQt: -a1}
+
+%if %{with patchedQt}
+cd qt-everywhere-opensource-src-%{qt_ver}
+%patch0 -p1
+# change QMAKE FLAGS to build
+%{__sed} -i -e '
+	s|QMAKE_CC.*=.*gcc|QMAKE_CC\t\t= %{__cc}|;
+	s|QMAKE_CXX.*=.*g++|QMAKE_CXX\t\t= %{__cxx}|;
+	s|QMAKE_LINK.*=.*g++|QMAKE_LINK\t\t= %{__cxx}|;
+	s|QMAKE_LINK_SHLIB.*=.*g++|QMAKE_LINK_SHLIB\t= %{__cxx}|;
+	s|QMAKE_CFLAGS_RELEASE.*|QMAKE_CFLAGS_RELEASE\t+= %{rpmcppflags} %{rpmcflags}|;
+	s|QMAKE_CXXFLAGS_RELEASE.*|QMAKE_CXXFLAGS_RELEASE\t+= %{rpmcppflags} %{rpmcxxflags}|;
+	s|QMAKE_CFLAGS_DEBUG.*|QMAKE_CFLAGS_DEBUG\t+= %{debugcflags}|;
+	s|QMAKE_CXXFLAGS_DEBUG.*|QMAKE_CXXFLAGS_DEBUG\t+= %{debugcflags}|;
+	' mkspecs/common/g++-base.conf
+%endif
 
 %build
+
+%if %{with patchedQt}
+export OPTFLAGS="%{rpmcflags}"
+mkdir -p build_qt
+cd build_qt
+qt_prefix=`pwd`
+
+../qt-everywhere-opensource-src-%{qt_ver}/configure \
+	-opensource \
+	-confirm-license \
+	-fast \
+	-release \
+	-static \
+	-graphicssystem raster \
+	-webkit \
+	-exceptions \
+	-xmlpatterns \
+	-system-zlib \
+	-system-libpng \
+	-system-libjpeg \
+	-no-libmng \
+	-no-libtiff \
+	-no-accessibility \
+	-no-stl \
+	-no-qt3support \
+	-no-phonon \
+	-no-phonon-backend \
+	-no-opengl \
+	-no-declarative \
+	-no-script \
+	-no-scripttools \
+	-no-sql-ibase \
+	-no-sql-mysql \
+	-no-sql-odbc \
+	-no-sql-psql \
+	-no-sql-sqlite \
+	-no-sql-sqlite2 \
+	-no-mmx \
+	-no-3dnow \
+	-no-sse \
+	-no-sse2 \
+	-no-sse3 \
+	-no-ssse3 \
+	-no-sse4.1 \
+	-no-sse4.2 \
+	-no-avx \
+	-no-multimedia \
+	-nomake demos \
+	-nomake docs \
+	-nomake examples \
+	-nomake tools \
+	-nomake tests \
+	-nomake translations \
+	-silent \
+	-xrender \
+	-largefile \
+	-iconv \
+	-openssl-linked \
+	-no-javascript-jit \
+	-no-rpath \
+	-no-dbus \
+	-no-nis \
+	-no-cups \
+	-no-pch \
+	-no-gtkstyle \
+	-no-nas-sound \
+	-no-sm \
+	-no-xshape \
+	-no-xinerama \
+	-no-xcursor \
+	-no-xfixes \
+	-no-xrandr \
+	-no-mitshm \
+	-no-xinput \
+	-no-xkb \
+	-no-glib \
+	-no-gstreamer \
+	-no-icu \
+	-no-openvg \
+	-no-xsync \
+	-no-audio-backend \
+	-no-neon \
+	-prefix "$qt_prefix"
+
+%{__make}
+
+cd ..
+
+$qt_prefix/bin/qmake \
+%else
 qmake-%{?with_qt5:qt5}%{!?with_qt5:qt4} \
+%endif
 	QMAKE_CXX="%{__cxx}" \
 	QMAKE_CXXFLAGS_RELEASE="%{rpmcxxflags}" \
 	QMAKE_LFLAGS_RELEASE="%{rpmldflags}"
@@ -74,11 +203,16 @@ qmake-%{?with_qt5:qt5}%{!?with_qt5:qt4} \
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_includedir}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir}}
+
+%{__make} install \
+        INSTALL_ROOT=$RPM_BUILD_ROOT%{_prefix}
+
+if [ ! -d "$RPM_BUILD_ROOT%{_libdir}" ]; then
+  mv $RPM_BUILD_ROOT{%{_prefix}/lib,%{_libdir}}
+fi
 
-install -p bin/wkhtmlto* $RPM_BUILD_ROOT%{_bindir}
-cp -dp bin/libwkhtmltox.so{,.?,.*.*.*} $RPM_BUILD_ROOT%{_libdir}
-cp -pr include/wkhtmltox $RPM_BUILD_ROOT%{_includedir}
+rm -f $RPM_BUILD_ROOT%{_libdir}/libwkhtmltox.so.0.12
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -93,6 +227,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/wkhtmltopdf
 %attr(755,root,root) %{_libdir}/libwkhtmltox.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libwkhtmltox.so.0
+%{_mandir}/man1/wkhtmlto*.1*
 
 %files devel
 %defattr(644,root,root,755)
diff --git a/qt.patch b/qt.patch
new file mode 100644
index 0000000..e9d3953
--- /dev/null
+++ b/qt.patch
@@ -0,0 +1,7438 @@
+diff --git a/configure b/configure
+index 10ad7ca0b0b..454c6c57fea 100755
+--- a/configure
++++ b/configure
+@@ -64,6 +64,7 @@ fi
+ OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"`
+ 
+ # initialize global variables
++CONFIG_SEPARATORS=`printf ' \t'`
+ QMAKE_SWITCHES=
+ QMAKE_VARS=
+ QMAKE_CONFIG=
+@@ -201,6 +202,21 @@ getXQMakeConf()
+     getQMakeConf3 "$1" "$xspecvals"
+ }
+ 
++testXConfig()
++{
++    # Put a space on each end of the CONFIG value so that searching for the
++    # target with whitespace on either side will work even when it's the
++    # first/last/only item in the CONFIG value.
++    case \ `getXQMakeConf CONFIG`\  in
++    *[${CONFIG_SEPARATORS}]$1[${CONFIG_SEPARATORS}]*)
++        return 0
++        ;;
++    *)
++        return 1
++        ;;
++    esac
++}
++
+ compilerSupportsFlag()
+ {
+     cat >conftest.cpp <<EOF
+@@ -5357,7 +5373,7 @@ if [ "$XPLATFORM_INTEGRITY" = "yes" ]; then
+ fi
+ 
+ # check IPC support
+-if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
++if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" -a "$XPLATFORM_MINGW" = "no" ]; then
+     # Raptor does not support configure tests.
+     if ! compileTest unix/ipc_sysv "ipc_sysv" ; then
+         # SYSV IPC is not supported - check POSIX IPC
+@@ -5815,7 +5831,7 @@ fi
+ 
+ # auto-detect iconv(3) support
+ if [ "$CFG_ICONV" != "no" ]; then
+-    if [ "$PLATFORM_QWS" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then
++    if [ "$PLATFORM_QWS" = "yes" -o "$XPLATFORM_MINGW" = "yes" ] || [ "$PLATFORM_QPA" = "yes" -a "$CFG_ICONV" = "auto" ]; then
+         CFG_ICONV=no
+     elif compileTest "unix/iconv" "POSIX iconv"; then
+         CFG_ICONV=yes
+@@ -7407,7 +7423,11 @@ fi
+ [ "$CFG_REDUCE_EXPORTS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_exports"
+ [ "$CFG_STACK_PROTECTOR_STRONG" = "yes" ] && QT_CONFIG="$QT_CONFIG stack-protector-strong"
+ [ "$CFG_REDUCE_RELOCATIONS" = "yes" ] && QT_CONFIG="$QT_CONFIG reduce_relocations"
+-[ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
++if testXConfig precompile_header; then
++    [ "$CFG_PRECOMPILE" = "no" ] && QMakeVar del CONFIG precompile_header
++else
++    [ "$CFG_PRECOMPILE" = "yes" ] && QMAKE_CONFIG="$QMAKE_CONFIG precompile_header"
++fi
+ if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
+     QMakeVar add QMAKE_CFLAGS -g
+     QMakeVar add QMAKE_CXXFLAGS -g
+@@ -7734,7 +7754,7 @@ case "$XPLATFORM" in
+     *-g++*)
+ 	# Check gcc's version
+ 	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
+-	    5*|4*|3.4*)
++	    8*|7*|6*|5*|4*|3.4*)
+ 		;;
+             3.3*)
+                 canBuildWebKit="no"
+@@ -7820,12 +7840,12 @@ if [ "$CFG_GUI" = "no" ]; then
+     canBuildWebKit="no"
+ fi
+ 
+-if [ "$CFG_SHARED" = "no" ]; then
+-    echo
+-    echo "WARNING: Using static linking will disable the WebKit module."
+-    echo
+-    canBuildWebKit="no"
+-fi
++#if [ "$CFG_SHARED" = "no" ]; then
++   # echo
++   # echo "WARNING: Using static linking will disable the WebKit module."
++   # echo
++   # canBuildWebKit="no"
++#fi
+ 
+ CFG_CONCURRENT="yes"
+ if [ "$canBuildQtConcurrent" = "no" ]; then
+@@ -8050,7 +8070,7 @@ g++*)
+     3.*)
+         COMPILER_VERSION="3.*"
+         ;;
+-    5*|4.*)
++    8*|7*|6*|5*|4.*)
+         COMPILER_VERSION="4"
+         ;;
+     *)
+diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
+index 3f93220cc45..7085dfa2c5a 100644
+--- a/mkspecs/features/default_post.prf
++++ b/mkspecs/features/default_post.prf
+@@ -25,7 +25,7 @@ breakpad {
+     win32 {
+         TARGET_BASEPATH ~= s,/,\\,
+         contains(TEMPLATE, .*lib) {
+-            isEmpty(TARGET_VERSION_EXT):!isEmpty(VERSION) {
++            !skip_target_version_ext:isEmpty(TARGET_VERSION_EXT):!isEmpty(VERSION) {
+                 TARGET_VERSION_EXT = $$section(VERSION, ., 0, 0)
+                 isEqual(TARGET_VERSION_EXT, 0):unset(TARGET_VERSION_EXT)
+             }
+diff --git a/mkspecs/win32-msvc2008/qmake.conf b/mkspecs/win32-msvc2008/qmake.conf
+index 5c31cdad79a..b8631a8e7b1 100644
+--- a/mkspecs/win32-msvc2008/qmake.conf
++++ b/mkspecs/win32-msvc2008/qmake.conf
+@@ -58,7 +58,7 @@ QMAKE_LINK              = link
+ QMAKE_LFLAGS            = /NOLOGO /DYNAMICBASE /NXCOMPAT
+ QMAKE_LFLAGS_RELEASE    = /INCREMENTAL:NO
+ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
+-QMAKE_LFLAGS_DEBUG      = /DEBUG
++QMAKE_LFLAGS_DEBUG      = /DEBUG /INCREMENTAL:NO
+ QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE
+ QMAKE_LFLAGS_WINDOWS    = /SUBSYSTEM:WINDOWS
+ QMAKE_LFLAGS_EXE        = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
+diff --git a/mkspecs/win32-msvc2010/qmake.conf b/mkspecs/win32-msvc2010/qmake.conf
+index 9e5711cc4e7..356d8b1859a 100644
+--- a/mkspecs/win32-msvc2010/qmake.conf
++++ b/mkspecs/win32-msvc2010/qmake.conf
+@@ -58,7 +58,7 @@ QMAKE_LINK              = link
+ QMAKE_LFLAGS            = /NOLOGO /DYNAMICBASE /NXCOMPAT
+ QMAKE_LFLAGS_RELEASE    = /INCREMENTAL:NO
+ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
+-QMAKE_LFLAGS_DEBUG      = /DEBUG
++QMAKE_LFLAGS_DEBUG      = /DEBUG /INCREMENTAL:NO
+ QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE
+ QMAKE_LFLAGS_WINDOWS    = /SUBSYSTEM:WINDOWS
+ QMAKE_LFLAGS_EXE        = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
+diff --git a/mkspecs/win32-msvc2012/qmake.conf b/mkspecs/win32-msvc2012/qmake.conf
+index 875978b8b3b..963dcb21efa 100644
+--- a/mkspecs/win32-msvc2012/qmake.conf
++++ b/mkspecs/win32-msvc2012/qmake.conf
+@@ -58,7 +58,7 @@ QMAKE_LINK              = link
+ QMAKE_LFLAGS            = /NOLOGO /DYNAMICBASE /NXCOMPAT
+ QMAKE_LFLAGS_RELEASE    = /INCREMENTAL:NO
+ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
+-QMAKE_LFLAGS_DEBUG      = /DEBUG
++QMAKE_LFLAGS_DEBUG      = /DEBUG /INCREMENTAL:NO
+ QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE
+ QMAKE_LFLAGS_WINDOWS    = /SUBSYSTEM:WINDOWS
+ QMAKE_LFLAGS_EXE        = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
+diff --git a/mkspecs/win32-msvc2013/qmake.conf b/mkspecs/win32-msvc2013/qmake.conf
+index 3ebb1da97a4..48f1867f423 100644
+--- a/mkspecs/win32-msvc2013/qmake.conf
++++ b/mkspecs/win32-msvc2013/qmake.conf
+@@ -16,7 +16,7 @@ QMAKE_LEX               = flex
+ QMAKE_LEXFLAGS          =
+ QMAKE_YACC              = byacc
+ QMAKE_YACCFLAGS         = -d
+-QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t- -FS
++QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t- -FS -wd"4099"
+ QMAKE_CFLAGS_WARN_ON    = -W3
+ QMAKE_CFLAGS_WARN_OFF   = -W0
+ QMAKE_CFLAGS_RELEASE    = -O2 -MD
+@@ -28,7 +28,7 @@ QMAKE_CFLAGS_MP         = -MP
+ 
+ QMAKE_CXX               = $$QMAKE_CC
+ QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS
+-QMAKE_CXXFLAGS_WARN_ON  = $$QMAKE_CFLAGS_WARN_ON -w34100 -w34189
++QMAKE_CXXFLAGS_WARN_ON  = $$QMAKE_CFLAGS_WARN_ON
+ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
+ QMAKE_CXXFLAGS_RELEASE  = $$QMAKE_CFLAGS_RELEASE
+ QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+@@ -58,7 +58,7 @@ QMAKE_LINK              = link
+ QMAKE_LFLAGS            = /NOLOGO /DYNAMICBASE /NXCOMPAT
+ QMAKE_LFLAGS_RELEASE    = /INCREMENTAL:NO
+ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
+-QMAKE_LFLAGS_DEBUG      = /DEBUG
++QMAKE_LFLAGS_DEBUG      = /DEBUG /INCREMENTAL:NO
+ QMAKE_LFLAGS_CONSOLE    = /SUBSYSTEM:CONSOLE
+ QMAKE_LFLAGS_WINDOWS    = /SUBSYSTEM:WINDOWS
+ QMAKE_LFLAGS_EXE        = \"/MANIFESTDEPENDENCY:type=\'win32\' name=\'Microsoft.Windows.Common-Controls\' version=\'6.0.0.0\' publicKeyToken=\'6595b64144ccf1df\' language=\'*\' processorArchitecture=\'*\'\"
+diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
+index b26874f5335..83e0f573b20 100644
+--- a/qmake/generators/win32/winmakefile.cpp
++++ b/qmake/generators/win32/winmakefile.cpp
+@@ -313,7 +313,8 @@ void Win32MakefileGenerator::processVars()
+     }
+ 
+     // TARGET_VERSION_EXT will be used to add a version number onto the target name
+-    if (project->values("TARGET_VERSION_EXT").isEmpty()
++    if (!project->isActiveConfig("skip_target_version_ext")
++        && project->values("TARGET_VERSION_EXT").isEmpty()
+         && !project->values("VER_MAJ").isEmpty()
+         && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty())
+         project->values("TARGET_VERSION_EXT").append(project->values("VER_MAJ").first());
+diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArgList.h b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArgList.h
+index 8e1fdbe4b89..4944cc47e6b 100644
+--- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArgList.h
++++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ArgList.h
+@@ -170,9 +170,6 @@ namespace JSC {
+ 
+         void* operator new[](size_t);
+         void operator delete[](void*);
+-
+-        void* operator new(size_t, void*);
+-        void operator delete(void*, size_t);
+     };
+ 
+     class ArgList {
+diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pri
+index d8290cfe4e7..bbec4c29460 100644
+--- a/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pri
++++ b/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pri
+@@ -53,7 +53,7 @@ symbian {
+     INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE
+ }
+ 
+-win32-*: DEFINES += _HAS_TR1=0
++win32-msvc200*: DEFINES += _HAS_TR1=0
+ 
+ DEFINES += BUILDING_JavaScriptCore BUILDING_WTF
+ 
+diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pro b/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pro
+index a1091795777..0e41715d369 100644
+--- a/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pro
++++ b/src/3rdparty/webkit/Source/JavaScriptCore/JavaScriptCore.pro
+@@ -22,7 +22,7 @@ contains(QT_CONFIG, embedded):CONFIG += embedded
+ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+ unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
+ 
+-CONFIG(QTDIR_build) {
++!contains(QT_CONFIG, webkit-debug):CONFIG(QTDIR_build) {
+     # Remove the following 2 lines if you want debug information in JavaScriptCore
+     CONFIG -= separate_debug_info
+     CONFIG += no_debug_info
+@@ -217,6 +217,12 @@ symbian: {
+     QMAKE_CXXFLAGS.ARMCC += -OTime -O3
+ }
+ 
++static {
++  !isEmpty(INSTALL_LIBS): target.path = $$INSTALL_LIBS
++  else: target.path = $$[QT_INSTALL_LIBS]
++  INSTALLS += target
++}
++
+ lessThan(QT_GCC_MAJOR_VERSION, 5) {
+     # GCC 4.5 and before
+     lessThan(QT_GCC_MINOR_VERSION, 6) {
+@@ -235,3 +241,6 @@ lessThan(QT_GCC_MAJOR_VERSION, 5) {
+         }
+     }
+ }
++
++# explictly select C++98 for gcc >= 6 as default mode is C++14 from gcc 6.1
++*-g++*:greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS += -std=gnu++98
+diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/runtime/ArgList.h b/src/3rdparty/webkit/Source/JavaScriptCore/runtime/ArgList.h
+index bb2d2842127..b1763ae1540 100644
+--- a/src/3rdparty/webkit/Source/JavaScriptCore/runtime/ArgList.h
++++ b/src/3rdparty/webkit/Source/JavaScriptCore/runtime/ArgList.h
+@@ -172,9 +172,6 @@ namespace JSC {
+ 
+         void* operator new[](size_t);
+         void operator delete[](void*);
+-
+-        void* operator new(size_t, void*);
+-        void operator delete(void*, size_t);
+     };
+ 
+     class ArgList {
+diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/StringExtras.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/StringExtras.h
+index 371e33bf98a..e039ada60ee 100644
+--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/StringExtras.h
++++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/StringExtras.h
+@@ -37,6 +37,7 @@
+ #if COMPILER(MSVC)
+ // FIXME: why a COMPILER check instead of OS? also, these should be HAVE checks
+ 
++#if _MSC_VER < 1900
+ inline int snprintf(char* buffer, size_t count, const char* format, ...) 
+ {
+     int result;
+@@ -52,6 +53,7 @@ inline int snprintf(char* buffer, size_t count, const char* format, ...)
+ 
+     return result;
+ }
++#  endif // _MSC_VER < 1900
+ 
+ inline double wtf_vsnprintf(char* buffer, size_t count, const char* format, va_list args)
+ {
+diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h
+index 44103cdd34a..3705ba6b4ad 100644
+--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h
++++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h
+@@ -179,7 +179,12 @@ namespace WTF {
+         typedef T Type;
+     };
+ 
+-#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
++#if (defined(_MSC_VER) && (_MSC_VER >= 1900))
++
++    template<typename T> struct HasTrivialConstructor : public std::is_trivially_default_constructible<T> { };
++    template<typename T> struct HasTrivialDestructor : public std::is_trivially_destructible<T> { };
++
++#elif (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
+ 
+     // GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace.
+     // VC10 (VS2010) and later support C++ TR1 type_traits in the std::tr1 namespace.
+diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pri b/src/3rdparty/webkit/Source/WebCore/WebCore.pri
+index 6ea37fde142..3411f665900 100644
+--- a/src/3rdparty/webkit/Source/WebCore/WebCore.pri
++++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pri
+@@ -170,6 +170,10 @@ contains(DEFINES, ENABLE_XSLT=1) {
+     QT *= xmlpatterns
+ }
+ 
++contains(DEFINES, ENABLE_ZLIB=1) {
++    include($$QT_SOURCE_TREE/src/3rdparty/zlib_dependency.pri)
++}
++
+ contains(DEFINES, ENABLE_SQLITE=1) {
+     !system-sqlite:exists( $${SQLITE3SRCDIR}/sqlite3.c ) {
+             INCLUDEPATH += $${SQLITE3SRCDIR}
+@@ -264,7 +268,7 @@ contains(DEFINES, ENABLE_WEBGL=1)|contains(CONFIG, texmap) {
+     QT *= opengl
+ }
+ 
+-!CONFIG(webkit-debug):CONFIG(QTDIR_build) {
++!contains(QT_CONFIG, webkit-debug):CONFIG(QTDIR_build) {
+     # Remove the following 2 lines if you want debug information in WebCore
+     CONFIG -= separate_debug_info
+     CONFIG += no_debug_info
+diff --git a/src/3rdparty/webkit/Source/WebCore/WebCore.pro b/src/3rdparty/webkit/Source/WebCore/WebCore.pro
+index a0d7d5d3004..e424a325b67 100644
+--- a/src/3rdparty/webkit/Source/WebCore/WebCore.pro
++++ b/src/3rdparty/webkit/Source/WebCore/WebCore.pro
+@@ -16,7 +16,6 @@ CONFIG += staticlib
+ DESTDIR = $$WEBCORE_DESTDIR
+ 
+ DEFINES += BUILDING_WEBKIT
+-DEFINES += QT_MAKEDLL
+ 
+ contains(DEFINES, WTF_USE_QT_MOBILE_THEME=1) {
+     DEFINES += ENABLE_NO_LISTBOX_RENDERING=1
+@@ -34,30 +33,36 @@ contains(DEFINES, ENABLE_WCSS=1) {
+     EXTRACSSVALUES += $$PWD/css/WCSSValueKeywords.in
+ }
+ 
++CONFIG(debug, debug|release) {
++    SOURCES += accessibility/AccessibilityAllInOne.cpp
++} else {
++    SOURCES += \
++        accessibility/AccessibilityImageMapLink.cpp \
++        accessibility/AccessibilityMediaControls.cpp \
++        accessibility/AccessibilityMenuList.cpp \
++        accessibility/AccessibilityMenuListOption.cpp \
++        accessibility/AccessibilityMenuListPopup.cpp \
++        accessibility/AccessibilityObject.cpp \
++        accessibility/AccessibilityList.cpp \
++        accessibility/AccessibilityListBox.cpp \
++        accessibility/AccessibilityListBoxOption.cpp \
++        accessibility/AccessibilityProgressIndicator.cpp \
++        accessibility/AccessibilityRenderObject.cpp \
++        accessibility/AccessibilityScrollbar.cpp \
++        accessibility/AccessibilityScrollView.cpp \
++        accessibility/AccessibilitySlider.cpp \
++        accessibility/AccessibilityARIAGrid.cpp \
++        accessibility/AccessibilityARIAGridCell.cpp \
++        accessibility/AccessibilityARIAGridRow.cpp \
++        accessibility/AccessibilityTable.cpp \
++        accessibility/AccessibilityTableCell.cpp \
++        accessibility/AccessibilityTableColumn.cpp \
++        accessibility/AccessibilityTableHeaderContainer.cpp \
++        accessibility/AccessibilityTableRow.cpp \
++        accessibility/AXObjectCache.cpp
++}
++
+ SOURCES += \
+-    accessibility/AccessibilityImageMapLink.cpp \
+-    accessibility/AccessibilityMediaControls.cpp \    
+-    accessibility/AccessibilityMenuList.cpp \
+-    accessibility/AccessibilityMenuListOption.cpp \
+-    accessibility/AccessibilityMenuListPopup.cpp \
+-    accessibility/AccessibilityObject.cpp \    
+-    accessibility/AccessibilityList.cpp \    
+-    accessibility/AccessibilityListBox.cpp \    
+-    accessibility/AccessibilityListBoxOption.cpp \    
+-    accessibility/AccessibilityProgressIndicator.cpp \    
+-    accessibility/AccessibilityRenderObject.cpp \    
+-    accessibility/AccessibilityScrollbar.cpp \
+-    accessibility/AccessibilityScrollView.cpp \
+-    accessibility/AccessibilitySlider.cpp \    
+-    accessibility/AccessibilityARIAGrid.cpp \    
+-    accessibility/AccessibilityARIAGridCell.cpp \    
+-    accessibility/AccessibilityARIAGridRow.cpp \    
+-    accessibility/AccessibilityTable.cpp \    
+-    accessibility/AccessibilityTableCell.cpp \    
+-    accessibility/AccessibilityTableColumn.cpp \    
+-    accessibility/AccessibilityTableHeaderContainer.cpp \    
+-    accessibility/AccessibilityTableRow.cpp \    
+-    accessibility/AXObjectCache.cpp \
+     bindings/generic/ActiveDOMCallback.cpp \
+     bindings/generic/RuntimeEnabledFeatures.cpp
+ 
+@@ -227,138 +232,144 @@ v8 {
+         bindings/v8/V8WorkerContextErrorHandler.cpp \
+         testing/v8/WebCoreTestSupport.cpp
+ } else {
++    CONFIG(debug, debug|release) {
++        SOURCES += bindings/js/JSBindingsAllInOne.cpp
++    } else {
++        SOURCES += \
++            bindings/js/CallbackFunction.cpp \
++            bindings/js/DOMObjectHashTableMap.cpp \
++            bindings/js/DOMWrapperWorld.cpp \
++            bindings/js/GCController.cpp \
++            bindings/js/JSArrayBufferCustom.cpp \
++            bindings/js/JSAttrCustom.cpp \
++            bindings/js/JSCDATASectionCustom.cpp \
++            bindings/js/JSCSSFontFaceRuleCustom.cpp \
++            bindings/js/JSCSSImportRuleCustom.cpp \
++            bindings/js/JSCSSMediaRuleCustom.cpp \
++            bindings/js/JSCSSPageRuleCustom.cpp \
++            bindings/js/JSCSSRuleCustom.cpp \
++            bindings/js/JSCSSRuleListCustom.cpp \
++            bindings/js/JSCSSStyleDeclarationCustom.cpp \
++            bindings/js/JSCSSStyleRuleCustom.cpp \
++            bindings/js/JSCSSValueCustom.cpp \
++            bindings/js/JSCallbackData.cpp \
++            bindings/js/JSCanvasRenderingContext2DCustom.cpp \
++            bindings/js/JSCanvasRenderingContextCustom.cpp \
++            bindings/js/JSClipboardCustom.cpp \
++            bindings/js/JSConsoleCustom.cpp \
++            bindings/js/JSCoordinatesCustom.cpp \
++            bindings/js/JSCustomPositionCallback.cpp \
++            bindings/js/JSCustomPositionErrorCallback.cpp \
++            bindings/js/JSCustomVoidCallback.cpp \
++            bindings/js/JSCustomXPathNSResolver.cpp \
++            bindings/js/JSDOMBinding.cpp \
++            bindings/js/JSDOMFormDataCustom.cpp \
++            bindings/js/JSDOMGlobalObject.cpp \
++            bindings/js/JSDOMImplementationCustom.cpp \
++            bindings/js/JSDOMMimeTypeArrayCustom.cpp \
++            bindings/js/JSDOMPluginArrayCustom.cpp \
++            bindings/js/JSDOMPluginCustom.cpp \
++            bindings/js/JSDOMStringMapCustom.cpp \
++            bindings/js/JSDOMTokenListCustom.cpp \
++            bindings/js/JSDOMWindowBase.cpp \
++            bindings/js/JSDOMWindowCustom.cpp \
++            bindings/js/JSDOMWindowShell.cpp \
++            bindings/js/JSDOMWrapper.cpp \
++            bindings/js/JSDataViewCustom.cpp \
++            bindings/js/JSDesktopNotificationsCustom.cpp \
++            bindings/js/JSDeviceOrientationEventCustom.cpp \
++            bindings/js/JSDocumentCustom.cpp \
++            bindings/js/JSElementCustom.cpp \
++            bindings/js/JSErrorHandler.cpp \
++            bindings/js/JSEventCustom.cpp \
++            bindings/js/JSEventListener.cpp \
++            bindings/js/JSEventSourceCustom.cpp \
++            bindings/js/JSEventTarget.cpp \
++            bindings/js/JSExceptionBase.cpp \
++            bindings/js/JSFloat32ArrayCustom.cpp \
++            bindings/js/JSGeolocationCustom.cpp \
++            bindings/js/JSHTMLAllCollectionCustom.cpp \
++            bindings/js/JSHTMLAppletElementCustom.cpp \
++            bindings/js/JSHTMLCanvasElementCustom.cpp \
++            bindings/js/JSHTMLCollectionCustom.cpp \
++            bindings/js/JSHTMLDocumentCustom.cpp \
++            bindings/js/JSHTMLElementCustom.cpp \
++            bindings/js/JSHTMLEmbedElementCustom.cpp \
++            bindings/js/JSHTMLFormElementCustom.cpp \
++            bindings/js/JSHTMLFrameElementCustom.cpp \
++            bindings/js/JSHTMLFrameSetElementCustom.cpp \
++            bindings/js/JSHTMLInputElementCustom.cpp \
++            bindings/js/JSHTMLLinkElementCustom.cpp \
++            bindings/js/JSHTMLObjectElementCustom.cpp \
++            bindings/js/JSHTMLOptionsCollectionCustom.cpp \
++            bindings/js/JSHTMLOutputElementCustom.cpp \
++            bindings/js/JSHTMLSelectElementCustom.cpp \
++            bindings/js/JSHTMLStyleElementCustom.cpp \
++            bindings/js/JSHistoryCustom.cpp \
++            bindings/js/JSImageConstructor.cpp \
++            bindings/js/JSImageDataCustom.cpp \
++            bindings/js/JSInjectedScriptHostCustom.cpp \
++            bindings/js/JSInjectedScriptManager.cpp \
++            bindings/js/JSInspectorFrontendHostCustom.cpp \
++            bindings/js/JSInt16ArrayCustom.cpp \
++            bindings/js/JSInt32ArrayCustom.cpp \
++            bindings/js/JSInt8ArrayCustom.cpp \
++            bindings/js/JSLazyEventListener.cpp \
++            bindings/js/JSLocationCustom.cpp \
++            bindings/js/JSMainThreadExecState.cpp \
++            bindings/js/JSMediaListCustom.cpp \
++            bindings/js/JSMemoryInfoCustom.cpp \
++            bindings/js/JSMessageChannelCustom.cpp \
++            bindings/js/JSMessageEventCustom.cpp \
++            bindings/js/JSMessagePortCustom.cpp \
++            bindings/js/JSNamedNodeMapCustom.cpp \
++            bindings/js/JSNavigatorCustom.cpp  \
++            bindings/js/JSNodeCustom.cpp \
++            bindings/js/JSNodeFilterCondition.cpp \
++            bindings/js/JSNodeFilterCustom.cpp \
++            bindings/js/JSNodeIteratorCustom.cpp \
++            bindings/js/JSNodeListCustom.cpp \
++            bindings/js/JSOptionConstructor.cpp \
++            bindings/js/JSPluginElementFunctions.cpp \
++            bindings/js/JSProcessingInstructionCustom.cpp \
++            bindings/js/JSScriptProfileNodeCustom.cpp \
++            bindings/js/JSStyleSheetCustom.cpp \
++            bindings/js/JSStyleSheetListCustom.cpp \
++            bindings/js/JSTextCustom.cpp \
++            bindings/js/JSTouchCustom.cpp \
++            bindings/js/JSTouchListCustom.cpp \
++            bindings/js/JSTreeWalkerCustom.cpp \
++            bindings/js/JSUint16ArrayCustom.cpp \
++            bindings/js/JSUint32ArrayCustom.cpp \
++            bindings/js/JSUint8ArrayCustom.cpp \
++            bindings/js/JSWebKitAnimationCustom.cpp \
++            bindings/js/JSWebKitAnimationListCustom.cpp \
++            bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp \
++            bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp \
++            bindings/js/JSWebKitCSSMatrixCustom.cpp \
++            bindings/js/JSWebKitPointCustom.cpp \
++            bindings/js/JSXMLHttpRequestCustom.cpp \
++            bindings/js/JSXMLHttpRequestUploadCustom.cpp \
++            bindings/js/ScheduledAction.cpp \
++            bindings/js/ScriptCachedFrameData.cpp \
++            bindings/js/ScriptCallStackFactory.cpp \
++            bindings/js/ScriptDebugServer.cpp \
++            bindings/js/ScriptEventListener.cpp \
++            bindings/js/ScriptFunctionCall.cpp \
++            bindings/js/ScriptGCEvent.cpp \
++            bindings/js/ScriptState.cpp \
++            bindings/js/SerializedScriptValue.cpp
++    }
+     SOURCES += \
+         bindings/ScriptControllerBase.cpp \
+-        bindings/js/CallbackFunction.cpp \
+-        bindings/js/DOMObjectHashTableMap.cpp \
+-        bindings/js/DOMWrapperWorld.cpp \
+-        bindings/js/GCController.cpp \
+-        bindings/js/JSArrayBufferCustom.cpp \
+-        bindings/js/JSAttrCustom.cpp \
+-        bindings/js/JSCDATASectionCustom.cpp \
+-        bindings/js/JSCSSFontFaceRuleCustom.cpp \
+-        bindings/js/JSCSSImportRuleCustom.cpp \
+-        bindings/js/JSCSSMediaRuleCustom.cpp \
+-        bindings/js/JSCSSPageRuleCustom.cpp \
+-        bindings/js/JSCSSRuleCustom.cpp \
+-        bindings/js/JSCSSRuleListCustom.cpp \
+-        bindings/js/JSCSSStyleDeclarationCustom.cpp \
+-        bindings/js/JSCSSStyleRuleCustom.cpp \
+-        bindings/js/JSCSSValueCustom.cpp \
+-        bindings/js/JSCallbackData.cpp \
+-        bindings/js/JSCanvasRenderingContext2DCustom.cpp \
+-        bindings/js/JSCanvasRenderingContextCustom.cpp \
+-        bindings/js/JSClipboardCustom.cpp \
+-        bindings/js/JSConsoleCustom.cpp \
+-        bindings/js/JSCoordinatesCustom.cpp \
+-        bindings/js/JSCustomPositionCallback.cpp \
+-        bindings/js/JSCustomPositionErrorCallback.cpp \
+-        bindings/js/JSCustomVoidCallback.cpp \
+-        bindings/js/JSCustomXPathNSResolver.cpp \
+-        bindings/js/JSDOMBinding.cpp \
+-        bindings/js/JSDOMFormDataCustom.cpp \
+-        bindings/js/JSDOMGlobalObject.cpp \
+-        bindings/js/JSDOMImplementationCustom.cpp \
+-        bindings/js/JSDOMMimeTypeArrayCustom.cpp \
+-        bindings/js/JSDOMPluginArrayCustom.cpp \
+-        bindings/js/JSDOMPluginCustom.cpp \
+-        bindings/js/JSDOMStringMapCustom.cpp \
+-        bindings/js/JSDOMTokenListCustom.cpp \
+-        bindings/js/JSDOMWindowBase.cpp \
+-        bindings/js/JSDOMWindowCustom.cpp \
+-        bindings/js/JSDOMWindowShell.cpp \
+-        bindings/js/JSDOMWrapper.cpp \
+-        bindings/js/JSDataViewCustom.cpp \
+-        bindings/js/JSDesktopNotificationsCustom.cpp \
+         bindings/js/JSDeviceMotionEventCustom.cpp \
+-        bindings/js/JSDeviceOrientationEventCustom.cpp \
+-        bindings/js/JSDocumentCustom.cpp \
+-        bindings/js/JSElementCustom.cpp \
+-        bindings/js/JSErrorHandler.cpp \
+-        bindings/js/JSEventCustom.cpp \
+-        bindings/js/JSEventListener.cpp \
+-        bindings/js/JSEventSourceCustom.cpp \
+-        bindings/js/JSEventTarget.cpp \
+-        bindings/js/JSExceptionBase.cpp \
+         bindings/js/JSFileReaderCustom.cpp \
+-        bindings/js/JSFloat32ArrayCustom.cpp \
+-        bindings/js/JSGeolocationCustom.cpp \
+-        bindings/js/JSHTMLAllCollectionCustom.cpp \
+-        bindings/js/JSHTMLAppletElementCustom.cpp \
+-        bindings/js/JSHTMLCanvasElementCustom.cpp \
+-        bindings/js/JSHTMLCollectionCustom.cpp \
+-        bindings/js/JSHTMLDocumentCustom.cpp \
+-        bindings/js/JSHTMLElementCustom.cpp \
+-        bindings/js/JSHTMLEmbedElementCustom.cpp \
+-        bindings/js/JSHTMLFormElementCustom.cpp \
+-        bindings/js/JSHTMLFrameElementCustom.cpp \
+-        bindings/js/JSHTMLFrameSetElementCustom.cpp \
+-        bindings/js/JSHTMLInputElementCustom.cpp \
+-        bindings/js/JSHTMLLinkElementCustom.cpp \
+-        bindings/js/JSHTMLObjectElementCustom.cpp \
+-        bindings/js/JSHTMLOptionsCollectionCustom.cpp \
+-        bindings/js/JSHTMLOutputElementCustom.cpp \
+-        bindings/js/JSHTMLSelectElementCustom.cpp \
+-        bindings/js/JSHTMLStyleElementCustom.cpp \
+-        bindings/js/JSHistoryCustom.cpp \
+-        bindings/js/JSImageConstructor.cpp \
+-        bindings/js/JSImageDataCustom.cpp \
+-        bindings/js/JSInjectedScriptHostCustom.cpp \
+-        bindings/js/JSInjectedScriptManager.cpp \
+-        bindings/js/JSInspectorFrontendHostCustom.cpp \
+-        bindings/js/JSInt16ArrayCustom.cpp \
+-        bindings/js/JSInt32ArrayCustom.cpp \
+-        bindings/js/JSInt8ArrayCustom.cpp \
+-        bindings/js/JSLazyEventListener.cpp \
+-        bindings/js/JSLocationCustom.cpp \
+-        bindings/js/JSMainThreadExecState.cpp \
+-        bindings/js/JSMediaListCustom.cpp \
+-        bindings/js/JSMemoryInfoCustom.cpp \
+-        bindings/js/JSMessageChannelCustom.cpp \
+-        bindings/js/JSMessageEventCustom.cpp \
+-        bindings/js/JSMessagePortCustom.cpp \
+         bindings/js/JSMessagePortCustom.h \
+-        bindings/js/JSNamedNodeMapCustom.cpp \
+-        bindings/js/JSNavigatorCustom.cpp  \
+-        bindings/js/JSNodeCustom.cpp \
+-        bindings/js/JSNodeFilterCondition.cpp \
+-        bindings/js/JSNodeFilterCustom.cpp \
+-        bindings/js/JSNodeIteratorCustom.cpp \
+-        bindings/js/JSNodeListCustom.cpp \
+-        bindings/js/JSOptionConstructor.cpp \
+-        bindings/js/JSPluginElementFunctions.cpp \
+-        bindings/js/JSProcessingInstructionCustom.cpp \
+-        bindings/js/JSScriptProfileNodeCustom.cpp \
+-        bindings/js/JSStyleSheetCustom.cpp \
+-        bindings/js/JSStyleSheetListCustom.cpp \
+-        bindings/js/JSTextCustom.cpp \
+-        bindings/js/JSTouchCustom.cpp \
+-        bindings/js/JSTouchListCustom.cpp \
+-        bindings/js/JSTreeWalkerCustom.cpp \
+-        bindings/js/JSUint16ArrayCustom.cpp \
+-        bindings/js/JSUint32ArrayCustom.cpp \
+-        bindings/js/JSUint8ArrayCustom.cpp \
+-        bindings/js/JSWebKitAnimationCustom.cpp \
+-        bindings/js/JSWebKitAnimationListCustom.cpp \
+-        bindings/js/JSWebKitCSSKeyframeRuleCustom.cpp \
+-        bindings/js/JSWebKitCSSKeyframesRuleCustom.cpp \
+-        bindings/js/JSWebKitCSSMatrixCustom.cpp \
+-        bindings/js/JSWebKitPointCustom.cpp \
+-        bindings/js/JSXMLHttpRequestCustom.cpp \
+-        bindings/js/JSXMLHttpRequestUploadCustom.cpp \
+         bindings/js/PageScriptDebugServer.cpp \
+-        bindings/js/ScheduledAction.cpp \
+-        bindings/js/ScriptCachedFrameData.cpp \
+-        bindings/js/ScriptCallStackFactory.cpp \
+         bindings/js/ScriptController.cpp \
+         bindings/js/ScriptControllerQt.cpp \
+-        bindings/js/ScriptDebugServer.cpp \
+-        bindings/js/ScriptEventListener.cpp \
+-        bindings/js/ScriptFunctionCall.cpp \
+-        bindings/js/ScriptGCEvent.cpp \
+         bindings/js/ScriptObject.cpp \
+         bindings/js/ScriptProfile.cpp \
+-        bindings/js/ScriptState.cpp \
+         bindings/js/ScriptValue.cpp \
+         bindings/js/SerializedScriptValue.cpp \
+         bridge/IdentifierRep.cpp \
+@@ -381,6 +392,347 @@ v8 {
+         testing/js/WebCoreTestSupport.cpp
+ }
+ 
++CONFIG(debug, debug|release) {
++    SOURCES += \
++        dom/DOMAllInOne.cpp \
++        editing/EditingAllInOne.cpp \
++        html/HTMLElementsAllInOne.cpp \
++        rendering/RenderingAllInOne.cpp \
++        rendering/style/StyleAllInOne.cpp
++} else {
++    SOURCES += \
++        dom/ActiveDOMObject.cpp \
++        dom/Attr.cpp \
++        dom/Attribute.cpp \
++        dom/BeforeProcessEvent.cpp \
++        dom/BeforeTextInsertedEvent.cpp \
++        dom/BeforeUnloadEvent.cpp \
++        dom/CDATASection.cpp \
++        dom/CharacterData.cpp \
++        dom/CheckedRadioButtons.cpp \
++        dom/ChildNodeList.cpp \
++        dom/ClassNodeList.cpp \
++        dom/ClientRect.cpp \
++        dom/ClientRectList.cpp \
++        dom/Clipboard.cpp \
++        dom/ClipboardEvent.cpp \
++        dom/Comment.cpp \
++        dom/CompositionEvent.cpp \
++        dom/ContainerNode.cpp \
++        dom/CSSMappedAttributeDeclaration.cpp \
++        dom/CustomEvent.cpp \
++        dom/DecodedDataDocumentParser.cpp \
++        dom/DeviceMotionController.cpp \
++        dom/DeviceMotionData.cpp \
++        dom/DeviceMotionEvent.cpp \
++        dom/DeviceOrientation.cpp \
++        dom/DeviceOrientationController.cpp \
++        dom/DeviceOrientationEvent.cpp \
++        dom/Document.cpp \
++        dom/DocumentFragment.cpp \
++        dom/DocumentMarkerController.cpp \
++        dom/DocumentOrderedMap.cpp \
++        dom/DocumentParser.cpp \
++        dom/DocumentType.cpp \
++        dom/DOMImplementation.cpp \
++        dom/DOMStringList.cpp \
++        dom/DOMStringMap.cpp \
++        dom/DatasetDOMStringMap.cpp \
++        dom/DynamicNodeList.cpp \
++        dom/EditingText.cpp \
++        dom/Element.cpp \
++        dom/EntityReference.cpp \
++        dom/ErrorEvent.cpp \
++        dom/Event.cpp \
++        dom/EventContext.cpp \
++        dom/EventDispatcher.cpp \
++        dom/EventNames.cpp \
++        dom/EventTarget.cpp \
++        dom/EventQueue.cpp \
++        dom/ExceptionBase.cpp \
++        dom/ExceptionCode.cpp \
++        dom/IconURL.cpp \
++        dom/InputElement.cpp \
++        dom/KeyboardEvent.cpp \
++        dom/MessageChannel.cpp \
++        dom/MessageEvent.cpp \
++        dom/MessagePort.cpp \
++        dom/MessagePortChannel.cpp \
++        dom/MouseEvent.cpp \
++        dom/MouseRelatedEvent.cpp \
++        dom/MutationEvent.cpp \
++        dom/NameNodeList.cpp \
++        dom/Node.cpp \
++        dom/NodeFilterCondition.cpp \
++        dom/NodeFilter.cpp \
++        dom/NodeIterator.cpp \
++        dom/Notation.cpp \
++        dom/OptionGroupElement.cpp \
++        dom/OptionElement.cpp \
++        dom/StaticHashSetNodeList.cpp \
++        dom/OverflowEvent.cpp \
++        dom/PageTransitionEvent.cpp \
++        dom/PendingScript.cpp \
++        dom/PopStateEvent.cpp \
++        dom/Position.cpp \
++        dom/PositionIterator.cpp \
++        dom/ProcessingInstruction.cpp \
++        dom/ProgressEvent.cpp \
++        dom/RegisteredEventListener.cpp \
++        dom/ScopedEventQueue.cpp \
++        dom/ScriptableDocumentParser.cpp \
++        dom/ScriptElement.cpp \
++        dom/ScriptExecutionContext.cpp \
++        dom/ScriptRunner.cpp \
++        dom/SelectElement.cpp \
++        dom/SelectorNodeList.cpp \
++        dom/ShadowRoot.cpp \
++        dom/SpaceSplitString.cpp \
++        dom/StaticNodeList.cpp \
++        dom/StyledElement.cpp \
++        dom/StyleElement.cpp \
++        dom/TagNodeList.cpp \
++        dom/Text.cpp \
++        dom/TextEvent.cpp \
++        dom/Touch.cpp \
++        dom/TouchEvent.cpp \
++        dom/TouchList.cpp \
++        dom/Traversal.cpp \
++        dom/TreeScope.cpp \
++        dom/TreeWalker.cpp \
++        dom/UIEvent.cpp \
++        dom/UIEventWithKeyState.cpp \
++        dom/UserGestureIndicator.cpp \
++        dom/UserTypingGestureIndicator.cpp \
++        dom/ViewportArguments.cpp \
++        dom/WebKitAnimationEvent.cpp \
++        dom/WebKitTransitionEvent.cpp \
++        dom/WheelEvent.cpp \
++        dom/WindowEventContext.cpp \
++        dom/XMLDocumentParser.cpp \
++        editing/AppendNodeCommand.cpp \
++        editing/ApplyBlockElementCommand.cpp \
++        editing/ApplyStyleCommand.cpp \
++        editing/BreakBlockquoteCommand.cpp \
++        editing/CompositeEditCommand.cpp \
++        editing/CreateLinkCommand.cpp \
++        editing/DeleteButtonController.cpp \
++        editing/DeleteButton.cpp \
++        editing/DeleteFromTextNodeCommand.cpp \
++        editing/DeleteSelectionCommand.cpp \
++        editing/EditCommand.cpp \
++        editing/EditingStyle.cpp \
++        editing/Editor.cpp \
++        editing/EditorCommand.cpp \
++        editing/FormatBlockCommand.cpp \
++        editing/htmlediting.cpp \
++        editing/HTMLInterchange.cpp \
++        editing/IndentOutdentCommand.cpp \
++        editing/InsertIntoTextNodeCommand.cpp \
++        editing/InsertLineBreakCommand.cpp \
++        editing/InsertListCommand.cpp \
++        editing/InsertNodeBeforeCommand.cpp \
++        editing/InsertParagraphSeparatorCommand.cpp \
++        editing/InsertTextCommand.cpp \
++        editing/JoinTextNodesCommand.cpp \
++        editing/markup.cpp \
++        editing/MarkupAccumulator.cpp \
++        editing/MergeIdenticalElementsCommand.cpp \
++        editing/ModifySelectionListLevel.cpp \
++        editing/MoveSelectionCommand.cpp \
++        editing/RemoveCSSPropertyCommand.cpp \
++        editing/RemoveFormatCommand.cpp \
++        editing/RemoveNodeCommand.cpp \
++        editing/RemoveNodePreservingChildrenCommand.cpp \
++        editing/ReplaceNodeWithSpanCommand.cpp \
++        editing/ReplaceSelectionCommand.cpp \
++        editing/SelectionController.cpp \
++        editing/SetNodeAttributeCommand.cpp \
++        editing/SmartReplaceICU.cpp \
++        editing/SpellChecker.cpp \
++        editing/SpellingCorrectionController.cpp \
++        editing/SplitElementCommand.cpp \
++        editing/SplitTextNodeCommand.cpp \
++        editing/SplitTextNodeContainingElementCommand.cpp \
++        editing/TextCheckingHelper.cpp \
++        editing/TextIterator.cpp \
++        editing/TypingCommand.cpp \
++        editing/UnlinkCommand.cpp \
++        editing/VisiblePosition.cpp \
++        editing/VisibleSelection.cpp \
++        editing/visible_units.cpp \
++        editing/WrapContentsInDummySpanCommand.cpp \
++        html/HTMLAppletElement.cpp \
++        html/HTMLAreaElement.cpp \
++        html/HTMLBRElement.cpp \
++        html/HTMLBaseElement.cpp \
++        html/HTMLBaseFontElement.cpp \
++        html/HTMLBlockquoteElement.cpp \
++        html/HTMLBodyElement.cpp \
++        html/HTMLButtonElement.cpp \
++        html/HTMLDataListElement.cpp \
++        html/HTMLDetailsElement.cpp \
++        html/HTMLDListElement.cpp \
++        html/HTMLDirectoryElement.cpp \
++        html/HTMLDivElement.cpp \
++        html/HTMLElement.cpp \
++        html/HTMLEmbedElement.cpp \
++        html/HTMLFieldSetElement.cpp \
++        html/HTMLFontElement.cpp \
++        html/HTMLFormControlElement.cpp \
++        html/HTMLFormElement.cpp \
++        html/HTMLFrameElement.cpp \
++        html/HTMLFrameElementBase.cpp \
++        html/HTMLFrameOwnerElement.cpp \
++        html/HTMLFrameSetElement.cpp \
++        html/HTMLHRElement.cpp \
++        html/HTMLHeadElement.cpp \
++        html/HTMLHeadingElement.cpp \
++        html/HTMLHtmlElement.cpp \
++        html/HTMLIFrameElement.cpp \
++        html/HTMLImageElement.cpp \
++        html/HTMLInputElement.cpp \
++        html/HTMLIsIndexElement.cpp \
++        html/HTMLKeygenElement.cpp \
++        html/HTMLLIElement.cpp \
++        html/HTMLLabelElement.cpp \
++        html/HTMLLegendElement.cpp \
++        html/HTMLLinkElement.cpp \
++        html/HTMLMapElement.cpp \
++        html/HTMLMarqueeElement.cpp \
++        html/HTMLMenuElement.cpp \
++        html/HTMLMetaElement.cpp \
++        html/HTMLMeterElement.cpp \
++        html/HTMLModElement.cpp \
++        html/HTMLOListElement.cpp \
++        html/HTMLObjectElement.cpp \
++        html/HTMLOptGroupElement.cpp \
++        html/HTMLOptionElement.cpp \
++        html/HTMLOutputElement.cpp \
++        html/HTMLParagraphElement.cpp \
++        html/HTMLParamElement.cpp \
++        html/HTMLParserErrorCodes.cpp \
++        html/HTMLPlugInImageElement.cpp \
++        html/HTMLPreElement.cpp \
++        html/HTMLProgressElement.cpp \
++        html/HTMLQuoteElement.cpp \
++        html/HTMLScriptElement.cpp \
++        html/HTMLSelectElement.cpp \
++        html/HTMLStyleElement.cpp \
++        html/HTMLSummaryElement.cpp \
++        html/HTMLTableCaptionElement.cpp \
++        html/HTMLTableCellElement.cpp \
++        html/HTMLTableColElement.cpp \
++        html/HTMLTableElement.cpp \
++        html/HTMLTablePartElement.cpp \
++        html/HTMLTableRowElement.cpp \
++        html/HTMLTableSectionElement.cpp \
++        html/HTMLTextAreaElement.cpp \
++        html/HTMLTitleElement.cpp \
++        html/HTMLUListElement.cpp \
++        rendering/AutoTableLayout.cpp \
++        rendering/break_lines.cpp \
++        rendering/BidiRun.cpp \
++        rendering/CounterNode.cpp \
++        rendering/EllipsisBox.cpp \
++        rendering/FixedTableLayout.cpp \
++        rendering/HitTestResult.cpp \
++        rendering/InlineBox.cpp \
++        rendering/InlineFlowBox.cpp \
++        rendering/InlineTextBox.cpp \
++        rendering/LayoutState.cpp \
++        rendering/RenderApplet.cpp \
++        rendering/RenderArena.cpp \
++        rendering/RenderBlock.cpp \
++        rendering/RenderBlockLineLayout.cpp \
++        rendering/RenderBox.cpp \
++        rendering/RenderBoxModelObject.cpp \
++        rendering/RenderBR.cpp \
++        rendering/RenderButton.cpp \
++        rendering/RenderCombineText.cpp \
++        rendering/RenderCounter.cpp \
++        rendering/RenderDetails.cpp \
++        rendering/RenderDetailsMarker.cpp \
++        rendering/RenderEmbeddedObject.cpp \
++        rendering/RenderFieldset.cpp \
++        rendering/RenderFileUploadControl.cpp \
++        rendering/RenderFlexibleBox.cpp \
++        rendering/RenderFrame.cpp \
++        rendering/RenderFrameBase.cpp \
++        rendering/RenderFrameSet.cpp \
++        rendering/RenderHTMLCanvas.cpp \
++        rendering/RenderIFrame.cpp \
++        rendering/RenderImage.cpp \
++        rendering/RenderImageResource.cpp \
++        rendering/RenderImageResourceStyleImage.cpp \
++        rendering/RenderInline.cpp \
++        rendering/RenderLayer.cpp \
++        rendering/RenderLayerCompositor.cpp \
++        rendering/RenderLineBoxList.cpp \
++        rendering/RenderListBox.cpp \
++        rendering/RenderListItem.cpp \
++        rendering/RenderListMarker.cpp \
++        rendering/RenderMarquee.cpp \
++        rendering/RenderMenuList.cpp \
++        rendering/RenderMeter.cpp \
++        rendering/RenderObject.cpp \
++        rendering/RenderObjectChildList.cpp \
++        rendering/RenderPart.cpp \
++        rendering/RenderProgress.cpp \
++        rendering/RenderQuote.cpp \
++        rendering/RenderReplaced.cpp \
++        rendering/RenderReplica.cpp \
++        rendering/RenderRuby.cpp \
++        rendering/RenderRubyBase.cpp \
++        rendering/RenderRubyRun.cpp \
++        rendering/RenderRubyText.cpp \
++        rendering/RenderScrollbar.cpp \
++        rendering/RenderScrollbarPart.cpp \
++        rendering/RenderScrollbarTheme.cpp \
++        rendering/RenderSlider.cpp \
++        rendering/RenderSummary.cpp \
++        rendering/RenderTable.cpp \
++        rendering/RenderTableCell.cpp \
++        rendering/RenderTableCol.cpp \
++        rendering/RenderTableRow.cpp \
++        rendering/RenderTableSection.cpp \
++        rendering/RenderText.cpp \
++        rendering/RenderTextControl.cpp \
++        rendering/RenderTextControlMultiLine.cpp \
++        rendering/RenderTextControlSingleLine.cpp \
++        rendering/RenderTextFragment.cpp \
++        rendering/RenderTheme.cpp \
++        rendering/RenderTreeAsText.cpp \
++        rendering/RenderView.cpp \
++        rendering/RenderWidget.cpp \
++        rendering/RenderWordBreak.cpp \
++        rendering/RootInlineBox.cpp \
++        rendering/ScrollBehavior.cpp \
++        rendering/ShadowElement.cpp \
++        rendering/TransformState.cpp \
++        rendering/style/ContentData.cpp \
++        rendering/style/CounterDirectives.cpp \
++        rendering/style/FillLayer.cpp \
++        rendering/style/KeyframeList.cpp \
++        rendering/style/NinePieceImage.cpp \
++        rendering/style/QuotesData.cpp \
++        rendering/style/RenderStyle.cpp \
++        rendering/style/ShadowData.cpp \
++        rendering/style/StyleBackgroundData.cpp \
++        rendering/style/StyleBoxData.cpp \
++        rendering/style/StyleCachedImage.cpp \
++        rendering/style/StyleFlexibleBoxData.cpp \
++        rendering/style/StyleGeneratedImage.cpp \
++        rendering/style/StyleInheritedData.cpp \
++        rendering/style/StyleMarqueeData.cpp \
++        rendering/style/StyleMultiColData.cpp \
++        rendering/style/StyleRareInheritedData.cpp \
++        rendering/style/StyleRareNonInheritedData.cpp \
++        rendering/style/StyleSurroundData.cpp \
++        rendering/style/StyleTransformData.cpp \
++        rendering/style/StyleVisualData.cpp
++}
++
+ SOURCES += \
+     css/CSSBorderImageValue.cpp \
+     css/CSSCanvasValue.cpp \
+@@ -446,173 +798,12 @@ SOURCES += \
+     css/WebKitCSSKeyframesRule.cpp \
+     css/WebKitCSSMatrix.cpp \
+     css/WebKitCSSTransformValue.cpp \
+-    dom/ActiveDOMObject.cpp \
+-    dom/Attr.cpp \
+-    dom/Attribute.cpp \
+-    dom/BeforeProcessEvent.cpp \
+-    dom/BeforeTextInsertedEvent.cpp \
+-    dom/BeforeUnloadEvent.cpp \
+-    dom/CDATASection.cpp \
+-    dom/CharacterData.cpp \
+-    dom/CheckedRadioButtons.cpp \
+-    dom/ChildNodeList.cpp \
+-    dom/ClassNodeList.cpp \
+-    dom/ClientRect.cpp \
+-    dom/ClientRectList.cpp \
+-    dom/Clipboard.cpp \
+-    dom/ClipboardEvent.cpp \
+-    dom/Comment.cpp \
+-    dom/CompositionEvent.cpp \
+-    dom/ContainerNode.cpp \
+-    dom/CSSMappedAttributeDeclaration.cpp \
+-    dom/CustomEvent.cpp \
+-    dom/DecodedDataDocumentParser.cpp \
+-    dom/DeviceMotionController.cpp \
+-    dom/DeviceMotionData.cpp \
+-    dom/DeviceMotionEvent.cpp \
+-    dom/DeviceOrientation.cpp \
+-    dom/DeviceOrientationController.cpp \
+-    dom/DeviceOrientationEvent.cpp \
+-    dom/Document.cpp \
+-    dom/DocumentFragment.cpp \
+-    dom/DocumentMarkerController.cpp \
+-    dom/DocumentOrderedMap.cpp \
+-    dom/DocumentParser.cpp \
+-    dom/DocumentType.cpp \
+-    dom/DOMImplementation.cpp \
+-    dom/DOMStringList.cpp \
+-    dom/DOMStringMap.cpp \
+-    dom/DatasetDOMStringMap.cpp \
+-    dom/DynamicNodeList.cpp \
+-    dom/EditingText.cpp \
+-    dom/Element.cpp \
+-    dom/EntityReference.cpp \
+-    dom/ErrorEvent.cpp \
+-    dom/Event.cpp \
+-    dom/EventContext.cpp \
+-    dom/EventDispatcher.cpp \
+-    dom/EventNames.cpp \
+-    dom/EventTarget.cpp \
+-    dom/EventQueue.cpp \
+-    dom/ExceptionBase.cpp \
+-    dom/ExceptionCode.cpp \
+-    dom/IconURL.cpp \
+-    dom/InputElement.cpp \
+-    dom/KeyboardEvent.cpp \
+-    dom/MessageChannel.cpp \
+-    dom/MessageEvent.cpp \
+-    dom/MessagePort.cpp \
+-    dom/MessagePortChannel.cpp \
+-    dom/MouseEvent.cpp \
+-    dom/MouseRelatedEvent.cpp \
+-    dom/MutationEvent.cpp \
+     dom/NamedNodeMap.cpp \
+-    dom/NameNodeList.cpp \
+-    dom/Node.cpp \
+-    dom/NodeFilterCondition.cpp \
+-    dom/NodeFilter.cpp \
+-    dom/NodeIterator.cpp \
+-    dom/Notation.cpp \
+-    dom/OptionGroupElement.cpp \
+-    dom/OptionElement.cpp \
+-    dom/StaticHashSetNodeList.cpp \
+-    dom/OverflowEvent.cpp \
+-    dom/PageTransitionEvent.cpp \
+-    dom/PendingScript.cpp \
+-    dom/PopStateEvent.cpp \
+-    dom/Position.cpp \
+-    dom/PositionIterator.cpp \
+-    dom/ProcessingInstruction.cpp \
+-    dom/ProgressEvent.cpp \
+     dom/QualifiedName.cpp \
+     dom/Range.cpp \
+     dom/RawDataDocumentParser.h \
+-    dom/RegisteredEventListener.cpp \
+-    dom/ScopedEventQueue.cpp \
+-    dom/ScriptableDocumentParser.cpp \
+-    dom/ScriptElement.cpp \
+-    dom/ScriptExecutionContext.cpp \
+-    dom/ScriptRunner.cpp \
+-    dom/SelectElement.cpp \
+-    dom/SelectorNodeList.cpp \
+-    dom/ShadowRoot.cpp \
+-    dom/SpaceSplitString.cpp \
+-    dom/StaticNodeList.cpp \
+-    dom/StyledElement.cpp \
+-    dom/StyleElement.cpp \
+-    dom/TagNodeList.cpp \
+-    dom/Text.cpp \
+-    dom/TextEvent.cpp \
+-    dom/Touch.cpp \
+-    dom/TouchEvent.cpp \
+-    dom/TouchList.cpp \
+-    dom/Traversal.cpp \
+-    dom/TreeScope.cpp \
+-    dom/TreeWalker.cpp \
+-    dom/UIEvent.cpp \
+-    dom/UIEventWithKeyState.cpp \
+-    dom/UserGestureIndicator.cpp \
+-    dom/UserTypingGestureIndicator.cpp \
+-    dom/ViewportArguments.cpp \
+-    dom/WebKitAnimationEvent.cpp \
+-    dom/WebKitTransitionEvent.cpp \
+-    dom/WheelEvent.cpp \
+-    dom/WindowEventContext.cpp \
+-    dom/XMLDocumentParser.cpp \
+     dom/XMLDocumentParserQt.cpp \
+     dom/default/PlatformMessagePortChannel.cpp \
+-    editing/AppendNodeCommand.cpp \
+-    editing/ApplyBlockElementCommand.cpp \
+-    editing/ApplyStyleCommand.cpp \
+-    editing/BreakBlockquoteCommand.cpp \
+-    editing/CompositeEditCommand.cpp \
+-    editing/CreateLinkCommand.cpp \
+-    editing/DeleteButtonController.cpp \
+-    editing/DeleteButton.cpp \
+-    editing/DeleteFromTextNodeCommand.cpp \
+-    editing/DeleteSelectionCommand.cpp \
+-    editing/EditCommand.cpp \
+-    editing/EditingStyle.cpp \
+-    editing/Editor.cpp \
+-    editing/EditorCommand.cpp \
+-    editing/FormatBlockCommand.cpp \
+-    editing/htmlediting.cpp \
+-    editing/HTMLInterchange.cpp \
+-    editing/IndentOutdentCommand.cpp \
+-    editing/InsertIntoTextNodeCommand.cpp \
+-    editing/InsertLineBreakCommand.cpp \
+-    editing/InsertListCommand.cpp \
+-    editing/InsertNodeBeforeCommand.cpp \
+-    editing/InsertParagraphSeparatorCommand.cpp \
+-    editing/InsertTextCommand.cpp \
+-    editing/JoinTextNodesCommand.cpp \
+-    editing/markup.cpp \
+-    editing/MarkupAccumulator.cpp \
+-    editing/MergeIdenticalElementsCommand.cpp \
+-    editing/ModifySelectionListLevel.cpp \
+-    editing/MoveSelectionCommand.cpp \
+-    editing/RemoveCSSPropertyCommand.cpp \
+-    editing/RemoveFormatCommand.cpp \
+-    editing/RemoveNodeCommand.cpp \
+-    editing/RemoveNodePreservingChildrenCommand.cpp \
+-    editing/ReplaceNodeWithSpanCommand.cpp \
+-    editing/ReplaceSelectionCommand.cpp \
+-    editing/SelectionController.cpp \
+-    editing/SetNodeAttributeCommand.cpp \
+-    editing/SmartReplaceICU.cpp \
+-    editing/SpellChecker.cpp \
+-    editing/SpellingCorrectionController.cpp \
+-    editing/SplitElementCommand.cpp \
+-    editing/SplitTextNodeCommand.cpp \
+-    editing/SplitTextNodeContainingElementCommand.cpp \
+-    editing/TextCheckingHelper.cpp \
+-    editing/TextIterator.cpp \
+-    editing/TypingCommand.cpp \
+-    editing/UnlinkCommand.cpp \
+-    editing/VisiblePosition.cpp \
+-    editing/VisibleSelection.cpp \
+-    editing/visible_units.cpp \
+-    editing/WrapContentsInDummySpanCommand.cpp \
+     fileapi/Blob.cpp \
+     fileapi/BlobURL.cpp \
+     fileapi/File.cpp \
+@@ -652,85 +843,17 @@ SOURCES += \
+     html/FileInputType.cpp \
+     html/FormAssociatedElement.cpp \
+     html/FormDataList.cpp \
+-    html/HTMLAllCollection.cpp \
+     html/HTMLAnchorElement.cpp \
+-    html/HTMLAppletElement.cpp \
+-    html/HTMLAreaElement.cpp \
+-    html/HTMLBRElement.cpp \
+-    html/HTMLBaseElement.cpp \
+-    html/HTMLBaseFontElement.cpp \
+-    html/HTMLBlockquoteElement.cpp \
+-    html/HTMLBodyElement.cpp \
+-    html/HTMLButtonElement.cpp \
++    html/HTMLAllCollection.cpp \
+     html/HTMLCanvasElement.cpp \
+     html/HTMLCollection.cpp \
+-    html/HTMLDListElement.cpp \
+-    html/HTMLDataListElement.cpp \
+-    html/HTMLDirectoryElement.cpp \
+-    html/HTMLDetailsElement.cpp \
+-    html/HTMLDivElement.cpp \
+     html/HTMLDocument.cpp \
+-    html/HTMLElement.cpp \
+-    html/HTMLEmbedElement.cpp \
+-    html/HTMLFieldSetElement.cpp \
+-    html/HTMLFontElement.cpp \
+     html/HTMLFormCollection.cpp \
+-    html/HTMLFormControlElement.cpp \
+-    html/HTMLFormElement.cpp \
+-    html/HTMLFrameElement.cpp \
+-    html/HTMLFrameElementBase.cpp \
+-    html/HTMLFrameOwnerElement.cpp \
+-    html/HTMLFrameSetElement.cpp \
+-    html/HTMLHRElement.cpp \
+-    html/HTMLHeadElement.cpp \
+-    html/HTMLHeadingElement.cpp \
+-    html/HTMLHtmlElement.cpp \
+-    html/HTMLIFrameElement.cpp \
+-    html/HTMLImageElement.cpp \
+     html/HTMLImageLoader.cpp \
+-    html/HTMLInputElement.cpp \
+-    html/HTMLIsIndexElement.cpp \
+-    html/HTMLKeygenElement.cpp \
+-    html/HTMLLIElement.cpp \
+-    html/HTMLLabelElement.cpp \
+-    html/HTMLLegendElement.cpp \
+-    html/HTMLLinkElement.cpp \
+-    html/HTMLMapElement.cpp \
+-    html/HTMLMarqueeElement.cpp \
+-    html/HTMLMenuElement.cpp \
+-    html/HTMLMetaElement.cpp \
+-    html/HTMLMeterElement.cpp \
+-    html/HTMLModElement.cpp \
+     html/HTMLNameCollection.cpp \
+-    html/HTMLOListElement.cpp \
+-    html/HTMLObjectElement.cpp \
+-    html/HTMLOptGroupElement.cpp \
+-    html/HTMLOptionElement.cpp \
+     html/HTMLOptionsCollection.cpp \
+-    html/HTMLOutputElement.cpp \
+-    html/HTMLParagraphElement.cpp \
+-    html/HTMLParamElement.cpp \
+-    html/HTMLParserErrorCodes.cpp \
+     html/HTMLPlugInElement.cpp \
+-    html/HTMLPlugInImageElement.cpp \
+-    html/HTMLPreElement.cpp \
+-    html/HTMLProgressElement.cpp \
+-    html/HTMLQuoteElement.cpp \
+-    html/HTMLScriptElement.cpp \
+-    html/HTMLSelectElement.cpp \
+-    html/HTMLStyleElement.cpp \
+-    html/HTMLSummaryElement.cpp \
+-    html/HTMLTableCaptionElement.cpp \
+-    html/HTMLTableCellElement.cpp \
+-    html/HTMLTableColElement.cpp \
+-    html/HTMLTableElement.cpp \
+-    html/HTMLTablePartElement.cpp \
+-    html/HTMLTableRowElement.cpp \
+     html/HTMLTableRowsCollection.cpp \
+-    html/HTMLTableSectionElement.cpp \
+-    html/HTMLTextAreaElement.cpp \
+-    html/HTMLTitleElement.cpp \
+-    html/HTMLUListElement.cpp \
+     html/HTMLViewSourceDocument.cpp \
+     html/HiddenInputType.cpp \
+     html/ImageData.cpp \
+@@ -989,6 +1112,7 @@ SOURCES += \
+     platform/graphics/PathTraversalState.cpp \
+     platform/graphics/Pattern.cpp \
+     platform/graphics/RoundedIntRect.cpp \
++    platform/graphics/WOFFFileFormat.cpp \
+     platform/graphics/SegmentedFontData.cpp \
+     platform/graphics/ShadowBlur.cpp \
+     platform/graphics/SVGGlyph.cpp \
+@@ -1075,108 +1199,7 @@ SOURCES += \
+     plugins/PluginPackage.cpp \
+     plugins/PluginStream.cpp \
+     plugins/PluginView.cpp \
+-    rendering/AutoTableLayout.cpp \
+-    rendering/break_lines.cpp \
+-    rendering/BidiRun.cpp \
+-    rendering/CounterNode.cpp \
+-    rendering/EllipsisBox.cpp \
+-    rendering/FixedTableLayout.cpp \
+-    rendering/HitTestResult.cpp \
+-    rendering/InlineBox.cpp \
+-    rendering/InlineFlowBox.cpp \
+-    rendering/InlineTextBox.cpp \
+-    rendering/LayoutState.cpp \
+-    rendering/RenderApplet.cpp \
+-    rendering/RenderArena.cpp \
+-    rendering/RenderBlock.cpp \
+-    rendering/RenderBlockLineLayout.cpp \
+-    rendering/RenderBox.cpp \
+-    rendering/RenderBoxModelObject.cpp \
+-    rendering/RenderBR.cpp \
+-    rendering/RenderButton.cpp \
+-    rendering/RenderCombineText.cpp \
+-    rendering/RenderCounter.cpp \
+-    rendering/RenderDetails.cpp \
+-    rendering/RenderDetailsMarker.cpp \
+-    rendering/RenderEmbeddedObject.cpp \
+-    rendering/RenderFieldset.cpp \
+-    rendering/RenderFileUploadControl.cpp \
+-    rendering/RenderFlexibleBox.cpp \
+-    rendering/RenderFrame.cpp \
+-    rendering/RenderFrameBase.cpp \
+-    rendering/RenderFrameSet.cpp \
+-    rendering/RenderHTMLCanvas.cpp \
+-    rendering/RenderIFrame.cpp \
+-    rendering/RenderImage.cpp \
+-    rendering/RenderImageResource.cpp \
+-    rendering/RenderImageResourceStyleImage.cpp \
+-    rendering/RenderInline.cpp \
+-    rendering/RenderLayer.cpp \
+     rendering/RenderLayerBacking.cpp \
+-    rendering/RenderLayerCompositor.cpp \
+-    rendering/RenderLineBoxList.cpp \
+-    rendering/RenderListBox.cpp \
+-    rendering/RenderListItem.cpp \
+-    rendering/RenderListMarker.cpp \
+-    rendering/RenderMarquee.cpp \
+-    rendering/RenderMenuList.cpp \
+-    rendering/RenderMeter.cpp \
+-    rendering/RenderObject.cpp \
+-    rendering/RenderObjectChildList.cpp \
+-    rendering/RenderPart.cpp \
+-    rendering/RenderProgress.cpp \
+-    rendering/RenderQuote.cpp \
+-    rendering/RenderReplaced.cpp \
+-    rendering/RenderReplica.cpp \
+-    rendering/RenderRuby.cpp \
+-    rendering/RenderRubyBase.cpp \
+-    rendering/RenderRubyRun.cpp \
+-    rendering/RenderRubyText.cpp \
+-    rendering/RenderScrollbar.cpp \
+-    rendering/RenderScrollbarPart.cpp \
+-    rendering/RenderScrollbarTheme.cpp \
+-    rendering/RenderSlider.cpp \
+-    rendering/RenderSummary.cpp \
+-    rendering/RenderTable.cpp \
+-    rendering/RenderTableCell.cpp \
+-    rendering/RenderTableCol.cpp \
+-    rendering/RenderTableRow.cpp \
+-    rendering/RenderTableSection.cpp \
+-    rendering/RenderText.cpp \
+-    rendering/RenderTextControl.cpp \
+-    rendering/RenderTextControlMultiLine.cpp \
+-    rendering/RenderTextControlSingleLine.cpp \
+-    rendering/RenderTextFragment.cpp \
+-    rendering/RenderTheme.cpp \
+-    rendering/RenderTreeAsText.cpp \
+-    rendering/RenderView.cpp \
+-    rendering/RenderWidget.cpp \
+-    rendering/RenderWordBreak.cpp \
+-    rendering/RootInlineBox.cpp \
+-    rendering/ScrollBehavior.cpp \
+-    rendering/ShadowElement.cpp \
+-    rendering/TransformState.cpp \
+-    rendering/style/ContentData.cpp \
+-    rendering/style/CounterDirectives.cpp \
+-    rendering/style/FillLayer.cpp \
+-    rendering/style/KeyframeList.cpp \
+-    rendering/style/NinePieceImage.cpp \
+-    rendering/style/QuotesData.cpp \
+-    rendering/style/RenderStyle.cpp \
+-    rendering/style/ShadowData.cpp \
+-    rendering/style/StyleBackgroundData.cpp \
+-    rendering/style/StyleBoxData.cpp \
+-    rendering/style/StyleCachedImage.cpp \
+-    rendering/style/StyleFlexibleBoxData.cpp \
+-    rendering/style/StyleGeneratedImage.cpp \
+-    rendering/style/StyleInheritedData.cpp \
+-    rendering/style/StyleMarqueeData.cpp \
+-    rendering/style/StyleMultiColData.cpp \
+-    rendering/style/StyleRareInheritedData.cpp \
+-    rendering/style/StyleRareNonInheritedData.cpp \
+-    rendering/style/StyleSurroundData.cpp \
+-    rendering/style/StyleTransformData.cpp \
+-    rendering/style/StyleVisualData.cpp \
+     testing/Internals.cpp \
+     xml/DOMParser.cpp \
+     xml/XMLHttpRequest.cpp \
+@@ -1959,6 +1982,7 @@ HEADERS += \
+     platform/graphics/PathTraversalState.h \
+     platform/graphics/Pattern.h \
+     platform/graphics/RoundedIntRect.h \
++    platform/graphics/WOFFFileFormat.h \
+     platform/graphics/qt/FontCustomPlatformData.h \
+     platform/graphics/qt/ImageDecoderQt.h \
+     platform/graphics/qt/StillImageQt.h \
+@@ -3129,7 +3153,6 @@ contains(DEFINES, ENABLE_SVG=1) {
+         rendering/style/SVGRenderStyle.cpp \
+         rendering/style/SVGRenderStyleDefs.cpp \
+         rendering/PointerEventsHitRules.cpp \
+-        rendering/svg/RenderSVGPath.cpp \
+         svg/animation/SMILTime.cpp \
+         svg/animation/SMILTimeContainer.cpp \
+         svg/animation/SVGSMILElement.cpp \
+@@ -3139,9 +3162,7 @@ contains(DEFINES, ENABLE_SVG=1) {
+         svg/graphics/SVGImage.cpp \
+         svg/properties/SVGPathSegListPropertyTearOff.cpp
+ 
+-    linux-g++*:CONFIG(debug, debug|release):isEqual(QT_ARCH,i386) {
+-         # Using all in one files to avoid memory exhaustion
+-         # during the linking phase.
++    CONFIG(debug, debug|release) {
+          SOURCES += \
+               rendering/svg/RenderSVGAllInOne.cpp \
+               svg/SVGAllInOne.cpp
+@@ -3156,6 +3177,7 @@ contains(DEFINES, ENABLE_SVG=1) {
+               rendering/svg/RenderSVGInline.cpp \
+               rendering/svg/RenderSVGInlineText.cpp \
+               rendering/svg/RenderSVGModelObject.cpp \
++              rendering/svg/RenderSVGPath.cpp \
+               rendering/svg/RenderSVGResource.cpp \
+               rendering/svg/RenderSVGResourceClipper.cpp \
+               rendering/svg/RenderSVGResourceContainer.cpp \
+@@ -3464,7 +3486,7 @@ contains(DEFINES, ENABLE_WEBGL=1) {
+         INCLUDEPATH += $$PWD/platform/graphics/gpu
+ }
+ 
+-win32:!win32-g++*:contains(QMAKE_HOST.arch, x86_64):{
++win32:!win32-g++*:contains(QMAKE_TARGET.arch, x86_64):{
+     asm_compiler.commands = ml64 /c
+     asm_compiler.commands +=  /Fo ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+     asm_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+@@ -3476,7 +3498,7 @@ win32:!win32-g++*:contains(QMAKE_HOST.arch, x86_64):{
+ 
+     ASM_SOURCES += \
+         plugins/win/PaintHooks.asm
+-   if(win32-msvc2005|win32-msvc2008):equals(TEMPLATE_PREFIX, "vc") {
++   if(win32-msvc*):equals(TEMPLATE_PREFIX, "vc") {
+         SOURCES += \
+             plugins/win/PaintHooks.asm
+    }
+diff --git a/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
+index dd7f7776df3..f9765ca1232 100644
+--- a/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
+@@ -34,7 +34,11 @@
+ #include "AccessibilityListBox.cpp"
+ #include "AccessibilityListBoxOption.cpp"
+ #include "AccessibilityMediaControls.cpp"
++#include "AccessibilityMenuList.cpp"
++#include "AccessibilityMenuListOption.cpp"
++#include "AccessibilityMenuListPopup.cpp"
+ #include "AccessibilityObject.cpp"
++#include "AccessibilityProgressIndicator.cpp"
+ #include "AccessibilityRenderObject.cpp"
+ #include "AccessibilityScrollView.cpp"
+ #include "AccessibilityScrollbar.cpp"
+diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
+index 0f1de36f01d..96d02b87fbf 100644
+--- a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
+@@ -31,7 +31,6 @@
+ #include "GCController.cpp"
+ #include "JSArrayBufferCustom.cpp"
+ #include "JSAttrCustom.cpp"
+-#include "JSAudioConstructor.cpp"
+ #include "JSCDATASectionCustom.cpp"
+ #include "JSCSSFontFaceRuleCustom.cpp"
+ #include "JSCSSImportRuleCustom.cpp"
+@@ -50,10 +49,8 @@
+ #include "JSCoordinatesCustom.cpp"
+ #include "JSCustomPositionCallback.cpp"
+ #include "JSCustomPositionErrorCallback.cpp"
+-#include "JSCustomSQLStatementErrorCallback.cpp"
+ #include "JSCustomVoidCallback.cpp"
+ #include "JSCustomXPathNSResolver.cpp"
+-#include "JSDOMApplicationCacheCustom.cpp"
+ #include "JSDOMBinding.cpp"
+ #include "JSDOMFormDataCustom.cpp"
+ #include "JSDOMGlobalObject.cpp"
+@@ -68,7 +65,6 @@
+ #include "JSDOMWindowShell.cpp"
+ #include "JSDOMWrapper.cpp"
+ #include "JSDataViewCustom.cpp"
+-#include "JSDedicatedWorkerContextCustom.cpp"
+ #include "JSDesktopNotificationsCustom.cpp"
+ #include "JSDeviceOrientationEventCustom.cpp"
+ #include "JSDocumentCustom.cpp"
+@@ -107,7 +103,6 @@
+ #include "JSInt16ArrayCustom.cpp"
+ #include "JSInt32ArrayCustom.cpp"
+ #include "JSInt8ArrayCustom.cpp"
+-#include "JSJavaScriptCallFrameCustom.cpp"
+ #include "JSLazyEventListener.cpp"
+ #include "JSLocationCustom.cpp"
+ #include "JSMainThreadExecState.cpp"
+@@ -126,15 +121,7 @@
+ #include "JSOptionConstructor.cpp"
+ #include "JSPluginElementFunctions.cpp"
+ #include "JSProcessingInstructionCustom.cpp"
+-#include "JSSQLResultSetRowListCustom.cpp"
+-#include "JSSQLTransactionCustom.cpp"
+-#include "JSSQLTransactionSyncCustom.cpp"
+-#include "JSSVGElementInstanceCustom.cpp"
+-#include "JSSVGLengthCustom.cpp"
+-#include "JSSVGPathSegCustom.cpp"
+ #include "JSScriptProfileNodeCustom.cpp"
+-#include "JSSharedWorkerCustom.cpp"
+-#include "JSStorageCustom.cpp"
+ #include "JSStyleSheetCustom.cpp"
+ #include "JSStyleSheetListCustom.cpp"
+ #include "JSTextCustom.cpp"
+@@ -150,28 +137,14 @@
+ #include "JSWebKitCSSKeyframesRuleCustom.cpp"
+ #include "JSWebKitCSSMatrixCustom.cpp"
+ #include "JSWebKitPointCustom.cpp"
+-#include "JSWebSocketCustom.cpp"
+-#include "JSWorkerContextBase.cpp"
+-#include "JSWorkerContextCustom.cpp"
+-#include "JSWorkerCustom.cpp"
+ #include "JSXMLHttpRequestCustom.cpp"
+ #include "JSXMLHttpRequestUploadCustom.cpp"
+-#include "JSXSLTProcessorCustom.cpp"
+-#include "JavaScriptCallFrame.cpp"
+-#include "MemoryInfo.cpp"
+-#include "PageScriptDebugServer.cpp"
+ #include "ScheduledAction.cpp"
+ #include "ScriptCachedFrameData.cpp"
+ #include "ScriptCallStackFactory.cpp"
+-#include "ScriptController.cpp"
+-#include "ScriptControllerWin.cpp"
+ #include "ScriptDebugServer.cpp"
+ #include "ScriptEventListener.cpp"
+ #include "ScriptFunctionCall.cpp"
+ #include "ScriptGCEvent.cpp"
+-#include "ScriptProfiler.cpp"
+ #include "ScriptState.cpp"
+ #include "SerializedScriptValue.cpp"
+-#include "WorkerScriptController.cpp"
+-#include "WorkerScriptDebugServer.cpp"
+-
+diff --git a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+index 8434e5052d7..9e16ad1eba8 100644
+--- a/src/3rdparty/webkit/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+@@ -170,6 +170,21 @@ JSValue JSCanvasRenderingContext2D::setStrokeColor(ExecState* exec)
+     return jsUndefined();
+ }
+ 
++JSValue JSCanvasRenderingContext2D::setLineDash(ExecState* exec)
++{
++    CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
++    JSValue value = exec->argument(0);
++    JSObject* array = asObject(value);
++    uint32_t length = array->get(exec, JSC::Identifier(exec, "length")).toInt32(exec);
++    DashArray lineDash;
++    for(uint32_t i = 0; i < length; i++) {
++        JSValue v = array->get(exec, i);
++        lineDash.append(v.toNumber(exec));
++    }
++    context->setLineDash(lineDash, lineDash[0]);
++    return jsUndefined();
++}
++
+ JSValue JSCanvasRenderingContext2D::strokeRect(ExecState* exec)
+ { 
+     CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(impl());
+diff --git a/src/3rdparty/webkit/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/src/3rdparty/webkit/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+index 08626ddfd85..4fb0feee689 100644
+--- a/src/3rdparty/webkit/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+@@ -1245,6 +1245,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
+         case CSSPropertyOpacity:
+             return primitiveValueCache->createValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
+         case CSSPropertyOrphans:
++            if (style->hasAutoOrphans())
++                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
+             return primitiveValueCache->createValue(style->orphans(), CSSPrimitiveValue::CSS_NUMBER);
+         case CSSPropertyOutlineColor:
+             return m_allowVisitedStyle ? primitiveValueCache->createColorValue(style->visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor(style.get(), style->outlineColor());
+@@ -1383,6 +1385,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
+         case CSSPropertyWhiteSpace:
+             return primitiveValueCache->createValue(style->whiteSpace());
+         case CSSPropertyWidows:
++            if (style->hasAutoWidows())
++                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
+             return primitiveValueCache->createValue(style->widows(), CSSPrimitiveValue::CSS_NUMBER);
+         case CSSPropertyWidth:
+             if (renderer)
+diff --git a/src/3rdparty/webkit/Source/WebCore/css/CSSFontFaceSource.cpp b/src/3rdparty/webkit/Source/WebCore/css/CSSFontFaceSource.cpp
+index b0f7365d63e..f51a25ac38c 100644
+--- a/src/3rdparty/webkit/Source/WebCore/css/CSSFontFaceSource.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/css/CSSFontFaceSource.cpp
+@@ -44,6 +44,10 @@
+ #include "SVGURIReference.h"
+ #endif
+ 
++#if PLATFORM(QT)
++#include <QFontInfo>
++#endif
++
+ namespace WebCore {
+ 
+ CSSFontFaceSource::CSSFontFaceSource(const String& str, CachedFont* font)
+diff --git a/src/3rdparty/webkit/Source/WebCore/css/CSSFontSelector.cpp b/src/3rdparty/webkit/Source/WebCore/css/CSSFontSelector.cpp
+index 8024afa4c2e..9edf17feeac 100644
+--- a/src/3rdparty/webkit/Source/WebCore/css/CSSFontSelector.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/css/CSSFontSelector.cpp
+@@ -108,94 +108,65 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
+     unsigned traitsMask = 0;
+ 
+     if (RefPtr<CSSValue> fontStyle = style->getPropertyCSSValue(CSSPropertyFontStyle)) {
+-        if (fontStyle->isPrimitiveValue()) {
+-            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+-            list->append(fontStyle);
+-            fontStyle = list;
+-        } else if (!fontStyle->isValueList())
+-            return;
+-
+-        CSSValueList* styleList = static_cast<CSSValueList*>(fontStyle.get());
+-        unsigned numStyles = styleList->length();
+-        if (!numStyles)
++        if (!fontStyle->isPrimitiveValue())
+             return;
+ 
+-        for (unsigned i = 0; i < numStyles; ++i) {
+-            switch (static_cast<CSSPrimitiveValue*>(styleList->itemWithoutBoundsCheck(i))->getIdent()) {
+-                case CSSValueAll:
+-                    traitsMask |= FontStyleMask;
+-                    break;
+-                case CSSValueNormal:
+-                    traitsMask |= FontStyleNormalMask;
+-                    break;
+-                case CSSValueItalic:
+-                case CSSValueOblique:
+-                    traitsMask |= FontStyleItalicMask;
+-                    break;
+-                default:
+-                    break;
+-            }
++        switch (static_cast<CSSPrimitiveValue*>(fontStyle.get())->getIdent()) {
++        case CSSValueNormal:
++            traitsMask |= FontStyleNormalMask;
++            break;
++        case CSSValueItalic:
++        case CSSValueOblique:
++            traitsMask |= FontStyleItalicMask;
++            break;
++        default:
++            break;
+         }
+     } else
+-        traitsMask |= FontStyleMask;
++        traitsMask |= FontStyleNormalMask;
+ 
+     if (RefPtr<CSSValue> fontWeight = style->getPropertyCSSValue(CSSPropertyFontWeight)) {
+-        if (fontWeight->isPrimitiveValue()) {
+-            RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+-            list->append(fontWeight);
+-            fontWeight = list;
+-        } else if (!fontWeight->isValueList())
++        if (!fontWeight->isPrimitiveValue())
+             return;
+ 
+-        CSSValueList* weightList = static_cast<CSSValueList*>(fontWeight.get());
+-        unsigned numWeights = weightList->length();
+-        if (!numWeights)
+-            return;
+-
+-        for (unsigned i = 0; i < numWeights; ++i) {
+-            switch (static_cast<CSSPrimitiveValue*>(weightList->itemWithoutBoundsCheck(i))->getIdent()) {
+-                case CSSValueAll:
+-                    traitsMask |= FontWeightMask;
+-                    break;
+-                case CSSValueBolder:
+-                case CSSValueBold:
+-                case CSSValue700:
+-                    traitsMask |= FontWeight700Mask;
+-                    break;
+-                case CSSValueNormal:
+-                case CSSValue400:
+-                    traitsMask |= FontWeight400Mask;
+-                    break;
+-                case CSSValue900:
+-                    traitsMask |= FontWeight900Mask;
+-                    break;
+-                case CSSValue800:
+-                    traitsMask |= FontWeight800Mask;
+-                    break;
+-                case CSSValue600:
+-                    traitsMask |= FontWeight600Mask;
+-                    break;
+-                case CSSValue500:
+-                    traitsMask |= FontWeight500Mask;
+-                    break;
+-                case CSSValue300:
+-                    traitsMask |= FontWeight300Mask;
+-                    break;
+-                case CSSValueLighter:
+-                case CSSValue200:
+-                    traitsMask |= FontWeight200Mask;
+-                    break;
+-                case CSSValue100:
+-                    traitsMask |= FontWeight100Mask;
+-                    break;
+-                default:
+-                    break;
+-            }
++        switch (static_cast<CSSPrimitiveValue*>(fontWeight.get())->getIdent()) {
++        case CSSValueBold:
++        case CSSValue700:
++            traitsMask |= FontWeight700Mask;
++            break;
++        case CSSValueNormal:
++        case CSSValue400:
++            traitsMask |= FontWeight400Mask;
++            break;
++        case CSSValue900:
++            traitsMask |= FontWeight900Mask;
++            break;
++        case CSSValue800:
++            traitsMask |= FontWeight800Mask;
++            break;
++        case CSSValue600:
++            traitsMask |= FontWeight600Mask;
++            break;
++        case CSSValue500:
++            traitsMask |= FontWeight500Mask;
++            break;
++        case CSSValue300:
++            traitsMask |= FontWeight300Mask;
++            break;
++        case CSSValue200:
++            traitsMask |= FontWeight200Mask;
++            break;
++        case CSSValue100:
++            traitsMask |= FontWeight100Mask;
++            break;
++        default:
++            break;
+         }
+     } else
+-        traitsMask |= FontWeightMask;
++        traitsMask |= FontWeight400Mask;
+ 
+     if (RefPtr<CSSValue> fontVariant = style->getPropertyCSSValue(CSSPropertyFontVariant)) {
++        // font-variant descriptor can be a value list
+         if (fontVariant->isPrimitiveValue()) {
+             RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+             list->append(fontVariant);
+@@ -210,9 +181,6 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
+ 
+         for (unsigned i = 0; i < numVariants; ++i) {
+             switch (static_cast<CSSPrimitiveValue*>(variantList->itemWithoutBoundsCheck(i))->getIdent()) {
+-                case CSSValueAll:
+-                    traitsMask |= FontVariantMask;
+-                    break;
+                 case CSSValueNormal:
+                     traitsMask |= FontVariantNormalMask;
+                     break;
+@@ -420,6 +388,7 @@ static inline bool compareFontFaces(CSSFontFace* first, CSSFontFace* second)
+     if (firstHasDesiredVariant != secondHasDesiredVariant)
+         return firstHasDesiredVariant;
+ 
++    // We need to check font-variant css property for CSS2.1 compatibility.
+     if ((desiredTraitsMaskForComparison & FontVariantSmallCapsMask) && !first->isLocalFallback() && !second->isLocalFallback()) {
+         // Prefer a font that has indicated that it can only support small-caps to a font that claims to support
+         // all variants.  The specialized font is more likely to be true small-caps and not require synthesis.
+@@ -449,12 +418,11 @@ static inline bool compareFontFaces(CSSFontFace* first, CSSFontFace* second)
+     if (firstTraitsMask & desiredTraitsMaskForComparison & FontWeightMask)
+         return true;
+ 
+-    // http://www.w3.org/TR/2002/WD-css3-webfonts-20020802/#q46 says: "If there are fewer then 9 weights in the family, the default algorithm
+-    // for filling the "holes" is as follows. If '500' is unassigned, it will be assigned the same font as '400'. If any of the values '600',
+-    // '700', '800', or '900' remains unassigned, they are assigned to the same face as the next darker assigned keyword, if any, or the next
+-    // lighter one otherwise. If any of '300', '200', or '100' remains unassigned, it is assigned to the next lighter assigned keyword, if any,
+-    // or the next darker otherwise."
+-    // For '400', we made up our own rule (which then '500' follows).
++    // http://www.w3.org/TR/2011/WD-css3-fonts-20111004/#font-matching-algorithm says :
++    //   - If the desired weight is less than 400, weights below the desired weight are checked in descending order followed by weights above the desired weight in ascending order until a match is found.
++    //   - If the desired weight is greater than 500, weights above the desired weight are checked in ascending order followed by weights below the desired weight in descending order until a match is found.
++    //   - If the desired weight is 400, 500 is checked first and then the rule for desired weights less than 400 is used.
++    //   - If the desired weight is 500, 400 is checked first and then the rule for desired weights less than 400 is used.
+ 
+     static const unsigned fallbackRuleSets = 9;
+     static const unsigned rulesPerSet = 8;
+@@ -462,8 +430,8 @@ static inline bool compareFontFaces(CSSFontFace* first, CSSFontFace* second)
+         { FontWeight200Mask, FontWeight300Mask, FontWeight400Mask, FontWeight500Mask, FontWeight600Mask, FontWeight700Mask, FontWeight800Mask, FontWeight900Mask },
+         { FontWeight100Mask, FontWeight300Mask, FontWeight400Mask, FontWeight500Mask, FontWeight600Mask, FontWeight700Mask, FontWeight800Mask, FontWeight900Mask },
+         { FontWeight200Mask, FontWeight100Mask, FontWeight400Mask, FontWeight500Mask, FontWeight600Mask, FontWeight700Mask, FontWeight800Mask, FontWeight900Mask },
+-        { FontWeight500Mask, FontWeight300Mask, FontWeight600Mask, FontWeight200Mask, FontWeight700Mask, FontWeight100Mask, FontWeight800Mask, FontWeight900Mask },
+-        { FontWeight400Mask, FontWeight300Mask, FontWeight600Mask, FontWeight200Mask, FontWeight700Mask, FontWeight100Mask, FontWeight800Mask, FontWeight900Mask },
++        { FontWeight500Mask, FontWeight300Mask, FontWeight200Mask, FontWeight100Mask, FontWeight600Mask, FontWeight700Mask, FontWeight800Mask, FontWeight900Mask },
++        { FontWeight400Mask, FontWeight300Mask, FontWeight200Mask, FontWeight100Mask, FontWeight600Mask, FontWeight700Mask, FontWeight800Mask, FontWeight900Mask },
+         { FontWeight700Mask, FontWeight800Mask, FontWeight900Mask, FontWeight500Mask, FontWeight400Mask, FontWeight300Mask, FontWeight200Mask, FontWeight100Mask },
+         { FontWeight800Mask, FontWeight900Mask, FontWeight600Mask, FontWeight500Mask, FontWeight400Mask, FontWeight300Mask, FontWeight200Mask, FontWeight100Mask },
+         { FontWeight900Mask, FontWeight700Mask, FontWeight600Mask, FontWeight500Mask, FontWeight400Mask, FontWeight300Mask, FontWeight200Mask, FontWeight100Mask },
+diff --git a/src/3rdparty/webkit/Source/WebCore/css/CSSParser.cpp b/src/3rdparty/webkit/Source/WebCore/css/CSSParser.cpp
+index 641ae05e380..ff7cd0ec8eb 100644
+--- a/src/3rdparty/webkit/Source/WebCore/css/CSSParser.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/css/CSSParser.cpp
+@@ -1241,7 +1241,9 @@ bool CSSParser::parseValue(int propId, bool important)
+         break;
+ 
+     case CSSPropertyFontStyle:           // normal | italic | oblique | inherit
+-        return parseFontStyle(important);
++        if (id == CSSValueNormal || id == CSSValueItalic || id == CSSValueOblique)
++            validPrimitive = true;
++        break;
+ 
+     case CSSPropertyFontVariant:         // normal | small-caps | inherit
+         return parseFontVariant(important);
+@@ -1291,10 +1293,12 @@ bool CSSParser::parseValue(int propId, bool important)
+             break;
+         }
+         /* nobreak */
+-    case CSSPropertyOrphans:              // <integer> | inherit
+-    case CSSPropertyWidows:               // <integer> | inherit
+-        // ### not supported later on
+-        validPrimitive = (!id && validUnit(value, FInteger, false));
++    case CSSPropertyOrphans:              // <integer> | inherit | auto (We've added support for auto for backwards compatibility)
++    case CSSPropertyWidows:               // <integer> | inherit | auto (Ditto)
++        if (id == CSSValueAuto)
++            validPrimitive = true;
++        else
++            validPrimitive = (!id && validUnit(value, FInteger, false));
+         break;
+ 
+     case CSSPropertyLineHeight:          // normal | <number> | <length> | <percentage> | inherit
+@@ -3760,53 +3764,6 @@ PassRefPtr<CSSValueList> CSSParser::parseFontFamily()
+     return list.release();
+ }
+ 
+-bool CSSParser::parseFontStyle(bool important)
+-{
+-    RefPtr<CSSValueList> values;
+-    if (m_valueList->size() > 1)
+-        values = CSSValueList::createCommaSeparated();
+-    CSSParserValue* val;
+-    bool expectComma = false;
+-    while ((val = m_valueList->current())) {
+-        RefPtr<CSSPrimitiveValue> parsedValue;
+-        if (!expectComma) {
+-            expectComma = true;
+-            if (val->id == CSSValueNormal || val->id == CSSValueItalic || val->id == CSSValueOblique)
+-                parsedValue = primitiveValueCache()->createIdentifierValue(val->id);
+-            else if (val->id == CSSValueAll && !values) {
+-                // 'all' is only allowed in @font-face and with no other values. Make a value list to
+-                // indicate that we are in the @font-face case.
+-                values = CSSValueList::createCommaSeparated();
+-                parsedValue = primitiveValueCache()->createIdentifierValue(val->id);
+-            }
+-        } else if (val->unit == CSSParserValue::Operator && val->iValue == ',') {
+-            expectComma = false;
+-            m_valueList->next();
+-            continue;
+-        }
+-
+-        if (!parsedValue)
+-            return false;
+-
+-        m_valueList->next();
+-
+-        if (values)
+-            values->append(parsedValue.release());
+-        else {
+-            addProperty(CSSPropertyFontStyle, parsedValue.release(), important);
+-            return true;
+-        }
+-    }
+-
+-    if (values && values->length()) {
+-        m_hasFontFaceOnlyValues = true;
+-        addProperty(CSSPropertyFontStyle, values.release(), important);
+-        return true;
+-    }
+-
+-    return false;
+-}
+-
+ bool CSSParser::parseFontVariant(bool important)
+ {
+     RefPtr<CSSValueList> values;
+@@ -3856,51 +3813,19 @@ bool CSSParser::parseFontVariant(bool important)
+ 
+ bool CSSParser::parseFontWeight(bool important)
+ {
+-    RefPtr<CSSValueList> values;
+-    if (m_valueList->size() > 1)
+-        values = CSSValueList::createCommaSeparated();
+-    CSSParserValue* val;
+-    bool expectComma = false;
+-    while ((val = m_valueList->current())) {
+-        RefPtr<CSSPrimitiveValue> parsedValue;
+-        if (!expectComma) {
+-            expectComma = true;
+-            if (val->unit == CSSPrimitiveValue::CSS_IDENT) {
+-                if (val->id >= CSSValueNormal && val->id <= CSSValue900)
+-                    parsedValue = primitiveValueCache()->createIdentifierValue(val->id);
+-                else if (val->id == CSSValueAll && !values) {
+-                    // 'all' is only allowed in @font-face and with no other values. Make a value list to
+-                    // indicate that we are in the @font-face case.
+-                    values = CSSValueList::createCommaSeparated();
+-                    parsedValue = primitiveValueCache()->createIdentifierValue(val->id);
+-                }
+-            } else if (validUnit(val, FInteger | FNonNeg, false)) {
+-                int weight = static_cast<int>(val->fValue);
+-                if (!(weight % 100) && weight >= 100 && weight <= 900)
+-                    parsedValue = primitiveValueCache()->createIdentifierValue(CSSValue100 + weight / 100 - 1);
+-            }
+-        } else if (val->unit == CSSParserValue::Operator && val->iValue == ',') {
+-            expectComma = false;
+-            m_valueList->next();
+-            continue;
+-        }
+-
+-        if (!parsedValue)
+-            return false;
+-
+-        m_valueList->next();
++    if (m_valueList->size() != 1)
++        return false;
+ 
+-        if (values)
+-            values->append(parsedValue.release());
+-        else {
+-            addProperty(CSSPropertyFontWeight, parsedValue.release(), important);
+-            return true;
+-        }
++    CSSParserValue* value = m_valueList->current();
++    if ((value->id >= CSSValueNormal) && (value->id <= CSSValue900)) {
++        addProperty(CSSPropertyFontWeight, primitiveValueCache()->createIdentifierValue(value->id), important);
++        return true;
+     }
+ 
+-    if (values && values->length()) {
+-        m_hasFontFaceOnlyValues = true;
+-        addProperty(CSSPropertyFontWeight, values.release(), important);
++    if (validUnit(value, FInteger | FNonNeg, false)) {
++        int weight = static_cast<int>(value->fValue);
++            if (!(weight % 100) && weight >= 100 && weight <= 900)
++                addProperty(CSSPropertyFontWeight, primitiveValueCache()->createIdentifierValue(CSSValue100 + weight / 100 - 1), important);
+         return true;
+     }
+ 
+@@ -6339,7 +6264,7 @@ CSSRule* CSSParser::createFontFaceRule()
+     for (unsigned i = 0; i < m_numParsedProperties; ++i) {
+         CSSProperty* property = m_parsedProperties[i];
+         int id = property->id();
+-        if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isPrimitiveValue()) {
++        if (id == CSSPropertyFontVariant && property->value()->isPrimitiveValue()) {
+             RefPtr<CSSValue> value = property->m_value.release();
+             property->m_value = CSSValueList::createCommaSeparated();
+             static_cast<CSSValueList*>(property->value())->append(value.release());
+@@ -6466,7 +6391,7 @@ void CSSParser::deleteFontFaceOnlyValues()
+     for (unsigned i = 0; i < m_numParsedProperties; ++i) {
+         CSSProperty* property = m_parsedProperties[i];
+         int id = property->id();
+-        if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isValueList()) {
++        if (id == CSSPropertyFontVariant && property->value()->isValueList()) {
+             delete property;
+             deletedProperties++;
+         } else if (deletedProperties)
+diff --git a/src/3rdparty/webkit/Source/WebCore/css/CSSParser.h b/src/3rdparty/webkit/Source/WebCore/css/CSSParser.h
+index 05243022623..0b8b6916add 100644
+--- a/src/3rdparty/webkit/Source/WebCore/css/CSSParser.h
++++ b/src/3rdparty/webkit/Source/WebCore/css/CSSParser.h
+@@ -140,7 +140,6 @@ namespace WebCore {
+ 
+         static bool parseColor(const String&, RGBA32& rgb, bool strict);
+ 
+-        bool parseFontStyle(bool important);
+         bool parseFontVariant(bool important);
+         bool parseFontWeight(bool important);
+         bool parseFontFaceSrc();
+diff --git a/src/3rdparty/webkit/Source/WebCore/css/CSSStyleSelector.cpp b/src/3rdparty/webkit/Source/WebCore/css/CSSStyleSelector.cpp
+index 7bb30d3c298..44f5d08830f 100644
+--- a/src/3rdparty/webkit/Source/WebCore/css/CSSStyleSelector.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/css/CSSStyleSelector.cpp
+@@ -4123,19 +4123,32 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
+     }
+     case CSSPropertyWidows:
+     {
+-        HANDLE_INHERIT_AND_INITIAL(widows, Widows)
+-        if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
++        if (isInherit) {
++            if (m_parentStyle->hasAutoWidows())
++                m_style->setHasAutoWidows();
++            else
++                m_style->setWidows(m_parentStyle->widows());
+             return;
+-        m_style->setWidows(primitiveValue->getIntValue());
++        } else if (isInitial || primitiveValue->getIdent() == CSSValueAuto) {
++            m_style->setHasAutoWidows();
++            return;
++        }
++        m_style->setWidows(static_cast<short>(primitiveValue->getIntValue()));
+         return;
+     }
+-        
+     case CSSPropertyOrphans:
+     {
+-        HANDLE_INHERIT_AND_INITIAL(orphans, Orphans)
+-        if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
++        if (isInherit) {
++            if (m_parentStyle->hasAutoOrphans())
++                m_style->setHasAutoOrphans();
++            else
++                m_style->setOrphans(m_parentStyle->widows());
+             return;
+-        m_style->setOrphans(primitiveValue->getIntValue());
++        } else if (isInitial || primitiveValue->getIdent() == CSSValueAuto) {
++            m_style->setHasAutoOrphans();
++            return;
++        }
++        m_style->setOrphans(static_cast<short>(primitiveValue->getIntValue()));
+         return;
+     }        
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/dom/DOMAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/dom/DOMAllInOne.cpp
+index 55674dfee91..7f855b70ef3 100644
+--- a/src/3rdparty/webkit/Source/WebCore/dom/DOMAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/dom/DOMAllInOne.cpp
+@@ -86,6 +86,7 @@
+ #include "MouseRelatedEvent.cpp"
+ #include "MutationEvent.cpp"
+ #include "NameNodeList.cpp"
++#include "Node.cpp"
+ #include "NodeFilter.cpp"
+ #include "NodeFilterCondition.cpp"
+ #include "NodeIterator.cpp"
+@@ -100,7 +101,6 @@
+ #include "PositionIterator.cpp"
+ #include "ProcessingInstruction.cpp"
+ #include "ProgressEvent.cpp"
+-#include "Range.cpp"
+ #include "RegisteredEventListener.cpp"
+ #include "ScopedEventQueue.cpp"
+ #include "ScriptElement.cpp"
+@@ -121,7 +121,6 @@
+ #include "Touch.cpp"
+ #include "TouchEvent.cpp"
+ #include "TouchList.cpp"
+-#include "TransformSourceLibxslt.cpp"
+ #include "Traversal.cpp"
+ #include "TreeScope.cpp"
+ #include "TreeWalker.cpp"
+@@ -135,4 +134,3 @@
+ #include "WheelEvent.cpp"
+ #include "WindowEventContext.cpp"
+ #include "XMLDocumentParser.cpp"
+-#include "XMLDocumentParserScope.cpp"
+diff --git a/src/3rdparty/webkit/Source/WebCore/editing/EditingAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/editing/EditingAllInOne.cpp
+index f38cbe62a60..9381c0ad177 100644
+--- a/src/3rdparty/webkit/Source/WebCore/editing/EditingAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/editing/EditingAllInOne.cpp
+@@ -61,8 +61,7 @@
+ #include <ReplaceSelectionCommand.cpp>
+ #include <SelectionController.cpp>
+ #include <SetNodeAttributeCommand.cpp>
+-#include <SmartReplace.cpp>
+-#include <SmartReplaceCF.cpp>
++#include <SmartReplaceICU.cpp>
+ #include <SpellingCorrectionController.cpp>
+ #include <SpellChecker.cpp>
+ #include <SplitElementCommand.cpp>
+diff --git a/src/3rdparty/webkit/Source/WebCore/features.pri b/src/3rdparty/webkit/Source/WebCore/features.pri
+index 612ed8a728e..ce8de529255 100644
+--- a/src/3rdparty/webkit/Source/WebCore/features.pri
++++ b/src/3rdparty/webkit/Source/WebCore/features.pri
+@@ -45,6 +45,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
+ !contains(DEFINES, ENABLE_DIRECTORY_UPLOAD=.): DEFINES += ENABLE_DIRECTORY_UPLOAD=0
+ !contains(DEFINES, ENABLE_FILE_SYSTEM=.): DEFINES += ENABLE_FILE_SYSTEM=0
+ !contains(DEFINES, ENABLE_QUOTA=.): DEFINES += ENABLE_QUOTA=0 
++!contains(DEFINES, ENABLE_ZLIB=.): DEFINES += ENABLE_ZLIB=1
+ 
+ # turn on SQLITE support if any of the dependent features are turned on
+ !contains(DEFINES, ENABLE_SQLITE=.) {
+diff --git a/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.cpp b/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.cpp
+index 0a66d056d15..c3c6fb35685 100644
+--- a/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.cpp
+@@ -129,7 +129,7 @@ bool JSCanvasRenderingContext2DConstructor::getOwnPropertyDescriptor(ExecState*
+ #define THUNK_GENERATOR(generator)
+ #endif
+ 
+-static const HashTableValue JSCanvasRenderingContext2DPrototypeTableValues[45] =
++static const HashTableValue JSCanvasRenderingContext2DPrototypeTableValues[46] =
+ {
+     { "save", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSave), (intptr_t)0 THUNK_GENERATOR(0) },
+     { "restore", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionRestore), (intptr_t)0 THUNK_GENERATOR(0) },
+@@ -167,6 +167,7 @@ static const HashTableValue JSCanvasRenderingContext2DPrototypeTableValues[45] =
+     { "strokeText", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionStrokeText), (intptr_t)0 THUNK_GENERATOR(0) },
+     { "setStrokeColor", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor), (intptr_t)0 THUNK_GENERATOR(0) },
+     { "setFillColor", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetFillColor), (intptr_t)0 THUNK_GENERATOR(0) },
++    { "setLineDash", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionSetLineDash), (intptr_t)0 THUNK_GENERATOR(0) },
+     { "strokeRect", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionStrokeRect), (intptr_t)0 THUNK_GENERATOR(0) },
+     { "drawImage", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionDrawImage), (intptr_t)0 THUNK_GENERATOR(0) },
+     { "drawImageFromRect", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect), (intptr_t)0 THUNK_GENERATOR(0) },
+@@ -1147,6 +1148,15 @@ EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetFillC
+     return JSValue::encode(castedThis->setFillColor(exec));
+ }
+ 
++EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineDash(ExecState* exec)
++{
++    JSValue thisValue = exec->hostThisValue();
++    if (!thisValue.inherits(&JSCanvasRenderingContext2D::s_info))
++        return throwVMTypeError(exec);
++    JSCanvasRenderingContext2D* castedThis = static_cast<JSCanvasRenderingContext2D*>(asObject(thisValue));
++    return JSValue::encode(castedThis->setLineDash(exec));
++}
++
+ EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeRect(ExecState* exec)
+ {
+     JSValue thisValue = exec->hostThisValue();
+diff --git a/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.h b/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.h
+index c557645ca9f..7c40fca4b08 100644
+--- a/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.h
++++ b/src/3rdparty/webkit/Source/WebCore/generated/JSCanvasRenderingContext2D.h
+@@ -56,6 +56,7 @@ public:
+     JSC::JSValue strokeText(JSC::ExecState*);
+     JSC::JSValue setStrokeColor(JSC::ExecState*);
+     JSC::JSValue setFillColor(JSC::ExecState*);
++    JSC::JSValue setLineDash(JSC::ExecState*);
+     JSC::JSValue strokeRect(JSC::ExecState*);
+     JSC::JSValue drawImage(JSC::ExecState*);
+     JSC::JSValue drawImageFromRect(JSC::ExecState*);
+@@ -122,6 +123,7 @@ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionFil
+ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeText(JSC::ExecState*);
+ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetStrokeColor(JSC::ExecState*);
+ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetFillColor(JSC::ExecState*);
++JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionSetLineDash(JSC::ExecState*);
+ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionStrokeRect(JSC::ExecState*);
+ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawImage(JSC::ExecState*);
+ JSC::EncodedJSValue JSC_HOST_CALL jsCanvasRenderingContext2DPrototypeFunctionDrawImageFromRect(JSC::ExecState*);
+diff --git a/src/3rdparty/webkit/Source/WebCore/html/HTMLElementsAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/html/HTMLElementsAllInOne.cpp
+index 7fda8aafe04..ccb890fc37f 100644
+--- a/src/3rdparty/webkit/Source/WebCore/html/HTMLElementsAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/html/HTMLElementsAllInOne.cpp
+@@ -31,17 +31,14 @@
+ // This source file coalesces the HTML elements into a single object file to
+ // reduce bloat and allow us to link release builds on 32-bit Windows.
+ 
+-#include "HTMLAnchorElement.cpp"
+ #include "HTMLAppletElement.cpp"
+ #include "HTMLAreaElement.cpp"
+-#include "HTMLAudioElement.cpp"
+ #include "HTMLBRElement.cpp"
+ #include "HTMLBaseElement.cpp"
+ #include "HTMLBaseFontElement.cpp"
+ #include "HTMLBlockquoteElement.cpp"
+ #include "HTMLBodyElement.cpp"
+ #include "HTMLButtonElement.cpp"
+-#include "HTMLCanvasElement.cpp"
+ #include "HTMLDataListElement.cpp"
+ #include "HTMLDetailsElement.cpp"
+ #include "HTMLDListElement.cpp"
+@@ -72,26 +69,23 @@
+ #include "HTMLLinkElement.cpp"
+ #include "HTMLMapElement.cpp"
+ #include "HTMLMarqueeElement.cpp"
+-#include "HTMLMediaElement.cpp"
+ #include "HTMLMenuElement.cpp"
+ #include "HTMLMetaElement.cpp"
+ #include "HTMLMeterElement.cpp"
+ #include "HTMLModElement.cpp"
+-#include "HTMLNoScriptElement.cpp"
+ #include "HTMLOListElement.cpp"
+ #include "HTMLObjectElement.cpp"
+ #include "HTMLOptGroupElement.cpp"
+ #include "HTMLOptionElement.cpp"
++#include "HTMLOutputElement.cpp"
+ #include "HTMLParagraphElement.cpp"
+ #include "HTMLParamElement.cpp"
+-#include "HTMLPlugInElement.cpp"
+ #include "HTMLPlugInImageElement.cpp"
+ #include "HTMLPreElement.cpp"
+ #include "HTMLProgressElement.cpp"
+ #include "HTMLQuoteElement.cpp"
+ #include "HTMLScriptElement.cpp"
+ #include "HTMLSelectElement.cpp"
+-#include "HTMLSourceElement.cpp"
+ #include "HTMLStyleElement.cpp"
+ #include "HTMLSummaryElement.cpp"
+ #include "HTMLTableCaptionElement.cpp"
+@@ -104,4 +98,3 @@
+ #include "HTMLTextAreaElement.cpp"
+ #include "HTMLTitleElement.cpp"
+ #include "HTMLUListElement.cpp"
+-#include "HTMLVideoElement.cpp"
+diff --git a/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp b/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
+index d66075e4832..ab8f1118049 100644
+--- a/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
+@@ -74,7 +74,7 @@ PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document*
+     RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
+     if (optionalWidth)
+         image->setWidth(*optionalWidth);
+-    if (optionalHeight > 0)
++    if (optionalHeight)
+         image->setHeight(*optionalHeight);
+     return image.release();
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+index 453248498e7..902a9c925e2 100644
+--- a/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+@@ -1047,6 +1047,12 @@ void CanvasRenderingContext2D::fillRect(float x, float y, float width, float hei
+     didDraw(rect);
+ }
+ 
++void CanvasRenderingContext2D::setLineDash(DashArray lineDash, float dashOffset)
++{
++    GraphicsContext* c = drawingContext();
++    c->setLineDash(lineDash, dashOffset);
++}
++
+ void CanvasRenderingContext2D::strokeRect(float x, float y, float width, float height)
+ {
+     if (!validateRectForCanvas(x, y, width, height))
+diff --git a/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.h b/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
+index d95ef7471c6..21939b9d1ab 100644
+--- a/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
++++ b/src/3rdparty/webkit/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
+@@ -31,6 +31,7 @@
+ #include "Color.h"
+ #include "FloatSize.h"
+ #include "Font.h"
++#include "GraphicsContext.h"
+ #include "GraphicsTypes.h"
+ #include "Path.h"
+ #include "PlatformString.h"
+@@ -152,6 +153,7 @@ public:
+ 
+     void clearRect(float x, float y, float width, float height);
+     void fillRect(float x, float y, float width, float height);
++    void setLineDash(DashArray lineDash, float setLineDash);
+     void strokeRect(float x, float y, float width, float height);
+     void strokeRect(float x, float y, float width, float height, float lineWidth);
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/Source/WebCore/page/FrameView.cpp
+index ef72fb7c101..54ff69cc484 100644
+--- a/src/3rdparty/webkit/Source/WebCore/page/FrameView.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/page/FrameView.cpp
+@@ -1080,7 +1080,9 @@ void FrameView::adjustMediaTypeForPrinting(bool printing)
+     if (printing) {
+         if (m_mediaTypeWhenNotPrinting.isNull())
+             m_mediaTypeWhenNotPrinting = mediaType();
+-            setMediaType("print");
++
++        String mediaType = (m_frame && m_frame->settings())?m_frame->settings()->printingMediaType():"print";
++        setMediaType(mediaType);
+     } else {
+         if (!m_mediaTypeWhenNotPrinting.isNull())
+             setMediaType(m_mediaTypeWhenNotPrinting);
+diff --git a/src/3rdparty/webkit/Source/WebCore/page/PrintContext.cpp b/src/3rdparty/webkit/Source/WebCore/page/PrintContext.cpp
+index 660ad11b9d2..443e500fd29 100644
+--- a/src/3rdparty/webkit/Source/WebCore/page/PrintContext.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/page/PrintContext.cpp
+@@ -26,6 +26,7 @@
+ #include "FrameView.h"
+ #include "RenderLayer.h"
+ #include "RenderView.h"
++#include "Settings.h"
+ #include <wtf/text/StringConcatenate.h>
+ 
+ namespace WebCore {
+@@ -82,9 +83,16 @@ void PrintContext::computePageRects(const FloatRect& printRect, float headerHeig
+     float pageWidth;
+     float pageHeight;
+     if (isHorizontal) {
+-        float ratio = printRect.height() / printRect.width();
+         pageWidth = view->docWidth();
+-        pageHeight = floorf(pageWidth * ratio);
++        ///NOTE: if we do not reuse the previously set logical page height,
++        ///      we can end up with off-by-one errors in the page height,
++        ///      leading to rendering issues (e.g. rows overlap pagebreaks)
++        if (view->pageLogicalHeight() == 0) {
++            float ratio = printRect.height() / printRect.width();
++            pageHeight = floorf(pageWidth * ratio);
++        } else {
++            pageHeight = view->pageLogicalHeight();
++        }
+     } else {
+         float ratio = printRect.width() / printRect.height();
+         pageHeight = view->docHeight();
+@@ -182,11 +190,21 @@ void PrintContext::begin(float width, float height)
+     // This function can be called multiple times to adjust printing parameters without going back to screen mode.
+     m_isPrinting = true;
+ 
+-    float minLayoutWidth = width * printingMinimumShrinkFactor;
+-    float minLayoutHeight = height * printingMinimumShrinkFactor;
++    float minimumShrinkFactor = m_frame->settings() ? 
++        m_frame->settings()->printingMinimumShrinkFactor() : 0.0f;
++    float maximumShrinkFactor = m_frame->settings() ? 
++        m_frame->settings()->printingMaximumShrinkFactor() : 0.0f;
++
++    if (maximumShrinkFactor < minimumShrinkFactor || minimumShrinkFactor <= 0.0f) {
++        minimumShrinkFactor = printingMinimumShrinkFactor;
++        maximumShrinkFactor = printingMaximumShrinkFactor;
++    }
++    
++    float minLayoutWidth = width * minimumShrinkFactor;
++    float minLayoutHeight = height * minimumShrinkFactor;
+ 
+     // This changes layout, so callers need to make sure that they don't paint to screen while in printing mode.
+-    m_frame->setPrinting(true, FloatSize(minLayoutWidth, minLayoutHeight), printingMaximumShrinkFactor / printingMinimumShrinkFactor, Frame::AdjustViewSize);
++    m_frame->setPrinting(true, FloatSize(minLayoutWidth, minLayoutHeight), maximumShrinkFactor / minimumShrinkFactor, Frame::AdjustViewSize);
+ }
+ 
+ float PrintContext::computeAutomaticScaleFactor(const FloatSize& availablePaperSize)
+diff --git a/src/3rdparty/webkit/Source/WebCore/page/PrintContext.h b/src/3rdparty/webkit/Source/WebCore/page/PrintContext.h
+index aadff475fda..19f378e24ec 100644
+--- a/src/3rdparty/webkit/Source/WebCore/page/PrintContext.h
++++ b/src/3rdparty/webkit/Source/WebCore/page/PrintContext.h
+@@ -83,6 +83,8 @@ public:
+     // (pageSizeInPixels.height() + 1) * number-of-pages - 1
+     static void spoolAllPagesWithBoundaries(Frame*, GraphicsContext&, const FloatSize& pageSizeInPixels);
+ 
++public:
++    const Vector<IntRect> & getPageRects() const {return m_pageRects;}
+ protected:
+     Frame* m_frame;
+     Vector<IntRect> m_pageRects;
+diff --git a/src/3rdparty/webkit/Source/WebCore/page/Settings.cpp b/src/3rdparty/webkit/Source/WebCore/page/Settings.cpp
+index 2025bd04de7..54142466232 100644
+--- a/src/3rdparty/webkit/Source/WebCore/page/Settings.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/page/Settings.cpp
+@@ -87,6 +87,7 @@ static EditingBehaviorType editingBehaviorTypeForPlatform()
+ 
+ Settings::Settings(Page* page)
+     : m_page(page)
++    , m_printingMediaType("print")
+     , m_editableLinkBehavior(EditableLinkDefaultBehavior)
+     , m_textDirectionSubmenuInclusionBehavior(TextDirectionSubmenuAutomaticallyIncluded)
+     , m_passwordEchoDurationInSeconds(1)
+@@ -184,6 +185,8 @@ Settings::Settings(Page* page)
+     , m_allowDisplayOfInsecureContent(true)
+     , m_allowRunningOfInsecureContent(true)
+     , m_passwordEchoEnabled(false)
++    , m_printingMinimumShrinkFactor(0.0)
++    , m_printingMaximumShrinkFactor(0.0)
+ {
+     // A Frame may not have been created yet, so we initialize the AtomicString 
+     // hash before trying to use it.
+@@ -569,6 +572,11 @@ void Settings::setApplicationChromeMode(bool mode)
+     m_inApplicationChromeMode = mode;
+ }
+ 
++void Settings::setPrintingMediaType(const String& type)
++{
++    m_printingMediaType = type;
++}
++
+ void Settings::setOfflineWebApplicationCacheEnabled(bool enabled)
+ {
+     m_offlineWebApplicationCacheEnabled = enabled;
+@@ -744,4 +752,15 @@ void Settings::setTiledBackingStoreEnabled(bool enabled)
+ #endif
+ }
+ 
++void Settings::setPrintingMinimumShrinkFactor(float printingMinimumShrinkFactor)
++{
++    m_printingMinimumShrinkFactor = printingMinimumShrinkFactor;
++}    
++
++void Settings::setPrintingMaximumShrinkFactor(float printingMaximumShrinkFactor)
++{
++    m_printingMaximumShrinkFactor = printingMaximumShrinkFactor;
++}    
++
++
+ } // namespace WebCore
+diff --git a/src/3rdparty/webkit/Source/WebCore/page/Settings.h b/src/3rdparty/webkit/Source/WebCore/page/Settings.h
+index 1d2a1386099..d827693a95c 100644
+--- a/src/3rdparty/webkit/Source/WebCore/page/Settings.h
++++ b/src/3rdparty/webkit/Source/WebCore/page/Settings.h
+@@ -258,6 +258,9 @@ namespace WebCore {
+         void setApplicationChromeMode(bool);
+         bool inApplicationChromeMode() const { return m_inApplicationChromeMode; }
+ 
++        void setPrintingMediaType(const String&);
++        const String& printingMediaType() const { return m_printingMediaType; }
++
+         void setOfflineWebApplicationCacheEnabled(bool);
+         bool offlineWebApplicationCacheEnabled() const { return m_offlineWebApplicationCacheEnabled; }
+ 
+@@ -349,6 +352,12 @@ namespace WebCore {
+         
+         void setTiledBackingStoreEnabled(bool);
+         bool tiledBackingStoreEnabled() const { return m_tiledBackingStoreEnabled; }
++	
++        void setPrintingMinimumShrinkFactor(float);
++        float printingMinimumShrinkFactor() const { return m_printingMinimumShrinkFactor; }
++	
++        void setPrintingMaximumShrinkFactor(float);
++        float printingMaximumShrinkFactor() const { return m_printingMaximumShrinkFactor; }
+ 
+         void setPaginateDuringLayoutEnabled(bool flag) { m_paginateDuringLayoutEnabled = flag; }
+         bool paginateDuringLayoutEnabled() const { return m_paginateDuringLayoutEnabled; }
+@@ -419,6 +428,7 @@ namespace WebCore {
+         String m_defaultTextEncodingName;
+         String m_ftpDirectoryTemplatePath;
+         String m_localStorageDatabasePath;
++        String m_printingMediaType;
+         KURL m_userStyleSheetLocation;
+         AtomicString m_standardFontFamily;
+         AtomicString m_fixedFontFamily;
+@@ -429,6 +439,8 @@ namespace WebCore {
+         EditableLinkBehavior m_editableLinkBehavior;
+         TextDirectionSubmenuInclusionBehavior m_textDirectionSubmenuInclusionBehavior;
+         double m_passwordEchoDurationInSeconds;
++        float m_printingMinimumShrinkFactor;
++        float m_printingMaximumShrinkFactor;
+         int m_minimumFontSize;
+         int m_minimumLogicalFontSize;
+         int m_defaultFontSize;
+diff --git a/src/3rdparty/webkit/Source/WebCore/page/animation/AnimationBase.cpp b/src/3rdparty/webkit/Source/WebCore/page/animation/AnimationBase.cpp
+index 00a15e82f83..b04a8f99b08 100644
+--- a/src/3rdparty/webkit/Source/WebCore/page/animation/AnimationBase.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/page/animation/AnimationBase.cpp
+@@ -656,6 +656,8 @@ void AnimationBase::ensurePropertyMap()
+         gPropertyWrappers->append(new PropertyWrapper<short>(CSSPropertyWebkitBorderHorizontalSpacing, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing));
+         gPropertyWrappers->append(new PropertyWrapper<short>(CSSPropertyWebkitBorderVerticalSpacing, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing));
+         gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyZIndex, &RenderStyle::zIndex, &RenderStyle::setZIndex));
++        gPropertyWrappers->append(new PropertyWrapper<short>(CSSPropertyOrphans, &RenderStyle::orphans, &RenderStyle::setOrphans));
++        gPropertyWrappers->append(new PropertyWrapper<short>(CSSPropertyWidows, &RenderStyle::widows, &RenderStyle::setWidows));
+         gPropertyWrappers->append(new PropertyWrapper<Length>(CSSPropertyLineHeight, &RenderStyle::lineHeight, &RenderStyle::setLineHeight));
+         gPropertyWrappers->append(new PropertyWrapper<int>(CSSPropertyOutlineOffset, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset));
+         gPropertyWrappers->append(new PropertyWrapper<unsigned short>(CSSPropertyOutlineWidth, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth));
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
+index 31966d7ea5b..505abc8cd90 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCacheQt.cpp
+@@ -35,6 +35,7 @@
+ #include <wtf/text/StringHash.h>
+ 
+ #include <QFont>
++#include <QFontDatabase>
+ #if HAVE(QRAWFONT)
+ #include <QTextLayout>
+ #endif
+@@ -106,6 +107,10 @@ void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)
+ 
+ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
+ {
++    QFontDatabase db;
++    if (!db.hasFamily(familyName))
++        return 0;
++
+     return new FontPlatformData(fontDescription, familyName);
+ }
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
+index 3996d223b98..d880f732568 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformData.h
+@@ -43,9 +43,11 @@ public:
+ 
+     // for use with QFontDatabase::addApplicationFont/removeApplicationFont
+     int m_handle;
++    bool m_italic;
++    bool m_bold;
+ 
+-    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontOrientation = Horizontal, TextOrientation = TextOrientationVerticalRight,
+-                                      FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
++    FontPlatformData fontPlatformData(int size, bool syntheticBold, bool syntheticItalic, FontOrientation = Horizontal, 
++        TextOrientation = TextOrientationVerticalRight, FontWidthVariant = RegularWidth, FontRenderingMode = NormalRenderingMode);
+ 
+     static bool supportsFormat(const String&);
+ };
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
+index 20f161a8f21..0ce1563d53e 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontCustomPlatformDataQt.cpp
+@@ -24,7 +24,9 @@
+ 
+ #include "FontPlatformData.h"
+ #include "SharedBuffer.h"
++#include "WOFFFileFormat.h"
+ #include <QFontDatabase>
++#include <QMap>
+ #include <QStringList>
+ 
+ namespace WebCore {
+@@ -34,36 +36,113 @@ FontCustomPlatformData::~FontCustomPlatformData()
+     QFontDatabase::removeApplicationFont(m_handle);
+ }
+ 
+-FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
++FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool syntheticBold, bool syntheticItalic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)
+ {
++    // Note that syntheticBold and syntheticItalic are only set by CSSFontSelector
++    // (the sole user of this class) if the markup has requested bold or italic
++    // (e.g. <i>text</i>) but the @font-face rule for the font does not specify support
++    // for it (e.g. @font-face { font-family: "font"; font-style: normal;).
++
+     QFont font;
+-    font.setFamily(QFontDatabase::applicationFontFamilies(m_handle)[0]);
++    QFontDatabase db;
++    
++    QString family = QFontDatabase::applicationFontFamilies(m_handle)[0];
++    font.setFamily(family);
+     font.setPixelSize(size);
+-    if (bold)
++    if (m_bold || syntheticBold)
+         font.setWeight(QFont::Bold);
+-    font.setItalic(italic);
++    font.setItalic(m_italic || syntheticItalic);
+ 
+     return FontPlatformData(font);
+ }
+ 
++static QMap<QString, QStringList> currentStyles(const QStringList& families, const QFontDatabase& db)
++{
++    QMap<QString, QStringList> styles;
++    for (int i = 0; i < families.size(); ++i)
++        styles[families.at(i)].append(db.styles(families.at(i)));
++    return styles;
++}
++
++static QStringList stylesAddedByFont(const QString& familyAdded, const QStringList& stylesAdded, const QMap<QString, QStringList>& styles)
++{
++    QStringList newStyles = stylesAdded;
++    for (int i = 0; i < styles[familyAdded].size(); ++i)
++        newStyles.removeAll(styles[familyAdded].at(i));
++    return newStyles;
++}
++
++static bool strictlyItalicAddedByFont(const QString& familyAdded, const QStringList& stylesAdded, const QFontDatabase& db)
++{
++    bool italic = false;
++    for (int i = 0; i < stylesAdded.size(); ++i) {
++        if (db.italic(familyAdded, stylesAdded.at(i))) {
++            italic = true;
++        } else if (!db.bold(familyAdded, stylesAdded.at(i)))
++            return false;
++    }
++    return italic;
++}
++
++static bool strictlyBoldAddedByFont(const QString& familyAdded, const QStringList& stylesAdded, const QFontDatabase& db)
++{
++    bool bold = false;
++    for (int i = 0; i < stylesAdded.size(); ++i) {
++        if (db.bold(familyAdded, stylesAdded.at(i))) {
++            bold = true;
++        } else if (!db.italic(familyAdded, stylesAdded.at(i)))
++            return false;
++    }
++    return bold;
++}
++
+ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
+ {
+     ASSERT_ARG(buffer, buffer);
++    QFontDatabase db;
++
++    // The font families in the font database, and the styles in each,
++    // before we load the new font in buffer.
++    QStringList families = db.families();
++    QMap<QString, QStringList> styles = currentStyles(families, db);
++
++    RefPtr<SharedBuffer> sfntBuffer;
++    if (isWOFF(buffer)) {
++        Vector<char> sfnt;
++        if (!convertWOFFToSfnt(buffer, sfnt))
++            return 0;
++        sfntBuffer = SharedBuffer::adoptVector(sfnt);
++        buffer = sfntBuffer.get();
++    }
+ 
+     int id = QFontDatabase::addApplicationFontFromData(QByteArray(buffer->data(), buffer->size()));
+     if (id == -1)
+         return 0;
+ 
++    QString familyAdded = QFontDatabase::applicationFontFamilies(id)[0];
++    QStringList stylesAdded = db.styles(QFontDatabase::applicationFontFamilies(id)[0]);
++
++    // If we already had the family of which this font is a member then
++    // get the styles it added to the family
++    if (families.contains(familyAdded))
++        stylesAdded = stylesAddedByFont(familyAdded, stylesAdded, styles);
++
+     Q_ASSERT(QFontDatabase::applicationFontFamilies(id).size() > 0);
+ 
+     FontCustomPlatformData *data = new FontCustomPlatformData;
+     data->m_handle = id;
++
++    // If we have created a font that only has bold or italic styles (or both)
++    // then we need to respect it's style(s) when we pass it back as
++    // FontPlatformData above.
++    data->m_italic = strictlyItalicAddedByFont(familyAdded, stylesAdded, db);
++    data->m_bold = strictlyBoldAddedByFont(familyAdded, stylesAdded, db);
+     return data;
+ }
+ 
+ bool FontCustomPlatformData::supportsFormat(const String& format)
+ {
+-    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype");
++    return equalIgnoringCase(format, "truetype") || equalIgnoringCase(format, "opentype") || equalIgnoringCase(format, "woff");
+ }
+ 
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformData.h b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformData.h
+index 88fd62737c2..efa9568b008 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformData.h
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformData.h
+@@ -36,6 +36,27 @@
+ 
+ namespace WebCore {
+ 
++static inline QFont::Weight toQFontWeight(FontWeight fontWeight)
++{
++    switch (fontWeight) {
++    case FontWeight100:
++    case FontWeight200:
++        return QFont::Light; // QFont::Light == Weight of 25
++    case FontWeight600:
++        return QFont::DemiBold; // QFont::DemiBold == Weight of 63
++    case FontWeight700:
++    case FontWeight800:
++        return QFont::Bold; // QFont::Bold == Weight of 75
++    case FontWeight900:
++        return QFont::Black; // QFont::Black == Weight of 87
++    case FontWeight300:
++    case FontWeight400:
++    case FontWeight500:
++    default:
++        return QFont::Normal; // QFont::Normal == Weight of 50
++    }
++}
++
+ class FontPlatformDataPrivate : public RefCounted<FontPlatformDataPrivate> {
+     WTF_MAKE_NONCOPYABLE(FontPlatformDataPrivate); WTF_MAKE_FAST_ALLOCATED;
+ public:
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+index c34887007db..864bcab574c 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+@@ -27,27 +27,6 @@
+ 
+ namespace WebCore {
+ 
+-static inline QFont::Weight toQFontWeight(FontWeight fontWeight)
+-{
+-    switch (fontWeight) {
+-    case FontWeight100:
+-    case FontWeight200:
+-        return QFont::Light; // QFont::Light == Weight of 25
+-    case FontWeight600:
+-        return QFont::DemiBold; // QFont::DemiBold == Weight of 63
+-    case FontWeight700:
+-    case FontWeight800:
+-        return QFont::Bold; // QFont::Bold == Weight of 75
+-    case FontWeight900:
+-        return QFont::Black; // QFont::Black == Weight of 87
+-    case FontWeight300:
+-    case FontWeight400:
+-    case FontWeight500:
+-    default:
+-        return QFont::Normal; // QFont::Normal == Weight of 50
+-    }
+-}
+-
+ static inline bool isEmptyValue(const float size, const bool bold, const bool oblique)
+ {
+      // this is the empty value by definition of the trait FontDataCacheKeyTraits
+@@ -73,7 +52,8 @@ FontPlatformData::FontPlatformData(const FontDescription& description, const Ato
+     font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
+     const bool smallCaps = description.smallCaps();
+     font.setCapitalization(smallCaps ? QFont::SmallCaps : QFont::MixedCase);
+-    font.setStyleStrategy(QFont::ForceIntegerMetrics);
++    // Commented out to work around webkit bug 93263
++    //font.setStyleStrategy(QFont::ForceIntegerMetrics);
+ 
+     m_data->bold = font.bold();
+     // WebKit allows font size zero but QFont does not. We will return
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontQt.cpp
+index c992efcefb8..1f77ec4a82a 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/FontQt.cpp
+@@ -27,6 +27,7 @@
+ #include "FontDescription.h"
+ #include "FontFallbackList.h"
+ #include "FontSelector.h"
++#include "FontPlatformData.h"
+ #if HAVE(QRAWFONT)
+ #include "GlyphBuffer.h"
+ #endif
+@@ -471,6 +472,8 @@ void Font::drawEmphasisMarksForSimpleText(GraphicsContext* /* context */, const
+ QFont Font::font() const
+ {
+     QFont f = primaryFont()->getQtFont();
++    f.setWeight(toQFontWeight(weight()));
++    f.setItalic(italic());
+     if (m_letterSpacing != 0)
+         f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
+     if (m_wordSpacing != 0)
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/ImageQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/ImageQt.cpp
+index 0c8ce9ed7b5..5ba54d0ddf9 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/ImageQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/qt/ImageQt.cpp
+@@ -41,6 +41,7 @@
+ #include "PlatformString.h"
+ #include "StillImageQt.h"
+ #include "qwebsettings.h"
++#include "SharedBuffer.h"
+ 
+ #include <QPixmap>
+ #include <QPainter>
+@@ -234,7 +235,8 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
+         }
+     }
+ 
+-    ctxt->platformContext()->drawPixmap(normalizedDst, *image, normalizedSrc);
++    QByteArray a = QByteArray::fromRawData(data()->data(), data()->size());
++    ctxt->platformContext()->drawPixmap(normalizedDst, *image, normalizedSrc, &a);
+ 
+     ctxt->setCompositeOperation(previousOperator);
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformScreenQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformScreenQt.cpp
+index 4db8bd1aa65..a6fc61c36e2 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformScreenQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/qt/PlatformScreenQt.cpp
+@@ -39,9 +39,34 @@
+ #include "QWebPageClient.h"
+ #include <QApplication>
+ #include <QDesktopWidget>
++#include <QByteArray>
+ 
+ namespace WebCore {
+ 
++static int wkhtmltox_screen_width()
++{
++    QByteArray override = qgetenv("WKHTMLTOX_SCREEN_WIDTH");
++
++    bool ok;
++    int width = override.toInt(&ok);
++    if (ok)
++        return qMax(320, qMin(7680, width));
++
++    return 1366; // default screen width
++}
++
++static int wkhtmltox_screen_height()
++{
++    QByteArray override = qgetenv("WKHTMLTOX_SCREEN_HEIGHT");
++
++    bool ok;
++    int height = override.toInt(&ok);
++    if (ok)
++        return qMax(240, qMin(4320, height));
++
++    return 768; // default screen height
++}
++
+ static int screenNumber(Widget* w)
+ {
+     if (!w)
+@@ -53,11 +78,17 @@ static int screenNumber(Widget* w)
+ 
+ int screenDepth(Widget* w)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return 32;
++
+     return QApplication::desktop()->screen(screenNumber(w))->depth();
+ }
+ 
+ int screenDepthPerComponent(Widget* w)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return 8;
++
+     int depth = QApplication::desktop()->screen(0)->depth();
+     if (w) {
+         QWebPageClient* client = w->root()->hostWindow()->platformPageClient();
+@@ -86,17 +117,26 @@ int screenDepthPerComponent(Widget* w)
+ 
+ bool screenIsMonochrome(Widget* w)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return false;
++
+     return QApplication::desktop()->screen(screenNumber(w))->colorCount() == 2;
+ }
+ 
+ FloatRect screenRect(Widget* w)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return FloatRect(0,0,wkhtmltox_screen_width(),wkhtmltox_screen_height());
++
+     QRect r = QApplication::desktop()->screenGeometry(screenNumber(w));
+     return FloatRect(r.x(), r.y(), r.width(), r.height());
+ }
+ 
+ FloatRect screenAvailableRect(Widget* w)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return FloatRect(0,0,wkhtmltox_screen_width(),wkhtmltox_screen_height());
++
+     QRect r = QApplication::desktop()->availableGeometry(screenNumber(w));
+     return FloatRect(r.x(), r.y(), r.width(), r.height());
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/qt/RenderThemeQt.cpp
+index f98df886ba7..b1fe30d0bec 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/qt/RenderThemeQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/qt/RenderThemeQt.cpp
+@@ -178,7 +178,13 @@ RenderThemeQt::RenderThemeQt(Page* page)
+     : RenderTheme()
+     , m_page(page)
+     , m_lineEdit(0)
++    , m_fallbackStyle(0)
+ {
++    if (QApplication::type() == QApplication::Tty) {
++        m_buttonFontFamily = "sans-serif";
++        return;
++    }
++
+     QPushButton button;
+     button.setAttribute(Qt::WA_MacSmallSize);
+     QFont defaultButtonFont = QApplication::font(&button);
+@@ -339,6 +345,9 @@ bool RenderThemeQt::supportsControlTints() const
+ 
+ int RenderThemeQt::findFrameLineWidth(QStyle* style) const
+ {
++    if (QApplication::type()==QApplication::Tty)
++        return 1;
++
+ #ifndef QT_NO_LINEEDIT
+     if (!m_lineEdit)
+         m_lineEdit = new QLineEdit();
+@@ -445,6 +454,9 @@ Color RenderThemeQt::systemColor(int cssValueId) const
+ 
+ int RenderThemeQt::minimumMenuListSize(RenderStyle*) const
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return 1;
++
+     const QFontMetrics &fm = QApplication::fontMetrics();
+     return fm.width(QLatin1Char('x'));
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/qt/ScreenQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/qt/ScreenQt.cpp
+index d648c5315fc..8ec41a0d2c8 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/qt/ScreenQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/qt/ScreenQt.cpp
+@@ -38,9 +38,36 @@
+ 
+ #include <QApplication>
+ #include <QDesktopWidget>
++#include <QByteArray>
+ 
+ namespace WebCore {
+ 
++static int wkhtmltox_screen_width()
++{
++    QByteArray override = qgetenv("WKHTMLTOX_SCREEN_WIDTH");
++
++    bool ok;
++    int width = override.toInt(&ok);
++    if (ok)
++        return qMax(320, qMin(7680, width));
++
++    return 1366; // default screen width
++}
++
++static int wkhtmltox_screen_height()
++{
++    QByteArray override = qgetenv("WKHTMLTOX_SCREEN_HEIGHT");
++
++    bool ok;
++    int height = override.toInt(&ok);
++    if (ok)
++        return qMax(240, qMin(4320, height));
++
++    return 768; // default screen width
++}
++
++
++
+ static QWidget* qwidgetForPage(const Page* page)
+ {
+     Frame* frame = (page ? page->mainFrame() : 0);
+@@ -54,6 +81,9 @@ static QWidget* qwidgetForPage(const Page* page)
+ 
+ FloatRect screenRect(const Page* page)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return FloatRect(0,0,wkhtmltox_screen_width(),wkhtmltox_screen_height());
++
+     QWidget* qw = qwidgetForPage(page);
+     if (!qw)
+         return FloatRect();
+@@ -68,6 +98,9 @@ FloatRect screenRect(const Page* page)
+ 
+ int screenDepth(const Page* page)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return 32;
++
+     QWidget* qw = qwidgetForPage(page);
+     if (!qw)
+         return 32;
+@@ -77,6 +110,9 @@ int screenDepth(const Page* page)
+ 
+ FloatRect usableScreenRect(const Page* page)
+ {
++    if (QApplication::type() == QApplication::Tty)
++        return FloatRect();
++
+     QWidget* qw = qwidgetForPage(page);
+     if (!qw)
+         return FloatRect();
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/qt/WidgetQt.cpp b/src/3rdparty/webkit/Source/WebCore/platform/qt/WidgetQt.cpp
+index 5215e666119..e0332795cae 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/qt/WidgetQt.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/platform/qt/WidgetQt.cpp
+@@ -41,6 +41,7 @@
+ #include "QWebPageClient.h"
+ #include "ScrollView.h"
+ 
++#include <QApplication>
+ #include <QCoreApplication>
+ #include <QDebug>
+ #include <QPaintEngine>
+@@ -78,6 +79,9 @@ void Widget::setFocus(bool focused)
+ void Widget::setCursor(const Cursor& cursor)
+ {
+ #ifndef QT_NO_CURSOR
++    if (QApplication::type() == QApplication::Tty)
++        return;
++
+     ScrollView* view = root();
+     if (!view)
+         return;
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/InlineFlowBox.h b/src/3rdparty/webkit/Source/WebCore/rendering/InlineFlowBox.h
+index 236371ac933..ca52cbcfd44 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/InlineFlowBox.h
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/InlineFlowBox.h
+@@ -46,6 +46,7 @@ public:
+         , m_includeLogicalLeftEdge(false)
+         , m_includeLogicalRightEdge(false)
+         , m_descendantsHaveSameLineHeightAndBaseline(true)
++        , m_isFirstAfterPageBreak(false)
+ #ifndef NDEBUG
+         , m_hasBadChildList(false)
+ #endif
+@@ -293,6 +294,7 @@ protected:
+     bool m_hasTextChildren : 1;
+     bool m_hasTextDescendants : 1;
+     bool m_descendantsHaveSameLineHeightAndBaseline : 1;
++    bool m_isFirstAfterPageBreak : 1;
+ 
+ #ifndef NDEBUG
+     bool m_hasBadChildList;
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp
+index 4ad1bfe8cda..5fd713c813c 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.cpp
+@@ -2048,7 +2048,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
+     setLogicalTopForChild(child, logicalTopAfterClear, ApplyLayoutDelta);
+ 
+     // Now we have a final top position.  See if it really does end up being different from our estimate.
+-    if (logicalTopAfterClear != logicalTopEstimate) {
++    if (logicalTopAfterClear != logicalTopEstimate || (paginated && childRenderBlock && childRenderBlock->shouldBreakAtLineToAvoidWidow())) {
+         if (child->shrinkToAvoidFloats()) {
+             // The child's width depends on the line width.
+             // When the child shifts to clear an item, its width can
+@@ -2235,7 +2235,7 @@ void RenderBlock::markForPaginationRelayoutIfNeeded()
+     if (needsLayout())
+         return;
+ 
+-    if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(logicalTop()) != pageLogicalOffset()))
++    if (view()->layoutState()->pageLogicalHeightChanged() || (view()->layoutState()->pageLogicalHeight() && view()->layoutState()->pageLogicalOffset(logicalTop()) != pageLogicalOffset()) || shouldBreakAtLineToAvoidWidow())
+         setChildNeedsLayout(true, false);
+ }
+ 
+@@ -3234,6 +3234,8 @@ void RenderBlock::removeFloatingObjectsBelow(FloatingObject* lastFloat, int logi
+         floatingObjectSet.removeLast();
+         ASSERT(!curr->m_originatingLine);
+         delete curr;
++        if (floatingObjectSet.isEmpty())
++            break;
+         curr = floatingObjectSet.last();
+     }
+ }
+@@ -4156,6 +4158,10 @@ VisiblePosition RenderBlock::positionForPointWithInlineChildren(const IntPoint&
+             continue;
+         if (!firstRootBoxWithChildren)
+             firstRootBoxWithChildren = root;
++
++        if (root->isFirstAfterPageBreak() && pointInLogicalContents.y() < root->logicalTop())
++            break;
++
+         lastRootBoxWithChildren = root;
+ 
+         // check if this root line box is located at this y coordinate
+@@ -5717,6 +5723,23 @@ void RenderBlock::setPageLogicalOffset(int logicalOffset)
+     m_rareData->m_pageLogicalOffset = logicalOffset;
+ }
+ 
++void RenderBlock::setBreakAtLineToAvoidWidow(RootInlineBox* lineToBreak)
++{
++    ASSERT(lineToBreak);
++    if (!m_rareData)
++        m_rareData = adoptPtr(new RenderBlockRareData(this));
++    m_rareData->m_shouldBreakAtLineToAvoidWidow = true;
++    m_rareData->m_lineBreakToAvoidWidow = lineToBreak;
++}
++
++void RenderBlock::clearShouldBreakAtLineToAvoidWidow() const
++{
++    if (!m_rareData)
++        return;
++    m_rareData->m_shouldBreakAtLineToAvoidWidow = false;
++    m_rareData->m_lineBreakToAvoidWidow = 0;
++}
++
+ void RenderBlock::absoluteRects(Vector<IntRect>& rects, int tx, int ty)
+ {
+     // For blocks inside inlines, we go ahead and include margins so that we run right up to the
+@@ -6045,7 +6068,8 @@ int RenderBlock::applyAfterBreak(RenderBox* child, int logicalOffset, MarginInfo
+ 
+ int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins)
+ {
+-    bool isUnsplittable = child->isReplaced() || child->scrollsOverflow();
++    bool isUnsplittable = child->isReplaced() || child->scrollsOverflow() ||
++                          child->style()->pageBreakInside() == PBAVOID;
+     if (!isUnsplittable)
+         return logicalOffset;
+     int childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0);
+@@ -6090,20 +6114,26 @@ void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, int& d
+         layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight);
+     logicalOffset += delta;
+     lineBox->setPaginationStrut(0);
++    lineBox->setIsFirstAfterPageBreak(false);
+     if (!pageLogicalHeight || lineHeight > pageLogicalHeight)
+         return;
+     IntSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
+     int offset = isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
+     int remainingLogicalHeight = pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight;
+-    if (remainingLogicalHeight < lineHeight) {
++    if (remainingLogicalHeight < lineHeight || (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineBox)) {
++        if (shouldBreakAtLineToAvoidWidow() && lineBreakToAvoidWidow() == lineBox)
++            clearShouldBreakAtLineToAvoidWidow();
+         int totalLogicalHeight = lineHeight + max(0, logicalOffset);
+-        if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight && !isPositioned() && !isTableCell())
++        if (((lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight) || (!style()->hasAutoOrphans() && style()->orphans() >= lineCount()))
++            && !isPositioned() && !isTableCell())
+             setPaginationStrut(remainingLogicalHeight + max(0, logicalOffset));
+         else {
+             delta += remainingLogicalHeight;
+             lineBox->setPaginationStrut(remainingLogicalHeight);
++            lineBox->setIsFirstAfterPageBreak(true);
+         }
+-    }  
++    } else if (remainingLogicalHeight == pageLogicalHeight && lineBox != firstRootBox())
++        lineBox->setIsFirstAfterPageBreak(true);
+ }
+ 
+ int RenderBlock::collapsedMarginBeforeForChild(RenderBox* child) const
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.h b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.h
+index 6e420ca0232..28c333235b6 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.h
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlock.h
+@@ -169,7 +169,12 @@ public:
+ 
+     int paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : 0; }
+     void setPaginationStrut(int);
+-    
++
++    bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m_shouldBreakAtLineToAvoidWidow; }
++    void clearShouldBreakAtLineToAvoidWidow() const;
++    RootInlineBox* lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBreakToAvoidWidow : 0; }
++    void setBreakAtLineToAvoidWidow(RootInlineBox*);
++
+     // The page logical offset is the object's offset from the top of the page in the page progression
+     // direction (so an x-offset in vertical text and a y-offset for horizontal text).
+     int pageLogicalOffset() const { return m_rareData ? m_rareData->m_pageLogicalOffset : 0; }
+@@ -785,6 +790,8 @@ private:
+             : m_margins(positiveMarginBeforeDefault(block), negativeMarginBeforeDefault(block), positiveMarginAfterDefault(block), negativeMarginAfterDefault(block))
+             , m_paginationStrut(0)
+             , m_pageLogicalOffset(0)
++            , m_shouldBreakAtLineToAvoidWidow(false)
++            , m_lineBreakToAvoidWidow(0)
+         { 
+         }
+ 
+@@ -809,6 +816,9 @@ private:
+         MarginValues m_margins;
+         int m_paginationStrut;
+         int m_pageLogicalOffset;
++
++        bool m_shouldBreakAtLineToAvoidWidow;
++        RootInlineBox* m_lineBreakToAvoidWidow;
+      };
+ 
+     OwnPtr<RenderBlockRareData> m_rareData;
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+index 2e928018c74..974773cc8b6 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlockLineLayout.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+@@ -34,6 +34,7 @@
+ #include "RenderListMarker.h"
+ #include "RenderRubyRun.h"
+ #include "RenderView.h"
++#include "RenderTableRow.h"
+ #include "Settings.h"
+ #include "TextBreakIterator.h"
+ #include "TextRun.h"
+@@ -816,6 +817,15 @@ RootInlineBox* RenderBlock::createLineBoxesFromBidiRuns(BidiRunList<BidiRun>& bi
+     return lineBox;
+ }
+ 
++static inline bool isTableCellWithPageBreakInsideAvoid(RenderBlock *block)
++{
++    if (!block->isTableCell())
++        return false;
++
++    RenderTableRow *row = toRenderTableRow(block->parent());
++    return row && row->style()->pageBreakInside() == PBAVOID;
++}
++
+ void RenderBlock::layoutRunsAndFloats(bool fullLayout, bool hasInlineChild, Vector<FloatWithRect>& floats, int& repaintLogicalTop, int& repaintLogicalBottom)
+ {
+     // We want to skip ahead to the first dirty line
+@@ -956,7 +966,8 @@ void RenderBlock::layoutRunsAndFloats(bool fullLayout, bool hasInlineChild, Vect
+                     repaintLogicalBottom = max(repaintLogicalBottom, lineBox->logicalBottomVisualOverflow());
+                 }
+ 
+-                if (paginated) {
++                // table cell pagination in case of page-break-inside: avoid is handled in RenderTableSection
++                if (paginated && !isTableCellWithPageBreakInsideAvoid(this)) {
+                     int adjustment = 0;
+                     adjustLinePositionForPagination(lineBox, adjustment);
+                     if (adjustment) {
+@@ -1013,6 +1024,63 @@ void RenderBlock::layoutRunsAndFloats(bool fullLayout, bool hasInlineChild, Vect
+         resolver.setPosition(end);
+     }
+ 
++    if (paginated && !style()->hasAutoWidows()) {
++        // Check the line boxes to make sure we didn't create unacceptable widows.
++        // However, we'll prioritize orphans - so nothing we do here should create
++        // a new orphan.
++
++        RootInlineBox* lineBox = lastRootBox();
++
++        // Count from the end of the block backwards, to see how many hanging
++        // lines we have.
++        RootInlineBox* firstLineInBlock = firstRootBox();
++        int numLinesHanging = 1;
++        while (lineBox && lineBox != firstLineInBlock && !lineBox->isFirstAfterPageBreak()) {
++            ++numLinesHanging;
++            lineBox = lineBox->prevRootBox();
++        }
++
++        // If there were no breaks in the block, we didn't create any widows.
++        if (!lineBox || !lineBox->isFirstAfterPageBreak() || lineBox == firstLineInBlock)
++            return;
++
++        if (numLinesHanging < style()->widows()) {
++            // We have detected a widow. Now we need to work out how many
++            // lines there are on the previous page, and how many we need
++            // to steal.
++            int numLinesNeeded = style()->widows() - numLinesHanging;
++            RootInlineBox* currentFirstLineOfNewPage = lineBox;
++
++            // Count the number of lines in the previous page.
++            lineBox = lineBox->prevRootBox();
++            int numLinesInPreviousPage = 1;
++            while (lineBox && lineBox != firstLineInBlock && !lineBox->isFirstAfterPageBreak()) {
++                ++numLinesInPreviousPage;
++                lineBox = lineBox->prevRootBox();
++            }
++
++            // If there was an explicit value for orphans, respect that. If not, we still
++            // shouldn't create a situation where we make an orphan bigger than the initial value.
++            // This means that setting widows implies we also care about orphans, but given
++            // the specification says the initial orphan value is non-zero, this is ok. The
++            // author is always free to set orphans explicitly as well.
++            int orphans = style()->hasAutoOrphans() ? style()->initialOrphans() : style()->orphans();
++            int numLinesAvailable = numLinesInPreviousPage - orphans;
++            if (numLinesAvailable <= 0)
++                return;
++
++            int numLinesToTake = min(numLinesAvailable, numLinesNeeded);
++            // Wind back from our first widowed line.
++            lineBox = currentFirstLineOfNewPage;
++            for (int i = 0; i < numLinesToTake; ++i)
++                lineBox = lineBox->prevRootBox();
++
++            // We now want to break at this line. Remember for next layout and trigger relayout.
++            setBreakAtLineToAvoidWidow(lineBox);
++            markLinesDirtyInBlockRange(lastRootBox()->lineBottom(), lineBox->lineBottom(), lineBox);
++        }
++    }
++
+     if (endLine) {
+         if (endLineMatched) {
+             // Attach all the remaining lines, and then adjust their y-positions as needed.
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp
+index 73b08015e1a..a439f6263a6 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTable.cpp
+@@ -37,6 +37,7 @@
+ #include "RenderLayer.h"
+ #include "RenderTableCell.h"
+ #include "RenderTableCol.h"
++#include "RenderTableRow.h"
+ #include "RenderTableSection.h"
+ #include "RenderView.h"
+ 
+@@ -63,7 +64,7 @@ RenderTable::RenderTable(Node* node)
+     setChildrenInline(false);
+     m_columnPos.fill(0, 2);
+     m_columns.fill(ColumnStruct(), 1);
+-    
++
+ }
+ 
+ RenderTable::~RenderTable()
+@@ -138,7 +139,7 @@ void RenderTable::addChild(RenderObject* child, RenderObject* beforeChild)
+                     m_head = toRenderTableSection(child);
+                 } else {
+                     resetSectionPointerIfNotBefore(m_firstBody, beforeChild);
+-                    if (!m_firstBody) 
++                    if (!m_firstBody)
+                         m_firstBody = toRenderTableSection(child);
+                 }
+                 wrapInAnonymousSection = false;
+@@ -203,7 +204,7 @@ void RenderTable::addChild(RenderObject* child, RenderObject* beforeChild)
+ void RenderTable::removeChild(RenderObject* oldChild)
+ {
+     RenderBox::removeChild(oldChild);
+-    
++
+     if (m_caption && oldChild == m_caption && node())
+         node()->setNeedsStyleRecalc();
+     setNeedsSectionRecalc();
+@@ -232,10 +233,10 @@ void RenderTable::computeLogicalWidth()
+             marginTotal += style()->marginStart().calcValue(availableLogicalWidth);
+         if (!style()->marginEnd().isAuto())
+             marginTotal += style()->marginEnd().calcValue(availableLogicalWidth);
+-            
++
+         // Subtract out our margins to get the available content width.
+         int availableContentLogicalWidth = max(0, containerWidthInInlineDirection - marginTotal);
+-        
++
+         // Ensure we aren't bigger than our max width or smaller than our min width.
+         setLogicalWidth(min(availableContentLogicalWidth, maxPreferredLogicalWidth()));
+     }
+@@ -273,7 +274,7 @@ void RenderTable::layout()
+         return;
+ 
+     recalcSectionsIfNeeded();
+-        
++
+     LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+     LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
+ 
+@@ -281,7 +282,7 @@ void RenderTable::layout()
+     m_overflow.clear();
+ 
+     initMaxMarginValues();
+-    
++
+     int oldLogicalWidth = logicalWidth();
+     computeLogicalWidth();
+ 
+@@ -302,11 +303,20 @@ void RenderTable::layout()
+ 
+     bool collapsing = collapseBorders();
+ 
++    // repeat header and footer on each page
++    int headHeight = 0;
++    int footHeight = 0;
+     for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+         if (child->isTableSection()) {
+             child->layoutIfNeeded();
+             RenderTableSection* section = toRenderTableSection(child);
+-            totalSectionLogicalHeight += section->calcRowLogicalHeight();
++            int rowHeight = section->calcRowLogicalHeight();
++            if (child == m_head) {
++                headHeight = rowHeight;
++            } else if (child == m_foot) {
++                footHeight = rowHeight;
++            }
++            totalSectionLogicalHeight += rowHeight;
+             if (collapsing)
+                 section->recalcOuterBorder();
+             ASSERT(!section->needsLayout());
+@@ -320,6 +330,34 @@ void RenderTable::layout()
+     if (m_caption)
+         m_caption->layoutIfNeeded();
+ 
++    // Bump table to next page if we can't fit the caption, thead and first body cell if first row has page-break-inside: avoid
++    setPaginationStrut(0);
++    if (view()->layoutState()->pageLogicalHeight()) {
++        LayoutState* layoutState = view()->layoutState();
++        const int pageLogicalHeight = layoutState->m_pageLogicalHeight;
++        const int remainingLogicalHeight = pageLogicalHeight - layoutState->pageLogicalOffset(0) % pageLogicalHeight;
++        if (remainingLogicalHeight > 0) {
++            int requiredHeight = headHeight;
++            if (m_caption && m_caption->style()->captionSide() != CAPBOTTOM) {
++                requiredHeight += m_caption->logicalHeight() + m_caption->marginBefore() + m_caption->marginAfter();
++            }
++            if (m_firstBody) {
++                // FIXME: Calculate maximum required height across all cells in first body row
++                if (m_firstBody->numRows() > 0 && m_firstBody->numColumns() > 0) {
++                    RenderTableCell* firstCell = m_firstBody->primaryCellAt(0, 0);
++                    if (firstCell) {
++                        RenderTableRow *firstRow = toRenderTableRow(firstCell->parent());
++                        if (firstRow && firstRow->style()->pageBreakInside() == PBAVOID)
++                            requiredHeight += firstCell->contentLogicalHeight() + firstCell->paddingTop(false) + firstCell->paddingBottom(false) + vBorderSpacing();
++                    }
++                }
++            }
++            if (requiredHeight > remainingLogicalHeight && requiredHeight < pageLogicalHeight) {
++                setPaginationStrut(remainingLogicalHeight);
++            }
++        }
++    }
++
+     // If any table section moved vertically, we will just repaint everything from that
+     // section down (it is quite unlikely that any of the following sections
+     // did not shift).
+@@ -352,12 +390,6 @@ void RenderTable::layout()
+         computedLogicalHeight = computePercentageLogicalHeight(logicalHeightLength);
+     computedLogicalHeight = max(0, computedLogicalHeight);
+ 
+-    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
+-        if (child->isTableSection())
+-            // FIXME: Distribute extra height between all table body sections instead of giving it all to the first one.
+-            toRenderTableSection(child)->layoutRows(child == m_firstBody ? max(0, computedLogicalHeight - totalSectionLogicalHeight) : 0);
+-    }
+-
+     if (!m_firstBody && computedLogicalHeight > totalSectionLogicalHeight && !document()->inQuirksMode()) {
+         // Completely empty tables (with no sections or anything) should at least honor specified height
+         // in strict mode.
+@@ -377,6 +409,9 @@ void RenderTable::layout()
+         }
+         section->setLogicalLocation(sectionLogicalLeft, logicalHeight());
+ 
++        // FIXME: Distribute extra height between all table body sections instead of giving it all to the first one.
++        section->layoutRows(section == m_firstBody ? max(0, computedLogicalHeight - totalSectionLogicalHeight) : 0, section == m_head ? 0 : headHeight, section == m_foot ? 0 : footHeight);
++
+         setLogicalHeight(logicalHeight() + section->logicalHeight());
+         section = sectionBelow(section);
+     }
+@@ -468,7 +503,7 @@ void RenderTable::paint(PaintInfo& paintInfo, int tx, int ty)
+             return;
+     }
+ 
+-    bool pushedClip = pushContentsClip(paintInfo, tx, ty);    
++    bool pushedClip = pushContentsClip(paintInfo, tx, ty);
+     paintObject(paintInfo, tx, ty);
+     if (pushedClip)
+         popContentsClip(paintInfo, paintPhase, tx, ty);
+@@ -488,7 +523,7 @@ void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty)
+     // We're done.  We don't bother painting any children.
+     if (paintPhase == PaintPhaseBlockBackground)
+         return;
+-    
++
+     // We don't paint our own background, but we do let the kids paint their backgrounds.
+     if (paintPhase == PaintPhaseChildBlockBackgrounds)
+         paintPhase = PaintPhaseChildBlockBackground;
+@@ -503,7 +538,92 @@ void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty)
+             child->paint(info, childPoint.x(), childPoint.y());
+         }
+     }
+-    
++
++    bool repaintedHead = false;
++    IntPoint repaintedHeadPoint;
++    bool repaintedFoot = false;
++    IntPoint repaintedFootPoint;
++    if (view()->pageLogicalHeight()) {
++        // re-paint header/footer if table is split over multiple pages
++        if (m_head) {
++            IntPoint childPoint = flipForWritingMode(m_head, IntPoint(tx, ty), ParentToChildFlippingAdjustment);
++            if (info.rect.y() > childPoint.y() + m_head->y()) {
++                repaintedHeadPoint = IntPoint(childPoint.x(), info.rect.y() - m_head->y());
++                repaintedHead = true;
++
++                RenderObject* headObj = dynamic_cast<RenderObject*>(m_head);
++                headObj->paint(info, repaintedHeadPoint.x(), repaintedHeadPoint.y());
++
++                RenderLayer* myLayer  = headObj->enclosingLayer();
++                if(myLayer){
++                    for (RenderObject* row = dynamic_cast<RenderObject*>(m_head)->firstChild(); row; row = row->nextSibling()) {
++                        if (row->isTableRow()) {
++                            for (RenderObject* cell = row->firstChild(); cell; cell = cell->nextSibling()) {
++                                if (cell->isTableCell()) {
++                                    for (RenderObject* contentObj = cell->firstChild(); contentObj; contentObj = contentObj->nextSibling()) {
++                                        if (contentObj->isBox()){
++
++                                            RenderLayer* currInnerLayer = contentObj->enclosingLayer();
++
++                                            if(currInnerLayer){
++                                                RenderBox* currContentBox = toRenderBox(contentObj);
++                                                RenderBox* currRowBox = toRenderBox(row);
++
++                                                int origY = currContentBox->y();
++                                                int newY = (repaintedHeadPoint.y()-ty)+(currRowBox->height()-currContentBox->height());
++
++                                                currContentBox->setY(newY);
++                                                currInnerLayer->updateLayerPosition();
++                                                myLayer->repaintIncludingDescendants();
++                                                currContentBox->setY(origY);
++                                            }
++                                        }
++                                    }
++                                }
++                            }
++                        }
++                    }
++                }
++            }
++        }
++        if (m_foot) {
++            IntPoint childPoint = flipForWritingMode(m_foot, IntPoint(tx, ty), ParentToChildFlippingAdjustment);
++            if (info.rect.y() + info.rect.height() < childPoint.y() + m_foot->y()) {
++                // find actual end of table on current page
++                int dy = 0;
++                const int max_dy = info.rect.y() + info.rect.height();
++                const int vspace = vBorderSpacing();
++                for (RenderObject* section = firstChild(); section; section = section->nextSibling()) {
++                    if (section->isTableSection()) {
++                        if (toRenderBox(section)->y() > max_dy) {
++                            continue;
++                        }
++                        int i = 0;
++                        for(RenderObject* row = section->firstChild(); row; row = row->nextSibling()) {
++                            if (!row->isTableRow()) {
++                                continue;
++                            }
++                            // get actual bottom-y position of this row - pretty complicated, how could this be simplified?
++                            // note how we have to take the rowPoint and section's y-offset into account, see e.g.
++                            // RenderTableSection::paint where this is also done...
++                            IntPoint rowPoint = flipForWritingMode(toRenderBox(row), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
++                            int row_dy = rowPoint.y() + toRenderBox(row)->y() + toRenderBox(row)->logicalHeight() + toRenderBox(section)->y();
++                            if (row_dy < max_dy && row_dy > dy) {
++                                dy = row_dy;
++                            } else if (row_dy > max_dy) {
++                                break;
++                            }
++                            i++;
++                        }
++                    }
++                }
++                repaintedFoot = true;
++                repaintedFootPoint = IntPoint(childPoint.x(), dy - m_foot->y());
++                dynamic_cast<RenderObject*>(m_foot)->paint(info, repaintedFootPoint.x(), repaintedFootPoint.y());
++            }
++        }
++    }
++
+     if (collapseBorders() && paintPhase == PaintPhaseChildBlockBackground && style()->visibility() == VISIBLE) {
+         // Collect all the unique border styles that we want to paint in a sorted list.  Once we
+         // have all the styles sorted, we then do individual passes, painting each style of border
+@@ -522,6 +642,12 @@ void RenderTable::paintObject(PaintInfo& paintInfo, int tx, int ty)
+             for (RenderObject* child = firstChild(); child; child = child->nextSibling())
+                 if (child->isTableSection()) {
+                     IntPoint childPoint = flipForWritingMode(toRenderTableSection(child), IntPoint(tx, ty), ParentToChildFlippingAdjustment);
++                    // also repaint borders of header/footer if required
++                    if (child == m_head && repaintedHead) {
++                        childPoint = repaintedHeadPoint;
++                    } else if (child == m_foot && repaintedFoot) {
++                        childPoint = repaintedFootPoint;
++                    }
+                     child->paint(info, childPoint.x(), childPoint.y());
+                 }
+         }
+@@ -560,7 +686,7 @@ void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
+     subtractCaptionRect(rect);
+ 
+     paintBoxShadow(paintInfo.context, rect.x(), rect.y(), rect.width(), rect.height(), style(), Normal);
+-    
++
+     if (isRoot())
+         paintRootBoxFillLayers(paintInfo);
+     else if (!isBody() || document()->documentElement()->renderer()->hasBackground())
+@@ -654,7 +780,7 @@ RenderTableCol* RenderTable::nextColElement(RenderTableCol* current) const
+             return 0;
+         next = next->nextSibling();
+     }
+-    
++
+     return 0;
+ }
+ 
+@@ -775,7 +901,7 @@ void RenderTable::recalcSections() const
+                 maxCols = sectionCols;
+         }
+     }
+-    
++
+     m_columns.resize(maxCols);
+     m_columnPos.resize(maxCols + 1);
+ 
+@@ -806,11 +932,11 @@ int RenderTable::calcBorderStart() const
+             if (gb.style() > BHIDDEN)
+                 borderWidth = max(borderWidth, static_cast<unsigned>(gb.width()));
+         }
+-        
++
+         RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
+         if (firstNonEmptySection && !firstNonEmptySection->numRows())
+             firstNonEmptySection = sectionBelow(firstNonEmptySection, true);
+-        
++
+         if (firstNonEmptySection) {
+             const BorderValue& sb = firstNonEmptySection->style()->borderStart();
+             if (sb.style() == BHIDDEN)
+@@ -820,7 +946,7 @@ int RenderTable::calcBorderStart() const
+                 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width()));
+ 
+             const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, 0);
+-            
++
+             if (cs.hasCells()) {
+                 const BorderValue& cb = cs.primaryCell()->style()->borderStart(); // FIXME: Make this work with perpendicualr and flipped cells.
+                 if (cb.style() == BHIDDEN)
+@@ -864,11 +990,11 @@ int RenderTable::calcBorderEnd() const
+             if (gb.style() > BHIDDEN)
+                 borderWidth = max(borderWidth, static_cast<unsigned>(gb.width()));
+         }
+-        
++
+         RenderTableSection* firstNonEmptySection = m_head ? m_head : (m_firstBody ? m_firstBody : m_foot);
+         if (firstNonEmptySection && !firstNonEmptySection->numRows())
+             firstNonEmptySection = sectionBelow(firstNonEmptySection, true);
+-        
++
+         if (firstNonEmptySection) {
+             const BorderValue& sb = firstNonEmptySection->style()->borderEnd();
+             if (sb.style() == BHIDDEN)
+@@ -878,7 +1004,7 @@ int RenderTable::calcBorderEnd() const
+                 borderWidth = max(borderWidth, static_cast<unsigned>(sb.width()));
+ 
+             const RenderTableSection::CellStruct& cs = firstNonEmptySection->cellAt(0, endColumn);
+-            
++
+             if (cs.hasCells()) {
+                 const BorderValue& cb = cs.primaryCell()->style()->borderEnd(); // FIXME: Make this work with perpendicular and flipped cells.
+                 if (cb.style() == BHIDDEN)
+@@ -1130,7 +1256,7 @@ RenderTableCell* RenderTable::cellBefore(const RenderTableCell* cell) const
+     int effCol = colToEffCol(cell->col());
+     if (!effCol)
+         return 0;
+-    
++
+     // If we hit a colspan back up to a real cell.
+     RenderTableSection::CellStruct& prevCell = section->cellAt(cell->row(), effCol - 1);
+     return prevCell.primaryCell();
+@@ -1175,7 +1301,7 @@ int RenderTable::firstLineBoxBaseline() const
+ IntRect RenderTable::overflowClipRect(int tx, int ty, OverlayScrollbarSizeRelevancy relevancy)
+ {
+     IntRect rect = RenderBlock::overflowClipRect(tx, ty, relevancy);
+-    
++
+     // If we have a caption, expand the clip to include the caption.
+     // FIXME: Technically this is wrong, but it's virtually impossible to fix this
+     // for real until captions have been re-written.
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp
+index 7d414a07dbc..43328c2cc9e 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.cpp
+@@ -414,7 +414,7 @@ void RenderTableSection::layout()
+     setNeedsLayout(false);
+ }
+ 
+-int RenderTableSection::layoutRows(int toAdd)
++int RenderTableSection::layoutRows(int toAdd, int headHeight, int footHeight)
+ {
+ #ifndef NDEBUG
+     setNeedsLayoutIsForbidden(true);
+@@ -496,12 +496,56 @@ int RenderTableSection::layoutRows(int toAdd)
+ 
+     LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), style()->isFlippedBlocksWritingMode());
+ 
++    // Calculate logical row heights
++    Vector<int> logicalRowHeights;
++    logicalRowHeights.resize(totalRows);
++    for (int r = 0; r < totalRows; r++) {
++        logicalRowHeights[r] = m_rowPos[r + 1] - m_rowPos[r] - vspacing;
++    }
++
++    // Make sure that cell contents do not overlap a page break
++    if (view()->layoutState()->pageLogicalHeight()) {
++        LayoutState* layoutState = view()->layoutState();
++        int pageLogicalHeight = layoutState->m_pageLogicalHeight;
++        int pageOffset = 0;
++
++        for (int r = 0; r < totalRows; ++r) {
++            m_rowPos[r] += pageOffset;
++            int remainingLogicalHeight = pageLogicalHeight - layoutState->pageLogicalOffset(m_rowPos[r]) % pageLogicalHeight;
++            int availableHeight = remainingLogicalHeight - footHeight - vspacing;
++            RenderTableRow* rowRenderer = m_grid[r].rowRenderer;
++            
++            int rowRequiredHeight = 0;
++
++            for (int c = 0; c < nEffCols; c++) {
++                CellStruct& cs = cellAt(r, c);
++                RenderTableCell* cell = cs.primaryCell();
++
++                if (!cell || cs.inColSpan || cell->row() != r || !rowRenderer || rowRenderer->style()->pageBreakInside() != PBAVOID)
++                    continue;
++
++                int cellRequiredHeight = cell->contentLogicalHeight() + cell->paddingTop(false) + cell->paddingBottom(false);
++                if( cellRequiredHeight > rowRequiredHeight ){
++                    rowRequiredHeight = cellRequiredHeight;
++                }
++            }
++            int requiredHeight = max(logicalRowHeights[r], rowRequiredHeight);
++            if (requiredHeight >= availableHeight && requiredHeight < pageLogicalHeight) {
++                pageOffset += remainingLogicalHeight + headHeight;
++                if (requiredHeight > availableHeight) {
++                    m_rowPos[r] += remainingLogicalHeight + headHeight;
++                }
++            }
++        }
++        m_rowPos[totalRows] += pageOffset;
++    }
++
+     for (int r = 0; r < totalRows; r++) {
+         // Set the row's x/y position and width/height.
+         if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
+             rowRenderer->setLocation(0, m_rowPos[r]);
+             rowRenderer->setLogicalWidth(logicalWidth());
+-            rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspacing);
++            rowRenderer->setLogicalHeight(logicalRowHeights[r]);
+             rowRenderer->updateLayerTransform();
+         }
+ 
+@@ -513,7 +557,11 @@ int RenderTableSection::layoutRows(int toAdd)
+                 continue;
+ 
+             rindx = cell->row();
+-            rHeight = m_rowPos[rindx + cell->rowSpan()] - m_rowPos[rindx] - vspacing;
++            if (cell->rowSpan() == 1) {
++                rHeight = logicalRowHeights[rindx];
++            } else {
++                rHeight = m_rowPos[rindx + cell->rowSpan()] - m_rowPos[rindx] - vspacing;
++            }
+             
+             // Force percent height children to lay themselves out again.
+             // This will cause these children to grow to fill the cell.
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h
+index db6edc2a7a0..9d912a08012 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderTableSection.h
+@@ -49,7 +49,7 @@ public:
+ 
+     void setCellLogicalWidths();
+     int calcRowLogicalHeight();
+-    int layoutRows(int logicalHeight);
++    int layoutRows(int logicalHeight, int headHeight, int footHeight);
+ 
+     RenderTable* table() const { return toRenderTable(parent()); }
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RenderingAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/RenderingAllInOne.cpp
+index afc42f14655..f216194abe6 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RenderingAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RenderingAllInOne.cpp
+@@ -35,7 +35,6 @@
+ #include "InlineFlowBox.cpp"
+ #include "InlineTextBox.cpp"
+ #include "LayoutState.cpp"
+-#include "PointerEventsHitRules.cpp"
+ #include "RenderApplet.cpp"
+ #include "RenderArena.cpp"
+ #include "RenderBR.cpp"
+@@ -68,8 +67,6 @@
+ #include "RenderListItem.cpp"
+ #include "RenderListMarker.cpp"
+ #include "RenderMarquee.cpp"
+-#include "RenderMedia.cpp"
+-#include "RenderMediaControls.cpp"
+ #include "RenderMenuList.cpp"
+ #include "RenderMeter.cpp"
+ #include "RenderObject.cpp"
+@@ -99,9 +96,7 @@
+ #include "RenderTextControlSingleLine.cpp"
+ #include "RenderTextFragment.cpp"
+ #include "RenderTheme.cpp"
+-#include "RenderThemeWin.cpp"
+ #include "RenderTreeAsText.cpp"
+-#include "RenderVideo.cpp"
+ #include "RenderView.cpp"
+ #include "RenderWidget.cpp"
+ #include "RenderWordBreak.cpp"
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/RootInlineBox.h b/src/3rdparty/webkit/Source/WebCore/rendering/RootInlineBox.h
+index 575a10db2bd..cf94af6f641 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/RootInlineBox.h
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/RootInlineBox.h
+@@ -53,6 +53,9 @@ public:
+     int paginationStrut() const { return m_paginationStrut; }
+     void setPaginationStrut(int s) { m_paginationStrut = s; }
+ 
++    bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; }
++    void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { m_isFirstAfterPageBreak = isFirstAfterPageBreak; }
++
+     int selectionTop() const;
+     int selectionBottom() const;
+     int selectionHeight() const { return max(0, selectionBottom() - selectionTop()); }
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/style/RenderStyle.h b/src/3rdparty/webkit/Source/WebCore/rendering/style/RenderStyle.h
+index 938b29760a5..8d52acc04e7 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/style/RenderStyle.h
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/style/RenderStyle.h
+@@ -637,6 +637,8 @@ public:
+ 
+     short widows() const { return rareInheritedData->widows; }
+     short orphans() const { return rareInheritedData->orphans; }
++    bool hasAutoWidows() const { return rareInheritedData->m_hasAutoWidows; }
++    bool hasAutoOrphans() const { return rareInheritedData->m_hasAutoOrphans; }
+     EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
+     EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags._page_break_before); }
+     EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags._page_break_after); }
+@@ -1011,8 +1013,10 @@ public:
+     int zIndex() const { return m_box->zIndex(); }
+     void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v) }
+ 
+-    void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); }
+-    void setOrphans(short o) { SET_VAR(rareInheritedData, orphans, o); }
++    void setHasAutoWidows() { SET_VAR(rareInheritedData, m_hasAutoWidows, true); SET_VAR(rareInheritedData, widows, initialWidows()) }
++    void setWidows(short w) { SET_VAR(rareInheritedData, m_hasAutoWidows, false); SET_VAR(rareInheritedData, widows, w); }
++    void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true); SET_VAR(rareInheritedData, orphans, initialOrphans()) }
++    void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, false); SET_VAR(rareInheritedData, orphans, o); }
+     void setPageBreakInside(EPageBreak b) { noninherited_flags._page_break_inside = b; }
+     void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
+     void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleAllInOne.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleAllInOne.cpp
+index 967fa000e76..2dd9dc99949 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleAllInOne.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleAllInOne.cpp
+@@ -32,8 +32,6 @@
+ #include "NinePieceImage.cpp"
+ #include "QuotesData.cpp"
+ #include "RenderStyle.cpp"
+-#include "SVGRenderStyle.cpp"
+-#include "SVGRenderStyleDefs.cpp"
+ #include "ShadowData.cpp"
+ #include "StyleBackgroundData.cpp"
+ #include "StyleBoxData.cpp"
+diff --git a/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleRareInheritedData.cpp b/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
+index c38461166bf..a7ece4fa356 100644
+--- a/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
+@@ -36,6 +36,8 @@ StyleRareInheritedData::StyleRareInheritedData()
<Skipped 3672 lines>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/wkhtmltopdf.git/commitdiff/0c8485594f929f5d39a8bf672e8c7e724cd7edc5



More information about the pld-cvs-commit mailing list