Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Qt] Remove support for Qt versions before 4.8.0
https://bugs.webkit.org/show_bug.cgi?id=91730

Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-07-19
Reviewed by Kenneth Rohde Christiansen.

Remove Qt version check #ifdefs for Qt versions before 4.8.0.

Source/WebCore:

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContextPlatformPrivate::clipBoundingRect):
* platform/qt/ThirdPartyCookiesQt.cpp:
(WebCore::urlsShareSameDomain):
(WebCore::thirdPartyCookiePolicyPermits):

Source/WebKit/qt:

* Api/qwebsettings.cpp:
(QWebSettingsPrivate):
(QWebSettings::QWebSettings):
(QWebSettings::thirdPartyCookiePolicy):
* Api/qwebsettings.h:
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* tests/qdeclarativewebview/tst_qdeclarativewebview.cpp:
(tst_QDeclarativeWebView):
(tst_QDeclarativeWebView::backgroundColor):
* tests/qwebelement/tst_qwebelement.cpp:
(tst_QWebElement::render):
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage):
(tst_QWebPage::thirdPartyCookiePolicy):

Tools:

* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::reset):
(LayoutTestController::setAlwaysBlockCookies):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
(LayoutTestController):

Canonical link: https://commits.webkit.org/109551@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
tronical authored and webkit-commit-queue committed Jul 19, 2012
1 parent 7418609 commit a365fa2
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 44 deletions.
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2012-07-19 Simon Hausmann <simon.hausmann@nokia.com>

[Qt] Remove support for Qt versions before 4.8.0
https://bugs.webkit.org/show_bug.cgi?id=91730

Reviewed by Kenneth Rohde Christiansen.

Remove Qt version check #ifdefs for Qt versions before 4.8.0.

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContextPlatformPrivate::clipBoundingRect):
* platform/qt/ThirdPartyCookiesQt.cpp:
(WebCore::urlsShareSameDomain):
(WebCore::thirdPartyCookiePolicyPermits):

2012-07-19 Peter Rybin <peter.rybin@gmail.com>

Web Inspector: CodeGeneratorInspector.py: fix output write logic to support incremental build
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
Expand Up @@ -211,11 +211,7 @@ class GraphicsContextPlatformPrivate {

QRectF clipBoundingRect() const
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
return p()->clipBoundingRect();
#else
return p()->clipRegion().boundingRect();
#endif
}

void takeOwnershipOfPlatformContext() { platformContextIsOwned = true; }
Expand Down
6 changes: 0 additions & 6 deletions Source/WebCore/platform/qt/ThirdPartyCookiesQt.cpp
Expand Up @@ -31,7 +31,6 @@

namespace WebCore {

#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
inline void removeTopLevelDomain(QString* domain, const QString& topLevelDomain)
{
domain->remove(domain->length() - topLevelDomain.length(), topLevelDomain.length());
Expand All @@ -57,11 +56,9 @@ static bool urlsShareSameDomain(const QUrl& url, const QUrl& firstPartyUrl)

return false;
}
#endif

bool thirdPartyCookiePolicyPermits(NetworkingContext* context, const QUrl& url, const QUrl& firstPartyUrl)
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
if (!context)
return true;

Expand All @@ -79,9 +76,6 @@ bool thirdPartyCookiePolicyPermits(NetworkingContext* context, const QUrl& url,
return true;

return context->thirdPartyCookiePolicyPermission(url);
#else
return true;
#endif
}

}
Expand Down
8 changes: 0 additions & 8 deletions Source/WebKit/qt/Api/qwebsettings.cpp
Expand Up @@ -82,9 +82,7 @@ class QWebSettingsPrivate {
QString localStoragePath;
QString offlineWebApplicationCachePath;
qint64 offlineStorageDefaultQuota;
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
QWebSettings::ThirdPartyCookiePolicy thirdPartyCookiePolicy;
#endif
void apply();
WebCore::Settings* settings;
};
Expand Down Expand Up @@ -365,7 +363,6 @@ QWebSettings* QWebSettings::globalSettings()
\value DefaultFixedFontSize The default font size for fixed-pitch text.
*/

#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
/*!
\enum QWebSettings::ThirdPartyCookiePolicy
Expand All @@ -380,7 +377,6 @@ QWebSettings* QWebSettings::globalSettings()
\since QtWebKit 2,3
*/
#endif

