diff options
author | Philip A Reimer | 2015-06-12 22:07:45 -0600 |
---|---|---|
committer | Philip A Reimer | 2015-06-12 22:07:45 -0600 |
commit | 1a83c3d8763962187b9895c199b2c46aa4453c01 (patch) | |
tree | 0e1e7481dbf832c09e420c2874133ac2fcf85d59 | |
download | aur-1a83c3d8763962187b9895c199b2c46aa4453c01.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 52 | ||||
-rw-r--r-- | PKGBUILD | 122 | ||||
-rw-r--r-- | qt5-qtwebkit-dont-depend-on-icu.patch | 267 | ||||
-rw-r--r-- | qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch | 12 | ||||
-rw-r--r-- | qt5-qtwebkit-fix-compatibility-with-latest-angle.patch | 135 | ||||
-rw-r--r-- | qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch | 21 | ||||
-rw-r--r-- | qtwebkit-dont-use-bundled-angle-libraries.patch | 94 | ||||
-rw-r--r-- | qtwebkit-opensource-src-5.0.1-debuginfo.patch | 88 | ||||
-rw-r--r-- | revert-qt4-unicode-removal.patch | 808 | ||||
-rw-r--r-- | webkit-commit-151422.patch | 46 |
10 files changed, 1645 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..16ac30b4f253 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,52 @@ +pkgbase = mingw-w64-qt5-webkit + pkgdesc = Classes for a WebKit2 based implementation and a new QML API (mingw-w64) + pkgver = 5.4.2 + pkgrel = 1 + url = http://qt-project.org + arch = any + groups = mingw-w64-qt + groups = mingw-w64-qt5 + license = custom, FDL, GPL3, LGPL + makedepends = mingw-w64-gcc + makedepends = python + makedepends = gperf + makedepends = ruby + makedepends = mingw-w64-pkg-config + depends = mingw-w64-qt5-base + depends = mingw-w64-qt5-declarative + depends = mingw-w64-qt5-sensors + depends = mingw-w64-qt5-location + depends = mingw-w64-qt5-multimedia + depends = mingw-w64-angleproject + depends = mingw-w64-fontconfig + depends = mingw-w64-libpng + depends = mingw-w64-libjpeg-turbo + depends = mingw-w64-libxslt + depends = mingw-w64-zlib + depends = mingw-w64-icu + depends = mingw-w64-sqlite + depends = mingw-w64-libwebp + options = !strip + options = !buildflags + options = staticlibs + source = http://download.qt-project.org/official_releases/qt/5.4/5.4.2/submodules/qtwebkit-opensource-src-5.4.2.tar.xz + source = qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch + source = qtwebkit-dont-use-bundled-angle-libraries.patch + source = qt5-qtwebkit-dont-depend-on-icu.patch + source = revert-qt4-unicode-removal.patch + source = qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch + source = qtwebkit-opensource-src-5.0.1-debuginfo.patch + source = webkit-commit-151422.patch + source = qt5-qtwebkit-fix-compatibility-with-latest-angle.patch + md5sums = b711b3f32646d72cd281b3c17ab6d14e + md5sums = ac574de962545d6a9e975b4db63c3e09 + md5sums = f452210683386f9c28f04d7dea0ecfc7 + md5sums = 069f86d834bcecb7fe0937b7539d28af + md5sums = 4e374836f26853b4d82be0e87aa584a5 + md5sums = 8b60ddebf01ee04a0e1180e98cdd3d52 + md5sums = 6aba6468efafb64943887079e258b799 + md5sums = c36fe581e0f3b61cef19415782b257ca + md5sums = 2ef87f4b6588e92a925f42c3b9595379 + +pkgname = mingw-w64-qt5-webkit + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0262850e8032 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,122 @@ +# Maintainer: ant32 <antreimer@gmail.com> +# Contributor: Filip Brcic <brcha@gna.org> +_qt_module=qtwebkit +pkgname=mingw-w64-qt5-webkit +pkgver=5.4.2 +pkgrel=1 +arch=(any) +pkgdesc="Classes for a WebKit2 based implementation and a new QML API (mingw-w64)" +depends=('mingw-w64-qt5-base' + 'mingw-w64-qt5-declarative' + 'mingw-w64-qt5-sensors' + 'mingw-w64-qt5-location' + 'mingw-w64-qt5-multimedia' + 'mingw-w64-angleproject' + 'mingw-w64-fontconfig' + 'mingw-w64-libpng' + 'mingw-w64-libjpeg-turbo' + 'mingw-w64-libxslt' + 'mingw-w64-zlib' + 'mingw-w64-icu' + 'mingw-w64-sqlite' + 'mingw-w64-libwebp') +makedepends=('mingw-w64-gcc' 'python' 'gperf' 'ruby' 'mingw-w64-pkg-config') +options=('!strip' '!buildflags' 'staticlibs') +license=("custom, FDL, GPL3, LGPL") +url="http://qt-project.org" +_pkgfqn="${_qt_module}-opensource-src-${pkgver}" +groups=(mingw-w64-qt mingw-w64-qt5) +source=("http://download.qt-project.org/official_releases/qt/5.4/${pkgver}/submodules/${_pkgfqn}.tar.xz" + 'qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch' + 'qtwebkit-dont-use-bundled-angle-libraries.patch' + 'qt5-qtwebkit-dont-depend-on-icu.patch' + 'revert-qt4-unicode-removal.patch' + 'qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch' + 'qtwebkit-opensource-src-5.0.1-debuginfo.patch' + 'webkit-commit-151422.patch' + 'qt5-qtwebkit-fix-compatibility-with-latest-angle.patch') +md5sums=('b711b3f32646d72cd281b3c17ab6d14e' + 'ac574de962545d6a9e975b4db63c3e09' + 'f452210683386f9c28f04d7dea0ecfc7' + '069f86d834bcecb7fe0937b7539d28af' + '4e374836f26853b4d82be0e87aa584a5' + '8b60ddebf01ee04a0e1180e98cdd3d52' + '6aba6468efafb64943887079e258b799' + 'c36fe581e0f3b61cef19415782b257ca' + '2ef87f4b6588e92a925f42c3b9595379') +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +prepare() { + cd "${srcdir}/${_pkgfqn}" + + # The ICU libraries used for cross-compilation are named exactly the same as their native Linux counterpart + #patch -p0 -b -i ../qt5-qtwebkit-use-correct-icu-libs.patch + + # By default the build system assumes that pkg-config isn't used for the win32 target + # However, we're using it in the Fedora MinGW toolchain so make sure it is used automatically + patch -p0 -b -i ../qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch + + # Make sure the bundled copy of the ANGLE library isn't used + patch -p1 -b -i ../qtwebkit-dont-use-bundled-angle-libraries.patch + + # qtwebkit depends on qtbase with ICU support. + # As ICU support in qtbase also introduces over 20MB of additional dependency + # bloat (and the qtbase libraries itself are only 13MB) the decision was made + # to build qtbase without ICU support. + # Make sure qtwebkit doesn't depend on a qtbase with ICU support any more + patch -p1 -b -i ../qt5-qtwebkit-dont-depend-on-icu.patch + + # Undo the removal of the old Qt4 based unicode support + # as we want to use it instead of the bloated ICU + patch -p1 -R -b -i ../revert-qt4-unicode-removal.patch + + # WebKit svn commit 136242 implemented a split into QtWebKit and QtWebKitWidgets + # Due to this change a static library named WebKit1.a is created first. + # After this a shared library is created named Qt5WebKit.dll which contains + # the contents of this static library and some other object files. + # However, various symbols in the static library are expected to be exported + # in the Qt5WebKit.dll shared library. As static libraries normally don't care + # about exported symbols (everything is exported after all) the decoration + # attribute Q_DECL_EXPORT won't be set. + # This results in undefined references when trying to link the QtWebKitWidgets + # shared library (which depends on various symbols which aren't exported properly + # in the Qt5WebKit.dll shared library) + patch -p0 -b -i ../qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch + + # smaller debuginfo s/-g/-g1/ (debian uses -gstabs) to avoid 4gb size limit + patch -p1 -b -i ../qtwebkit-opensource-src-5.0.1-debuginfo.patch + + # Revert commit 151422 to fix a build failure which happens because we're not using ICU + patch -p1 -R -b -i ../webkit-commit-151422.patch + + # Fix compatibility issue when using the latest ANGLE + patch -p1 -b -i ../qt5-qtwebkit-fix-compatibility-with-latest-angle.patch + + # Make sure the bundled copy of the ANGLE libraries isn't used + rm -rf Source/ThirdParty/ANGLE +} + +build() { + unset PKG_CONFIG_PATH + cd "${srcdir}/${_pkgfqn}" + for _arch in ${_architectures}; do + mkdir -p build-${_arch} && pushd build-${_arch} + ${_arch}-qmake-qt5 QMAKE_CXXFLAGS+=-Wno-c++0x-compat ../WebKit.pro + make + popd + done +} + +package() { + for _arch in ${_architectures}; do + cd "${srcdir}/${_pkgfqn}/build-${_arch}" + make INSTALL_ROOT="${pkgdir}" install + + # The .dll's are installed in both bindir and libdir + # One copy of the .dll's is sufficient + rm -f "${pkgdir}/usr/${_arch}/lib/"*.dll + find "${pkgdir}/usr/${_arch}" -name "*.exe" -o -name "*.bat" -o -name "*.def" -o -name "*.exp" -o -name '*.prl' | xargs -rtl1 rm + find "${pkgdir}/usr/${_arch}" -name "*.dll" -exec ${_arch}-strip --strip-unneeded {} \; + find "${pkgdir}/usr/${_arch}" -name "*.a" -o -name "*.dll" | xargs -rtl1 ${_arch}-strip -g + done +} diff --git a/qt5-qtwebkit-dont-depend-on-icu.patch b/qt5-qtwebkit-dont-depend-on-icu.patch new file mode 100644 index 000000000000..1226704b4f6f --- /dev/null +++ b/qt5-qtwebkit-dont-depend-on-icu.patch @@ -0,0 +1,267 @@ +--- qtwebkit-opensource-src-5.0.0/Tools/qmake/mkspecs/features/configure.prf.orig 2013-01-04 18:56:36.785550268 +0100 ++++ qtwebkit-opensource-src-5.0.0/Tools/qmake/mkspecs/features/configure.prf 2013-01-04 18:58:20.047373664 +0100 +@@ -115,9 +115,9 @@ + } + + # Sanity checks that would prevent us from building the whole project altogether. +- !android:!mac:!config_icu { +- addReasonForSkippingBuild("ICU is required.") +- } ++# !android:!mac:!config_icu { ++# addReasonForSkippingBuild("ICU is required.") ++# } + production_build:blackberry|qnx { + addReasonForSkippingBuild("Build not supported on BB10/QNX yet.") + } +--- qtwebkit-opensource-src-5.0.0/Source/WTF/wtf/Platform.h.orig 2013-01-04 19:28:53.735934784 +0100 ++++ qtwebkit-opensource-src-5.0.0/Source/WTF/wtf/Platform.h 2013-01-04 19:28:13.856641177 +0100 +@@ -580,9 +580,13 @@ + # define WTF_USE_WCHAR_UNICODE 1 + #endif + ++#if OS(WINDOWS) && PLATFORM(QT) ++#define WTF_USE_QT4_UNICODE 1 ++#else + #if !USE(WCHAR_UNICODE) + #define WTF_USE_ICU_UNICODE 1 + #endif ++#endif + + #if PLATFORM(MAC) && !PLATFORM(IOS) + #if CPU(X86_64) +--- qtwebkit-opensource-src-5.0.0/Source/WebCore/platform/text/TextAllInOne.cpp.orig 2013-01-04 21:55:38.574265749 +0100 ++++ qtwebkit-opensource-src-5.0.0/Source/WebCore/platform/text/TextAllInOne.cpp 2013-01-04 20:51:54.156245445 +0100 +@@ -27,7 +27,11 @@ + + #include "TextBoundaries.cpp" + #include "TextBreakIterator.cpp" ++#if USE(QT4_UNICODE) ++#include "TextBreakIteratorQt.cpp" ++#else + #include "TextBreakIteratorICU.cpp" ++#endif + #include "TextCodec.cpp" + #include "TextCodecICU.cpp" + #include "TextCodecLatin1.cpp" +@@ -35,6 +39,10 @@ + #include "TextCodecUTF8.cpp" + #include "TextCodecUserDefined.cpp" + #include "TextEncoding.cpp" ++#if USE(QT4_UNICODE) ++#include "TextEncodingDetectorNone.cpp" ++#else + #include "TextEncodingDetectorICU.cpp" ++#endif + #include "TextEncodingRegistry.cpp" + #include "TextStream.cpp" +--- /dev/null 2012-12-26 00:21:52.105366365 +0100 ++++ qtwebkit-opensource-src-5.0.0/Source/WebCore/platform/text/TextBreakIteratorQt.cpp 2012-05-31 00:58:54.000000000 +0200 +@@ -0,0 +1,175 @@ ++/* ++ * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public License ++ * along with this library; see the file COPYING.LIB. If not, write to ++ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ * ++ */ ++ ++#include "config.h" ++#include "TextBreakIterator.h" ++ ++#include <QtCore/qtextboundaryfinder.h> ++#include <algorithm> ++#include <qdebug.h> ++#include <wtf/Atomics.h> ++ ++// #define DEBUG_TEXT_ITERATORS ++#ifdef DEBUG_TEXT_ITERATORS ++#define DEBUG qDebug ++#else ++#define DEBUG if (1) {} else qDebug ++#endif ++ ++using namespace WTF; ++using namespace std; ++ ++namespace WebCore { ++ ++ class TextBreakIterator : public QTextBoundaryFinder { ++ public: ++ TextBreakIterator(QTextBoundaryFinder::BoundaryType type, const QString& string) ++ : QTextBoundaryFinder(type, string) ++ { } ++ TextBreakIterator() ++ : QTextBoundaryFinder() ++ { } ++ }; ++ ++ TextBreakIterator* setUpIterator(TextBreakIterator& iterator, QTextBoundaryFinder::BoundaryType type, const UChar* characters, int length) ++ { ++ if (!characters || !length) ++ return 0; ++ ++ if (iterator.isValid() && type == iterator.type() && iterator.string() == QString::fromRawData(reinterpret_cast<const QChar*>(characters), length)) { ++ iterator.toStart(); ++ return &iterator; ++ } ++ ++ iterator = TextBreakIterator(type, QString(reinterpret_cast<const QChar*>(characters), length)); ++ return &iterator; ++ } ++ ++ TextBreakIterator* wordBreakIterator(const UChar* string, int length) ++ { ++ static TextBreakIterator staticWordBreakIterator; ++ return setUpIterator(staticWordBreakIterator, QTextBoundaryFinder::Word, string, length); ++ } ++ ++ static TextBreakIterator* nonSharedCharacterBreakIterator; ++ ++ NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length) ++ { ++ m_iterator = nonSharedCharacterBreakIterator; ++ bool createdIterator = m_iterator && weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), m_iterator, 0); ++ if (!createdIterator) ++ m_iterator = new TextBreakIterator(); ++ if (!setUpIterator(*m_iterator, QTextBoundaryFinder::Grapheme, buffer, length)) { ++ delete m_iterator; ++ m_iterator = 0; ++ } ++ } ++ ++ NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator() ++ { ++ if (!weakCompareAndSwap(reinterpret_cast<void**>(&nonSharedCharacterBreakIterator), 0, m_iterator)) ++ delete m_iterator; ++ } ++ ++ TextBreakIterator* cursorMovementIterator(const UChar* string, int length) ++ { ++ static TextBreakIterator staticCursorMovementIterator; ++ return setUpIterator(staticCursorMovementIterator, QTextBoundaryFinder::Grapheme, string, length); ++ } ++ ++ static TextBreakIterator* staticLineBreakIterator; ++ ++ TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&) ++ { ++ TextBreakIterator* lineBreakIterator = 0; ++ if (staticLineBreakIterator) { ++ setUpIterator(*staticLineBreakIterator, QTextBoundaryFinder::Line, string, length); ++ std::swap(staticLineBreakIterator, lineBreakIterator); ++ } ++ ++ if (!lineBreakIterator && string && length) ++ lineBreakIterator = new TextBreakIterator(QTextBoundaryFinder::Line, QString(reinterpret_cast<const QChar*>(string), length)); ++ ++ return lineBreakIterator; ++ } ++ ++ void releaseLineBreakIterator(TextBreakIterator* iterator) ++ { ++ ASSERT(iterator); ++ ++ if (!staticLineBreakIterator) ++ staticLineBreakIterator = iterator; ++ else ++ delete iterator; ++ } ++ ++ TextBreakIterator* sentenceBreakIterator(const UChar* string, int length) ++ { ++ static TextBreakIterator staticSentenceBreakIterator; ++ return setUpIterator(staticSentenceBreakIterator, QTextBoundaryFinder::Sentence, string, length); ++ ++ } ++ ++ int textBreakFirst(TextBreakIterator* bi) ++ { ++ bi->toStart(); ++ DEBUG() << "textBreakFirst" << bi->position(); ++ return bi->position(); ++ } ++ ++ int textBreakNext(TextBreakIterator* bi) ++ { ++ int pos = bi->toNextBoundary(); ++ DEBUG() << "textBreakNext" << pos; ++ return pos; ++ } ++ ++ int textBreakPreceding(TextBreakIterator* bi, int pos) ++ { ++ bi->setPosition(pos); ++ int newpos = bi->toPreviousBoundary(); ++ DEBUG() << "textBreakPreceding" << pos << newpos; ++ return newpos; ++ } ++ ++ int textBreakFollowing(TextBreakIterator* bi, int pos) ++ { ++ bi->setPosition(pos); ++ int newpos = bi->toNextBoundary(); ++ DEBUG() << "textBreakFollowing" << pos << newpos; ++ return newpos; ++ } ++ ++ int textBreakCurrent(TextBreakIterator* bi) ++ { ++ return bi->position(); ++ } ++ ++ bool isTextBreak(TextBreakIterator*, int) ++ { ++ return true; ++ } ++ ++ bool isWordTextBreak(TextBreakIterator*) ++ { ++ return true; ++ } ++ ++} +--- a/Source/WebCore/platform/ThreadGlobalData.cpp ++++ b/Source/WebCore/platform/ThreadGlobalData.cpp +@@ -37,6 +37,8 @@ + + #if USE(ICU_UNICODE) + #include "TextCodecICU.h" ++#elif USE(QT4_UNICODE) ++#include "qt/TextCodecQt.h" + #endif + + #if PLATFORM(MAC) +--- qtwebkit-opensource-src-5.2.0-rc1/Source/WebCore/platform/text/TextBreakIteratorQt.cpp.orig 2013-12-04 00:08:41.281004481 +0100 ++++ qtwebkit-opensource-src-5.2.0-rc1/Source/WebCore/platform/text/TextBreakIteratorQt.cpp 2013-12-04 00:07:52.878531508 +0100 +@@ -96,7 +96,7 @@ + + static TextBreakIterator* staticLineBreakIterator; + +- TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&) ++ TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&, const UChar* priorContext, unsigned priorContextLength) + { + TextBreakIterator* lineBreakIterator = 0; + if (staticLineBreakIterator) { +--- qtwebkit-opensource-src-5.4.0/Tools/qmake/mkspecs/features/features.prf.orig 2014-12-29 23:30:47.372582743 +0100 ++++ qtwebkit-opensource-src-5.4.0/Tools/qmake/mkspecs/features/features.prf 2014-12-29 23:31:08.021797817 +0100 +@@ -142,7 +142,7 @@ + # IndexedDB requires leveldb + enable?(indexed_database): WEBKIT_CONFIG += use_leveldb + +- !config_icu:!mac: WEBKIT_CONFIG += use_wchar_unicode ++# !config_icu:!mac: WEBKIT_CONFIG += use_wchar_unicode + + export(WEBKIT_CONFIG) + export(CONFIGURE_WARNINGS) diff --git a/qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch b/qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch new file mode 100644 index 000000000000..82355fca3b72 --- /dev/null +++ b/qt5-qtwebkit-enable-pkgconfig-support-for-win32-target.patch @@ -0,0 +1,12 @@ +--- Tools/qmake/mkspecs/features/win32/default_pre.prf.orig 2012-11-12 21:19:24.500379251 +0100 ++++ Tools/qmake/mkspecs/features/win32/default_pre.prf 2012-11-12 21:19:50.901564454 +0100 +@@ -4,6 +4,9 @@ + # See 'Tools/qmake/README' for an overview of the build system + # ------------------------------------------------------------------- + ++# Make sure we process the PKGCONFIG variable if applicable ++CONFIG += link_pkgconfig ++ + load(default_pre) + + debug: CONFIG += use_all_in_one_files diff --git a/qt5-qtwebkit-fix-compatibility-with-latest-angle.patch b/qt5-qtwebkit-fix-compatibility-with-latest-angle.patch new file mode 100644 index 000000000000..2a12fca270ea --- /dev/null +++ b/qt5-qtwebkit-fix-compatibility-with-latest-angle.patch @@ -0,0 +1,135 @@ +--- qtwebkit-opensource-src-5.4.0/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h.orig 2014-12-29 22:48:34.532357391 +0100 ++++ qtwebkit-opensource-src-5.4.0/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h 2014-12-29 23:01:26.254334924 +0100 +@@ -34,14 +34,15 @@ + #elif PLATFORM(WIN) + #include "GLSLANG/ShaderLang.h" + #else +-#include "ShaderLang.h" ++#include "GLSLANG/ShaderLang.h" ++#include "angle_gl.h" + #endif + + namespace WebCore { + + enum ANGLEShaderType { +- SHADER_TYPE_VERTEX = SH_VERTEX_SHADER, +- SHADER_TYPE_FRAGMENT = SH_FRAGMENT_SHADER, ++ SHADER_TYPE_VERTEX = GL_VERTEX_SHADER, ++ SHADER_TYPE_FRAGMENT = GL_FRAGMENT_SHADER, + }; + + enum ANGLEShaderSymbolType { +@@ -53,17 +54,17 @@ + ANGLEShaderSymbolType symbolType; + String name; + String mappedName; +- ShDataType dataType; ++ sh::GLenum dataType; + int size; + bool isArray; + + bool isSampler() const + { + return symbolType == SHADER_SYMBOL_TYPE_UNIFORM +- && (dataType == SH_SAMPLER_2D +- || dataType == SH_SAMPLER_CUBE +- || dataType == SH_SAMPLER_2D_RECT_ARB +- || dataType == SH_SAMPLER_EXTERNAL_OES); ++ && (dataType == GL_SAMPLER_2D ++ || dataType == GL_SAMPLER_CUBE ++ || dataType == GL_SAMPLER_2D_RECT_ARB ++ || dataType == GL_SAMPLER_EXTERNAL_OES); + } + }; + +--- qtwebkit-opensource-src-5.4.0/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp.orig 2014-12-29 23:37:30.636783007 +0100 ++++ qtwebkit-opensource-src-5.4.0/Source/WebCore/platform/graphics/ANGLEWebKitBridge.cpp 2014-12-30 12:00:39.524299653 +0100 +@@ -42,7 +42,7 @@ + inline static ANGLEGetInfoType getValidationResultValue(const ShHandle compiler, ShShaderInfo shaderInfo) + { + ANGLEGetInfoType value = 0; +- ShGetInfo(compiler, shaderInfo, &value); ++ ShGetInfo(compiler, (ShShaderInfo) shaderInfo, &value); + return value; + } + +@@ -51,11 +51,11 @@ + ShShaderInfo symbolMaxNameLengthType; + + switch (symbolType) { +- case SH_ACTIVE_ATTRIBUTES: +- symbolMaxNameLengthType = SH_ACTIVE_ATTRIBUTE_MAX_LENGTH; ++ case GL_ACTIVE_ATTRIBUTES: ++ symbolMaxNameLengthType = (ShShaderInfo) GL_ACTIVE_ATTRIBUTE_MAX_LENGTH; + break; +- case SH_ACTIVE_UNIFORMS: +- symbolMaxNameLengthType = SH_ACTIVE_UNIFORM_MAX_LENGTH; ++ case GL_ACTIVE_UNIFORMS: ++ symbolMaxNameLengthType = (ShShaderInfo) GL_ACTIVE_UNIFORM_MAX_LENGTH; + break; + default: + ASSERT_NOT_REACHED(); +@@ -79,14 +79,16 @@ + for (ANGLEGetInfoType i = 0; i < numSymbols; ++i) { + ANGLEShaderSymbol symbol; + ANGLEGetInfoType nameLength = 0; ++ ShPrecisionType precision = SH_PRECISION_UNDEFINED; ++ int staticUse = 0; + switch (symbolType) { +- case SH_ACTIVE_ATTRIBUTES: ++ case GL_ACTIVE_ATTRIBUTES: + symbol.symbolType = SHADER_SYMBOL_TYPE_ATTRIBUTE; +- ShGetActiveAttrib(compiler, i, &nameLength, &symbol.size, &symbol.dataType, nameBuffer.data(), mappedNameBuffer.data()); ++ ShGetVariableInfo(compiler, SH_ACTIVE_ATTRIBUTES, i, &nameLength, &symbol.size, &symbol.dataType, &precision, &staticUse, nameBuffer.data(), mappedNameBuffer.data()); + break; +- case SH_ACTIVE_UNIFORMS: ++ case GL_ACTIVE_UNIFORMS: + symbol.symbolType = SHADER_SYMBOL_TYPE_UNIFORM; +- ShGetActiveUniform(compiler, i, &nameLength, &symbol.size, &symbol.dataType, nameBuffer.data(), mappedNameBuffer.data()); ++ ShGetVariableInfo(compiler, SH_ACTIVE_UNIFORMS, i, &nameLength, &symbol.size, &symbol.dataType, &precision, &staticUse, nameBuffer.data(), mappedNameBuffer.data()); + break; + default: + ASSERT_NOT_REACHED(); +@@ -170,8 +172,8 @@ + bool ANGLEWebKitBridge::compileShaderSource(const char* shaderSource, ANGLEShaderType shaderType, String& translatedShaderSource, String& shaderValidationLog, Vector<ANGLEShaderSymbol>& symbols, int extraCompileOptions) + { + if (!builtCompilers) { +- m_fragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, m_shaderSpec, m_shaderOutput, &m_resources); +- m_vertexCompiler = ShConstructCompiler(SH_VERTEX_SHADER, m_shaderSpec, m_shaderOutput, &m_resources); ++ m_fragmentCompiler = ShConstructCompiler(GL_FRAGMENT_SHADER, m_shaderSpec, m_shaderOutput, &m_resources); ++ m_vertexCompiler = ShConstructCompiler(GL_VERTEX_SHADER, m_shaderSpec, m_shaderOutput, &m_resources); + if (!m_fragmentCompiler || !m_vertexCompiler) { + cleanupCompilers(); + return false; +@@ -189,7 +191,7 @@ + + const char* const shaderSourceStrings[] = { shaderSource }; + +- bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, SH_OBJECT_CODE | SH_ATTRIBUTES_UNIFORMS | extraCompileOptions); ++ bool validateSuccess = ShCompile(compiler, shaderSourceStrings, 1, SH_OBJECT_CODE | SH_VARIABLES | extraCompileOptions); + if (!validateSuccess) { + int logSize = getValidationResultValue(compiler, SH_INFO_LOG_LENGTH); + if (logSize > 1) { +@@ -211,9 +213,9 @@ + translatedShaderSource = translationBuffer.get(); + } + +- if (!getSymbolInfo(compiler, SH_ACTIVE_ATTRIBUTES, symbols)) ++ if (!getSymbolInfo(compiler, (ShShaderInfo) GL_ACTIVE_ATTRIBUTES, symbols)) + return false; +- if (!getSymbolInfo(compiler, SH_ACTIVE_UNIFORMS, symbols)) ++ if (!getSymbolInfo(compiler, (ShShaderInfo) GL_ACTIVE_UNIFORMS, symbols)) + return false; + + return true; +--- qtwebkit-opensource-src-5.4.0/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp.orig 2014-12-30 12:11:43.450097601 +0100 ++++ qtwebkit-opensource-src-5.4.0/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp 2014-12-30 12:13:46.812361166 +0100 +@@ -172,7 +172,7 @@ + + String translatedShaderSource; + String shaderInfoLog; +- int extraCompileOptions = SH_MAP_LONG_VARIABLE_NAMES | SH_CLAMP_INDIRECT_ARRAY_BOUNDS; ++ int extraCompileOptions = SH_CLAMP_INDIRECT_ARRAY_BOUNDS; + + if (m_requiresBuiltInFunctionEmulation) + extraCompileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS; diff --git a/qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch b/qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch new file mode 100644 index 000000000000..12b9ecde90f1 --- /dev/null +++ b/qt5-qtwebkit-workaround-build-breakage-after-svn-commit-136242.patch @@ -0,0 +1,21 @@ +--- Source/WebKit/qt/Api/qwebkitglobal.h.orig 2013-01-06 19:14:49.225087412 +0100 ++++ Source/WebKit/qt/Api/qwebkitglobal.h 2013-01-06 19:15:02.498182976 +0100 +@@ -26,7 +26,6 @@ + + #define QTWEBKIT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) + +-#ifndef QT_STATIC + # if !defined(QT_BUILD_WEBKITWIDGETS_LIB) && defined(BUILDING_WEBKIT) + # define QWEBKIT_EXPORT Q_DECL_EXPORT + # else +@@ -37,10 +36,6 @@ + # else + # define QWEBKITWIDGETS_EXPORT Q_DECL_IMPORT + # endif +-#else +-# define QWEBKITWIDGETS_EXPORT +-# define QWEBKIT_EXPORT +-#endif + + QWEBKIT_EXPORT QString qWebKitVersion(); + QWEBKIT_EXPORT int qWebKitMajorVersion(); diff --git a/qtwebkit-dont-use-bundled-angle-libraries.patch b/qtwebkit-dont-use-bundled-angle-libraries.patch new file mode 100644 index 000000000000..274313269ce6 --- /dev/null +++ b/qtwebkit-dont-use-bundled-angle-libraries.patch @@ -0,0 +1,94 @@ +--- qtwebkit-opensource-src-5.0.0/WebKit.pro.orig 2013-01-04 01:50:18.373246956 +0100 ++++ qtwebkit-opensource-src-5.0.0/WebKit.pro 2013-01-04 01:50:23.777286725 +0100 +@@ -18,12 +18,6 @@ + JavaScriptCore.makefile = Makefile.JavaScriptCore + SUBDIRS += JavaScriptCore + +-use?(3D_GRAPHICS) { +- ANGLE.file = Source/ThirdParty/ANGLE/ANGLE.pro +- ANGLE.makefile = Makefile.ANGLE +- SUBDIRS += ANGLE +-} +- + use?(leveldb):!use?(system_leveldb) { + leveldb.file = Source/ThirdParty/leveldb/leveldb.pro + leveldb.makefile = Makefile.leveldb +--- qtwebkit-opensource-src-5.0.0/Source/WebCore/Target.pri.orig 2013-01-04 01:58:25.145960916 +0100 ++++ qtwebkit-opensource-src-5.0.0/Source/WebCore/Target.pri 2013-01-04 01:58:53.245166218 +0100 +@@ -4194,7 +4194,7 @@ + platform/graphics/texmap/coordinated/CoordinatedTile.cpp \ + platform/graphics/texmap/coordinated/UpdateAtlas.cpp + +- INCLUDEPATH += $$PWD/platform/graphics/gpu ++ INCLUDEPATH += $$PWD/platform/graphics/gpu /usr/i686-w64-mingw32/sys-root/mingw/include/GLSLANG + + contains(QT_CONFIG, opengl) { + contains(QT_CONFIG, opengles2) { +--- qtwebkit-opensource-src-5.0.0/Tools/qmake/mkspecs/modules/angle.prf.orig 2013-01-04 02:25:16.357429590 +0100 ++++ qtwebkit-opensource-src-5.0.0/Tools/qmake/mkspecs/modules/angle.prf 2013-01-04 02:25:29.383533741 +0100 +@@ -4,6 +4,3 @@ + # See 'Tools/qmake/README' for an overview of the build system + # ------------------------------------------------------------------- + +-WEBKIT.angle.root_source_dir = $${ROOT_WEBKIT_DIR}/Source/ThirdParty/ANGLE +- +-include($${WEBKIT.angle.root_source_dir}/ANGLE.pri) +--- qtwebkit-opensource-src-5.0.0/Source/WebKit/WebKit1.pro.orig 2013-01-04 13:58:41.258048080 +0100 ++++ qtwebkit-opensource-src-5.0.0/Source/WebKit/WebKit1.pro 2013-01-04 13:59:23.135351974 +0100 +@@ -96,7 +96,10 @@ + INCLUDEPATH += \ + $$PWD/qt/WebCoreSupport + +-use?(3D_GRAPHICS): WEBKIT += angle ++use?(3D_GRAPHICS) { ++ WEBKIT += angle ++ INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/GLSLANG ++} + + have?(qtpositioning):enable?(GEOLOCATION) { + HEADERS += \ +--- qtwebkit-opensource-src-5.0.0/Source/WebKit2/Target.pri.orig 2013-01-04 14:01:39.267381271 +0100 ++++ qtwebkit-opensource-src-5.0.0/Source/WebKit2/Target.pri 2013-01-04 14:02:01.414542791 +0100 +@@ -942,7 +942,10 @@ + + have?(qtpositioning):enable?(GEOLOCATION): QT += positioning + +-use?(3D_GRAPHICS): WEBKIT += angle ++use?(3D_GRAPHICS) { ++ WEBKIT += angle ++ INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/GLSLANG ++} + + use?(PLUGIN_BACKEND_XLIB) { + DEFINES += XP_UNIX +--- qtwebkit-opensource-src-5.0.0/Tools/qmake/mkspecs/features/webkit_modules.prf.orig 2013-01-04 14:37:56.650662923 +0100 ++++ qtwebkit-opensource-src-5.0.0/Tools/qmake/mkspecs/features/webkit_modules.prf 2013-01-04 14:38:20.063847512 +0100 +@@ -7,7 +7,7 @@ + + # Reorder libraries so that the link and include order is correct, + # and make sure the case matches the original case. +-libraries = WebKit1 WebKit2 WebCore ANGLE leveldb JavaScriptCore WTF ++libraries = WebKit1 WebKit2 WebCore leveldb JavaScriptCore WTF + for(library, libraries) { + contains(WEBKIT, $$lower($$library)) { + WEBKIT -= $$lower($$library) +--- qtwebkit-opensource-src-5.0.2/Source/api.pri.orig 2013-05-18 01:36:18.524909031 +0200 ++++ qtwebkit-opensource-src-5.0.2/Source/api.pri 2013-05-18 02:14:48.609146344 +0200 +@@ -24,7 +24,6 @@ + } + build?(webkit2): QMAKE_INTERNAL_INCLUDED_FILES *= WebKit2/Target.pri + +-use?(3D_GRAPHICS): WEBKIT += angle + use?(leveldb):!use?(system_leveldb) WEBKIT += leveldb + + MODULE = webkit +--- qtwebkit-opensource-src-5.0.2/Source/WebCore/WebCore.pri.orig 2013-05-18 01:50:16.481110868 +0200 ++++ qtwebkit-opensource-src-5.0.2/Source/WebCore/WebCore.pri 2013-05-18 02:19:24.941843621 +0200 +@@ -209,6 +209,7 @@ + CONFIG(debug, debug|release):contains(QT_CONFIG, angle) { + LIBS += $$QMAKE_LIBS_OPENGL_ES2_DEBUG + } else { ++ INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/GLSLANG + LIBS += $$QMAKE_LIBS_OPENGL_ES2 + } + } else { diff --git a/qtwebkit-opensource-src-5.0.1-debuginfo.patch b/qtwebkit-opensource-src-5.0.1-debuginfo.patch new file mode 100644 index 000000000000..d41241817c81 --- /dev/null +++ b/qtwebkit-opensource-src-5.0.1-debuginfo.patch @@ -0,0 +1,88 @@ +diff -up qtwebkit-opensource-src-5.0.1/Source/JavaScriptCore/JavaScriptCore.pri.debuginfo qtwebkit-opensource-src-5.0.1/Source/JavaScriptCore/JavaScriptCore.pri +--- qtwebkit-opensource-src-5.0.1/Source/JavaScriptCore/JavaScriptCore.pri.debuginfo 2013-01-29 13:03:49.000000000 -0600 ++++ qtwebkit-opensource-src-5.0.1/Source/JavaScriptCore/JavaScriptCore.pri 2013-02-23 13:54:22.578460045 -0600 +@@ -7,6 +7,12 @@ + + SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/JavaScriptCore + ++#equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64) { ++# message("JavaScriptCore workaround for QtWebkit: do not build with -g, but with -g1") ++# QMAKE_CXXFLAGS -= -g ++# QMAKE_CXXFLAGS += -g1 ++#} ++ + JAVASCRIPTCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/JavaScriptCore/$${GENERATED_SOURCES_DESTDIR} + + INCLUDEPATH += \ +diff -up qtwebkit-opensource-src-5.0.1/Source/WebCore/WebCore.pri.debuginfo qtwebkit-opensource-src-5.0.1/Source/WebCore/WebCore.pri +--- qtwebkit-opensource-src-5.0.1/Source/WebCore/WebCore.pri.debuginfo 2013-01-29 13:03:41.000000000 -0600 ++++ qtwebkit-opensource-src-5.0.1/Source/WebCore/WebCore.pri 2013-02-23 13:57:16.984279672 -0600 +@@ -7,6 +7,12 @@ + + SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebCore + ++equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64) { ++ message("WebCore workaround for QtWebkit: do not build with -g, but with -g1") ++ QMAKE_CXXFLAGS -= -g ++ QMAKE_CXXFLAGS += -g1 ++} ++ + QT *= network sql core-private gui-private + + WEBCORE_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebCore/$${GENERATED_SOURCES_DESTDIR} +@@ -302,6 +308,7 @@ + unix:!mac:*-g++*:QMAKE_CXXFLAGS += -fdata-sections + unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections + linux*-g++*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF ++win32:!equals(QT_ARCH, powerpc):!equals(QT_ARCH, s390):!equals(QT_ARCH, mips):!equals(QT_ARCH, arm):QMAKE_LFLAGS += -Wl,--no-keep-memory -Wl,--reduce-memory-overheads + + enable_fast_mobile_scrolling: DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1 + +diff -up qtwebkit-opensource-src-5.0.1/Source/WebKit2/WebKit2.pri.debuginfo qtwebkit-opensource-src-5.0.1/Source/WebKit2/WebKit2.pri +--- qtwebkit-opensource-src-5.0.1/Source/WebKit2/WebKit2.pri.debuginfo 2013-01-29 13:03:39.000000000 -0600 ++++ qtwebkit-opensource-src-5.0.1/Source/WebKit2/WebKit2.pri 2013-02-23 13:54:22.579460033 -0600 +@@ -9,6 +9,12 @@ SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/ + + WEBKIT2_GENERATED_SOURCES_DIR = $${ROOT_BUILD_DIR}/Source/WebKit2/$${GENERATED_SOURCES_DESTDIR} + ++#equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64) { ++# message("WebKit2 workaround for QtWebkit: do not build with -g, but with -g1") ++# QMAKE_CXXFLAGS -= -g ++# QMAKE_CXXFLAGS += -g1 ++#} ++ + INCLUDEPATH += \ + $$SOURCE_DIR \ + $$SOURCE_DIR/Platform \ +diff -up qtwebkit-opensource-src-5.0.1/Source/WebKit/WebKit1.pri.debuginfo qtwebkit-opensource-src-5.0.1/Source/WebKit/WebKit1.pri +--- qtwebkit-opensource-src-5.0.1/Source/WebKit/WebKit1.pri.debuginfo 2013-01-29 13:03:54.000000000 -0600 ++++ qtwebkit-opensource-src-5.0.1/Source/WebKit/WebKit1.pri 2013-02-23 13:54:22.579460033 -0600 +@@ -7,6 +7,12 @@ + + SOURCE_DIR = $${ROOT_WEBKIT_DIR}/Source/WebKit + ++#equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64) { ++# message("WebKit workaround for QtWebkit: do not build with -g, but with -g1") ++# QMAKE_CXXFLAGS -= -g ++# QMAKE_CXXFLAGS += -g1 ++#} ++ + INCLUDEPATH += \ + $$SOURCE_DIR/qt/Api \ + $$SOURCE_DIR/qt/WebCoreSupport \ +diff -up qtwebkit-opensource-src-5.0.1/Source/WTF/WTF.pri.debuginfo qtwebkit-opensource-src-5.0.1/Source/WTF/WTF.pri +--- qtwebkit-opensource-src-5.0.1/Source/WTF/WTF.pri.debuginfo 2013-01-29 13:03:38.000000000 -0600 ++++ qtwebkit-opensource-src-5.0.1/Source/WTF/WTF.pri 2013-02-23 13:56:23.584947256 -0600 +@@ -8,6 +8,12 @@ + # All external modules should include WTF headers by prefixing with "wtf" (#include <wtf/some/thing.h>). + INCLUDEPATH += $$PWD + ++#equals(QT_ARCH, s390)|equals(QT_ARCH, arm)|equals(QT_ARCH, mips)|equals(QT_ARCH, i386)|equals(QT_ARCH, i686)|equals(QT_ARCH, x86_64) { ++# message("WTF workaround for QtWebkit: do not build with -g, but with -g1") ++# QMAKE_CXXFLAGS -= -g ++# QMAKE_CXXFLAGS += -g1 ++#} ++ + mac { + # Mac OS does ship libicu but not the associated header files. + # Therefore WebKit provides adequate header files. diff --git a/revert-qt4-unicode-removal.patch b/revert-qt4-unicode-removal.patch new file mode 100644 index 000000000000..fc45b6b56c58 --- /dev/null +++ b/revert-qt4-unicode-removal.patch @@ -0,0 +1,808 @@ +From 92b3cd3b0d01ca2f03e184cb16b75b31ab9a3ee6 Mon Sep 17 00:00:00 2001 +From: hausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc> +Date: Wed, 30 Jan 2013 12:27:34 +0000 +Subject: [PATCH] [Qt] Remove QT4_UNICODE related code paths + https://bugs.webkit.org/show_bug.cgi?id=108316 + +Reviewed by Kenneth Rohde Christiansen. + +Source/WebCore: + +Get rid of QT4_UNICODE and any related code paths. The Qt port +requires Qt5 and ICU these days. This also allows for the removal +of TextCodecQt. + +* Target.pri: +* platform/KURL.cpp: +(WebCore::appendEncodedHostname): +* platform/graphics/SurrogatePairAwareTextIterator.cpp: +(WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks): +* platform/text/TextEncoding.cpp: +(WebCore::TextEncoding::encode): +* platform/text/TextEncodingRegistry.cpp: +(WebCore::extendTextCodecMaps): +* platform/text/qt/TextCodecQt.cpp: Removed. +* platform/text/qt/TextCodecQt.h: Removed. + +Source/WebKit/blackberry: + +* WebCoreSupport/AboutDataUseFeatures.in: The feature macro has been removed. + +Source/WTF: + +Get rid of QT4_UNICODE and any related code paths. The Qt port +requires Qt5 and ICU these days. + +* WTF.gypi: +* WTF.pro: +* wtf/unicode/Unicode.h: +* wtf/unicode/qt4/UnicodeQt4.h: Removed. + +git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141255 268f45cc-cd09-0410-ab3c-d52691b4dbfc +--- + Source/WTF/ChangeLog | 15 + + Source/WTF/WTF.gypi | 1 - + Source/WTF/WTF.pro | 1 - + Source/WTF/wtf/unicode/Unicode.h | 4 +- + Source/WTF/wtf/unicode/qt4/UnicodeQt4.h | 377 -------------------- + Source/WebCore/ChangeLog | 23 ++ + Source/WebCore/Target.pri | 2 - + Source/WebCore/platform/KURL.cpp | 5 - + .../graphics/SurrogatePairAwareTextIterator.cpp | 5 - + Source/WebCore/platform/text/TextEncoding.cpp | 6 - + .../WebCore/platform/text/TextEncodingRegistry.cpp | 8 - + Source/WebCore/platform/text/qt/TextCodecQt.cpp | 160 --------- + Source/WebCore/platform/text/qt/TextCodecQt.h | 54 --- + Source/WebKit/blackberry/ChangeLog | 9 + + .../WebCoreSupport/AboutDataUseFeatures.in | 1 - + 15 files changed, 48 insertions(+), 623 deletions(-) + delete mode 100644 Source/WTF/wtf/unicode/qt4/UnicodeQt4.h + delete mode 100644 Source/WebCore/platform/text/qt/TextCodecQt.cpp + delete mode 100644 Source/WebCore/platform/text/qt/TextCodecQt.h + +diff --git a/Source/WTF/WTF.pro b/Source/WTF/WTF.pro +index c929c68..727d78b 100644 +--- a/Source/WTF/WTF.pro ++++ b/Source/WTF/WTF.pro +@@ -178,7 +178,6 @@ HEADERS += \ + unicode/CharacterNames.h \ + unicode/Collator.h \ + unicode/icu/UnicodeIcu.h \ +- unicode/qt4/UnicodeQt4.h \ + unicode/ScriptCodesFromICU.h \ + unicode/Unicode.h \ + unicode/UnicodeMacrosFromICU.h \ +diff --git a/Source/WTF/wtf/unicode/Unicode.h b/Source/WTF/wtf/unicode/Unicode.h +index 9260211..11fee6b 100644 +--- a/Source/WTF/wtf/unicode/Unicode.h ++++ b/Source/WTF/wtf/unicode/Unicode.h +@@ -30,8 +30,6 @@ + + #if USE(ICU_UNICODE) + #include <wtf/unicode/icu/UnicodeIcu.h> +-#elif USE(QT4_UNICODE) +-#include "qt4/UnicodeQt4.h" + #elif USE(WCHAR_UNICODE) + #include <wtf/unicode/wchar/UnicodeWchar.h> + #else +diff --git a/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h b/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h +deleted file mode 100644 +index a2d1ad4..0000000 +--- a/Source/WTF/wtf/unicode/qt4/UnicodeQt4.h ++++ /dev/null +@@ -1,377 +0,0 @@ +-/* +- * Copyright (C) 2006 George Staikos <staikos@kde.org> +- * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> +- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Library General Public +- * License as published by the Free Software Foundation; either +- * version 2 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Library General Public License for more details. +- * +- * You should have received a copy of the GNU Library General Public License +- * along with this library; see the file COPYING.LIB. If not, write to +- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +- * Boston, MA 02110-1301, USA. +- * +- */ +- +-#ifndef WTF_UNICODE_QT4_H +-#define WTF_UNICODE_QT4_H +- +-#include <wtf/unicode/ScriptCodesFromICU.h> +-#include <wtf/unicode/UnicodeMacrosFromICU.h> +- +-#include <QChar> +-#include <QString> +- +-#include <config.h> +- +-#include <stdint.h> +-#if USE(ICU_UNICODE) +-#include <unicode/ubrk.h> +-#endif +- +-QT_BEGIN_NAMESPACE +-namespace QUnicodeTables { +- struct Properties { +- ushort category : 8; +- ushort line_break_class : 8; +- ushort direction : 8; +- ushort combiningClass :8; +- ushort joining : 2; +- signed short digitValue : 6; /* 5 needed */ +- ushort unicodeVersion : 4; +- ushort lowerCaseSpecial : 1; +- ushort upperCaseSpecial : 1; +- ushort titleCaseSpecial : 1; +- ushort caseFoldSpecial : 1; /* currently unused */ +- signed short mirrorDiff : 16; +- signed short lowerCaseDiff : 16; +- signed short upperCaseDiff : 16; +- signed short titleCaseDiff : 16; +- signed short caseFoldDiff : 16; +- }; +- Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4); +- Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2); +-} +-QT_END_NAMESPACE +- +-// ugly hack to make UChar compatible with JSChar in API/JSStringRef.h +-#if defined(Q_OS_WIN) || (COMPILER(RVCT) && !OS(LINUX)) +-typedef wchar_t UChar; +-#else +-typedef uint16_t UChar; +-#endif +- +-#if !USE(ICU_UNICODE) +-typedef uint32_t UChar32; +-#endif +- +-namespace WTF { +-namespace Unicode { +- +-enum Direction { +- LeftToRight = QChar::DirL, +- RightToLeft = QChar::DirR, +- EuropeanNumber = QChar::DirEN, +- EuropeanNumberSeparator = QChar::DirES, +- EuropeanNumberTerminator = QChar::DirET, +- ArabicNumber = QChar::DirAN, +- CommonNumberSeparator = QChar::DirCS, +- BlockSeparator = QChar::DirB, +- SegmentSeparator = QChar::DirS, +- WhiteSpaceNeutral = QChar::DirWS, +- OtherNeutral = QChar::DirON, +- LeftToRightEmbedding = QChar::DirLRE, +- LeftToRightOverride = QChar::DirLRO, +- RightToLeftArabic = QChar::DirAL, +- RightToLeftEmbedding = QChar::DirRLE, +- RightToLeftOverride = QChar::DirRLO, +- PopDirectionalFormat = QChar::DirPDF, +- NonSpacingMark = QChar::DirNSM, +- BoundaryNeutral = QChar::DirBN +-}; +- +-enum DecompositionType { +- DecompositionNone = QChar::NoDecomposition, +- DecompositionCanonical = QChar::Canonical, +- DecompositionCompat = QChar::Compat, +- DecompositionCircle = QChar::Circle, +- DecompositionFinal = QChar::Final, +- DecompositionFont = QChar::Font, +- DecompositionFraction = QChar::Fraction, +- DecompositionInitial = QChar::Initial, +- DecompositionIsolated = QChar::Isolated, +- DecompositionMedial = QChar::Medial, +- DecompositionNarrow = QChar::Narrow, +- DecompositionNoBreak = QChar::NoBreak, +- DecompositionSmall = QChar::Small, +- DecompositionSquare = QChar::Square, +- DecompositionSub = QChar::Sub, +- DecompositionSuper = QChar::Super, +- DecompositionVertical = QChar::Vertical, +- DecompositionWide = QChar::Wide +-}; +- +-enum CharCategory { +- NoCategory = 0, +- Mark_NonSpacing = U_MASK(QChar::Mark_NonSpacing), +- Mark_SpacingCombining = U_MASK(QChar::Mark_SpacingCombining), +- Mark_Enclosing = U_MASK(QChar::Mark_Enclosing), +- Number_DecimalDigit = U_MASK(QChar::Number_DecimalDigit), +- Number_Letter = U_MASK(QChar::Number_Letter), +- Number_Other = U_MASK(QChar::Number_Other), +- Separator_Space = U_MASK(QChar::Separator_Space), +- Separator_Line = U_MASK(QChar::Separator_Line), +- Separator_Paragraph = U_MASK(QChar::Separator_Paragraph), +- Other_Control = U_MASK(QChar::Other_Control), +- Other_Format = U_MASK(QChar::Other_Format), +- Other_Surrogate = U_MASK(QChar::Other_Surrogate), +- Other_PrivateUse = U_MASK(QChar::Other_PrivateUse), +- Other_NotAssigned = U_MASK(QChar::Other_NotAssigned), +- Letter_Uppercase = U_MASK(QChar::Letter_Uppercase), +- Letter_Lowercase = U_MASK(QChar::Letter_Lowercase), +- Letter_Titlecase = U_MASK(QChar::Letter_Titlecase), +- Letter_Modifier = U_MASK(QChar::Letter_Modifier), +- Letter_Other = U_MASK(QChar::Letter_Other), +- Punctuation_Connector = U_MASK(QChar::Punctuation_Connector), +- Punctuation_Dash = U_MASK(QChar::Punctuation_Dash), +- Punctuation_Open = U_MASK(QChar::Punctuation_Open), +- Punctuation_Close = U_MASK(QChar::Punctuation_Close), +- Punctuation_InitialQuote = U_MASK(QChar::Punctuation_InitialQuote), +- Punctuation_FinalQuote = U_MASK(QChar::Punctuation_FinalQuote), +- Punctuation_Other = U_MASK(QChar::Punctuation_Other), +- Symbol_Math = U_MASK(QChar::Symbol_Math), +- Symbol_Currency = U_MASK(QChar::Symbol_Currency), +- Symbol_Modifier = U_MASK(QChar::Symbol_Modifier), +- Symbol_Other = U_MASK(QChar::Symbol_Other) +-}; +- +- +-// FIXME: handle surrogates correctly in all methods +- +-inline UChar32 toLower(UChar32 ch) +-{ +- return QChar::toLower(uint32_t(ch)); +-} +- +-inline int toLower(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) +-{ +- const UChar *e = src + srcLength; +- const UChar *s = src; +- UChar *r = result; +- uint rindex = 0; +- +- // this avoids one out of bounds check in the loop +- if (s < e && QChar(*s).isLowSurrogate()) { +- if (r) +- r[rindex] = *s++; +- ++rindex; +- } +- +- int needed = 0; +- while (s < e && (rindex < uint(resultLength) || !r)) { +- uint c = *s; +- if (QChar(c).isLowSurrogate() && QChar(*(s - 1)).isHighSurrogate()) +- c = QChar::surrogateToUcs4(*(s - 1), c); +- const QUnicodeTables::Properties *prop = QUnicodeTables::properties(c); +- if (prop->lowerCaseSpecial) { +- QString qstring; +- if (c < 0x10000) { +- qstring += QChar(c); +- } else { +- qstring += QChar(*(s-1)); +- qstring += QChar(*s); +- } +- qstring = qstring.toLower(); +- for (int i = 0; i < qstring.length(); ++i) { +- if (rindex >= uint(resultLength)) { +- needed += qstring.length() - i; +- break; +- } +- if (r) +- r[rindex] = qstring.at(i).unicode(); +- ++rindex; +- } +- } else { +- if (r) +- r[rindex] = *s + prop->lowerCaseDiff; +- ++rindex; +- } +- ++s; +- } +- if (s < e) +- needed += e - s; +- *error = (needed != 0); +- if (rindex < uint(resultLength)) +- r[rindex] = 0; +- return rindex + needed; +-} +- +-inline UChar32 toUpper(UChar32 c) +-{ +- return QChar::toUpper(uint32_t(c)); +-} +- +-inline int toUpper(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) +-{ +- const UChar *e = src + srcLength; +- const UChar *s = src; +- UChar *r = result; +- int rindex = 0; +- +- // this avoids one out of bounds check in the loop +- if (s < e && QChar(*s).isLowSurrogate()) { +- if (r) +- r[rindex] = *s++; +- ++rindex; +- } +- +- int needed = 0; +- while (s < e && (rindex < resultLength || !r)) { +- uint c = *s; +- if (QChar(c).isLowSurrogate() && QChar(*(s - 1)).isHighSurrogate()) +- c = QChar::surrogateToUcs4(*(s - 1), c); +- const QUnicodeTables::Properties *prop = QUnicodeTables::properties(c); +- if (prop->upperCaseSpecial) { +- QString qstring; +- if (c < 0x10000) { +- qstring += QChar(c); +- } else { +- qstring += QChar(*(s-1)); +- qstring += QChar(*s); +- } +- qstring = qstring.toUpper(); +- for (int i = 0; i < qstring.length(); ++i) { +- if (rindex >= resultLength) { +- needed += qstring.length() - i; +- break; +- } +- if (r) +- r[rindex] = qstring.at(i).unicode(); +- ++rindex; +- } +- } else { +- if (r) +- r[rindex] = *s + prop->upperCaseDiff; +- ++rindex; +- } +- ++s; +- } +- if (s < e) +- needed += e - s; +- *error = (needed != 0); +- if (rindex < resultLength) +- r[rindex] = 0; +- return rindex + needed; +-} +- +-inline int toTitleCase(UChar32 c) +-{ +- return QChar::toTitleCase(uint32_t(c)); +-} +- +-inline UChar32 foldCase(UChar32 c) +-{ +- return QChar::toCaseFolded(uint32_t(c)); +-} +- +-inline int foldCase(UChar* result, int resultLength, const UChar* src, int srcLength, bool* error) +-{ +- // FIXME: handle special casing. Easiest with some low level API in Qt +- *error = false; +- if (resultLength < srcLength) { +- *error = true; +- return srcLength; +- } +- for (int i = 0; i < srcLength; ++i) +- result[i] = QChar::toCaseFolded(ushort(src[i])); +- return srcLength; +-} +- +-inline bool isArabicChar(UChar32 c) +-{ +- return c >= 0x0600 && c <= 0x06FF; +-} +- +-inline bool isPrintableChar(UChar32 c) +-{ +- const uint test = U_MASK(QChar::Other_Control) | +- U_MASK(QChar::Other_NotAssigned); +- return !(U_MASK(QChar::category(uint32_t(c))) & test); +-} +- +-inline bool isSeparatorSpace(UChar32 c) +-{ +- return QChar::category(uint32_t(c)) == QChar::Separator_Space; +-} +- +-inline bool isPunct(UChar32 c) +-{ +- const uint test = U_MASK(QChar::Punctuation_Connector) | +- U_MASK(QChar::Punctuation_Dash) | +- U_MASK(QChar::Punctuation_Open) | +- U_MASK(QChar::Punctuation_Close) | +- U_MASK(QChar::Punctuation_InitialQuote) | +- U_MASK(QChar::Punctuation_FinalQuote) | +- U_MASK(QChar::Punctuation_Other); +- return U_MASK(QChar::category(uint32_t(c))) & test; +-} +- +-inline bool isLower(UChar32 c) +-{ +- return QChar::category(uint32_t(c)) == QChar::Letter_Lowercase; +-} +- +-inline bool hasLineBreakingPropertyComplexContext(UChar32) +-{ +- // FIXME: Implement this to return whether the character has line breaking property SA (Complex Context). +- return false; +-} +- +-inline UChar32 mirroredChar(UChar32 c) +-{ +- return QChar::mirroredChar(uint32_t(c)); +-} +- +-inline uint8_t combiningClass(UChar32 c) +-{ +- return QChar::combiningClass(uint32_t(c)); +-} +- +-inline DecompositionType decompositionType(UChar32 c) +-{ +- return (DecompositionType)QChar::decompositionTag(c); +-} +- +-inline int umemcasecmp(const UChar* a, const UChar* b, int len) +-{ +- // handle surrogates correctly +- for (int i = 0; i < len; ++i) { +- uint c1 = QChar::toCaseFolded(ushort(a[i])); +- uint c2 = QChar::toCaseFolded(ushort(b[i])); +- if (c1 != c2) +- return c1 - c2; +- } +- return 0; +-} +- +-inline Direction direction(UChar32 c) +-{ +- return (Direction)QChar::direction(uint32_t(c)); +-} +- +-inline CharCategory category(UChar32 c) +-{ +- return (CharCategory) U_MASK(QChar::category(uint32_t(c))); +-} +- +-} // namespace Unicode +-} // namespace WTF +- +-#endif // WTF_UNICODE_QT4_H +diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri +index 44f02b6..0e3cd5f 100644 +--- a/Source/WebCore/Target.pri ++++ b/Source/WebCore/Target.pri +@@ -2357,7 +2357,6 @@ HEADERS += \ + platform/text/DecodeEscapeSequences.h \ + platform/text/Hyphenation.h \ + platform/text/QuotedPrintable.h \ +- platform/text/qt/TextCodecQt.h \ + platform/text/RegularExpression.h \ + platform/text/SegmentedString.h \ + platform/text/TextBoundaries.h \ +@@ -2927,7 +2926,6 @@ SOURCES += \ + platform/qt/TemporaryLinkStubsQt.cpp \ + platform/text/qt/TextBoundariesQt.cpp \ + platform/text/qt/TextBreakIteratorInternalICUQt.cpp \ +- platform/text/qt/TextCodecQt.cpp \ + platform/qt/WidgetQt.cpp + + use?(LIBXML2) { +diff --git a/Source/WebCore/platform/KURL.cpp b/Source/WebCore/platform/KURL.cpp +index a1e0114..01a408c 100644 +--- a/Source/WebCore/platform/KURL.cpp ++++ b/Source/WebCore/platform/KURL.cpp +@@ -40,8 +40,6 @@ + + #if USE(ICU_UNICODE) + #include <unicode/uidna.h> +-#elif USE(QT4_UNICODE) +-#include <QUrl> + #endif + + // FIXME: This file makes too much use of the + operator on String. +@@ -1498,9 +1496,6 @@ + hostnameBufferLength, UIDNA_ALLOW_UNASSIGNED, 0, &error); + if (error == U_ZERO_ERROR) + buffer.append(hostnameBuffer, numCharactersConverted); +-#elif USE(QT4_UNICODE) +- QByteArray result = QUrl::toAce(String(str, strLen)); +- buffer.append(result.constData(), result.length()); + #endif + } + +diff --git a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp +index 11da4b9..e7eb43b 100644 +--- a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp ++++ b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp +@@ -90,11 +90,6 @@ UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks() + int32_t resultLength = unorm_normalize(m_characters, 2, UNORM_NFC, UNORM_UNICODE_3_2, &normalizedCharacters[0], 2, &uStatus); + if (resultLength == 1 && !uStatus) + return normalizedCharacters[0]; +-#elif USE(QT4_UNICODE) +- QString tmp(reinterpret_cast<const QChar*>(m_characters), 2); +- QString res = tmp.normalized(QString::NormalizationForm_C, QChar::Unicode_3_2); +- if (res.length() == 1) +- return res.at(0).unicode(); + #endif + } + +diff --git a/Source/WebCore/platform/text/TextEncoding.cpp b/Source/WebCore/platform/text/TextEncoding.cpp +index f28cd67..6c9a24d 100644 +--- a/Source/WebCore/platform/text/TextEncoding.cpp ++++ b/Source/WebCore/platform/text/TextEncoding.cpp +@@ -37,8 +37,6 @@ + + #if USE(ICU_UNICODE) + #include <unicode/unorm.h> +-#elif USE(QT4_UNICODE) +-#include <QString> + #endif + + namespace WebCore { +@@ -103,10 +101,6 @@ + sourceLength = normalizedLength; + } + return newTextCodec(*this)->encode(source, sourceLength, handling); +-#elif USE(QT4_UNICODE) +- QString str(reinterpret_cast<const QChar*>(characters), length); +- str = str.normalized(QString::NormalizationForm_C); +- return newTextCodec(*this)->encode(reinterpret_cast<const UChar *>(str.utf16()), str.length(), handling); + #elif OS(WINDOWS) && USE(WCHAR_UNICODE) + // normalization will be done by Windows CE API + OwnPtr<TextCodec> textCodec = newTextCodec(*this); +diff --git a/Source/WebCore/platform/text/TextEncodingRegistry.cpp b/Source/WebCore/platform/text/TextEncodingRegistry.cpp +index 2790227..1d12202 100644 +--- a/Source/WebCore/platform/text/TextEncodingRegistry.cpp ++++ b/Source/WebCore/platform/text/TextEncodingRegistry.cpp +@@ -42,9 +42,6 @@ + #if USE(ICU_UNICODE) + #include "TextCodecICU.h" + #endif +-#if USE(QT4_UNICODE) +-#include "qt/TextCodecQt.h" +-#endif + #if PLATFORM(MAC) + #include "TextCodecMac.h" + #endif +@@ -296,11 +293,6 @@ static void extendTextCodecMaps() + TextCodecICU::registerCodecs(addToTextCodecMap); + #endif + +-#if USE(QT4_UNICODE) +- TextCodecQt::registerEncodingNames(addToTextEncodingNameMap); +- TextCodecQt::registerCodecs(addToTextCodecMap); +-#endif +- + #if PLATFORM(MAC) + TextCodecMac::registerEncodingNames(addToTextEncodingNameMap); + TextCodecMac::registerCodecs(addToTextCodecMap); +diff --git a/Source/WebCore/platform/text/qt/TextCodecQt.cpp b/Source/WebCore/platform/text/qt/TextCodecQt.cpp +deleted file mode 100644 +index 6a36e1a..0000000 +--- a/Source/WebCore/platform/text/qt/TextCodecQt.cpp ++++ /dev/null +@@ -1,160 +0,0 @@ +-/* +- * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> +- * Copyright (C) 2008 Holger Hans Peter Freyther +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * 1. Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * 2. Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * +- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- */ +- +-#include "config.h" +-#if USE(QT4_UNICODE) +-#include "TextCodecQt.h" +- +-#include <qset.h> +-#include <wtf/text/CString.h> +-#include <wtf/text/WTFString.h> +- +-namespace WebCore { +- +-static QSet<QByteArray> *unique_names = 0; +- +-static const char *getAtomicName(const QByteArray &name) +-{ +- if (!unique_names) +- unique_names = new QSet<QByteArray>; +- +- unique_names->insert(name); +- return unique_names->find(name)->constData(); +-} +- +-void TextCodecQt::registerEncodingNames(EncodingNameRegistrar registrar) +-{ +- QList<int> mibs = QTextCodec::availableMibs(); +- +- for (int i = 0; i < mibs.size(); ++i) { +- QTextCodec *c = QTextCodec::codecForMib(mibs.at(i)); +- const char *name = getAtomicName(c->name()); +- registrar(name, name); +- QList<QByteArray> aliases = c->aliases(); +- for (int i = 0; i < aliases.size(); ++i) { +- const char *a = getAtomicName(aliases.at(i)); +- registrar(a, name); +- } +- } +-} +- +-static PassOwnPtr<TextCodec> newTextCodecQt(const TextEncoding& encoding, const void*) +-{ +- return adoptPtr(new TextCodecQt(encoding)); +-} +- +-void TextCodecQt::registerCodecs(TextCodecRegistrar registrar) +-{ +- QList<int> mibs = QTextCodec::availableMibs(); +- +- for (int i = 0; i < mibs.size(); ++i) { +- QTextCodec *c = QTextCodec::codecForMib(mibs.at(i)); +- const char *name = getAtomicName(c->name()); +- registrar(name, newTextCodecQt, 0); +- } +-} +- +-TextCodecQt::TextCodecQt(const TextEncoding& encoding) +- : m_encoding(encoding) +-{ +- m_codec = QTextCodec::codecForName(m_encoding.name()); +-} +- +-TextCodecQt::~TextCodecQt() +-{ +-} +- +- +-String TextCodecQt::decode(const char* bytes, size_t length, bool flush, bool /*stopOnError*/, bool& sawError) +-{ +- // We chop input buffer to smaller buffers to avoid excessive memory consumption +- // when the input buffer is big. This helps reduce peak memory consumption in +- // mobile devices where system RAM is limited. +- static const int MaxInputChunkSize = 1024 * 1024; +- const char* buf = bytes; +- const char* end = buf + length; +- String unicode(""); // a non-null string is expected +- +- while (buf < end) { +- int size = end - buf; +- size = qMin(size, MaxInputChunkSize); +- QString decoded = m_codec->toUnicode(buf, size, &m_state); +- unicode.append(reinterpret_cast_ptr<const UChar*>(decoded.unicode()), decoded.length()); +- buf += size; +- } +- +- sawError = m_state.invalidChars != 0; +- +- if (flush) { +- m_state.flags = QTextCodec::DefaultConversion; +- m_state.remainingChars = 0; +- m_state.invalidChars = 0; +- } +- +- return unicode; +-} +- +-CString TextCodecQt::encode(const UChar* characters, size_t length, UnencodableHandling handling) +-{ +- QTextCodec::ConverterState state; +- state.flags = QTextCodec::ConversionFlags(QTextCodec::ConvertInvalidToNull | QTextCodec::IgnoreHeader); +- +- if (!length) +- return ""; +- +- QByteArray ba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), length, &state); +- +- // If some <b> characters </b> are unencodable, escape them as specified by <b> handling </b> +- // We append one valid encoded chunk to a QByteArray at a time. When we encounter an unencodable chunk we +- // escape it with getUnencodableReplacement, append it, then move to the next chunk. +- if (state.invalidChars) { +- state.invalidChars = 0; +- state.remainingChars = 0; +- int len = 0; +- ba.clear(); +- for (size_t pos = 0; pos < length; ++pos) { +- QByteArray tba = m_codec->fromUnicode(reinterpret_cast<const QChar*>(characters), ++len, &state); +- if (state.remainingChars) +- continue; +- if (state.invalidChars) { +- UnencodableReplacementArray replacement; +- getUnencodableReplacement(characters[0], handling, replacement); +- tba.replace('\0', replacement); +- state.invalidChars = 0; +- } +- ba.append(tba); +- characters += len; +- len = 0; +- state.remainingChars = 0; +- } +- } +- +- return CString(ba.constData(), ba.length()); +-} +- +- +-} // namespace WebCore +-#endif +diff --git a/Source/WebCore/platform/text/qt/TextCodecQt.h b/Source/WebCore/platform/text/qt/TextCodecQt.h +deleted file mode 100644 +index f28f0bb..0000000 +--- a/Source/WebCore/platform/text/qt/TextCodecQt.h ++++ /dev/null +@@ -1,54 +0,0 @@ +-/* +- * Copyright (C) 2006 Lars Knoll <lars@trolltech.com> +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * 1. Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * 2. Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * +- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- */ +- +-#ifndef TextCodecQt_h +-#define TextCodecQt_h +- +-#include "TextCodec.h" +-#include "TextEncoding.h" +-#include <QTextCodec> +- +-namespace WebCore { +- +- class TextCodecQt : public TextCodec { +- public: +- static void registerEncodingNames(EncodingNameRegistrar); +- static void registerCodecs(TextCodecRegistrar); +- +- TextCodecQt(const TextEncoding&); +- virtual ~TextCodecQt(); +- +- virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError); +- virtual CString encode(const UChar*, size_t length, UnencodableHandling); +- +- private: +- TextEncoding m_encoding; +- QTextCodec *m_codec; +- QTextCodec::ConverterState m_state; +- }; +- +-} // namespace WebCore +- +-#endif // TextCodecICU_h +-- +1.7.1 + diff --git a/webkit-commit-151422.patch b/webkit-commit-151422.patch new file mode 100644 index 000000000000..5656f61546a1 --- /dev/null +++ b/webkit-commit-151422.patch @@ -0,0 +1,46 @@ +Index: trunk/Source/WebCore/rendering/RenderText.cpp
+===================================================================
+--- trunk/Source/WebCore/rendering/RenderText.cpp (revision 151327)
++++ trunk/Source/WebCore/rendering/RenderText.cpp (revision 151422)
+@@ -101,5 +101,5 @@
+
+ unsigned length = string->length();
+- const UChar* characters = string->characters();
++ const StringImpl& stringImpl = *string->impl();
+
+ if (length >= numeric_limits<unsigned>::max())
+@@ -110,8 +110,8 @@
+ for (unsigned i = 1; i < length + 1; i++) {
+ // Replace   with a real space since ICU no longer treats   as a word separator.
+- if (characters[i - 1] == noBreakSpace)
++ if (stringImpl[i - 1] == noBreakSpace)
+ stringWithPrevious[i] = ' ';
+ else
+- stringWithPrevious[i] = characters[i - 1];
++ stringWithPrevious[i] = stringImpl[i - 1];
+ }
+
+@@ -120,5 +120,6 @@
+ return;
+
+- StringBuffer<UChar> data(length);
++ StringBuilder result;
++ result.reserveCapacity(length);
+
+ int32_t endOfWord;
+@@ -126,10 +127,10 @@
+ for (endOfWord = textBreakNext(boundary); endOfWord != TextBreakDone; startOfWord = endOfWord, endOfWord = textBreakNext(boundary)) {
+ if (startOfWord) // Ignore first char of previous string
+- data[startOfWord - 1] = characters[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]);
++ result.append(stringImpl[startOfWord - 1] == noBreakSpace ? noBreakSpace : toTitleCase(stringWithPrevious[startOfWord]));
+ for (int i = startOfWord + 1; i < endOfWord; i++)
+- data[i - 1] = characters[i - 1];
+- }
+-
+- *string = String::adopt(data);
++ result.append(stringImpl[i - 1]);
++ }
++
++ *string = result.toString();
+ }
+
|