summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r--Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp4
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp35
-rw-r--r--Source/WebCore/platform/network/qt/ResourceRequest.h13
-rw-r--r--Source/WebCore/platform/network/qt/ResourceRequestQt.cpp23
4 files changed, 61 insertions, 14 deletions
diff --git a/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp b/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
index 2ed4a98c3..8727bccab 100644
--- a/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp
@@ -105,7 +105,9 @@ FontPlatformData::FontPlatformData(const FontDescription& description, const Ato
font.setLetterSpacing(QFont::AbsoluteSpacing, letterSpacing);
if (!FontCascade::shouldUseSmoothing())
- font.setStyleStrategy(QFont::NoAntialias);
+ font.setStyleStrategy(static_cast<QFont::StyleStrategy>(QFont::NoAntialias | QFont::ForceOutline));
+ else
+ font.setStyleStrategy(QFont::ForceOutline);
m_data->bold = font.bold();
// WebKit allows font size zero but QFont does not. We will return
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 48432d974..0da45fbc7 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -41,6 +41,29 @@
#include <QCoreApplication>
+#if USE(HTTP2)
+
+#include <private/http2protocol_p.h>
+#include <cstdlib>
+
+// Redefine private bits which are not currenly exported from QtNetwork
+
+QT_BEGIN_NAMESPACE
+
+namespace Http2 {
+const char *http2ParametersPropertyName = "QT_HTTP2_PARAMETERS_PROPERTY";
+
+ProtocolParameters::ProtocolParameters()
+{
+ settingsFrameData[Settings::INITIAL_WINDOW_SIZE_ID] = qtDefaultStreamReceiveWindowSize;
+ settingsFrameData[Settings::ENABLE_PUSH_ID] = 0;
+}
+}
+
+QT_END_NAMESPACE
+
+#endif // USE(HTTP2)
+
static const int gMaxRedirections = 10;
namespace WebCore {
@@ -774,6 +797,18 @@ QNetworkReply* QNetworkReplyHandler::sendNetworkRequest(QNetworkAccessManager* m
if (!manager)
return 0;
+#if USE(HTTP2)
+ static const bool alpnIsSupported = ResourceRequest::alpnIsSupported();
+ if (alpnIsSupported && !manager->property(Http2::http2ParametersPropertyName).isValid()) {
+ Http2::ProtocolParameters params;
+ // QTBUG-77308
+ params.maxSessionReceiveWindowSize = Http2::maxSessionReceiveWindowSize / 2;
+ // Enable HTTP/2 push
+ params.settingsFrameData[Http2::Settings::ENABLE_PUSH_ID] = 1;
+ manager->setProperty(Http2::http2ParametersPropertyName, QVariant::fromValue(params));
+ }
+#endif
+
const QUrl url = m_request.url();
// Post requests on files and data don't really make sense, but for
diff --git a/Source/WebCore/platform/network/qt/ResourceRequest.h b/Source/WebCore/platform/network/qt/ResourceRequest.h
index e74d9024c..1154d56a0 100644
--- a/Source/WebCore/platform/network/qt/ResourceRequest.h
+++ b/Source/WebCore/platform/network/qt/ResourceRequest.h
@@ -29,6 +29,13 @@
#include "ResourceRequestBase.h"
+// HTTP/2 is implemented since Qt 5.8, but various QtNetwork bugs make it unusable in browser with Qt < 5.10.1
+// We also don't enable HTTP/2 for unencrypted connections because of possible compatibility issues; it can be
+// enabled manually by user application via custom QNAM subclass
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1)
+#define USE_HTTP2 1
+#endif
+
QT_BEGIN_NAMESPACE
class QNetworkRequest;
QT_END_NAMESPACE
@@ -63,6 +70,12 @@ class NetworkingContext;
QNetworkRequest toNetworkRequest(NetworkingContext* = 0) const;
+#if USE(HTTP2)
+ // Don't enable HTTP/2 when ALPN support status is unknown
+ static bool alpnIsSupported();
+#endif
+
+
private:
friend class ResourceRequestBase;
diff --git a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
index 694e2a764..2cf2e7750 100644
--- a/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
+++ b/Source/WebCore/platform/network/qt/ResourceRequestQt.cpp
@@ -27,20 +27,8 @@
#include <QNetworkRequest>
#include <QUrl>
-// HTTP/2 is implemented since Qt 5.8, but various QtNetwork bugs make it unusable in browser with Qt < 5.10.1
-// We also don't enable HTTP/2 for unencrypted connections because of possible compatibility issues; it can be
-// enabled manually by user application via custom QNAM subclass
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1)
+#if USE(HTTP2)
#include <QSslSocket>
-#define USE_HTTP2 1
-
-// Don't enable HTTP/2 when ALPN support status is unknown
-// Before QTBUG-65903 is implemented there is no better way than to check OpenSSL version
-static bool alpnIsSupported()
-{
- return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
- QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
-}
#endif
namespace WebCore {
@@ -70,6 +58,15 @@ static inline QByteArray stringToByteArray(const String& string)
return QString(string).toLatin1();
}
+#if USE(HTTP2)
+bool ResourceRequest::alpnIsSupported()
+{
+ // Before QTBUG-65903 is implemented there is no better way than to check OpenSSL version
+ return QSslSocket::sslLibraryVersionNumber() > 0x10002000L &&
+ QSslSocket::sslLibraryVersionString().startsWith(QLatin1String("OpenSSL"));
+}
+#endif
+
QNetworkRequest ResourceRequest::toNetworkRequest(NetworkingContext *context) const
{
QNetworkRequest request;