diff options
Diffstat (limited to 'WebKit/qt/Api')
-rw-r--r-- | WebKit/qt/Api/qwebelement.cpp | 2 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebframe.cpp | 2 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebpage.cpp | 37 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebpage.h | 6 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebplugindatabase.cpp | 4 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebsettings.cpp | 9 | ||||
-rw-r--r-- | WebKit/qt/Api/qwebview.cpp | 6 |
7 files changed, 36 insertions, 30 deletions
diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp index 83ee451..f7b1188 100644 --- a/WebKit/qt/Api/qwebelement.cpp +++ b/WebKit/qt/Api/qwebelement.cpp @@ -1446,7 +1446,7 @@ void QWebElement::render(QPainter* painter) FrameView* view = frame->view(); - view->layoutIfNeededRecursive(); + view->updateLayoutAndStyleIfNeededRecursive(); IntRect rect = e->getRect(); diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 1b0c2df..81eabfc 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -286,7 +286,7 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: QPainter* painter = context->platformContext(); WebCore::FrameView* view = frame->view(); - view->layoutIfNeededRecursive(); + view->updateLayoutAndStyleIfNeededRecursive(); for (int i = 0; i < vector.size(); ++i) { const QRect& clipRect = vector.at(i); diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index 5eee21c..ec415bb 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -81,6 +81,7 @@ #include "Cache.h" #include "runtime/InitializeThreading.h" #include "PageGroup.h" +#include "GeolocationPermissionClientQt.h" #include "NotificationPresenterClientQt.h" #include "PageClientQt.h" #include "WorkerThread.h" @@ -2082,30 +2083,6 @@ bool QWebPage::shouldInterruptJavaScript() #endif } -/*! - \fn bool QWebPage::allowGeolocationRequest() - \since 4.7 - - This function is called whenever a JavaScript program running inside \a frame tries to access user location through navigator.geolocation. - - If the user wants to allow access to location then it should return true; otherwise false. - - The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons. - - \warning Because of binary compatibility constraints, this function is not virtual. If you want to - provide your own implementation in a QWebPage subclass, reimplement the allowGeolocationRequest() - slot in your subclass instead. QtWebKit will dynamically detect the slot and call it. -*/ -bool QWebPage::allowGeolocationRequest(QWebFrame *frame) -{ -#ifdef QT_NO_MESSAGEBOX - return false; -#else - QWidget* parent = (d->client) ? d->client->ownerWidget() : 0; - return QMessageBox::Yes == QMessageBox::information(parent, tr("Location Request by- %1").arg(frame->url().host()), tr("The page wants to access your location information. Do you want to allow the request?"), QMessageBox::Yes, QMessageBox::No); -#endif -} - void QWebPage::setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy) { switch (domain) { @@ -2115,6 +2092,12 @@ void QWebPage::setUserPermission(QWebFrame* frame, PermissionDomain domain, Perm NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame); #endif break; + case GeolocationPermissionDomain: +#if ENABLE(GEOLOCATION) + GeolocationPermissionClientQt::geolocationPermissionClient()->setPermission(frame, policy); +#endif + break; + default: break; } @@ -2131,7 +2114,11 @@ void QWebPage::setUserPermission(QWebFrame* frame, PermissionDomain domain, Perm If \a type is WebModalDialog, the application must call setWindowModality(Qt::ApplicationModal) on the new window. - \sa acceptNavigationRequest() + \note In the cases when the window creation is being triggered by JavaScript, apart from + reimplementing this method application must also set the JavaScriptCanOpenWindows attribute + of QWebSettings to true in order for it to get called. + + \sa acceptNavigationRequest(), QWebView::createWindow() */ QWebPage *QWebPage::createWindow(WebWindowType type) { diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h index 14f3b8b..dda4a6a 100644 --- a/WebKit/qt/Api/qwebpage.h +++ b/WebKit/qt/Api/qwebpage.h @@ -57,6 +57,7 @@ namespace WebCore { class InspectorClientQt; class InspectorFrontendClientQt; class NotificationPresenterClientQt; + class GeolocationPermissionClientQt; class ResourceHandle; class HitTestResult; class QNetworkReplyHandler; @@ -202,7 +203,8 @@ public: }; enum PermissionDomain { - NotificationsPermissionDomain + NotificationsPermissionDomain, + GeolocationPermissionDomain }; class ViewportHints { @@ -351,7 +353,6 @@ public: public Q_SLOTS: bool shouldInterruptJavaScript(); - bool allowGeolocationRequest(QWebFrame *frame); Q_SIGNALS: void loadStarted(); @@ -424,6 +425,7 @@ private: friend class WebCore::InspectorClientQt; friend class WebCore::InspectorFrontendClientQt; friend class WebCore::NotificationPresenterClientQt; + friend class WebCore::GeolocationPermissionClientQt; friend class WebCore::ResourceHandle; friend class WebCore::QNetworkReplyHandler; friend class DumpRenderTreeSupportQt; diff --git a/WebKit/qt/Api/qwebplugindatabase.cpp b/WebKit/qt/Api/qwebplugindatabase.cpp index 758e257..a7a3b5f 100644 --- a/WebKit/qt/Api/qwebplugindatabase.cpp +++ b/WebKit/qt/Api/qwebplugindatabase.cpp @@ -284,6 +284,10 @@ QList<QWebPluginInfo> QWebPluginDatabase::plugins() const for (unsigned int i = 0; i < plugins.size(); ++i) { PluginPackage* plugin = plugins[i]; +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + if (!plugin->ensurePluginLoaded()) + continue; +#endif qwebplugins.append(QWebPluginInfo(plugin)); } diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp index edd07da..d88b0da 100644 --- a/WebKit/qt/Api/qwebsettings.cpp +++ b/WebKit/qt/Api/qwebsettings.cpp @@ -34,6 +34,7 @@ #include "KURL.h" #include "PlatformString.h" #include "IconDatabase.h" +#include "PluginDatabase.h" #include "Image.h" #include "IntSize.h" #include "ApplicationCacheStorage.h" @@ -1093,6 +1094,14 @@ void QWebSettings::enablePersistentStorage(const QString& path) QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true); + +#if ENABLE(NETSCAPE_PLUGIN_METADATA_CACHE) + QFileInfo info(storagePath); + if (info.isDir() && info.isWritable()) { + WebCore::PluginDatabase::setPersistentMetadataCacheEnabled(true); + WebCore::PluginDatabase::setPersistentMetadataCachePath(storagePath); + } +#endif } /*! diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp index 10cf60c..1f400cb 100644 --- a/WebKit/qt/Api/qwebview.cpp +++ b/WebKit/qt/Api/qwebview.cpp @@ -953,7 +953,11 @@ void QWebView::paintEvent(QPaintEvent *ev) \note If the createWindow() method of the associated page is reimplemented, this method is not called, unless explicitly done so in the reimplementation. - \sa QWebPage::createWindow() + \note In the cases when the window creation is being triggered by JavaScript, apart from + reimplementing this method application must also set the JavaScriptCanOpenWindows attribute + of QWebSettings to true in order for it to get called. + + \sa QWebPage::createWindow(), QWebPage::acceptNavigationRequest() */ QWebView *QWebView::createWindow(QWebPage::WebWindowType type) { |