summaryrefslogtreecommitdiff
path: root/Source/WebKit/qt
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
commita89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch)
treeb7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/WebKit/qt
parent8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff)
downloadqtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/WebKit/qt')
-rw-r--r--Source/WebKit/qt/Api/qgraphicswebview.h3
-rw-r--r--Source/WebKit/qt/Api/qwebelement.cpp13
-rw-r--r--Source/WebKit/qt/Api/qwebframe.h4
-rw-r--r--Source/WebKit/qt/Api/qwebhistory.h4
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp39
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.h4
-rw-r--r--Source/WebKit/qt/Api/qwebview.h3
-rw-r--r--Source/WebKit/qt/ChangeLog82
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp23
-rw-r--r--Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp14
-rw-r--r--Source/WebKit/qt/declarative/experimental/plugin.cpp2
-rw-r--r--Source/WebKit/qt/declarative/plugin.cpp4
13 files changed, 144 insertions, 53 deletions
diff --git a/Source/WebKit/qt/Api/qgraphicswebview.h b/Source/WebKit/qt/Api/qgraphicswebview.h
index 29e7ffdac..15fe087d6 100644
--- a/Source/WebKit/qt/Api/qgraphicswebview.h
+++ b/Source/WebKit/qt/Api/qgraphicswebview.h
@@ -25,12 +25,11 @@
#include <QtCore/qurl.h>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtWidgets/qgraphicswidget.h>
-#include <QtWidgets/qicon.h>
#else
#include <QtGui/qgraphicswidget.h>
-#include <QtGui/qicon.h>
#endif
#include <QtGui/qevent.h>
+#include <QtGui/qicon.h>
#include <QtGui/qpainter.h>
#include <QtNetwork/qnetworkaccessmanager.h>
diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp
index fb9be7892..1d020e11c 100644
--- a/Source/WebKit/qt/Api/qwebelement.cpp
+++ b/Source/WebKit/qt/Api/qwebelement.cpp
@@ -51,6 +51,7 @@
#include "ScriptState.h"
#include "StaticNodeList.h"
#include "StyleResolver.h"
+#include "markup.h"
#include "qwebframe.h"
#include "qwebframe_p.h"
#if USE(JSC)
@@ -1010,7 +1011,7 @@ void QWebElement::appendInside(const QString &markup)
if (!m_element->isHTMLElement())
return;
- RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(m_element));
+ RefPtr<DocumentFragment> fragment = createContextualFragment(markup, toHTMLElement(m_element), AllowScriptingContent);
ExceptionCode exception = 0;
m_element->appendChild(fragment, exception);
@@ -1055,7 +1056,7 @@ void QWebElement::prependInside(const QString &markup)
if (!m_element->isHTMLElement())
return;
- RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(m_element));
+ RefPtr<DocumentFragment> fragment = createContextualFragment(markup, toHTMLElement(m_element), AllowScriptingContent);
ExceptionCode exception = 0;
@@ -1107,7 +1108,7 @@ void QWebElement::prependOutside(const QString &markup)
if (!parent->isHTMLElement())
return;
- RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(parent));
+ RefPtr<DocumentFragment> fragment = createContextualFragment(markup, toHTMLElement(parent), AllowScriptingContent);
ExceptionCode exception = 0;
parent->insertBefore(fragment, m_element, exception);
@@ -1157,7 +1158,7 @@ void QWebElement::appendOutside(const QString &markup)
if (!parent->isHTMLElement())
return;
- RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(parent));
+ RefPtr<DocumentFragment> fragment = createContextualFragment(markup, toHTMLElement(parent), AllowScriptingContent);
ExceptionCode exception = 0;
if (!m_element->nextSibling())
@@ -1303,7 +1304,7 @@ void QWebElement::encloseContentsWith(const QString &markup)
if (!m_element->isHTMLElement())
return;
- RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(m_element));
+ RefPtr<DocumentFragment> fragment = createContextualFragment(markup, toHTMLElement(m_element), AllowScriptingContent);
if (!fragment || !fragment->firstChild())
return;
@@ -1378,7 +1379,7 @@ void QWebElement::encloseWith(const QString &markup)
if (!parent->isHTMLElement())
return;
- RefPtr<DocumentFragment> fragment = Range::createDocumentFragmentForElement(markup, toHTMLElement(parent));
+ RefPtr<DocumentFragment> fragment = createContextualFragment(markup, toHTMLElement(parent), AllowScriptingContent);
if (!fragment || !fragment->firstChild())
return;
diff --git a/Source/WebKit/qt/Api/qwebframe.h b/Source/WebKit/qt/Api/qwebframe.h
index ff157771f..0a8e6fc65 100644
--- a/Source/WebKit/qt/Api/qwebframe.h
+++ b/Source/WebKit/qt/Api/qwebframe.h
@@ -24,11 +24,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-#include <QtWidgets/qicon.h>
-#else
#include <QtGui/qicon.h>
-#endif
#include <QtScript/qscriptengine.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include "qwebkitglobal.h"
diff --git a/Source/WebKit/qt/Api/qwebhistory.h b/Source/WebKit/qt/Api/qwebhistory.h
index 0d590414e..753eb6376 100644
--- a/Source/WebKit/qt/Api/qwebhistory.h
+++ b/Source/WebKit/qt/Api/qwebhistory.h
@@ -24,11 +24,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qshareddata.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-#include <QtWidgets/qicon.h>
-#else
#include <QtGui/qicon.h>
-#endif
#include "qwebkitglobal.h"
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index 2e330acff..9e84eeeab 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -130,6 +130,7 @@
#include <QDropEvent>
#include <QFileDialog>
#include <QInputDialog>
+#include <QLabel>
#include <QMenu>
#include <QMessageBox>
#include <QNetworkProxy>
@@ -2082,7 +2083,12 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
Q_UNUSED(frame)
#ifndef QT_NO_MESSAGEBOX
QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
- QMessageBox::information(parent, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), escapeHtml(msg), QMessageBox::Ok);
+ QMessageBox box(parent);
+ box.setWindowTitle(tr("JavaScript Alert - %1").arg(mainFrame()->url().host()));
+ box.setTextFormat(Qt::PlainText);
+ box.setText(msg);
+ box.setStandardButtons(QMessageBox::Ok);
+ box.exec();
#endif
}
@@ -2099,7 +2105,12 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
return true;
#else
QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
- return QMessageBox::Yes == QMessageBox::information(parent, tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()), escapeHtml(msg), QMessageBox::Yes, QMessageBox::No);
+ QMessageBox box(parent);
+ box.setWindowTitle(tr("JavaScript Confirm - %1").arg(mainFrame()->url().host()));
+ box.setTextFormat(Qt::PlainText);
+ box.setText(msg);
+ box.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ return QMessageBox::Yes == box.exec();
#endif
}
@@ -2118,10 +2129,30 @@ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QStr
Q_UNUSED(frame)
bool ok = false;
#ifndef QT_NO_INPUTDIALOG
+
QWidget* parent = (d->client) ? d->client->ownerWidget() : 0;
- QString x = QInputDialog::getText(parent, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), escapeHtml(msg), QLineEdit::Normal, defaultValue, &ok);
+ QInputDialog dlg(parent);
+ dlg.setWindowTitle(tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()));
+
+ // Hack to force the dialog's QLabel into plain text mode
+ // prevents https://bugs.webkit.org/show_bug.cgi?id=34429
+ QLabel* label = dlg.findChild<QLabel*>();
+ if (label)
+ label->setTextFormat(Qt::PlainText);
+
+ // double the &'s because single & will underline the following character
+ // (Accelerator mnemonics)
+ QString escMsg(msg);
+ escMsg.replace(QChar::fromAscii('&'), QString::fromAscii("&&"));
+ dlg.setLabelText(escMsg);
+
+ dlg.setTextEchoMode(QLineEdit::Normal);
+ dlg.setTextValue(defaultValue);
+
+ ok = !!dlg.exec();
+
if (ok && result)
- *result = x;
+ *result = dlg.textValue();
#endif
return ok;
}
diff --git a/Source/WebKit/qt/Api/qwebsettings.h b/Source/WebKit/qt/Api/qwebsettings.h
index 136ee8dc4..0aee525b0 100644
--- a/Source/WebKit/qt/Api/qwebsettings.h
+++ b/Source/WebKit/qt/Api/qwebsettings.h
@@ -24,11 +24,7 @@
#include <QtCore/qstring.h>
#include <QtGui/qpixmap.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-#include <QtWidgets/qicon.h>
-#else
#include <QtGui/qicon.h>
-#endif
#include <QtCore/qshareddata.h>
namespace WebCore {
diff --git a/Source/WebKit/qt/Api/qwebview.h b/Source/WebKit/qt/Api/qwebview.h
index 07e30d391..90d0a8e3b 100644
--- a/Source/WebKit/qt/Api/qwebview.h
+++ b/Source/WebKit/qt/Api/qwebview.h
@@ -25,11 +25,10 @@
#include "qwebpage.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtWidgets/qwidget.h>
-#include <QtWidgets/qicon.h>
#else
#include <QtGui/qwidget.h>
-#include <QtGui/qicon.h>
#endif
+#include <QtGui/qicon.h>
#include <QtGui/qpainter.h>
#include <QtCore/qurl.h>
#include <QtNetwork/qnetworkaccessmanager.h>
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 34a01c83d..e823f86e5 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,85 @@
+2012-05-25 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Buildfix for newer Qt5
+ https://bugs.webkit.org/show_bug.cgi?id=87257
+
+ Reviewed by Simon Hausmann.
+
+ * Api/qgraphicswebview.h: QtWidgets/qicon.h -> QtGui/qicon.h renaming.
+ * Api/qwebframe.h: QtWidgets/qicon.h -> QtGui/qicon.h renaming.
+ * Api/qwebhistory.h: QtWidgets/qicon.h -> QtGui/qicon.h renaming.
+ * Api/qwebsettings.h: QtWidgets/qicon.h -> QtGui/qicon.h renaming.
+ * Api/qwebview.h: QtWidgets/qicon.h -> QtGui/qicon.h renaming.
+ * WebCoreSupport/FrameLoaderClientQt.cpp: Adjust QCoreApplication::translate() parameter list to newer Qt 5.
+ (WebCore::FrameLoaderClientQt::cancelledError):
+ (WebCore::FrameLoaderClientQt::blockedError):
+ (WebCore::FrameLoaderClientQt::cannotShowURLError):
+ (WebCore::FrameLoaderClientQt::interruptedForPolicyChangeError):
+ (WebCore::FrameLoaderClientQt::cannotShowMIMETypeError):
+ (WebCore::FrameLoaderClientQt::fileDoesNotExistError):
+ (WebCore::FrameLoaderClientQt::pluginWillHandleLoadError):
+ * declarative/experimental/plugin.cpp: QDeclarativeExtensionPlugin -> QQmlExtensionPlugin renaming.
+ * declarative/plugin.cpp: QDeclarativeExtensionPlugin -> QQmlExtensionPlugin renaming.
+ (WebKitQmlPlugin):
+
+2012-05-24 Ryosuke Niwa <rniwa@webkit.org>
+
+ There are too many poorly named functions to create a fragment from markup
+ https://bugs.webkit.org/show_bug.cgi?id=87339
+
+ Reviewed by Eric Seidel.
+
+ Replace calls to Range::createDocumentFragmentForElement by calls to
+ createContextualDocumentFragment.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::appendInside):
+ (QWebElement::prependInside):
+ (QWebElement::prependOutside):
+ (QWebElement::appendOutside):
+ (QWebElement::encloseContentsWith):
+ (QWebElement::encloseWith):
+
+2012-05-24 Gabor Ballabas <gaborb@inf.u-szeged.hu>
+
+ [Qt] Fix Webkit1 + V8 build.
+ https://bugs.webkit.org/show_bug.cgi?id=87368
+
+ Reviewed by Eric Seidel.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld):
+
+2012-05-24 Steffen Imhof <steffen.imhof@basyskom.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=67093
+ [Qt] Default window.alert shows HTML entities in certain cases
+
+ Instead of HTML escaping the text of JS alerts (which does not work
+ consistently because of Qt's automatisms), build message boxes
+ explicitly to be able set the text format to plain text.
+ QInputDialog is a bit hacky, because there is no way to access or
+ control the contained QLabel.
+
+ Reviewed by Simon Hausmann.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptAlert):
+ (QWebPage::javaScriptConfirm):
+ (QWebPage::javaScriptPrompt):
+
+2012-05-21 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ Move setEditingBehavior() from layoutTestController to window.internals
+ https://bugs.webkit.org/show_bug.cgi?id=42689
+
+ Reviewed by Hajime Morita and Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::setWindowsBehaviorAsEditingBehavior): Reduce the job
+ done by this function to the minimal.
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
2012-05-18 MORITA Hajime <morrita@google.com>
https://bugs.webkit.org/show_bug.cgi?id=85515
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index 2d4fb5057..ff7d00627 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -654,26 +654,12 @@ bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame*
return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
}
-void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior)
-{
- WebCore::EditingBehaviorType coreEditingBehavior;
-
- if (editingBehavior == QLatin1String("win"))
- coreEditingBehavior = EditingWindowsBehavior;
- else if (editingBehavior == QLatin1String("mac"))
- coreEditingBehavior = EditingMacBehavior;
- else if (editingBehavior == QLatin1String("unix"))
- coreEditingBehavior = EditingUnixBehavior;
- else {
- ASSERT_NOT_REACHED();
- return;
- }
-
+void DumpRenderTreeSupportQt::setWindowsBehaviorAsEditingBehavior(QWebPage* page)
+{
Page* corePage = QWebPagePrivate::core(page);
if (!corePage)
return;
-
- corePage->settings()->setEditingBehaviorType(coreEditingBehavior);
+ corePage->settings()->setEditingBehaviorType(EditingWindowsBehavior);
}
void DumpRenderTreeSupportQt::clearAllApplicationCaches()
@@ -932,7 +918,8 @@ void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, in
ScriptSourceCode source(script);
Vector<ScriptSourceCode> sources;
sources.append(source);
- proxy->evaluateInIsolatedWorld(0, sources, true);
+ Vector<ScriptValue> result;
+ proxy->evaluateInIsolatedWorld(0, sources, &result);
#endif
}
diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 373f60e70..2c96fb3a2 100644
--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -145,7 +145,7 @@ public:
static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height);
static bool hasDocumentElement(QWebFrame* frame);
static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId);
- static void setEditingBehavior(QWebPage* page, const QString& editingBehavior);
+ static void setWindowsBehaviorAsEditingBehavior(QWebPage*);
static void clearAllApplicationCaches();
diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index c23311daa..e816b9f21 100644
--- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -909,7 +909,7 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c
WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::ResourceRequest& request)
{
ResourceError error = ResourceError("QtNetwork", QNetworkReply::OperationCanceledError, request.url().string(),
- QCoreApplication::translate("QWebFrame", "Request cancelled", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "Request cancelled", 0));
error.setIsCancellation(true);
return error;
}
@@ -929,38 +929,38 @@ enum {
WebCore::ResourceError FrameLoaderClientQt::blockedError(const WebCore::ResourceRequest& request)
{
return ResourceError("WebKitErrorDomain", WebKitErrorCannotUseRestrictedPort, request.url().string(),
- QCoreApplication::translate("QWebFrame", "Request blocked", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "Request blocked", 0));
}
WebCore::ResourceError FrameLoaderClientQt::cannotShowURLError(const WebCore::ResourceRequest& request)
{
return ResourceError("WebKitErrorDomain", WebKitErrorCannotShowURL, request.url().string(),
- QCoreApplication::translate("QWebFrame", "Cannot show URL", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "Cannot show URL", 0));
}
WebCore::ResourceError FrameLoaderClientQt::interruptedForPolicyChangeError(const WebCore::ResourceRequest& request)
{
return ResourceError("WebKitErrorDomain", WebKitErrorFrameLoadInterruptedByPolicyChange, request.url().string(),
- QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "Frame load interrupted by policy change", 0));
}
WebCore::ResourceError FrameLoaderClientQt::cannotShowMIMETypeError(const WebCore::ResourceResponse& response)
{
return ResourceError("WebKitErrorDomain", WebKitErrorCannotShowMIMEType, response.url().string(),
- QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "Cannot show mimetype", 0));
}
WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore::ResourceResponse& response)
{
return ResourceError("QtNetwork", QNetworkReply::ContentNotFoundError, response.url().string(),
- QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "File does not exist", 0));
}
WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response)
{
return ResourceError("WebKit", WebKitErrorPluginWillHandleLoad, response.url().string(),
- QCoreApplication::translate("QWebFrame", "Loading is handled by the media engine", 0, QCoreApplication::UnicodeUTF8));
+ QCoreApplication::translate("QWebFrame", "Loading is handled by the media engine", 0));
}
bool FrameLoaderClientQt::shouldFallBack(const WebCore::ResourceError& error)
diff --git a/Source/WebKit/qt/declarative/experimental/plugin.cpp b/Source/WebKit/qt/declarative/experimental/plugin.cpp
index 495b308c6..567476700 100644
--- a/Source/WebKit/qt/declarative/experimental/plugin.cpp
+++ b/Source/WebKit/qt/declarative/experimental/plugin.cpp
@@ -43,7 +43,7 @@ public:
QQuickWebViewExperimental* experimental() { return static_cast<QQuickWebView*>(parent())->experimental(); }
};
-class WebKitQmlExperimentalExtensionPlugin: public QDeclarativeExtensionPlugin {
+class WebKitQmlExperimentalExtensionPlugin: public QQmlExtensionPlugin {
Q_OBJECT
public:
virtual void registerTypes(const char* uri)
diff --git a/Source/WebKit/qt/declarative/plugin.cpp b/Source/WebKit/qt/declarative/plugin.cpp
index 08532bf01..f8c532a06 100644
--- a/Source/WebKit/qt/declarative/plugin.cpp
+++ b/Source/WebKit/qt/declarative/plugin.cpp
@@ -44,7 +44,11 @@
QT_BEGIN_NAMESPACE
+#if QT_VERSION >= 0x050000
+class WebKitQmlPlugin : public QQmlExtensionPlugin {
+#else
class WebKitQmlPlugin : public QDeclarativeExtensionPlugin {
+#endif
Q_OBJECT
public:
#if defined(HAVE_WEBKIT2)