/*!
\enum QWebSettings::WebGraphic
Expand Down Expand Up @@ -530,9 +526,7 @@ QWebSettings::QWebSettings()
d->attributes.insert(QWebSettings::SiteSpecificQuirksEnabled, true);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
d->defaultTextEncoding = QLatin1String("iso-8859-1");
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
d->thirdPartyCookiePolicy = AlwaysAllowThirdPartyCookies;
#endif
}

/*!
Expand Down Expand Up @@ -869,7 +863,6 @@ void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheM
qMax(0, totalCapacity));
}

#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
/*!
Sets the third-party cookie policy, the default is AlwaysAllowThirdPartyCookies.
*/
Expand All @@ -885,7 +878,6 @@ QWebSettings::ThirdPartyCookiePolicy QWebSettings::thirdPartyCookiePolicy() cons
{
return d->thirdPartyCookiePolicy;
}
#endif

/*!
Sets the actual font family to \a family for the specified generic family,
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit/qt/Api/qwebsettings.h
Expand Up @@ -97,13 +97,11 @@ class QWEBKIT_EXPORT QWebSettings {
DefaultFontSize,
DefaultFixedFontSize
};
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
enum ThirdPartyCookiePolicy {
AlwaysAllowThirdPartyCookies,
AlwaysBlockThirdPartyCookies,
AllowThirdPartyWithExistingCookies
};
#endif

static QWebSettings *globalSettings();

Expand Down Expand Up @@ -156,10 +154,8 @@ class QWEBKIT_EXPORT QWebSettings {

static void enablePersistentStorage(const QString& path = QString());

#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
void setThirdPartyCookiePolicy(ThirdPartyCookiePolicy);
QWebSettings::ThirdPartyCookiePolicy thirdPartyCookiePolicy() const;
#endif

inline QWebSettingsPrivate* handle() const { return d; }

Expand Down
26 changes: 26 additions & 0 deletions Source/WebKit/qt/ChangeLog
@@ -1,3 +1,29 @@
2012-07-19 Simon Hausmann <simon.hausmann@nokia.com>

[Qt] Remove support for Qt versions before 4.8.0
https://bugs.webkit.org/show_bug.cgi?id=91730

Reviewed by Kenneth Rohde Christiansen.

Remove Qt version check #ifdefs for Qt versions before 4.8.0.

* Api/qwebsettings.cpp:
(QWebSettingsPrivate):
(QWebSettings::QWebSettings):
(QWebSettings::thirdPartyCookiePolicy):
* Api/qwebsettings.h:
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* tests/qdeclarativewebview/tst_qdeclarativewebview.cpp:
(tst_QDeclarativeWebView):
(tst_QDeclarativeWebView::backgroundColor):
* tests/qwebelement/tst_qwebelement.cpp:
(tst_QWebElement::render):
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage):
(tst_QWebPage::thirdPartyCookiePolicy):

2012-07-17 Gabor Ballabas <gaborb@inf.u-szeged.hu>

[Qt][V8] Remove the V8 related codepaths and configuration
Expand Down
2 changes: 0 additions & 2 deletions Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Expand Up @@ -984,13 +984,11 @@ void DumpRenderTreeSupportQt::setMinimumTimerInterval(QWebPage* page, double int
corePage->settings()->setMinDOMTimerInterval(interval);
}

#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
bool DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows(QWebPage *page, const QUrl& url, const QUrl& firstPartyUrl)
{
Page* corePage = QWebPagePrivate::core(page);
return thirdPartyCookiePolicyPermits(corePage->mainFrame()->loader()->networkingContext(), url, firstPartyUrl);
}
#endif

QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const QString& elementId)
{
Expand Down
2 changes: 0 additions & 2 deletions Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
Expand Up @@ -211,9 +211,7 @@ class QWEBKIT_EXPORT DumpRenderTreeSupportQt {
static void setDefersLoading(QWebPage*, bool flag);
static void goBack(QWebPage*);

#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
static bool thirdPartyCookiePolicyAllows(QWebPage*, const QUrl&, const QUrl& firstPartyUrl);
#endif

static QImage paintPagesWithBoundaries(QWebFrame*);
};
Expand Down
Expand Up @@ -40,9 +40,7 @@ private slots:
void renderingEnabled();
void setHtml();
void settings();
#if QT_VERSION >= 0x040704
void backgroundColor();
#endif

private:
void checkNoErrors(const QDeclarativeComponent&);
Expand Down Expand Up @@ -505,7 +503,6 @@ void tst_QDeclarativeWebView::settings()
}
}

#if QT_VERSION >= 0x040704
void tst_QDeclarativeWebView::backgroundColor()
{
// We test here the rendering of the background.
Expand Down Expand Up @@ -533,7 +530,6 @@ void tst_QDeclarativeWebView::backgroundColor()
wv->setProperty("backgroundColor", Qt::green);
QCOMPARE(spyColorChanged.count(), 1);
}
#endif

void tst_QDeclarativeWebView::checkNoErrors(const QDeclarativeComponent& component)
{
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
Expand Up @@ -1062,11 +1062,7 @@ void tst_QWebElement::render()
QPainter painter(&chunk);
painter.fillRect(chunkRect, Qt::white);
QRect chunkPaintRect(x, 0, chunkWidth, chunkHeight);
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
tables[0].render(&painter, chunkPaintRect);
#else
tables[0].render(&painter);
#endif
painter.end();

// The first chunk in this test is passing, but the others are failing
Expand Down
4 changes: 0 additions & 4 deletions Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
Expand Up @@ -90,9 +90,7 @@ public slots:
private slots:
void initTestCase();
void cleanupTestCase();
#if QT_VERSION >= 0x040800
void thirdPartyCookiePolicy();
#endif
void contextMenuCopy();
void contextMenuPopulatedOnce();
void acceptNavigationRequest();
Expand Down Expand Up @@ -3042,7 +3040,6 @@ void tst_QWebPage::navigatorCookieEnabled()
QVERIFY(m_page->mainFrame()->evaluateJavaScript("navigator.cookieEnabled").toBool());
}

#if QT_VERSION >= 0x040800
void tst_QWebPage::thirdPartyCookiePolicy()
{
QWebSettings::globalSettings()->setThirdPartyCookiePolicy(QWebSettings::AlwaysBlockThirdPartyCookies);
Expand Down Expand Up @@ -3081,7 +3078,6 @@ void tst_QWebPage::thirdPartyCookiePolicy()
QVERIFY(!DumpRenderTreeSupportQt::thirdPartyCookiePolicyAllows(m_page,
QUrl("http://anotherexample.co.uk"), QUrl("http://example.co.uk")));
}
#endif

#ifdef Q_OS_MAC
void tst_QWebPage::macCopyUnicodeToClipboard()
Expand Down
15 changes: 15 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,18 @@
2012-07-19 Simon Hausmann <simon.hausmann@nokia.com>

[Qt] Remove support for Qt versions before 4.8.0
https://bugs.webkit.org/show_bug.cgi?id=91730

Reviewed by Kenneth Rohde Christiansen.

Remove Qt version check #ifdefs for Qt versions before 4.8.0.

* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::reset):
(LayoutTestController::setAlwaysBlockCookies):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
(LayoutTestController):

2012-07-19 Mario Sanchez Prada <msanchez@igalia.com>

[GTK] Enable MHTML support by default at build time
Expand Down
4 changes: 0 additions & 4 deletions Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
Expand Up @@ -94,10 +94,8 @@ void LayoutTestController::reset()
DumpRenderTreeSupportQt::resetGeolocationMock(m_drt->webPage());
setIconDatabaseEnabled(false);
clearAllDatabases();
#if QT_VERSION >= 0x040800
// The default state for DRT is to block third-party cookies, mimicing the Mac port
setAlwaysAcceptCookies(false);
#endif
emit hidePage();
}

Expand Down Expand Up @@ -977,7 +975,6 @@ void LayoutTestController::setTextDirection(const QString& directionName)
m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionLeftToRight);
}

#if QT_VERSION >= 0x040800
void LayoutTestController::setAlwaysAcceptCookies(bool accept)
{
QWebSettings* globalSettings = QWebSettings::globalSettings();
Expand All @@ -997,7 +994,6 @@ void LayoutTestController::setAlwaysBlockCookies(bool block)
else
globalSettings->setThirdPartyCookiePolicy(QWebSettings::AlwaysAllowThirdPartyCookies);
}
#endif

const unsigned LayoutTestController::maxViewWidth = 800;
const unsigned LayoutTestController::maxViewHeight = 600;
2 changes: 0 additions & 2 deletions Tools/DumpRenderTree/qt/LayoutTestControllerQt.h
Expand Up @@ -275,10 +275,8 @@ public slots:
void setTextDirection(const QString& directionName);
void goBack();
void setDefersLoading(bool);
#if QT_VERSION >= 0x040800
void setAlwaysAcceptCookies(bool);
void setAlwaysBlockCookies(bool);
#endif

private slots:
void processWork();
Expand Down

0 comments on commit a365fa2

Please sign in to comment.