Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
1351100200
:
1001689948
>
opt-qtwebkit
> webkit-qtwebkit-2.2tp1-qt46.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File webkit-qtwebkit-2.2tp1-qt46.patch of Package opt-qtwebkit
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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/page/ContextMenuController.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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/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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/FontQt.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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/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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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/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 16:42:28.000000000 +0200 +++ webkit-qtwebkit/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp 2011-05-19 15:07:35.000000000 +0200 @@ -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; } diff -up webkit-qtwebkit/Source/WebKit/qt/Api/qwebframe.cpp.type-casting webkit-qtwebkit/Source/WebKit/qt/Api/qwebframe.cpp --- webkit-qtwebkit/Source/WebKit/qt/Api/qwebframe.cpp.type-casting 2011-05-24 09:55:43.000000000 +0200 +++ webkit-qtwebkit/Source/WebKit/qt/Api/qwebframe.cpp 2011-05-24 09:59:16.000000000 +0200 @@ -907,9 +907,11 @@ void QWebFrame::load(const QNetworkReque case QNetworkAccessManager::DeleteOperation: request.setHTTPMethod("DELETE"); break; +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) case QNetworkAccessManager::CustomOperation: request.setHTTPMethod(req.attribute(QNetworkRequest::CustomVerbAttribute).toByteArray().constData()); break; +#endif case QNetworkAccessManager::UnknownOperation: // eh? break; diff -up webkit-qtwebkit/Source/WebKit/qt/Api/qwebsettings.cpp.type-casting webkit-qtwebkit/Source/WebKit/qt/Api/qwebsettings.cpp --- webkit-qtwebkit/Source/WebKit/qt/Api/qwebsettings.cpp.type-casting 2011-05-24 09:46:59.000000000 +0200 +++ webkit-qtwebkit/Source/WebKit/qt/Api/qwebsettings.cpp 2011-05-24 09:53:45.000000000 +0200 @@ -480,16 +480,25 @@ QWebSettings::QWebSettings() d->fontFamilies.insert(QWebSettings::StandardFont, defaultFont.defaultFamily()); d->fontFamilies.insert(QWebSettings::SerifFont, defaultFont.defaultFamily()); +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) defaultFont.setStyleHint(QFont::Fantasy); d->fontFamilies.insert(QWebSettings::FantasyFont, defaultFont.defaultFamily()); defaultFont.setStyleHint(QFont::Cursive); d->fontFamilies.insert(QWebSettings::CursiveFont, defaultFont.defaultFamily()); +#else + d->fontFamilies.insert(QWebSettings::FantasyFont, defaultFont.defaultFamily()); + d->fontFamilies.insert(QWebSettings::CursiveFont, defaultFont.defaultFamily()); +#endif defaultFont.setStyleHint(QFont::SansSerif); d->fontFamilies.insert(QWebSettings::SansSerifFont, defaultFont.defaultFamily()); +#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) defaultFont.setStyleHint(QFont::Monospace); +#else + defaultFont.setStyleHint(QFont::TypeWriter); +#endif d->fontFamilies.insert(QWebSettings::FixedFont, defaultFont.defaultFamily()); d->attributes.insert(QWebSettings::AutoLoadImages, true);