[qtwebkit] import

Rex Dieter rdieter at fedoraproject.org
Thu May 19 16:11:15 UTC 2011


commit ea356d4f1102fa432dc4879f8bce4cad7c6eb20e
Author: Rex Dieter <rdieter at fedoraproject.org>
Date:   Thu May 19 11:08:10 2011 -0500

    import

 .gitignore                                         |    1 +
 qtwebkit.spec                                      |  168 +++++++++
 sources                                            |    1 +
 webkit-qtwebkit-2.2-javascriptcore_debuginfo.patch |   12 +
 webkit-qtwebkit-2.2-no_Werror.patch                |   12 +
 webkit-qtwebkit-2.2-tp1-pluginpath.patch           |   19 +
 webkit-qtwebkit-type-casting.patch                 |  363 ++++++++++++++++++++
 7 files changed, 576 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..52aee59 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/webkit-qtwebkit-2.2-20110513.tar.xz
diff --git a/qtwebkit.spec b/qtwebkit.spec
new file mode 100644
index 0000000..2aed96a
--- /dev/null
+++ b/qtwebkit.spec
@@ -0,0 +1,168 @@
+
+%define snap 20110513
+
+Name: qtwebkit
+Version: 2.2
+Release: 2.%{snap}%{?dist}
+Summary: Qt WebKit bindings
+Group: System Environment/Libraries
+License: LGPLv2 with exceptions or GPLv3 with exceptions
+URL: http://trac.webkit.org/wiki/QtWebKit
+## start with, http://gitorious.org/webkit/qtwebkit/archive-tarball/qtwebkit-2.2-tp1
+## then rm -rf *Tests/ , and, ... 
+## tar jcf qtwebkit-developers-qtwebkit-qtwebkit-2.2-tp1.tar.bz2 webkit-qtwebkit
+# or
+# git archive --prefix=webkit-qtwebkit/ qtwebkit-2.2 autogen.sh ChangeLog configure.ac GNUmakefile.am Makefile Source/ Tools/ | xz -9
+Source0: webkit-qtwebkit-2.2-%{snap}.tar.xz
+BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+
+# search /usr/lib{,64}/mozilla/plugins-wrapped for browser plugins too
+Patch1: webkit-qtwebkit-2.2-tp1-pluginpath.patch
+# an attempt to make this work with qt-4.6.x too, work-in-progress
+Patch2: webkit-qtwebkit-type-casting.patch
+# include JavaScriptCore -debuginfo too 
+Patch3: webkit-qtwebkit-2.2-javascriptcore_debuginfo.patch
+# don't use -Werror
+Patch4: webkit-qtwebkit-2.2-no_Werror.patch
+
+BuildRequires: bison
+BuildRequires: chrpath
+BuildRequires: flex
+BuildRequires: gperf
+# FIXME, get build to set USE_GSTREAMER=1 -- Rex
+BuildRequires: gstreamer-devel gstreamer-plugins-base-devel
+BuildRequires: libicu-devel
+BuildRequires: pcre-devel
+BuildRequires: perl
+BuildRequires: qt4-devel
+%if 0%{?fedora}
+# for qtlocation and qtmultimediakit
+BuildRequires: qt-mobility-devel >= 1.2
+%endif
+BuildRequires: sqlite-devel
+
+# Not used, gstreamer and qtmultimedia are preferred
+%if 0
+BuildRequires: phonon-devel
+Requires: qt4%{?_isa} >= %{_qt4_version}
+%global phonon_ver %(pkg-config --modversion phonon 2>/dev/null || echo 4.5.0)
+Requires: phonon%{?_isa} >= %{phonon_ver}
+%endif
+
+Obsoletes: qt-webkit < 1:4.7.3
+Provides: qt-webkit = 2:%{version}-%{release}
+Provides: qt4-webkit = 2:%{version}-%{release}
+Provides: qt4-webkit%{?_isa} = 2:%{version}-%{release}
+
+%description
+%{summary}
+
+%package devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+# when qt_webkit_version.pri was moved from qt-devel => qt-webkit-devel
+Conflicts: qt-devel < 1:4.7.2-9
+Requires: qt4-devel
+Obsoletes: qt-webkit-devel < 1:4.7.3
+Provides:  qt-webkit-devel = 2:%{version}-%{release}
+Provides:  qt4-webkit-devel = 2:%{version}-%{release}
+Provides:  qt4-webkit-devel%{?_isa} = 2:%{version}-%{release}
+%description devel
+%{summary}.
+
+
+%prep
+%setup -q -n webkit-qtwebkit 
+
+%patch1 -p1 -b .pluginpath
+%patch2 -p1 -b .type-cast
+%patch3 -p1 -b .javascriptcore_debuginfo
+%patch4 -p1 -b .no_Werror
+
+
+%build 
+
+PATH=%{_qt4_bindir}:$PATH; export PATH
+QTDIR=%{_qt4_prefix}; export QTDIR
+
+#  --qmakearg="CONFIG+=webkit2"
+#  --install-headers=%{_qt4_headerdir} \
+#  --install-libs=%{_qt4_libdir} \
+# USE_GSTREAMER=1 
+Tools/Scripts/build-webkit \
+  --makeargs="%{?_smp_mflags}" \
+  --qmake=%{_qt4_qmake} \
+  --qt \
+  --release 
+
+  
+%install
+rm -rf %{buildroot} 
+
+make install INSTALL_ROOT=%{buildroot} -C WebKitBuild/Release
+
+## HACK, there has to be a better way
+chrpath --list   %{buildroot}%{_qt4_libdir}/libQtWebKit.so.4.9.0 ||:
+chrpath --delete %{buildroot}%{_qt4_libdir}/libQtWebKit.so.4.9.0 ||:
+chrpath --list   %{buildroot}%{_qt4_importdir}/QtWebKit/libqmlwebkitplugin.so ||:
+chrpath --delete %{buildroot}%{_qt4_importdir}/QtWebKit/libqmlwebkitplugin.so ||:
+
+
+%clean
+rm -rf %{buildroot} 
+
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+
+%files
+%defattr(-,root,root,-)
+%{_qt4_libdir}/libQtWebKit.so.4*
+%{_qt4_importdir}/QtWebKit/
+
+%files devel
+%defattr(-,root,root,-)
+%{_qt4_datadir}/mkspecs/modules/qt_webkit_version.pri
+%{_qt4_headerdir}/QtWebKit/
+%{_qt4_libdir}/libQtWebKit.prl
+%{_qt4_libdir}/libQtWebKit.so
+%{_libdir}/pkgconfig/QtWebKit.pc
+
+
+%changelog
+* Fri May 13 2011 Rex Dieter <rdieter at fedoraproject.org> 2.2-2.20110513
+- 20110513 qtwebkit-2.2 branch snapshot
+- cleanup deps
+- drop -Werror
+
+* Thu May 12 2011 Than Ngo <than at redhat.com> - 2.2-1
+- 2.2-tp1
+- gstreamer is now default, drop unneeded phonon patch
+
+* Fri Apr 22 2011 Rex Dieter <rdieter at fedoraproject.org> 2.1-4
+- javascriptcore -debuginfo too (#667175)
+
+* Fri Apr 22 2011 Rex Dieter <rdieter at fedoraproject.org> 2.1-3
+- Provides: qt(4)-webkit(-devel) = 2:%%version...
+
+* Thu Apr 21 2011 Rex Dieter <rdieter at fedoraproject.org> 2.1-2
+- -devel: Conflicts: qt-devel < 1:4.7.2-9 (qt_webkit_version.pri)
+- drop old/deprecated Obsoletes/Provides: WebKit-qt
+- use modified, less gigantic tarball
+- patch to use phonon instead of QtMultimediaKit
+- patch pluginpath for /usr/lib{,64}/mozilla/plugins-wrapped
+
+* Tue Apr 19 2011 Rex Dieter <rdieter at fedoraproject.org> 2.1-1
+- 2.1
+
+* Mon Nov 08 2010 Than Ngo <than at redhat.com> - 2.0-2
+- fix webkit to export symbol correctly
+
+* Tue Nov 02 2010 Rex Dieter <rdieter at fedoraproject.org> 2.0-1
+- 2.0 (as released with qt-4.7.0)
+
+* Thu Sep 09 2010 Rex Dieter <rdieter at fedoraproject.org> 2.0-0.1.week32
+- first try, borrowing a lot from debian/kubuntu packaging
diff --git a/sources b/sources
index e69de29..f5d586c 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+ff99d7a8d086b0c5af5f93b2891317ba  webkit-qtwebkit-2.2-20110513.tar.xz
diff --git a/webkit-qtwebkit-2.2-javascriptcore_debuginfo.patch b/webkit-qtwebkit-2.2-javascriptcore_debuginfo.patch
new file mode 100644
index 0000000..bc07242
--- /dev/null
+++ b/webkit-qtwebkit-2.2-javascriptcore_debuginfo.patch
@@ -0,0 +1,12 @@
+diff -up webkit-qtwebkit/Source/JavaScriptCore/JavaScriptCore.pro.javascriptcore_debuginfo webkit-qtwebkit/Source/JavaScriptCore/JavaScriptCore.pro
+--- webkit-qtwebkit/Source/JavaScriptCore/JavaScriptCore.pro.javascriptcore_debuginfo	2011-05-10 12:43:19.000000000 -0500
++++ webkit-qtwebkit/Source/JavaScriptCore/JavaScriptCore.pro	2011-05-13 10:57:21.626144796 -0500
+@@ -22,7 +22,7 @@ contains(QT_CONFIG, embedded):CONFIG += 
+ contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+ unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
+ 
+-CONFIG(QTDIR_build) {
++!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
diff --git a/webkit-qtwebkit-2.2-no_Werror.patch b/webkit-qtwebkit-2.2-no_Werror.patch
new file mode 100644
index 0000000..e63d4e9
--- /dev/null
+++ b/webkit-qtwebkit-2.2-no_Werror.patch
@@ -0,0 +1,12 @@
+diff -up webkit-qtwebkit/Source/WebKit.pri.Werror webkit-qtwebkit/Source/WebKit.pri
+--- webkit-qtwebkit/Source/WebKit.pri.Werror	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebKit.pri	2011-05-13 12:42:09.956080365 -0500
+@@ -92,7 +92,7 @@ CONFIG -= warn_on
+ 
+ # Treat warnings as errors on x86/Linux/GCC
+ linux-g++* {
+-    isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
++    #isEqual(QT_ARCH,x86_64)|isEqual(QT_ARCH,i386): QMAKE_CXXFLAGS += -Werror
+ 
+     greaterThan(QT_GCC_MAJOR_VERSION, 3):greaterThan(QT_GCC_MINOR_VERSION, 5) {
+         if (!contains(QMAKE_CXXFLAGS, -std=c++0x) && !contains(QMAKE_CXXFLAGS, -std=gnu++0x)) {
diff --git a/webkit-qtwebkit-2.2-tp1-pluginpath.patch b/webkit-qtwebkit-2.2-tp1-pluginpath.patch
new file mode 100644
index 0000000..b1e8e2f
--- /dev/null
+++ b/webkit-qtwebkit-2.2-tp1-pluginpath.patch
@@ -0,0 +1,19 @@
+diff -up webkit-qtwebkit/Source/WebCore/plugins/PluginDatabase.cpp.orig webkit-qtwebkit/Source/WebCore/plugins/PluginDatabase.cpp
+--- webkit-qtwebkit/Source/WebCore/plugins/PluginDatabase.cpp.orig	2011-05-12 10:06:43.000000000 +0200
++++ webkit-qtwebkit/Source/WebCore/plugins/PluginDatabase.cpp	2011-05-12 10:08:08.000000000 +0200
+@@ -380,6 +380,7 @@ Vector<String> PluginDatabase::defaultPl
+     paths.append("/usr/lib/firefox/plugins");
+     paths.append("/usr/lib64/browser-plugins");
+     paths.append("/usr/lib/browser-plugins");
++    paths.append("/usr/lib/mozilla/plugins-wrapped");
+     paths.append("/usr/lib/mozilla/plugins");
+     paths.append("/usr/local/netscape/plugins");
+     paths.append("/opt/mozilla/plugins");
+@@ -389,6 +390,7 @@ Vector<String> PluginDatabase::defaultPl
+     paths.append("/usr/lib/netscape/plugins");
+     paths.append("/usr/lib/netscape/plugins-libc5");
+     paths.append("/usr/lib/netscape/plugins-libc6");
++    paths.append("/usr/lib64/mozilla/plugins-wrapped");
+     paths.append("/usr/lib64/netscape/plugins");
+     paths.append("/usr/lib64/mozilla/plugins");
+     paths.append("/usr/lib/nsbrowser/plugins");
diff --git a/webkit-qtwebkit-type-casting.patch b/webkit-qtwebkit-type-casting.patch
new file mode 100644
index 0000000..10a83e0
--- /dev/null
+++ b/webkit-qtwebkit-type-casting.patch
@@ -0,0 +1,363 @@
+diff -up webkit-qtwebkit/Source/WebCore/bindings/js/JSDocumentCustom.cpp.type-cast webkit-qtwebkit/Source/WebCore/bindings/js/JSDocumentCustom.cpp
+--- webkit-qtwebkit/Source/WebCore/bindings/js/JSDocumentCustom.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/bindings/js/JSDocumentCustom.cpp	2011-05-13 13:39:06.626230025 -0500
+@@ -118,7 +118,7 @@ JSValue JSDocument::createTouchList(Exec
+ {
+     RefPtr<TouchList> touchList = TouchList::create();
+ 
+-    for (int i = 0; i < exec->argumentCount(); i++)
++    for (uint i = 0; i < exec->argumentCount(); i++)
+         touchList->append(toTouch(exec->argument(i)));
+ 
+     return toJS(exec, globalObject(), touchList.release());
+diff -up webkit-qtwebkit/Source/WebCore/editing/qt/SmartReplaceQt.cpp.type-cast webkit-qtwebkit/Source/WebCore/editing/qt/SmartReplaceQt.cpp
+--- webkit-qtwebkit/Source/WebCore/editing/qt/SmartReplaceQt.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/editing/qt/SmartReplaceQt.cpp	2011-05-13 13:39:06.626230025 -0500
+@@ -55,8 +55,8 @@ bool isCharacterSmartReplaceExempt(UChar
+     const char prev[] = "([\"\'#$/-`{\0";
+     const char next[] = ")].,;:?\'!\"%*-/}\0";
+     const char* str = (isPreviousCharacter) ? prev : next;
+-    for (int i = 0; i < strlen(str); ++i) {
+-        if (str[i] == c)
++    for (uint i = 0; i < strlen(str); ++i) {
++        if ((UChar32)str[i] == c)
+           return true;
+     }
+ 
+diff -up webkit-qtwebkit/Source/WebCore/page/ContextMenuController.cpp.type-cast webkit-qtwebkit/Source/WebCore/page/ContextMenuController.cpp
+--- webkit-qtwebkit/Source/WebCore/page/ContextMenuController.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/page/ContextMenuController.cpp	2011-05-13 13:39:06.627229928 -0500
+@@ -1050,6 +1050,11 @@ void ContextMenuController::checkOrEnabl
+             shouldEnable = true;
+             break;
+ #endif
++#if PLATFORM(QT)
++        case ContextMenuItemTagSelectAll:
++            shouldEnable = true;
++            break;
++#endif
+         case ContextMenuItemTagUnderline: {
+             shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyWebkitTextDecorationsInEffect, "underline") != FalseTriState;
+             shouldEnable = frame->editor()->canEditRichly();
+diff -up webkit-qtwebkit/Source/WebCore/page/Frame.cpp.type-cast webkit-qtwebkit/Source/WebCore/page/Frame.cpp
+--- webkit-qtwebkit/Source/WebCore/page/Frame.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/page/Frame.cpp	2011-05-13 13:39:06.627229928 -0500
+@@ -969,7 +969,7 @@ void Frame::tiledBackingStorePaintEnd(co
+         return;
+     unsigned size = paintedArea.size();
+     // Request repaint from the system
+-    for (int n = 0; n < size; ++n)
++    for (uint n = 0; n < size; ++n)
+         m_page->chrome()->invalidateContentsAndWindow(m_view->contentsToWindow(paintedArea[n]), false);
+ }
+ 
+diff -up webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp	2011-05-13 13:39:06.627229928 -0500
+@@ -73,8 +73,9 @@ FontPlatformData::FontPlatformData(const
+     font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
+     const bool smallCaps = description.smallCaps();
+     font.setCapitalization(smallCaps ? QFont::SmallCaps : QFont::MixedCase);
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+     font.setStyleStrategy(QFont::ForceIntegerMetrics);
+-
++#endif
+     m_data->bold = font.bold();
+     // WebKit allows font size zero but QFont does not. We will return
+     // m_data->size if a font size of zero is requested and pixelSize()
+diff -up webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontQt.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontQt.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontQt.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontQt.cpp	2011-05-13 13:39:06.627229928 -0500
+@@ -186,17 +186,20 @@ static void drawTextCommon(GraphicsConte
+             p->restore();
+             return;
+         }
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+         int skipWidth = QFontMetrics(font).width(string, from, Qt::TextBypassShaping);
+         pt.setX(pt.x() + skipWidth);
+         string = fromRawDataWithoutRef(sanitized, from, to - from);
++#endif
+     }
+ 
+     p->setFont(font);
+ 
+     int flags = run.rtl() ? Qt::TextForceRightToLeft : Qt::TextForceLeftToRight;
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+     if (!isComplexText && !(ctx->textDrawingMode() & TextModeStroke))
+         flags |= Qt::TextBypassShaping;
+-
++#endif
+     QPainterPath textStrokePath;
+     if (ctx->textDrawingMode() & TextModeStroke)
+         textStrokePath.addText(pt, font, string);
+@@ -212,7 +215,11 @@ static void drawTextCommon(GraphicsConte
+                 p->restore();
+             } else {
+                 QFontMetrics fm(font);
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+                 QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1, flags), fm.height());
++#else
++                QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1), fm.height());
++#endif
+                 QPainter* shadowPainter = ctxShadow->beginShadowLayer(ctx, boundingRect);
+                 if (shadowPainter) {
+                     // Since it will be blurred anyway, we don't care about render hints.
+@@ -229,7 +236,11 @@ static void drawTextCommon(GraphicsConte
+                 p->translate(-ctxShadow->offset());
+             } else {
+                 QFontMetrics fm(font);
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+                 QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1, flags), fm.height());
++#else
++                QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string, -1), fm.height());
++#endif
+                 QPainter* shadowPainter = ctxShadow->beginShadowLayer(ctx, boundingRect);
+                 if (shadowPainter) {
+                     // Since it will be blurred anyway, we don't care about render hints.
+@@ -254,7 +265,11 @@ static void drawTextCommon(GraphicsConte
+ 
+ void Font::drawComplexText(GraphicsContext* ctx, const TextRun& run, const FloatPoint& point, int from, int to) const
+ {
+-    drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */true);
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
++    drawTextCommon(ctx, run, point, from, to, font(), /* isComplexText = */false);
++#else
++    Q_ASSERT(false);
++#endif
+ }
+ 
+ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFontData*>*, GlyphOverflow*) const
+@@ -402,6 +417,7 @@ int Font::offsetForPositionForSimpleText
+ 
+ float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer, HashSet<const SimpleFontData*>* fallbackFonts, GlyphOverflow* glyphOverflow) const
+ {
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+     if (!primaryFont()->platformData().size())
+         return 0;
+ 
+@@ -418,11 +434,16 @@ float Font::floatWidthForSimpleText(cons
+         w -= m_wordSpacing;
+ 
+     return w + run.expansion();
++#else
++    Q_ASSERT(false);
++    return 0.0f;
++#endif
+ }
+ 
+ 
+ FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
+ {
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+     String sanitized = Font::normalizeSpaces(run.characters(), run.length());
+     QString wholeText = fromRawDataWithoutRef(sanitized);
+     QString selectedText = fromRawDataWithoutRef(sanitized, from, qMin(to - from, wholeText.length() - from));
+@@ -431,6 +452,10 @@ FloatRect Font::selectionRectForSimpleTe
+     int width = QFontMetrics(font()).width(selectedText, -1, Qt::TextBypassShaping);
+ 
+     return FloatRect(pt.x() + startX, pt.y(), width, h);
++#else
++    Q_ASSERT(false);
++    return FloatRect();
++#endif
+ }
+ 
+ bool Font::canExpandAroundIdeographsInComplexText()
+diff -up webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp	2011-05-13 13:39:06.628229831 -0500
+@@ -233,8 +233,11 @@ PassRefPtr<ByteArray> getImageData(const
+     ASSERT(!image.isNull());
+ 
+     const int bytesPerLine = image.bytesPerLine();
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+     const uchar* bits = image.constBits();
+-
++#else
++    const uchar* bits = image.bits();
++#endif
+     quint32* destRows = reinterpret_cast_ptr<quint32*>(&data[desty * rect.width() * 4 + destx * 4]);
+ 
+     if (multiplied == Unmultiplied) {
+diff -up webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp	2011-05-13 13:39:06.628229831 -0500
+@@ -184,7 +184,7 @@ void ImageDecoderQt::internalReadImage(s
+       setFailed();
+ 
+     // Attempt to return some memory
+-    for (int i = 0; i < m_frameBufferCache.size(); ++i) {
++    for (uint i = 0; i < m_frameBufferCache.size(); ++i) {
+         if (m_frameBufferCache[i].status() != ImageFrame::FrameComplete)
+             return;
+     }
+@@ -194,8 +194,15 @@ void ImageDecoderQt::internalReadImage(s
+ 
+ bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
+ {
+-    QPixmap pixmap = QPixmap::fromImageReader(m_reader.get());
++    QPixmap pixmap;
+ 
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
++    pixmap = QPixmap::fromImageReader(m_reader.get());
++#else
++    QImage img;
++    if (m_reader->read(&img))
++        pixmap = QPixmap::fromImage(img);
++#endif
+     if (pixmap.isNull()) {
+         frameCount();
+         repetitionCount();
+diff -up webkit-qtwebkit/Source/WebCore/platform/graphics/TiledBackingStore.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/graphics/TiledBackingStore.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/graphics/TiledBackingStore.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/graphics/TiledBackingStore.cpp	2011-05-13 13:39:06.628229831 -0500
+@@ -76,8 +76,8 @@ void TiledBackingStore::invalidate(const
+     Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
+     Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
+     
+-    for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
+-        for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
++    for (signed yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
++        for (signed xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
+             RefPtr<Tile> currentTile = tileAt(Tile::Coordinate(xCoordinate, yCoordinate));
+             if (!currentTile)
+                 continue;
+@@ -135,8 +135,8 @@ void TiledBackingStore::paint(GraphicsCo
+     Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
+     Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(dirtyRect.maxX(), dirtyRect.maxY()));
+ 
+-    for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
+-        for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
++    for (signed yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
++        for (signed xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
+             Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
+             RefPtr<Tile> currentTile = tileAt(currentCoordinate);
+             if (currentTile && currentTile->isReadyToPaint())
+@@ -231,8 +231,8 @@ void TiledBackingStore::createTiles()
+     unsigned requiredTileCount = 0;
+     Tile::Coordinate topLeft = tileCoordinateForPoint(coverRect.location());
+     Tile::Coordinate bottomRight = tileCoordinateForPoint(IntPoint(coverRect.maxX(), coverRect.maxY()));
+-    for (unsigned yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
+-        for (unsigned xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
++    for (signed yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
++        for (signed xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
+             Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
+             if (tileAt(currentCoordinate))
+                 continue;
+diff -up webkit-qtwebkit/Source/WebCore/platform/network/MIMESniffing.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/network/MIMESniffing.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/network/MIMESniffing.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/network/MIMESniffing.cpp	2011-05-13 13:39:06.628229831 -0500
+@@ -223,7 +223,7 @@ const size_t imageTypesSize = sizeof(ima
+ static inline size_t dataSizeNeededForImageSniffing()
+ {
+     size_t result = 0;
+-    for (int i = 0; i < imageTypesSize; ++i) {
++    for (uint i = 0; i < imageTypesSize; ++i) {
+         if (imageTypes[i].size > result)
+             result = imageTypes[i].size;
+     }
+diff -up webkit-qtwebkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp	2011-05-13 13:46:40.024092720 -0500
+@@ -71,7 +71,7 @@ FormDataIODevice::~FormDataIODevice()
+ 
+ qint64 FormDataIODevice::computeSize() 
+ {
+-    for (int i = 0; i < m_formElements.size(); ++i) {
++    for (uint i = 0; i < m_formElements.size(); ++i) {
+         const FormDataElement& element = m_formElements[i];
+         if (element.m_type == FormDataElement::data) 
+             m_dataSize += element.m_data.size();
+@@ -124,7 +124,7 @@ qint64 FormDataIODevice::readData(char* 
+             m_currentDelta += toCopy;
+             copied += toCopy;
+ 
+-            if (m_currentDelta == element.m_data.size())
++            if ((unsigned)m_currentDelta == element.m_data.size())
+                 moveToNextElement();
+         } else {
+             const QByteArray data = m_currentFile->read(available);
+@@ -362,8 +362,10 @@ String QNetworkReplyHandler::httpMethod(
+         return "PUT";
+     case QNetworkAccessManager::DeleteOperation:
+         return "DELETE";
++#if QT_VERSION >= 0x040700
+     case QNetworkAccessManager::CustomOperation:
+         return m_resourceHandle->firstRequest().httpMethod();
++#endif
+     default:
+         ASSERT_NOT_REACHED();
+         return "GET";
+@@ -390,7 +392,11 @@ QNetworkReplyHandler::QNetworkReplyHandl
+     else if (r.httpMethod() == "DELETE")
+         m_method = QNetworkAccessManager::DeleteOperation;
+     else
++#if QT_VERSION >= 0x040700
+         m_method = QNetworkAccessManager::CustomOperation;
++#else
++        m_method = QNetworkAccessManager::UnknownOperation;
++#endif
+ 
+     QObject* originatingObject = 0;
+     if (m_resourceHandle->getInternal()->m_context)
+@@ -511,10 +517,16 @@ void QNetworkReplyHandler::sendResponseI
+         response.setHTTPStatusText(m_replyWrapper->reply()->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray().constData());
+ 
+         // Add remaining headers.
+-        foreach (const QNetworkReply::RawHeaderPair& pair, m_replyWrapper->reply()->rawHeaderPairs())
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
++        foreach (const QNetworkReply::RawHeaderPair& pair, m_replyWrapper->reply()->rawHeaderPairs()) {
+             response.setHTTPHeaderField(QString::fromLatin1(pair.first), QString::fromLatin1(pair.second));
++        }
++#else
++        foreach (const QByteArray& headerName, m_replyWrapper->reply()->rawHeaderList()) {
++            response.setHTTPHeaderField(QString::fromAscii(headerName), QString::fromAscii(m_replyWrapper->reply()->rawHeader(headerName)));
++        }
++#endif
+     }
+-
+     QUrl redirection = m_replyWrapper->reply()->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
+     if (redirection.isValid()) {
+         redirect(response, redirection);
+@@ -641,8 +653,10 @@ QNetworkReply* QNetworkReplyHandler::sen
+         case QNetworkAccessManager::DeleteOperation: {
+             return manager->deleteResource(m_request);
+         }
++#if QT_VERSION >= 0x040700
+         case QNetworkAccessManager::CustomOperation:
+             return manager->sendCustomRequest(m_request, m_resourceHandle->firstRequest().httpMethod().latin1().data());
++#endif
+         case QNetworkAccessManager::UnknownOperation:
+             ASSERT_NOT_REACHED();
+             return 0;
+diff -up webkit-qtwebkit/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/network/qt/QtMIMETypeSniffer.cpp	2011-05-13 13:39:06.629229734 -0500
+@@ -44,7 +44,7 @@ bool QtMIMETypeSniffer::sniff()
+     // See QNetworkReplyWrapper::setFinished().
+     const bool isReplyFinished = m_reply->property("_q_isFinished").toBool();
+ 
+-    if (!isReplyFinished && m_reply->bytesAvailable() < m_sniffer.dataSize())
++    if (!isReplyFinished && (unsigned)m_reply->bytesAvailable() < m_sniffer.dataSize())
+         return false;
+ 
+     QByteArray data = m_reply->peek(m_sniffer.dataSize());
+diff -up webkit-qtwebkit/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp.type-cast webkit-qtwebkit/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+--- webkit-qtwebkit/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp.type-cast	2011-05-12 09:42:28.000000000 -0500
++++ webkit-qtwebkit/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp	2011-05-13 13:39:06.629229734 -0500
+@@ -82,13 +82,13 @@ QNetworkRequest ResourceRequest::toNetwo
+     default:
+         break;
+     }
+-
++#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+     if (!allowCookies()) {
+         request.setAttribute(QNetworkRequest::CookieLoadControlAttribute, QNetworkRequest::Manual);
+         request.setAttribute(QNetworkRequest::CookieSaveControlAttribute, QNetworkRequest::Manual);
+         request.setAttribute(QNetworkRequest::AuthenticationReuseAttribute, QNetworkRequest::Manual);
+     }
+-
++#endif
+     return request;
+ }
+ 


More information about the scm-commits mailing list