Diff
Modified: trunk/Source/WebKit2/ChangeLog (118753 => 118754)
--- trunk/Source/WebKit2/ChangeLog 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/ChangeLog 2012-05-29 11:37:41 UTC (rev 118754)
@@ -1,3 +1,25 @@
+2012-05-29 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r118752.
+ http://trac.webkit.org/changeset/118752
+ https://bugs.webkit.org/show_bug.cgi?id=87731
+
+ incomplete patch (Requested by cmarcelo on #webkit).
+
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::didRelaunchProcess):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ (QQuickWebViewPrivate):
+ * UIProcess/API/qt/tests/qmltests/WebView.pro:
+ * UIProcess/WebPageProxy.h:
+ (WebPageProxy):
+ * UIProcess/qt/WebPageProxyQt.cpp:
+ * WebProcess/WebPage/WebPage.h:
+ (WebPage):
+ * WebProcess/WebPage/WebPage.messages.in:
+ * WebProcess/WebPage/qt/WebPageQt.cpp:
+
2012-05-21 Caio Marcelo de Oliveira Filho <[email protected]>
[Qt] [WK2] Allow user to inject JS scripts when the page loads
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (118753 => 118754)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2012-05-29 11:37:41 UTC (rev 118754)
@@ -54,7 +54,6 @@
#include <_javascript_Core/JSBase.h>
#include <_javascript_Core/JSRetainPtr.h>
#include <QDateTime>
-#include <QtCore/QFile>
#include <QtQml/QJSValue>
#include <WKOpenPanelResultListener.h>
#include <WKSerializedScriptValue.h>
@@ -62,7 +61,6 @@
#include <WebCore/IntRect.h>
#include <wtf/Assertions.h>
#include <wtf/MainThread.h>
-#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
using namespace WebCore;
@@ -454,7 +452,6 @@
webPageProxy->drawingArea()->setSize(viewSize(), IntSize());
updateViewportSize();
- updateUserScripts();
}
PassOwnPtr<DrawingAreaProxy> QQuickWebViewPrivate::createDrawingAreaProxy()
@@ -682,52 +679,6 @@
context->setNavigatorQtObjectEnabled(webPageProxy.get(), enabled);
}
-static QString readUserScript(const QUrl& url)
-{
- QString path;
- if (url.isLocalFile())
- path = url.toLocalFile();
- else if (url.scheme() == QLatin1String("qrc"))
- path = QStringLiteral(":") + url.path();
- else {
- qWarning("QQuickWebView: Couldn't open '%s' as user script because only file:/// and qrc:/// URLs are supported.", qPrintable(url.toString()));
- return QString();
- }
-
- QFile file(path);
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- qWarning("QQuickWebView: Couldn't open '%s' as user script due to error '%s'.", qPrintable(url.toString()), qPrintable(file.errorString()));
- return QString();
- }
-
- QString contents = QString::fromUtf8(file.readAll());
- if (contents.isEmpty())
- qWarning("QQuickWebView: Ignoring '%s' as user script because file is empty.", qPrintable(url.toString()));
-
- return contents;
-}
-
-void QQuickWebViewPrivate::updateUserScripts()
-{
- Vector<String> scripts;
- scripts.reserveCapacity(userScripts.size());
-
- for (unsigned i = 0; i < userScripts.size(); ++i) {
- const QUrl& url = ""
- if (!url.isValid()) {
- qWarning("QQuickWebView: Couldn't open '%s' as user script because URL is invalid.", qPrintable(url.toString()));
- continue;
- }
-
- QString contents = readUserScript(url);
- if (contents.isEmpty())
- continue;
- scripts.append(String(contents));
- }
-
- webPageProxy->setUserScripts(scripts);
-}
-
QPointF QQuickWebViewPrivate::contentPos() const
{
Q_Q(const QQuickWebView);
@@ -1345,22 +1296,6 @@
d_ptr->webPageProxy.get()->runJavaScriptInMainFrame(script, ScriptValueCallback::create(closure, _javascript_Callback));
}
-QList<QUrl> QQuickWebViewExperimental::userScripts() const
-{
- Q_D(const QQuickWebView);
- return d->userScripts;
-}
-
-void QQuickWebViewExperimental::setUserScripts(const QList<QUrl>& userScripts)
-{
- Q_D(QQuickWebView);
- if (d->userScripts == userScripts)
- return;
- d->userScripts = userScripts;
- d->updateUserScripts();
- emit userScriptsChanged();
-}
-
QQuickUrlSchemeDelegate* QQuickWebViewExperimental::schemeDelegates_At(QQmlListProperty<QQuickUrlSchemeDelegate>* property, int index)
{
const QObjectList children = property->object->children();
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h (118753 => 118754)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2012-05-29 11:37:41 UTC (rev 118754)
@@ -268,7 +268,6 @@
Q_PROPERTY(QQmlListProperty<QQuickUrlSchemeDelegate> urlSchemeDelegates READ schemeDelegates)
Q_PROPERTY(QString userAgent READ userAgent WRITE setUserAgent NOTIFY userAgentChanged)
Q_PROPERTY(double devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged)
- Q_PROPERTY(QList<QUrl> userScripts READ userScripts WRITE setUserScripts NOTIFY userScriptsChanged)
Q_ENUMS(NavigationRequestActionExperimental)
public:
@@ -301,8 +300,6 @@
void setUserAgent(const QString& userAgent);
double devicePixelRatio() const;
void setDevicePixelRatio(double);
- QList<QUrl> userScripts() const;
- void setUserScripts(const QList<QUrl>& userScripts);
QWebKitTest* test();
@@ -356,7 +353,6 @@
void devicePixelRatioChanged();
void enterFullScreenRequested();
void exitFullScreenRequested();
- void userScriptsChanged();
private:
QQuickWebView* q_ptr;
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h (118753 => 118754)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2012-05-29 11:37:41 UTC (rev 118754)
@@ -124,7 +124,6 @@
bool renderToOffscreenBuffer() const { return m_renderToOffscreenBuffer; }
bool transparentBackground() const;
void setNavigatorQtObjectEnabled(bool);
- void updateUserScripts();
QPointF contentPos() const;
void setContentPos(const QPointF&);
@@ -193,8 +192,6 @@
WebCore::ViewportAttributes attributes;
- QList<QUrl> userScripts;
-
bool m_useDefaultContentItemSize;
bool m_navigatorQtObjectEnabled;
bool m_renderToOffscreenBuffer;
Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro (118753 => 118754)
--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView.pro 2012-05-29 11:37:41 UTC (rev 118754)
@@ -16,5 +16,3 @@
OTHER_FILES += \
WebView/* \
common/*
-
-RESOURCES = resources.qrc
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (118753 => 118754)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2012-05-29 11:37:41 UTC (rev 118754)
@@ -336,7 +336,6 @@
void authenticationRequiredRequest(const String& hostname, const String& realm, const String& prefilledUsername, String& username, String& password);
void certificateVerificationRequest(const String& hostname, bool& ignoreErrors);
void proxyAuthenticationRequiredRequest(const String& hostname, uint16_t port, const String& prefilledUsername, String& username, String& password);
- void setUserScripts(const Vector<String>&);
#endif // PLATFORM(QT).
#if PLATFORM(QT)
Modified: trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp (118753 => 118754)
--- trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/UIProcess/qt/WebPageProxyQt.cpp 2012-05-29 11:37:41 UTC (rev 118754)
@@ -102,11 +102,6 @@
}
}
-void WebPageProxy::setUserScripts(const Vector<String>& scripts)
-{
- process()->send(Messages::WebPage::SetUserScripts(scripts), m_pageID);
-}
-
#if PLUGIN_ARCHITECTURE(X11)
void WebPageProxy::createPluginContainer(uint64_t& windowID)
{
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (118753 => 118754)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2012-05-29 11:37:41 UTC (rev 118754)
@@ -523,7 +523,6 @@
void registerApplicationScheme(const String& scheme);
void applicationSchemeReply(const QtNetworkReplyData&);
void receivedApplicationSchemeRequest(const QNetworkRequest&, QtNetworkReply*);
- void setUserScripts(const Vector<String>&);
#endif
void wheelEvent(const WebWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (118753 => 118754)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2012-05-29 11:37:41 UTC (rev 118754)
@@ -68,7 +68,6 @@
#if PLATFORM(QT)
ApplicationSchemeReply(WebKit::QtNetworkReplyData reply)
RegisterApplicationScheme(WTF::String scheme)
- SetUserScripts(WTF::Vector<WTF::String> script)
#endif
StopLoadingFrame(uint64_t frameID)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp (118753 => 118754)
--- trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp 2012-05-29 11:36:14 UTC (rev 118753)
+++ trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp 2012-05-29 11:37:41 UTC (rev 118754)
@@ -32,12 +32,10 @@
#include "WebEvent.h"
#include "WebPageProxyMessages.h"
#include "WebProcess.h"
-#include <WebCore/DOMWrapperWorld.h>
#include <WebCore/FocusController.h>
#include <WebCore/Frame.h>
#include <WebCore/KeyboardEvent.h>
#include <WebCore/Page.h>
-#include <WebCore/PageGroup.h>
#include <WebCore/PlatformKeyboardEvent.h>
#include <WebCore/Range.h>
#include <WebCore/Settings.h>
@@ -413,13 +411,4 @@
networkReply->finalize();
}
-void WebPage::setUserScripts(const Vector<String>& scripts)
-{
- // This works because we keep an unique page group for each Page.
- PageGroup* pageGroup = PageGroup::pageGroup(this->pageGroup()->identifier());
- pageGroup->removeUserScriptsFromWorld(mainThreadNormalWorld());
- for (unsigned i = 0; i < scripts.size(); ++i)
- pageGroup->addUserScriptToWorld(mainThreadNormalWorld(), scripts.at(i), KURL(), nullptr, nullptr, InjectAtDocumentEnd, InjectInTopFrameOnly);
-}
-
} // namespace WebKit