summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/WebKit/qt
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-09-18 10:35:59 +0200
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-09-18 10:38:07 +0200
commitef310719ef42cd09e2542fce96c529b5657bf167 (patch)
treec691bab10518e479ce40d4cac6c79daa312fce87 /src/3rdparty/webkit/WebKit/qt
parent5b828316abb0ad1a33cdc11ebac0999d9b79576a (diff)
downloadqt4-tools-ef310719ef42cd09e2542fce96c529b5657bf167.tar.gz
Updated WebKit from /home/joce/dev/qtwebkit/ to qtwebkit-4.6-snapshot-18092009 ( 15c07fb8d7fa5e93c939aa7eb21c06e19c754cee )
Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com> Reviewed by Simon Hausmann. Symbian build fix. Moved the #ifdefs around _q_cleanupLeakMessages() into the function definition. QMake is not being able to distinguish between release and debug builds in Symbian build. This is a Symbian toolchain issue. * Api/qwebpage.cpp: (QWebPagePrivate::_q_cleanupLeakMessages): * Api/qwebpage.h: * Api/qwebpage_p.h: 2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Simon Hausmann. Small cosmetic documentation fixlet in the QWebInspector. * Api/qwebinspector.cpp: 2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com> Reviewed by Eric Seidel. Detect and add Windows7 properly to the user agent. * Api/qwebpage.cpp: (QWebPage::userAgentForUrl): 2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk> Rubberstamped by Kenneth Christiansen. [Qt] Build fix for previous changes. * QGVLauncher/main.cpp: (MainView::flip): 2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> Unreviewed potential Qt < 4.6 build fix. * QGVLauncher/main.cpp: (MainView::flip): 2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. Add a "Flip effect" to our GraphicsView based launcher. * QGVLauncher/main.cpp: (MainView::resizeEvent): (MainView::flip): (MainWindow::flip): (MainWindow::buildUI): 2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> Rubber-stamped by Simon Hausmann. [Qt] Typo fix. Pass the window object to the Format menu. In this way Qt can free its internal graphical objects during exit. * QtLauncher/main.cpp: (MainWindow::setupUI): 2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Tor Arne Vestbø. [Qt] Build break fix on gcc ARM. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItemPrivate::_q_doLoadProgress): 2009-09-16 Warwick Allison <warwick.allison@nokia.com> Reviewed by Simon Hausmann. Fix a crash in QWebFrame::hasFocus() with a simple null pointer check when the focused frame is null. We do the same check in other places where we call kit(). * Api/qwebframe.cpp: (QWebFrame::hasFocus): 2009-09-16 Jure Repinc <jlp@holodeck1.com> Reviewed by Simon Hausmann. Fixed a typo found during translation. * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError): 2009-09-14 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. [Qt] QWebGraphicsItem should check for null QWebPage. https://bugs.webkit.org/show_bug.cgi?id=29185 Don't crash in QWebGraphicsItem when the page is still null, by either checking if it's the case or constructing the default one. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::icon): (QWebGraphicsItem::setZoomFactor): (QWebGraphicsItem::zoomFactor): (QWebGraphicsItem::setGeometry): (QWebGraphicsItem::load): (QWebGraphicsItem::setHtml): (QWebGraphicsItem::toHtml): (QWebGraphicsItem::setContent): (QWebGraphicsItem::history): (QWebGraphicsItem::settings): 2009-09-11 David Boddie <dboddie@trolltech.com> Reviewed by Simon Hausmann. Doc: Note that Netscape plugins are only available on desktop platforms. * docs/qtwebkit.qdoc: 2009-09-11 Martin Smith <msmith@trolltech.com> Reviewed by Simon Hausmann. Adjust the name of the contentspage for the documentation to the new name used in Qt 4.6. * docs/qtwebkit.qdoc: 2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com> Reviewed by Simon Hausmann. Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general renaming. * Api/qwebpluginfactory.cpp: * docs/webkitsnippets/simple/main.cpp: (main): * docs/webkitsnippets/webpage/main.cpp: (main): 2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com> Reviewed by Simon Hausmann. Restructure the documentation, both on a file and on a content level. * Api/qwebdatabase.cpp: * Api/qwebelement.cpp: * Api/qwebframe.cpp: * Api/qwebhistory.cpp: * Api/qwebhistoryinterface.cpp: * Api/qwebpage.cpp: * Api/qwebpluginfactory.cpp: * Api/qwebsecurityorigin.cpp: * Api/qwebsettings.cpp: * Api/qwebview.cpp: * docs/qtwebkit.qdoc: 2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29136 [Qt] emit microFocusChanged() signal when no QWidget-based view is present. emit microFocusChange() signal regardless of view. * WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::setInputMethodState): 2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=28806 [Qt] Make the WebInspector available as a QWidget. * Api/headers.pri: * Api/qwebelement.cpp: (QWebElement::enclosingElement): * Api/qwebelement.h: * Api/qwebinspector.cpp: Added. * Api/qwebinspector.h: Added. * Api/qwebinspector_p.h: Added. * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): (QWebPagePrivate::setInspector): (QWebPagePrivate::getOrCreateInspector): (QWebPagePrivate::inspectorController): (QWebPage::~QWebPage): (QWebPage::triggerAction): * Api/qwebpage.h: * Api/qwebpage_p.h: * Api/qwebsettings.cpp: * QtLauncher/main.cpp: (MainWindow::MainWindow): * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientWebPage::InspectorClientWebPage): (WebCore::InspectorClientWebPage::createWindow): (WebCore::InspectorClientQt::createPage): (WebCore::InspectorClientQt::showWindow): (WebCore::InspectorClientQt::closeWindow): (WebCore::InspectorClientQt::attachWindow): (WebCore::InspectorClientQt::detachWindow): (WebCore::InspectorClientQt::updateWindowTitle): * WebCoreSupport/InspectorClientQt.h: * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added. 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Eric Seidel. [Qt] Fix comparison between signed and unsigned integer warnings https://bugs.webkit.org/show_bug.cgi?id=29162 No functional change. * Api/qwebelement.cpp: (QWebElement::findAll): * Api/qwebhistory.cpp: (QWebHistory::items): (QWebHistory::backItems): (QWebHistory::forwardItems): (QWebHistory::saveState): * Api/qwebplugindatabase.cpp: (QWebPluginDatabase::setSearchPaths): * WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::runOpenPanel): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::createPlugin): 2009-09-10 Simon Hausmann <hausmann@webkit.org> Rubber-stamped by Ariya Hidayat. Fix a bunch of qdoc warnings: Invalid references, non-standard wording, etc. * Api/qwebelement.cpp: * Api/qwebgraphicsitem.cpp: * Api/qwebsecurityorigin.cpp: 2009-09-10 Simon Hausmann <hausmann@webkit.org> Reviewed by Ariya Hidayat. Fix context menu event delivery with QWebGraphicsItem. Re-implement the correct context menu virtual function using a QGraphicsSceneContextMenuEvent and forward & handle it in QWebPage. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::contextMenuEvent): * Api/qwebgraphicsitem.h: * Api/qwebpage.cpp: (QWebPagePrivate::contextMenuEvent): (QWebPage::event): * Api/qwebpage_p.h: 2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com> Unreviewed. Build fix for QtWebKit for Mac after r48219. qevent and qstyleoption are QtGui interfaces. * Api/qwebgraphicsitem.cpp: * Api/qwebgraphicsitem.h: 2009-09-09 Simon Hausmann <hausmann@webkit.org> Reviewed by Tor Arne Vestbø. Call the right base class function QGraphicsWidget::event() instead of skipping it and using QObject::event() instead. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::event): 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> Unreviewed. Fix comment at Tor Arne Vestbø's request. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::sceneEvent): (QWebGraphicsItem::event): 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Tor Arne Vestbø. Implement some virtual event methods so that we can fix event-related bugs in Qt patch releases. * Api/qwebgraphicsitem.cpp: (QWebGraphicsItem::sceneEvent): (QWebGraphicsItem::event): * Api/qwebgraphicsitem.h: 2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org> Reviewed by Simon Hausmann. Add a new QGraphicsWidget based version of the "QWebView" under the name "QWebGraphicsItem". https://bugs.webkit.org/show_bug.cgi?id=28862 Includes an alternative Qt launcher using the QGraphicsView. * Api/headers.pri: * Api/qwebgraphicsitem.cpp: Added. * Api/qwebgraphicsitem.h: Added. * Api/qwebpage.h: * QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro. * QGVLauncher/main.cpp: Added. * WebCoreSupport/ChromeClientQt.cpp: (WebCore::ChromeClientQt::repaint): (WebCore::ChromeClientQt::scroll): 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> Unreviewed build fix. Potential build fix for Qt 4.5 * Api/qwebpage.cpp: (QWebPagePrivate::mousePressEvent): 2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com> Reviewed by Simon Hausmann. https://bugs.webkit.org/show_bug.cgi?id=29007 Add a test for the signal QWebFrame::javaScriptWindowObjectCleared() * tests/qwebframe/tst_qwebframe.cpp: 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Simon Hausmann. [Qt] Fix unused variable warnings https://bugs.webkit.org/show_bug.cgi?id=29018 * Api/qwebpage.cpp: (QWebPagePrivate::keyPressEvent): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::startDownload): (WebCore::FrameLoaderClientQt::createFrame): 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Ariya Hidayat. [Qt] Use the declaration order in initializer lists https://bugs.webkit.org/show_bug.cgi?id=29017 * Api/qwebframe_p.h: 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. Add support for handling QGraphicsScene events. * Api/qwebpage.cpp: (QWebPagePrivate::mouseMoveEvent): (QWebPagePrivate::mousePressEvent): (QWebPagePrivate::mouseDoubleClickEvent): (QWebPagePrivate::mouseTripleClickEvent): (QWebPagePrivate::handleClipboard): (QWebPagePrivate::mouseReleaseEvent): (QWebPagePrivate::wheelEvent): (QWebPagePrivate::dragEnterEvent): (QWebPagePrivate::dragLeaveEvent): (QWebPagePrivate::dragMoveEvent): (QWebPagePrivate::dropEvent): (QWebPage::event): * Api/qwebpage_p.h: 2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Simon Hausmann. [Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack. https://bugs.webkit.org/show_bug.cgi?id=28865 Clean up the unserCursor hack to use the QCursor set as a property of the QWidget by WebCore::WidgetQt. Remove all code that are no longer necessary for getting cursor change events. Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07 * Api/qwebpage.cpp: * Api/qwebpage_p.h: * Api/qwebview.cpp: (QWebViewPrivate::QWebViewPrivate): (QWebView::event): 2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Simon Hausmann. [Qt] QtWebKit single API to enable persistency https://bugs.webkit.org/show_bug.cgi?id=28682 Disable LocalStorage, ApplicationCache, HTML5 offline storage by default. If persistency is enabled the default directory for LocalStorage and ApplicationCache is now based on QDesktopServices::DataLocation and not QDesktopServices::CacheLocation (as it is expected to keep this data around after a reboot). If persistency is enabled initialize HTML5 offline storage as well - this fixed offline Storage for QtLauncher. * Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate): * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): (QWebSettings::enablePersistentStorage): * Api/qwebsettings.h: Add a new API called enablePersistentStorage * QtLauncher/main.cpp: Use the new enablePersistentStorage API (main): 2009-09-07 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Speed up the QWebPluginInfo::supportsMimeType() function. https://bugs.webkit.org/show_bug.cgi?id=27651 Instead of going through the MIME types list constructed with mimeTypes() function, look up the internal mimeToDescriptions map. * Api/qwebplugindatabase.cpp: (QWebPluginInfo::supportsMimeType): 2009-09-07 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Speed up the QWebPluginInfo::mimeTypes() function. https://bugs.webkit.org/show_bug.cgi?id=27651 Instead of constructing a list of MIME types every time it is called, do this only once. * Api/qwebplugindatabase.cpp: (QWebPluginInfo::mimeTypes): (QWebPluginInfo::operator=): * Api/qwebplugindatabase.h: * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: (tst_QWebPluginDatabase::operatorassign_data): (tst_QWebPluginDatabase::operatorassign): 2009-09-07 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Remove the private classes from QWebPluginDatabase. https://bugs.webkit.org/show_bug.cgi?id=27651 Instead, hold the PluginDatabase and PluginPackage objects as class members and take care of refcounting on our own instead of using RefPtr. This way we not only made the code cleaner but also got rid of redundant allocations when constructing null QWebPluginInfo objects. The private classes have been forward-declared and the d-pointers left to be on the safe side. * Api/qwebplugindatabase.cpp: (QWebPluginInfo::QWebPluginInfo): (QWebPluginInfo::~QWebPluginInfo): (QWebPluginInfo::name): (QWebPluginInfo::description): (QWebPluginInfo::mimeTypes): (QWebPluginInfo::path): (QWebPluginInfo::isNull): (QWebPluginInfo::setEnabled): (QWebPluginInfo::isEnabled): (QWebPluginInfo::operator==): (QWebPluginInfo::operator!=): (QWebPluginInfo::operator=): (QWebPluginDatabase::QWebPluginDatabase): (QWebPluginDatabase::~QWebPluginDatabase): (QWebPluginDatabase::plugins): (QWebPluginDatabase::searchPaths): (QWebPluginDatabase::setSearchPaths): (QWebPluginDatabase::addSearchPath): (QWebPluginDatabase::refresh): (QWebPluginDatabase::pluginForMimeType): (QWebPluginDatabase::setPreferredPluginForMimeType): * Api/qwebplugindatabase.h: * Api/qwebplugindatabase_p.h: Removed. 2009-09-05 Jakub Wieczorek <faw217@gmail.com> Reviewed by Eric Seidel. [Qt] r47424 broke binary compatibility https://bugs.webkit.org/show_bug.cgi?id=28996 Append the new DnsPrefetchEnabled attribute at the end of the enum. * Api/qwebsettings.h: 2009-09-04 Mark Mentovai <mark@chromium.org> Reviewed by Dave Hyatt. https://bugs.webkit.org/show_bug.cgi?id=28614 Account for scrollbar state changes that occur during layout. * Api/qwebframe.cpp: (QWebFrame::setScrollBarPolicy): Eliminate duplicated (and incorrect) scrollbar mode tracking between FrameView and ScrollView. 2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Eric Seidel. [Qt] Fix tst_QWebPage::database autotest failure https://bugs.webkit.org/show_bug.cgi?id=28961 Make sure that the test case enables the feature before the feature gets tested * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::database): 2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com> Reviewed by Eric Seidel. Any QtWebKit application crashes on exit if the inspector is used during the session rather then exiting. If a QWebView has a QWebPage that is destroyed the QWebView does not update its pointer and will crash the next time it access the page pointers (such as in its destructor). InspectorClientView should not call deleteLater when the page is destroyed because it does not have a parent and is a top level widget. close() needs to be called so that QApplication can exit the application if quitOnLastWindowClosed is set and a InspectorClientView is the last window, otherwise the application will never exit. * Api/qwebview.cpp: (QWebViewPrivate::_q_pageDestroyed): (QWebView::setPage): * Api/qwebview.h: * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientView::InspectorClientView): 2009-09-03 Adam Barth <abarth@webkit.org> Reviewed by eric@webkit.org. https://bugs.webkit.org/show_bug.cgi?id=24696 Stub implementations of mixed content methods of FrameLoaderClient. * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::didDisplayInsecureContent): (WebCore::FrameLoaderClientQt::didRunInsecureContent): * WebCoreSupport/FrameLoaderClientQt.h: 2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Eric Seidel. [Qt] Add a setting to turn SessionStorage on/off https://bugs.webkit.org/show_bug.cgi?id=28836 * Api/qwebsettings.cpp: (QWebSettingsPrivate::apply): (QWebSettings::QWebSettings): * Api/qwebsettings.h: * tests/qwebpage/tst_qwebpage.cpp: (testFlag): (tst_QWebPage::testOptionalJSObjects): 2009-09-02 Richard Moore <rich@kde.org> Reviewed by Tor Arne Vestbø. [Qt] Make sure we relayout the page after evaluating JS https://bugs.webkit.org/show_bug.cgi?id=28235 QtWebKit does not always seem to reflow the page when evaluating javascript. This patch changes the way evaluateJavaScript works to use the frameloader which ensures that this is done properly. * Api/qwebframe.cpp: (QWebFrame::evaluateJavaScript): * tests/qwebframe/tst_qwebframe.cpp: 2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> Reviewed by Holger Freyther. https://bugs.webkit.org/show_bug.cgi?id=25889 [GTK] scrollbar policy for main frame is not implementable Add empty implementation for new ChromeClient method. * WebCoreSupport/ChromeClientQt.h: (WebCore::ChromeClientQt::scrollbarsModeDidChange): 2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Ariya Hidayat. QWebHistory::clear() modifications. Clear() method was changed. If QWebHistory is empty (there is no elements even current) clear() do nothing. If there at least one element clear() will delete everything apart of current. New autotests in QWebHistory New autotests were added to QWebHistory. They should check some crashes in save and restore state process and clear() method and general behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1 Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711 * Api/qwebhistory.cpp: (QWebHistory::clear): * tests/qwebhistory/tst_qwebhistory.cpp: (tst_QWebHistory::back): (tst_QWebHistory::forward): (tst_QWebHistory::saveAndRestore_crash_1): (tst_QWebHistory::saveAndRestore_crash_2): (tst_QWebHistory::saveAndRestore_crash_3): (tst_QWebHistory::clear): 2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed by Ariya Hidayat. [Qt] Cleanup, old and commented part of source code was removed. Fix some formatting problems. https://bugs.webkit.org/show_bug.cgi?id=28712 * Api/qwebhistory_p.h: (QWebHistoryPrivate::QWebHistoryPrivate): 2009-08-26 Adam Barth <abarth@webkit.org> Reviewed by Oliver Hunt. Don't let local files access web URLs https://bugs.webkit.org/show_bug.cgi?id=28480 * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org> Reviewed by Ariya Hidayat. Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class. * Api/qwebframe.cpp: (QWebFrame::requestedUrl): * WebCoreSupport/FrameLoaderClientQt.cpp: (WebCore::FrameLoaderClientQt::FrameLoaderClientQt): (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad): (WebCore::FrameLoaderClientQt::postProgressFinishedNotification): (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad): (WebCore::FrameLoaderClientQt::dispatchDidFailLoad): * WebCoreSupport/FrameLoaderClientQt.h: 2009-08-22 Adam Barth <abarth@webkit.org> Revert 47684. We're going to do this later once clients have had a chance to opt into the setting they like. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-08-22 Adam Barth <abarth@webkit.org> Reviewed by Eric Seidel. Don't let local files access web URLs https://bugs.webkit.org/show_bug.cgi?id=28480 * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): 2009-08-19 Aaron Boodman <aa@chromium.org> Speculative build break fix for qt. * Api/qwebsecurityorigin.cpp: (QWebSecurityOrigin::whiteListAccessFromOrigin): * Api/qwebsecurityorigin.h: 2009-08-19 Aaron Boodman <aa@chromium.org> Reviewed by David Levin. https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to specify a more granular policy for cross-origin XHR access. * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists. (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto. (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto. * Api/qwebsecurityorigin.h: Ditto. 2009-08-18 Markus Goetz <Markus.Goetz@nokia.com> Reviwed by Ariya Hidayat. [Qt] For prefecthDNS, the pre-fetching has to be enabled in the WebSettings. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): * Api/qwebsettings.h: 2009-08-17 Darin Adler <darin@apple.com> Try to fix Qt build again. * WebCoreSupport/EditorClientQt.cpp: Move "using namespace". 2009-08-17 Darin Adler <darin@apple.com> Try to fix Qt build. * WebCoreSupport/EditorClientQt.cpp: (WebCore::EditorClientQt::shouldShowDeleteInterface): Use getAttribute(classAttr) instead of className() function. 2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com> Reviewed by Simon Hausmann. RVCT elftran fails to resolve QPainter::staticMetaObject coming with QWebView::RenderHints property. This is a temporary fix and will be revereted when the right symbols exported from Qt lib in S60. https://bugs.webkit.org/show_bug.cgi?id=28181 * Api/qwebview.h: 2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Simon Hausmann. [Qt] Public API to configure the storage path for HTML5 localStorage https://bugs.webkit.org/show_bug.cgi?id=28036 Disables LocalStorage for QtWebKit by default by setting QWebSettings::LocalStorageEnabled to false. Sets up a default for the LocalStorage path so that clients would only need to enable the LocalStorageEnabled setting to turn on LocalStoragre support. Turn on LocalStorage support for QtLauncher and the relevant test since LocalStorage is now disabled by default for QtWebkit. * Api/qwebpage.cpp: (defaultCachePath): (initializeApplicationCachePathIfNecessary): (QWebPagePrivate::QWebPagePrivate): * Api/qwebsettings.cpp: (QWebSettingsPrivate::apply): (QWebSettings::QWebSettings): (QWebSettings::setLocalStoragePath): (QWebSettings::localStoragePath): * Api/qwebsettings.h: * QtLauncher/main.cpp: (main): * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::multiplePageGroupsAndLocalStorage): 2009-08-14 Yael Aharon <yael.aharon@nokia.com> Reviewed by Simon Hausmann. [Qt] Allow applications to register their own local URL scheme. https://bugs.webkit.org/show_bug.cgi?id=28240 * Api/qwebsecurityorigin.cpp: (QWebSecurityOrigin::addLocalScheme): (QWebSecurityOrigin::removeLocalScheme): (QWebSecurityOrigin::localSchemes): * Api/qwebsecurityorigin.h: * tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::localURLSchemes): 2009-08-13 Mark Rowe <mrowe@apple.com> Try and fix the Qt build. * Api/qwebelement.cpp: 2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com> Reviewed by Simon Hausmann. Doc - Some cleanup on the documentation of QWebElement * Api/qwebelement.cpp: 2009-08-13 Norbert Leser <norbert.leser@nokia.com> Reviewed by Simon Hausmann. Symbian target components (library and executable files) require Unique Identifiers (i.e., UID3). These identifiers are defined in the respective project files, conditionally for "symbian" platform. * QtLauncher/QtLauncher.pro: * tests/qwebelement/qwebelement.pro: * tests/qwebframe/qwebframe.pro: * tests/qwebhistory/qwebhistory.pro: * tests/qwebhistoryinterface/qwebhistoryinterface.pro: * tests/qwebpage/qwebpage.pro: * tests/qwebview/qwebview.pro: 2009-08-12 George Wright <george.wright@torchmobile.com> Reviewed by Adam Treat. Initialise zoom levels independent of whether a URL is valid or not to fix https://bugs.webkit.org/show_bug.cgi?id=28162 * QtLauncher/main.cpp: (MainWindow::MainWindow): 2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com> Reviewed by Simon Hausmann. QtWebKit compile fix for Windows CE There's no getenv on Windows CE, use qgetenv instead. * Api/qwebpage.cpp: (qt_drt_overwritePluginDirectories): 2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com> Reviewed by Simon Hausmann. Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation. * Api/qwebplugindatabase.cpp: * Api/qwebsettings.cpp: 2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com> Reviewed by Simon Hausmann. Doc: there is no group of explicitly shared classes, only one class uses this. Explain the implications in the QWebHistoryItem documentation, and get rid of the "group". * Api/qwebhistory.cpp: 2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu> Reviewed by Simon Hausmann. [Qt] Fix build error caused by http://trac.webkit.org/changeset/46763 * Api/qwebpluginfactory.h: Export macro added. 2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org> Reviewed by Simon Hausmann. [Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors. https://bugs.webkit.org/show_bug.cgi?id=27804 * Api/qwebframe.cpp: (QWebFrame::requestedUrl): * tests/qwebframe/tst_qwebframe.cpp: 2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Tor Arne Vestbø. Rename QWebPlugin to QWebPluginInfo, as discussed on IRC. * Api/qwebplugindatabase.cpp: (QWebPluginInfoPrivate::QWebPluginInfoPrivate): (QWebPluginInfo::QWebPluginInfo): (QWebPluginInfo::~QWebPluginInfo): (QWebPluginInfo::name): (QWebPluginInfo::description): (QWebPluginInfo::mimeTypes): (QWebPluginInfo::supportsMimeType): (QWebPluginInfo::path): (QWebPluginInfo::isNull): (QWebPluginInfo::setEnabled): (QWebPluginInfo::isEnabled): (QWebPluginInfo::operator==): (QWebPluginInfo::operator!=): (QWebPluginInfo::operator=): (QWebPluginDatabase::plugins): (QWebPluginDatabase::pluginForMimeType): (QWebPluginDatabase::setPreferredPluginForMimeType): * Api/qwebplugindatabase.h: * Api/qwebplugindatabase_p.h: * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: (tst_QWebPluginDatabase::installedPlugins): (tst_QWebPluginDatabase::searchPaths): (tst_QWebPluginDatabase::null_data): (tst_QWebPluginDatabase::null): (tst_QWebPluginDatabase::pluginForMimeType): (tst_QWebPluginDatabase::enabled): (tst_QWebPluginDatabase::operatorequal_data): (tst_QWebPluginDatabase::operatorequal): (tst_QWebPluginDatabase::preferredPlugin): 2009-08-04 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Adam Treat. Replace QWebPlugin::MimeType with a typedef to QWebPluginFactory::MimeType. * Api/qwebplugindatabase.cpp: * Api/qwebplugindatabase.h: * Api/qwebpluginfactory.cpp: (QWebPluginFactory::MimeType::operator==): * Api/qwebpluginfactory.h: 2009-08-04 Jakub Wieczorek <faw217@gmail.com> Reviewed by Simon Hausmann. Add QWebPluginDatabase API to the Qt API. https://bugs.webkit.org/show_bug.cgi?id=27651 * Api/headers.pri: * Api/qwebplugindatabase.cpp: Added. (QWebPluginPrivate::QWebPluginPrivate): (QWebPluginDatabasePrivate::QWebPluginDatabasePrivate): (QWebPlugin::MimeType::operator==): (QWebPlugin::QWebPlugin): (QWebPlugin::~QWebPlugin): (QWebPlugin::name): (QWebPlugin::description): (QWebPlugin::mimeTypes): (QWebPlugin::supportsMimeType): (QWebPlugin::path): (QWebPlugin::isNull): (QWebPlugin::setEnabled): (QWebPlugin::isEnabled): (QWebPlugin::operator==): (QWebPlugin::operator!=): (QWebPlugin::operator=): (QWebPluginDatabase::QWebPluginDatabase): (QWebPluginDatabase::~QWebPluginDatabase): (QWebPluginDatabase::plugins): (QWebPluginDatabase::defaultSearchPaths): (QWebPluginDatabase::searchPaths): (QWebPluginDatabase::setSearchPaths): (QWebPluginDatabase::addSearchPath): (QWebPluginDatabase::refresh): (QWebPluginDatabase::pluginForMimeType): (QWebPluginDatabase::setPreferredPluginForMimeType): * Api/qwebplugindatabase.h: Added. * Api/qwebplugindatabase_p.h: Added. * Api/qwebsettings.cpp: (QWebSettings::pluginDatabase): * Api/qwebsettings.h: * tests/qwebplugindatabase/qwebplugindatabase.pro: Added. * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added. (tst_QWebPluginDatabase::installedPlugins): (tst_QWebPluginDatabase::searchPaths): (tst_QWebPluginDatabase::null_data): (tst_QWebPluginDatabase::null): (tst_QWebPluginDatabase::pluginForMimeType): (tst_QWebPluginDatabase::enabled): (tst_QWebPluginDatabase::operatorequal_data): (tst_QWebPluginDatabase::operatorequal): (tst_QWebPluginDatabase::preferredPlugin): * tests/tests.pro: 2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> Reviewed by Simon Hausmann. Do memory cleanup when running robotized QtLauncher in debug as well. * QtLauncher/main.cpp: (launcherMain): (main): 2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com> Reviewed by Tor Arne Vestbø. [Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default https://bugs.webkit.org/show_bug.cgi?id=27866 * Api/qwebpage.cpp: (initializeApplicationCachePathIfNecessary): (QWebPagePrivate::QWebPagePrivate): 2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com> Reviewed by Adam Treat. Build QtWebKit without benchmark tests for Qt < 4.5. https://bugs.webkit.org/show_bug.cgi?id=27886 The QBENCHMARK macro is only available from 4.5 on, so builds for Qt < 4.5 shouldn't try to build those. * tests/tests.pro: 2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Adam Treat. Fix warning by migrating use of QString.sprintf(...) to QString.arg().arg()... * WebCoreSupport/EditorClientQt.cpp: (dumpRange): 2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Tor Arne Vestbø. Expose the Offline Web Application Cache in the Qt API. * Api/qwebsettings.cpp: (QWebSettings::QWebSettings): (QWebSettings::setOfflineWebApplicationCachePath): (QWebSettings::offlineWebApplicationCachePath): (QWebSettings::setOfflineWebApplicationCacheQuota): (QWebSettings::offlineWebApplicationCacheQuota): * Api/qwebsettings.h: 2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Adam Treat. Add missing Q_OBJECT to class inheriting from QObject. * tests/qwebframe/tst_qwebframe.cpp: 2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org> Reviewed by Adam Treat. Fix indentation. * tests/qwebframe/tst_qwebframe.cpp: 2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com> Reviewed by Simon Hausmann. Fix documentation links to examples. * Api/qwebview.cpp: 2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu> Reviewed by Simon Hausmann. Allocate MainWindow on heap in robotized QtLauncher as well. * QtLauncher/main.cpp: (main): 2009-07-29 Kevin McCullough <kmccullough@apple.com> Reviewed by Darin Adler. Added foundation work to allow a testing infrastructure for the Web Inspector. * WebCoreSupport/InspectorClientQt.cpp: (WebCore::InspectorClientQt::inspectorWindowObjectCleared): * WebCoreSupport/InspectorClientQt.h: 2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu> Reviewed by Simon Hausmann. [Qt] In debug mode, this fix frees cached resources and other unreferenced objects (by calling the garbage collector) to remove the LEAK messages. https://bugs.webkit.org/show_bug.cgi?id=27767 * Api/qwebframe.cpp: (qt_drt_cache_clear): * QtLauncher/main.cpp: (main): 2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org> Fix the Qt build by adapting to the changes of ScriptObject. * Api/qwebelement.cpp: (setupScriptObject): 2009-07-28 Robert Hogan <robert@roberthogan.net> Reviewed by Simon Hausmann. Add WebKit version API to Qt. Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig at compile time and make it available to Qt applications through qWebKitVersion(). Also amend the User Agent string to place the Safari clause outside the final bracket and to the end of the UA string. https://bugs.webkit.org/show_bug.cgi?id=27158 Minor build tweak by Simon Hausmann (adding export macros to new functions). * Api/headers.pri: * Api/qwebkitversion.cpp: Added. (webKitVersion): (webKitMajorVersion): (webKitMinorVersion): * Api/qwebkitversion.h: Added. * Api/qwebpage.cpp: (QWebPage::userAgentForUrl): * tests/qwebview/tst_qwebview.cpp: (tst_QWebView::getWebKitVersion): http://qt.nokia.com/developer/task-tracker/index_html?id=238391&method=entry http://qt.nokia.com/developer/task-tracker/index_html?id=219344&method=entry http://qt.nokia.com/developer/task-tracker/index_html?id=241144&method=entry
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/headers.pri6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp24
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp13
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp764
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h146
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp30
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h28
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp187
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h58
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h44
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp58
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h32
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp331
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h49
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp376
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h98
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp46
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp178
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h22
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp66
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog1175
-rw-r--r--src/3rdparty/webkit/WebKit/qt/QGVLauncher/QGVLauncher.pro13
-rw-r--r--src/3rdparty/webkit/WebKit/qt/QGVLauncher/main.cpp317
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp11
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp19
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp34
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h5
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp113
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp17
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp163
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp67
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp90
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp437
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp7
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/tests.pro4
51 files changed, 4762 insertions, 330 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
index d92eb1cf78..51abba40df 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
+++ b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
@@ -1,4 +1,5 @@
WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
+ $$PWD/qwebgraphicsitem.h \
$$PWD/qwebkitglobal.h \
$$PWD/qwebpage.h \
$$PWD/qwebview.h \
@@ -7,5 +8,8 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
$$PWD/qwebdatabase.h \
$$PWD/qwebsecurityorigin.h \
$$PWD/qwebelement.h \
+ $$PWD/qwebplugindatabase.h \
$$PWD/qwebpluginfactory.h \
- $$PWD/qwebhistory.h
+ $$PWD/qwebhistory.h \
+ $$PWD/qwebinspector.h \
+ $$PWD/qwebkitversion.h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
index 57c8b0d322..ff086f6770 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -23,8 +23,8 @@
#include "CSSComputedStyleDeclaration.h"
#include "CSSMutableStyleDeclaration.h"
#include "CSSParser.h"
-#include "CSSRuleList.h"
#include "CSSRule.h"
+#include "CSSRuleList.h"
#include "CSSStyleRule.h"
#include "CString.h"
#include "Document.h"
@@ -42,6 +42,7 @@
#include "qwebframe.h"
#include "qwebframe_p.h"
#include "runtime_root.h"
+#include <parser/SourceCode.h>
#include <wtf/Vector.h>
using namespace WebCore;
@@ -218,7 +219,7 @@ QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
if (!nodes)
return elements;
- for (int i = 0; i < nodes->length(); ++i) {
+ for (unsigned i = 0; i < nodes->length(); ++i) {
WebCore::Node* n = nodes->item(i);
elements.append(QWebElement(static_cast<Element*>(n)));
}
@@ -697,7 +698,7 @@ static bool setupScriptObject(WebCore::Element* element, ScriptObject& object, S
if (!thisObject)
return false;
- object = ScriptObject(thisObject);
+ object = ScriptObject(state, thisObject);
return true;
}
@@ -1661,6 +1662,23 @@ void QWebElement::replace(const QString &markup)
}
/*!
+ \internal
+ Walk \a node's parents until a valid QWebElement is found.
+ For example, a WebCore::Text node is not a valid Html QWebElement, but its
+ enclosing p tag is.
+*/
+QWebElement QWebElement::enclosingElement(WebCore::Node* node)
+{
+ QWebElement element(node);
+
+ while (element.isNull() && node) {
+ node = node->parentNode();
+ element = QWebElement(node);
+ }
+ return element;
+}
+
+/*!
\fn inline bool QWebElement::operator==(const QWebElement& o) const;
Returns true if this element points to the same underlying DOM object as
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
index bc6f8a9566..5f4870c550 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
@@ -141,9 +141,12 @@ private:
explicit QWebElement(WebCore::Element*);
explicit QWebElement(WebCore::Node*);
+ static QWebElement enclosingElement(WebCore::Node*);
+
friend class QWebFrame;
friend class QWebHitTestResult;
friend class QWebHitTestResultPrivate;
+ friend class QWebPage;
QWebElementPrivate* d;
WebCore::Element* m_element;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index f2fe1080e7..fe813b8767 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -540,8 +540,12 @@ QUrl QWebFrame::url() const
*/
QUrl QWebFrame::requestedUrl() const
{
+ // In the following edge cases (where the failing document
+ // loader does not get commited by the frame loader) it is
+ // safer to rely on outgoingReferrer than originalRequest.
if (!d->frame->loader()->activeDocumentLoader()
- || !d->frameLoaderClient->m_loadSucceeded)
+ || (!d->frameLoaderClient->m_loadError.isNull()
+ && !d->frame->loader()->outgoingReferrer().isEmpty()))
return QUrl(d->frame->loader()->outgoingReferrer());
return d->frame->loader()->originalRequest().url();
@@ -799,13 +803,11 @@ void QWebFrame::setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPol
d->horizontalScrollBarPolicy = policy;
if (d->frame->view()) {
d->frame->view()->setHorizontalScrollbarMode((ScrollbarMode)policy);
- d->frame->view()->updateDefaultScrollbarState();
}
} else {
d->verticalScrollBarPolicy = policy;
if (d->frame->view()) {
d->frame->view()->setVerticalScrollbarMode((ScrollbarMode)policy);
- d->frame->view()->updateDefaultScrollbarState();
}
}
}
@@ -1022,7 +1024,8 @@ qreal QWebFrame::zoomFactor() const
*/
bool QWebFrame::hasFocus() const
{
- return QWebFramePrivate::kit(d->frame->page()->focusController()->focusedFrame()) == this;
+ WebCore::Frame* ff = d->frame->page()->focusController()->focusedFrame();
+ return ff && QWebFramePrivate::kit(ff) == this;
}
/*!
@@ -1244,7 +1247,7 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
ScriptController *proxy = d->frame->script();
QVariant rc;
if (proxy) {
- JSC::JSValue v = proxy->evaluate(ScriptSourceCode(scriptSource)).jsValue();
+ JSC::JSValue v = d->frame->loader()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
int distance = 0;
rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject()->globalExec(), v, QMetaType::Void, &distance);
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
index d6afc01bcd..632f83a268 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe_p.h
@@ -79,15 +79,14 @@ public:
WebCore::Scrollbar* horizontalScrollBar() const;
WebCore::Scrollbar* verticalScrollBar() const;
- Qt::ScrollBarPolicy horizontalScrollBarPolicy;
- Qt::ScrollBarPolicy verticalScrollBarPolicy;
-
static WebCore::Frame* core(QWebFrame*);
static QWebFrame* kit(WebCore::Frame*);
void renderPrivate(QPainter *painter, const QRegion &clip);
QWebFrame *q;
+ Qt::ScrollBarPolicy horizontalScrollBarPolicy;
+ Qt::ScrollBarPolicy verticalScrollBarPolicy;
WebCore::FrameLoaderClientQt *frameLoaderClient;
WebCore::Frame *frame;
QWebPage *page;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp
new file mode 100644
index 0000000000..be8f6ab1a3
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.cpp
@@ -0,0 +1,764 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebgraphicsitem.h"
+
+#include "qwebframe.h"
+#include "qwebpage.h"
+#include "qwebpage_p.h"
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QGraphicsView>
+#include <QtGui/qapplication.h>
+#include <QtGui/qgraphicssceneevent.h>
+#include <QtGui/qstyleoption.h>
+
+class QWebGraphicsItemPrivate {
+public:
+ QWebGraphicsItemPrivate(QWebGraphicsItem* parent)
+ : q(parent)
+ , page(0)
+ , interactive(true)
+ , progress(1.0)
+ {}
+
+ void _q_doScroll(int dx, int dy, const QRect&);
+ void _q_doLoadProgress(int progress);
+ void _q_doLoadFinished(bool success);
+ void _q_doUpdate(const QRect& dirtyRect);
+ void _q_setStatusBarMessage(const QString& message);
+
+ QWebGraphicsItem* q;
+ QWebPage* page;
+
+ QString statusBarMessage;
+ bool interactive;
+ qreal progress;
+};
+
+void QWebGraphicsItemPrivate::_q_doLoadProgress(int progress)
+{
+ if (qFuzzyCompare(this->progress, qreal(progress / 100.)))
+ return;
+
+ this->progress = progress / 100.;
+
+ emit q->progressChanged(this->progress);
+}
+
+void QWebGraphicsItemPrivate::_q_doLoadFinished(bool success)
+{
+ // If the page had no title, still make sure it gets the signal
+ if (q->title().isEmpty())
+ emit q->urlChanged(q->url());
+
+ if (success)
+ emit q->loadFinished();
+ else
+ emit q->loadFailed();
+}
+
+void QWebGraphicsItemPrivate::_q_doScroll(int dx, int dy, const QRect& rectToScroll)
+{
+ q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll));
+}
+
+void QWebGraphicsItemPrivate::_q_doUpdate(const QRect & dirtyRect)
+{
+ q->update(QRectF(dirtyRect));
+}
+
+void QWebGraphicsItemPrivate::_q_setStatusBarMessage(const QString& s)
+{
+ statusBarMessage = s;
+ emit q->statusChanged();
+}
+
+/*!
+ \class QWebGraphicsItem
+ \brief The QWebGraphicsItem class allows web content to be added to a GraphicsView.
+ \inherits QGraphicsWidget.
+ \since 4.6
+
+ A WebGraphicsItem renders web content based on a URL or set data.
+
+ If the width and height of the item is not set, they will
+ dynamically adjust to a size appropriate for the content.
+ This width may be large (eg. 980) for typical online web pages.
+*/
+
+/*!
+ Constructs an empty QWebGraphicsItem with parent \a parent.
+
+ \sa load()
+*/
+QWebGraphicsItem::QWebGraphicsItem(QGraphicsItem* parent)
+ : QGraphicsWidget(parent)
+ , d(new QWebGraphicsItemPrivate(this))
+{
+#if QT_VERSION >= 0x040600
+ setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
+#endif
+ setAcceptHoverEvents(true);
+ setFocusPolicy(Qt::StrongFocus);
+}
+
+/*!
+ Destroys the web graphicsitem.
+*/
+QWebGraphicsItem::~QWebGraphicsItem()
+{
+ if (d->page)
+ d->page->d->view = 0;
+
+ if (d->page && d->page->parent() == this)
+ delete d->page;
+
+ delete d;
+}
+
+/*!
+ Returns a pointer to the underlying web page.
+
+ \sa setPage()
+*/
+QWebPage* QWebGraphicsItem::page() const
+{
+ if (!d->page) {
+ QWebGraphicsItem* that = const_cast<QWebGraphicsItem*>(this);
+ QWebPage* page = new QWebPage(that);
+
+ // Default to not having a background, in the case
+ // the page doesn't provide one.
+ QPalette palette = QApplication::palette();
+ palette.setBrush(QPalette::Base, QColor::fromRgbF(0, 0, 0, 0));
+ page->setPalette(palette);
+
+ that->setPage(page);
+ }
+
+ return d->page;
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget*)
+{
+ page()->mainFrame()->render(painter, option->exposedRect.toRect());
+}
+
+/*! \reimp
+*/
+bool QWebGraphicsItem::sceneEvent(QEvent* event)
+{
+ // Re-implemented in order to allows fixing event-related bugs in patch releases.
+ return QGraphicsWidget::sceneEvent(event);
+}
+
+/*! \reimp
+*/
+bool QWebGraphicsItem::event(QEvent* event)
+{
+ // Re-implemented in order to allows fixing event-related bugs in patch releases.
+ return QGraphicsWidget::event(event);
+}
+
+/*!
+ Makes \a page the new web page of the web graphicsitem.
+
+ The parent QObject of the provided page remains the owner
+ of the object. If the current document is a child of the web
+ view, it will be deleted.
+
+ \sa page()
+*/
+void QWebGraphicsItem::setPage(QWebPage* page)
+{
+ if (d->page == page)
+ return;
+
+ if (d->page) {
+ if (d->page->parent() == this)
+ delete d->page;
+ else
+ d->page->disconnect(this);
+ }
+
+ d->page = page;
+ if (!d->page)
+ return;
+
+ QSize size = geometry().size().toSize();
+ page->setViewportSize(size);
+
+ QWebFrame* mainFrame = d->page->mainFrame();
+
+ connect(mainFrame, SIGNAL(titleChanged(const QString&)),
+ this, SIGNAL(titleChanged(const QString&)));
+ connect(mainFrame, SIGNAL(iconChanged()),
+ this, SIGNAL(iconChanged()));
+ connect(mainFrame, SIGNAL(urlChanged(const QUrl&)),
+ this, SIGNAL(urlChanged(const QUrl&)));
+ connect(d->page, SIGNAL(loadStarted()),
+ this, SIGNAL(loadStarted()));
+ connect(d->page, SIGNAL(loadProgress(int)),
+ this, SLOT(_q_doLoadProgress(int)));
+ connect(d->page, SIGNAL(loadFinished(bool)),
+ this, SLOT(_q_doLoadFinished(bool)));
+ connect(d->page, SIGNAL(repaintRequested(QRect)),
+ this, SLOT(_q_doUpdate(const QRect&)));
+ connect(d->page, SIGNAL(scrollRequested(int, int, const QRect&)),
+ this, SLOT(_q_doScroll(int, int, const QRect&)));
+ connect(d->page, SIGNAL(statusBarMessage(const QString&)),
+ this, SLOT(_q_setStatusBarMessage(const QString&)));
+}
+
+/*!
+ \property QWebGraphicsItem::url
+ \brief the url of the web page currently viewed
+
+ Setting this property clears the view and loads the URL.
+
+ By default, this property contains an empty, invalid URL.
+
+ \sa load(), urlChanged()
+*/
+
+void QWebGraphicsItem::setUrl(const QUrl &url)
+{
+ page()->mainFrame()->setUrl(url);
+}
+
+QUrl QWebGraphicsItem::url() const
+{
+ if (d->page)
+ return d->page->mainFrame()->url();
+
+ return QUrl();
+}
+
+/*!
+ \property QWebGraphicsItem::title
+ \brief the title of the web page currently viewed
+
+ By default, this property contains an empty string.
+
+ \sa titleChanged()
+*/
+QString QWebGraphicsItem::title() const
+{
+ if (d->page)
+ return d->page->mainFrame()->title();
+
+ return QString();
+}
+
+/*!
+ \property QWebGraphicsItem::icon
+ \brief the icon associated with the web page currently viewed
+
+ By default, this property contains a null icon.
+
+ \sa iconChanged(), QWebSettings::iconForUrl()
+*/
+QIcon QWebGraphicsItem::icon() const
+{
+ if (d->page)
+ return d->page->mainFrame()->icon();
+
+ return QIcon();
+}
+
+/*!
+ \property QWebGraphicsItem::zoomFactor
+ \since 4.5
+ \brief the zoom factor for the view
+*/
+
+void QWebGraphicsItem::setZoomFactor(qreal factor)
+{
+ if (factor == page()->mainFrame()->zoomFactor())
+ return;
+
+ page()->mainFrame()->setZoomFactor(factor);
+ emit zoomFactorChanged();
+}
+
+qreal QWebGraphicsItem::zoomFactor() const
+{
+ return page()->mainFrame()->zoomFactor();
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::updateGeometry()
+{
+ QGraphicsWidget::updateGeometry();
+
+ if (!d->page)
+ return;
+
+ QSize size = geometry().size().toSize();
+ d->page->setViewportSize(size);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::setGeometry(const QRectF& rect)
+{
+ QGraphicsWidget::setGeometry(rect);
+
+ if (!d->page)
+ return;
+
+ // NOTE: call geometry() as setGeometry ensures that
+ // the geometry is within legal bounds (minimumSize, maximumSize)
+ QSize size = geometry().size().toSize();
+ d->page->setViewportSize(size);
+}
+
+/*!
+ \brief The load status message associated to the web graphicsitem
+
+ Provides the latest status message set during the load of a URL.
+ Commonly shown by Status Bar widgets.
+
+ \sa statusChanged()
+*/
+
+QString QWebGraphicsItem::status() const
+{
+ return d->statusBarMessage;
+}
+
+/*!
+ Convenience slot that stops loading the document.
+
+ \sa reload(), pageAction(), loadFinished()
+*/
+void QWebGraphicsItem::stop()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Stop);
+}
+
+/*!
+ Convenience slot that loads the previous document in the list of documents
+ built by navigating links. Does nothing if there is no previous document.
+
+ \sa forward(), pageAction()
+*/
+void QWebGraphicsItem::back()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Back);
+}
+
+/*!
+ Convenience slot that loads the next document in the list of documents
+ built by navigating links. Does nothing if there is no next document.
+
+ \sa back(), pageAction()
+*/
+void QWebGraphicsItem::forward()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Forward);
+}
+
+/*!
+ Reloads the current document.
+
+ \sa stop(), pageAction(), loadStarted()
+*/
+void QWebGraphicsItem::reload()
+{
+ if (d->page)
+ d->page->triggerAction(QWebPage::Reload);
+}
+
+/*!
+ \property QWebGraphicsItem::progress
+ \brief the progress of loading the current URL, from 0 to 1.
+*/
+qreal QWebGraphicsItem::progress() const
+{
+ return d->progress;
+}
+
+/*!
+ Loads the specified \a url and displays it.
+
+ \note The view remains the same until enough data has arrived to display the new \a url.
+
+ \sa setUrl(), url(), urlChanged()
+*/
+void QWebGraphicsItem::load(const QUrl& url)
+{
+ page()->mainFrame()->load(url);
+}
+
+/*!
+ \fn void QWebGraphicsItem::load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &body)
+
+ Loads a network request, \a request, using the method specified in \a operation.
+
+ \a body is optional and is only used for POST operations.
+
+ \note The view remains the same until enough data has arrived to display the new url.
+
+ \sa url(), urlChanged()
+*/
+
+void QWebGraphicsItem::load(const QNetworkRequest& request,
+ QNetworkAccessManager::Operation operation,
+ const QByteArray& body)
+{
+ page()->mainFrame()->load(request, operation, body);
+}
+
+/*!
+ Sets the content of the web graphicsitem to the specified \a html.
+
+ External objects such as stylesheets or images referenced in the HTML
+ document are located relative to \a baseUrl.
+
+ The \a html is loaded immediately; external objects are loaded asynchronously.
+
+ When using this method, WebKit assumes that external resources such as
+ JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
+ specified. For example, the encoding of an external script can be specified
+ through the charset attribute of the HTML script tag. Alternatively, the
+ encoding can also be specified by the web server.
+
+ \sa load(), setContent(), QWebFrame::toHtml()
+*/
+void QWebGraphicsItem::setHtml(const QString& html, const QUrl& baseUrl)
+{
+ page()->mainFrame()->setHtml(html, baseUrl);
+}
+
+QString QWebGraphicsItem::toHtml() const
+{
+ return page()->mainFrame()->toHtml();
+}
+
+/*!
+ Sets the content of the web graphicsitem to the specified content \a data. If the \a mimeType argument
+ is empty it is currently assumed that the content is HTML but in future versions we may introduce
+ auto-detection.
+
+ External objects referenced in the content are located relative to \a baseUrl.
+
+ The \a data is loaded immediately; external objects are loaded asynchronously.
+
+ \sa load(), setHtml(), QWebFrame::toHtml()
+*/
+void QWebGraphicsItem::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl)
+{
+ page()->mainFrame()->setContent(data, mimeType, baseUrl);
+}
+
+/*!
+ Returns a pointer to the view's history of navigated web pages.
+
+ It is equivalent to
+
+ \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 0
+*/
+QWebHistory* QWebGraphicsItem::history() const
+{
+ return page()->history();
+}
+
+/*!
+ \property QWebGraphicsItem::interactive
+ \brief controls whether the item responds to mouse and key events.
+*/
+
+bool QWebGraphicsItem::isInteractive() const
+{
+ return d->interactive;
+}
+
+void QWebGraphicsItem::setInteractive(bool allowed)
+{
+ if (d->interactive == allowed)
+ return;
+
+ d->interactive = allowed;
+ emit interactivityChanged();
+}
+
+/*!
+ Returns a pointer to the view/page specific settings object.
+
+ It is equivalent to
+
+ \snippet webkitsnippets/qtwebkit_qwebview_snippet.cpp 1
+
+ \sa QWebSettings::globalSettings()
+*/
+QWebSettings* QWebGraphicsItem::settings() const
+{
+ return page()->settings();
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::hoverMoveEvent(QGraphicsSceneHoverEvent* ev)
+{
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ QMouseEvent me = QMouseEvent(QEvent::MouseMove,
+ ev->pos().toPoint(), Qt::NoButton,
+ Qt::NoButton, Qt::NoModifier);
+ d->page->setView(ev->widget());
+ d->page->event(&me);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::hoverMoveEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::hoverLeaveEvent(QGraphicsSceneHoverEvent* ev)
+{
+ Q_UNUSED(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mouseMoveEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mousePressEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mouseReleaseEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
+{
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::mouseDoubleClickEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::keyPressEvent(QKeyEvent* ev)
+{
+ if (d->interactive && d->page)
+ d->page->event(ev);
+
+ if (!ev->isAccepted())
+ QGraphicsItem::keyPressEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::keyReleaseEvent(QKeyEvent* ev)
+{
+ if (d->interactive && d->page)
+ d->page->event(ev);
+
+ if (!ev->isAccepted())
+ QGraphicsItem::keyReleaseEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::focusInEvent(QFocusEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ else
+ QGraphicsItem::focusInEvent(ev);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::focusOutEvent(QFocusEvent* ev)
+{
+ if (d->page)
+ d->page->event(ev);
+ else
+ QGraphicsItem::focusOutEvent(ev);
+}
+
+/*! \reimp
+*/
+bool QWebGraphicsItem::focusNextPrevChild(bool next)
+{
+ if (d->page)
+ return d->page->focusNextPrevChild(next);
+
+ return QGraphicsWidget::focusNextPrevChild(next);
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ //if (d->page)
+ // d->page->event(ev);
+ //Just remove this line below when the code above is working
+ Q_UNUSED(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsWidget::dragLeaveEvent(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsWidget::dragMoveEvent(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+/*! \reimp
+*/
+void QWebGraphicsItem::dropEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsWidget::dropEvent(ev);
+#else
+ Q_UNUSED(ev);
+#endif
+}
+
+#ifndef QT_NO_CONTEXTMENU
+/*! \reimp
+*/
+void QWebGraphicsItem::contextMenuEvent(QGraphicsSceneContextMenuEvent* ev)
+{
+ if (d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+}
+#endif // QT_NO_CONTEXTMENU
+
+#ifndef QT_NO_WHEELEVENT
+/*! \reimp
+*/
+void QWebGraphicsItem::wheelEvent(QGraphicsSceneWheelEvent* ev)
+{
+ if (d->interactive && d->page) {
+ const bool accepted = ev->isAccepted();
+ d->page->event(ev);
+ ev->setAccepted(accepted);
+ }
+
+ if (!ev->isAccepted())
+ QGraphicsItem::wheelEvent(ev);
+}
+#endif // QT_NO_WHEELEVENT
+
+/*! \reimp
+*/
+void QWebGraphicsItem::inputMethodEvent(QInputMethodEvent* ev)
+{
+ if (d->interactive && d->page)
+ d->page->event(ev);
+
+ if (!ev->isAccepted())
+ QGraphicsItem::inputMethodEvent(ev);
+}
+
+#include "moc_qwebgraphicsitem.cpp"
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h
new file mode 100644
index 0000000000..223ac421b6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebgraphicsitem.h
@@ -0,0 +1,146 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWebGraphicsItem_h
+#define QWebGraphicsItem_h
+
+#include "qwebkitglobal.h"
+#include <QtCore/qurl.h>
+#include <QtGui/qevent.h>
+#include <QtGui/qgraphicswidget.h>
+#include <QtGui/qicon.h>
+#include <QtGui/qpainter.h>
+#include <QtNetwork/qnetworkaccessmanager.h>
+
+class QWebPage;
+class QWebHistory;
+class QWebSettings;
+
+class QWebGraphicsItemPrivate;
+
+class QWEBKIT_EXPORT QWebGraphicsItem : public QGraphicsWidget {
+ Q_OBJECT
+
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
+ Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
+ Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged)
+ Q_PROPERTY(QString status READ status NOTIFY statusChanged)
+
+ Q_PROPERTY(QString html READ toHtml WRITE setHtml)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
+ Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
+
+ Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactivityChanged)
+
+public:
+ QWebGraphicsItem(QGraphicsItem* parent = 0);
+ ~QWebGraphicsItem();
+
+ QWebPage* page() const;
+ void setPage(QWebPage*);
+
+ QUrl url() const;
+ void setUrl(const QUrl&);
+
+ QString title() const;
+ QIcon icon() const;
+
+ qreal zoomFactor() const;
+ void setZoomFactor(qreal);
+
+ bool isInteractive() const;
+ void setInteractive(bool);
+
+ qreal progress() const;
+
+ void load(const QUrl &url);
+ void load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray& body = QByteArray());
+
+ QString toHtml() const;
+ void setHtml(const QString& html, const QUrl& baseUrl = QUrl());
+ // FIXME: Consider rename to setHtml?
+ void setContent(const QByteArray& data, const QString& mimeType = QString(), const QUrl& baseUrl = QUrl());
+
+ QWebHistory* history() const;
+ QWebSettings* settings() const;
+
+ QString status() const;
+
+ virtual void setGeometry(const QRectF& rect);
+ virtual void updateGeometry();
+ virtual void paint(QPainter*, const QStyleOptionGraphicsItem* options, QWidget* widget = 0);
+ virtual bool event(QEvent*);
+
+public Q_SLOTS:
+ void stop();
+ void back();
+ void forward();
+ void reload();
+
+Q_SIGNALS:
+ void loadStarted();
+ void loadFinished();
+ void loadFailed();
+
+ void progressChanged(qreal);
+ void interactivityChanged();
+ void urlChanged(const QUrl&);
+ void titleChanged(const QString&);
+ void iconChanged();
+ void statusChanged();
+ void zoomFactorChanged();
+
+protected:
+ virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
+ virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
+ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
+ virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
+ virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*);
+ virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent*);
+#ifndef QT_NO_WHEELEVENT
+ virtual void wheelEvent(QGraphicsSceneWheelEvent*);
+#endif
+ virtual void keyPressEvent(QKeyEvent*);
+ virtual void keyReleaseEvent(QKeyEvent*);
+#ifndef QT_NO_CONTEXTMENU
+ virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent*);
+#endif
+ virtual void dragEnterEvent(QGraphicsSceneDragDropEvent*);
+ virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent*);
+ virtual void dragMoveEvent(QGraphicsSceneDragDropEvent*);
+ virtual void dropEvent(QGraphicsSceneDragDropEvent*);
+ virtual void focusInEvent(QFocusEvent*);
+ virtual void focusOutEvent(QFocusEvent*);
+ virtual void inputMethodEvent(QInputMethodEvent*);
+ virtual bool focusNextPrevChild(bool next);
+
+ virtual bool sceneEvent(QEvent*);
+
+private:
+ Q_PRIVATE_SLOT(d, void _q_doScroll(int dx, int dy, const QRect&))
+ Q_PRIVATE_SLOT(d, void _q_doLoadProgress(int progress))
+ Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success))
+ Q_PRIVATE_SLOT(d, void _q_doUpdate(const QRect& dirtyRect))
+ Q_PRIVATE_SLOT(d, void _q_setStatusBarMessage(const QString& message))
+
+ QWebGraphicsItemPrivate* const d;
+ friend class QWebGraphicsItemPrivate;
+};
+
+#endif // QWebGraphicsItem_h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
index b11ae5680b..b57272dcd8 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory.cpp
@@ -248,17 +248,25 @@ QWebHistory::~QWebHistory()
*/
void QWebHistory::clear()
{
- RefPtr<WebCore::HistoryItem> current = d->lst->currentItem();
- int capacity = d->lst->capacity();
- d->lst->setCapacity(0);
+ //shortcut to private BackForwardList
+ WebCore::BackForwardList* lst = d->lst;
- WebCore::Page* page = d->lst->page();
+ //clear visited links
+ WebCore::Page* page = lst->page();
if (page && page->groupPtr())
page->groupPtr()->removeVisitedLinks();
- d->lst->setCapacity(capacity);
- d->lst->addItem(current.get());
- d->lst->goToItem(current.get());
+ //if count() == 0 then just return
+ if (!lst->entries().size())
+ return;
+
+ RefPtr<WebCore::HistoryItem> current = lst->currentItem();
+ int capacity = lst->capacity();
+ lst->setCapacity(0);
+
+ lst->setCapacity(capacity); //revert capacity
+ lst->addItem(current.get()); //insert old current item
+ lst->goToItem(current.get()); //and set it as current again
}
/*!
@@ -271,7 +279,7 @@ QList<QWebHistoryItem> QWebHistory::items() const
const WebCore::HistoryItemVector &items = d->lst->entries();
QList<QWebHistoryItem> ret;
- for (int i = 0; i < items.size(); ++i) {
+ for (unsigned i = 0; i < items.size(); ++i) {
QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
ret.append(QWebHistoryItem(priv));
}
@@ -290,7 +298,7 @@ QList<QWebHistoryItem> QWebHistory::backItems(int maxItems) const
d->lst->backListWithLimit(maxItems, items);
QList<QWebHistoryItem> ret;
- for (int i = 0; i < items.size(); ++i) {
+ for (unsigned i = 0; i < items.size(); ++i) {
QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
ret.append(QWebHistoryItem(priv));
}
@@ -309,7 +317,7 @@ QList<QWebHistoryItem> QWebHistory::forwardItems(int maxItems) const
d->lst->forwardListWithLimit(maxItems, items);
QList<QWebHistoryItem> ret;
- for (int i = 0; i < items.size(); ++i) {
+ for (unsigned i = 0; i < items.size(); ++i) {
QWebHistoryItemPrivate *priv = new QWebHistoryItemPrivate(items[i].get());
ret.append(QWebHistoryItem(priv));
}
@@ -533,7 +541,7 @@ QByteArray QWebHistory::saveState(HistoryStateVersion version) const
stream << count() << currentItemIndex();
const WebCore::HistoryItemVector &items = d->lst->entries();
- for (int i = 0; i < items.size(); i++)
+ for (unsigned i = 0; i < items.size(); i++)
items[i].get()->saveState(stream, version);
if (stream.status() != QDataStream::Ok)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
index e77adefc2f..809d405f50 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebhistory_p.h
@@ -27,11 +27,11 @@
class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData {
public:
- static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem *q)
+ static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem* q)
{
return q->d;
}
- QWebHistoryItemPrivate(WebCore::HistoryItem *i)
+ QWebHistoryItemPrivate(WebCore::HistoryItem* i)
{
if (i)
i->ref();
@@ -43,30 +43,12 @@ public:
item->deref();
}
- /* QByteArray saveStateWithoutVersionControl(QWebHistory::HistoryStateVersion version)
- {
- QByteArray buffer;
- switch(version){
- case QWebHistory::HistoryVersion1:
- buffer=item->saveState(version);
- break;
- default:{}
- }
- return buffer;
- }
-
- bool restoreStateWithoutVersionControl(QWebHistory::HistoryStateVersion version,QDataStream& stream)
- {
-
- }
-*/
-
- WebCore::HistoryItem *item;
+ WebCore::HistoryItem* item;
};
class QWebHistoryPrivate : public QSharedData {
public:
- QWebHistoryPrivate(WebCore::BackForwardList *l)
+ QWebHistoryPrivate(WebCore::BackForwardList* l)
{
l->ref();
lst = l;
@@ -75,7 +57,7 @@ public:
{
lst->deref();
}
- WebCore::BackForwardList *lst;
+ WebCore::BackForwardList* lst;
};
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
new file mode 100644
index 0000000000..5a66cc6c19
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.cpp
@@ -0,0 +1,187 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebinspector.h"
+
+#include "Element.h"
+#include "InspectorController.h"
+#include "qwebelement.h"
+#include "qwebinspector_p.h"
+#include "qwebpage_p.h"
+
+#include <QResizeEvent>
+
+// TODO: handle the "Always enable" commands with QWebSettings
+
+/*!
+ \class QWebInspector
+ \since 4.6
+ \brief The QWebInspector class allows the placement and control of a
+ QWebPage's inspector.
+ The inspector allows you to see a page current hierarchy and loading
+ statistics.
+
+ The QWebPage to be inspected is determined with the setPage() method.
+
+ A typical use of QWebInspector follows:
+
+ \snippet webkitsnippets/qtwebkit_qwebinspector_snippet.cpp 0
+
+ Most of the resources needed by the inspector are owned by the associated
+ QWebPage and are allocated the first time that:
+ \list
+ \o an element is inspected
+ \o the QWebInspector is shown.
+ \endlist
+
+ This class acts mostly as a container and a controller for the inspector.
+ You can defer the creation and association of the QWebInspector until
+ the first emission of QWebPage::webInspectorTriggered() to save additional
+ resources.
+
+ \note A QWebInspector will display a blank widget if either:
+ \list
+ \o page() is null
+ \o QWebSettings::DeveloperExtrasEnabled is false
+ \endlist
+
+ \sa QWebPage::webInspectorTriggered()
+*/
+
+/*!
+ Constructs an empty QWebInspector with parent \a parent.
+*/
+QWebInspector::QWebInspector(QWidget* parent)
+ : QWidget(parent)
+ , d(new QWebInspectorPrivate(this))
+{
+}
+
+/*!
+ Destroys the inspector.
+*/
+QWebInspector::~QWebInspector()
+{
+ // Remove association principally to prevent deleting a child frontend
+ setPage(0);
+}
+
+/*!
+ Sets the QWebPage to be inspected.
+
+ There can only be one QWebInspector associated with a QWebPage
+ and vices versa.
+
+ Calling with \a page as null will break the current association, if any.
+
+ If \a page is already associated to another QWebInspector, the association
+ will be replaced and the previous QWebInspector will have no page
+ associated.
+
+ \sa page()
+*/
+void QWebInspector::setPage(QWebPage* page)
+{
+ if (d->page) {
+ // Break currentPage-->this
+ d->page->d->setInspector(0);
+ }
+ if (page && page->d->inspector && page->d->inspector != this) {
+ // Break newPage<->newPageCurrentInspector
+ page->d->inspector->setPage(0);
+ }
+
+ d->page = page;
+
+ if (page) {
+ // Setup the reciprocal association
+ page->d->setInspector(this);
+ }
+}
+
+/*!
+ Returns the inspected QWebPage.
+ If no web page is currently associated, a null pointer is returned.
+*/
+QWebPage* QWebInspector::page() const
+{
+ return d->page;
+}
+
+/*! \reimp */
+QSize QWebInspector::sizeHint() const
+{
+ return QSize(450, 300);
+}
+
+/*! \reimp */
+bool QWebInspector::event(QEvent* ev)
+{
+ return QWidget::event(ev);
+}
+
+/*! \reimp */
+void QWebInspector::resizeEvent(QResizeEvent* event)
+{
+ d->adjustFrontendSize(event->size());
+}
+
+/*! \reimp */
+void QWebInspector::showEvent(QShowEvent* event)
+{
+ // Allows QWebInspector::show() to init the inspector.
+ if (d->page)
+ d->page->d->inspectorController()->show();
+}
+
+/*! \reimp */
+void QWebInspector::hideEvent(QHideEvent* event)
+{
+ if (d->page)
+ d->page->d->inspectorController()->setWindowVisible(false);
+}
+
+/*! \internal */
+void QWebInspectorPrivate::setFrontend(QWidget* newFrontend)
+{
+ if (frontend)
+ frontend->setParent(0);
+
+ frontend = newFrontend;
+
+ if (frontend) {
+ frontend->setParent(q);
+ frontend->show();
+ adjustFrontendSize(q->size());
+ }
+}
+
+void QWebInspectorPrivate::adjustFrontendSize(const QSize& size)
+{
+ if (frontend)
+ frontend->resize(size);
+}
+
+/*!
+ \fn void QWebInspector::windowTitleChanged(const QString& newTitle);
+
+ This is emitted to signal that this widget's title changed to \a newTitle.
+*/
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
new file mode 100644
index 0000000000..bb5bd64a48
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBINSPECTOR_H
+#define QWEBINSPECTOR_H
+
+#include "qwebkitglobal.h"
+#include "qwebpage.h"
+
+#include "qwebview.h"
+
+class QWebInspectorPrivate;
+
+class QWEBKIT_EXPORT QWebInspector : public QWidget {
+ Q_OBJECT
+public:
+ QWebInspector(QWidget* parent = 0);
+ ~QWebInspector();
+
+ void setPage(QWebPage* page);
+ QWebPage* page() const;
+
+ QSize sizeHint() const;
+ bool event(QEvent*);
+
+Q_SIGNALS:
+ void windowTitleChanged(const QString& newTitle);
+
+protected:
+ void resizeEvent(QResizeEvent* event);
+ void showEvent(QShowEvent* event);
+ void hideEvent(QHideEvent* event);
+
+private:
+ QWebInspectorPrivate* d;
+
+ friend class QWebInspectorPrivate;
+ friend class QWebPage;
+ friend class QWebPagePrivate;
+ friend class WebCore::InspectorClientQt;
+};
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
new file mode 100644
index 0000000000..b7af4f888e
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebinspector_p.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 2008, 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBINSPECTOR_P_H
+#define QWEBINSPECTOR_P_H
+
+class QSize;
+class QWebInspector;
+class QWebPage;
+class QWidget;
+
+class QWebInspectorPrivate {
+public:
+ QWebInspectorPrivate(QWebInspector* qq)
+ : q(qq)
+ , page(0)
+ , frontend(0)
+ {}
+
+ void setFrontend(QWidget* newFrontend);
+ void adjustFrontendSize(const QSize& size);
+
+ QWebInspector* q;
+ QWebPage* page;
+ QWidget* frontend;
+};
+
+#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
new file mode 100644
index 0000000000..062839fab0
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.cpp
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2009 Robert Hogan <robert@roberthogan.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include <qwebkitversion.h>
+#include <WebKitVersion.h>
+
+/*!
+
+ Returns the version number of WebKit at run-time as a string (for
+ example, "531.3"). This is the version of WebKit the application
+ was compiled against.
+
+*/
+QString qWebKitVersion()
+{
+ return QString("%1.%2").arg(WEBKIT_MAJOR_VERSION).arg(WEBKIT_MINOR_VERSION);
+}
+
+/*!
+
+ Returns the 'major' version number of WebKit at run-time as an integer
+ (for example, 531). This is the version of WebKit the application
+ was compiled against.
+
+*/
+int qWebKitMajorVersion()
+{
+ return WEBKIT_MAJOR_VERSION;
+}
+
+/*!
+
+ Returns the 'minor' version number of WebKit at run-time as an integer
+ (for example, 3). This is the version of WebKit the application
+ was compiled against.
+
+*/
+int qWebKitMinorVersion()
+{
+ return WEBKIT_MINOR_VERSION;
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h
new file mode 100644
index 0000000000..f0fbef0ef9
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebkitversion.h
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2009 Robert Hogan <robert@roberthogan.net>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <qstring.h>
+
+#ifndef qwebkitversion_h
+#define qwebkitversion_h
+
+#include <QtCore/qstring.h>
+#include "qwebkitglobal.h"
+
+QWEBKIT_EXPORT QString qWebKitVersion();
+QWEBKIT_EXPORT int qWebKitMajorVersion();
+QWEBKIT_EXPORT int qWebKitMinorVersion();
+
+#endif // qwebkitversion_h
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 7860cec86b..98c0770b6e 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -27,7 +27,10 @@
#include "qwebframe_p.h"
#include "qwebhistory.h"
#include "qwebhistory_p.h"
+#include "qwebinspector.h"
+#include "qwebinspector_p.h"
#include "qwebsettings.h"
+#include "qwebkitversion.h"
#include "Frame.h"
#include "FrameTree.h"
@@ -35,6 +38,7 @@
#include "FrameLoaderClientQt.h"
#include "FrameView.h"
#include "FormState.h"
+#include "ApplicationCacheStorage.h"
#include "ChromeClientQt.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
@@ -223,18 +227,6 @@ const char* QWebPagePrivate::editorCommandForWebActions(QWebPage::WebAction acti
return 0;
}
-#ifndef QT_NO_CURSOR
-SetCursorEvent::SetCursorEvent(const QCursor& cursor)
- : QEvent(static_cast<QEvent::Type>(EventType))
- , m_cursor(cursor)
-{}
-
-QCursor SetCursorEvent::cursor() const
-{
- return m_cursor;
-}
-#endif
-
// If you change this make sure to also adjust the docs for QWebPage::userAgentForUrl
#define WEBKIT_VERSION "527+"
@@ -265,6 +257,9 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions)
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
: q(qq)
, view(0)
+ , inspectorFrontend(0)
+ , inspector(0)
+ , inspectorIsInternalOnly(false)
, viewportSize(QSize(0, 0))
{
WebCore::InitializeLoggingChannelsIfNecessary();
@@ -437,13 +432,13 @@ void QWebPagePrivate::_q_webActionTriggered(bool checked)
q->triggerAction(action, checked);
}
-#ifndef NDEBUG
void QWebPagePrivate::_q_cleanupLeakMessages()
{
+#ifndef NDEBUG
// Need this to make leak messages accurate.
cache()->setCapacities(0, 0, 0);
-}
#endif
+}
void QWebPagePrivate::updateAction(QWebPage::WebAction action)
{
@@ -580,6 +575,18 @@ void QWebPagePrivate::timerEvent(QTimerEvent *ev)
q->QObject::timerEvent(ev);
}
+void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
+{
+ q->setView(ev->widget());
+
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = frame->eventHandler()->mouseMoved(PlatformMouseEvent(ev, 0));
+ ev->setAccepted(accepted);
+}
+
void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -590,6 +597,29 @@ void QWebPagePrivate::mouseMoveEvent(QMouseEvent *ev)
ev->setAccepted(accepted);
}
+void QWebPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev)
+{
+ q->setView(ev->widget());
+
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ if (tripleClickTimer.isActive()
+ && (ev->pos().toPoint() - tripleClick).manhattanLength()
+ < QApplication::startDragDistance()) {
+ mouseTripleClickEvent(ev);
+ return;
+ }
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 1);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+}
+
void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -611,6 +641,25 @@ void QWebPagePrivate::mousePressEvent(QMouseEvent *ev)
ev->setAccepted(accepted);
}
+void QWebPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *ev)
+{
+ q->setView(ev->widget());
+
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 2);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
+ ev->setAccepted(accepted);
+
+ tripleClickTimer.start(QApplication::doubleClickInterval(), q);
+ tripleClick = ev->pos().toPoint();
+}
+
void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -628,7 +677,7 @@ void QWebPagePrivate::mouseDoubleClickEvent(QMouseEvent *ev)
tripleClick = ev->pos();
}
-void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
+void QWebPagePrivate::mouseTripleClickEvent(QGraphicsSceneMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
@@ -642,30 +691,33 @@ void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
ev->setAccepted(accepted);
}
-void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
+void QWebPagePrivate::mouseTripleClickEvent(QMouseEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
if (!frame->view())
return;
bool accepted = false;
- PlatformMouseEvent mev(ev, 0);
+ PlatformMouseEvent mev(ev, 3);
// ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
if (mev.button() != NoButton)
- accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ accepted = frame->eventHandler()->handleMousePressEvent(mev);
ev->setAccepted(accepted);
+}
+void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button)
+{
#ifndef QT_NO_CLIPBOARD
if (QApplication::clipboard()->supportsSelection()) {
bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
Pasteboard::generalPasteboard()->setSelectionMode(true);
WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame();
- if (ev->button() == Qt::LeftButton) {
+ if (button == Qt::LeftButton) {
if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
focusFrame->editor()->copy();
ev->setAccepted(true);
}
- } else if (ev->button() == Qt::MidButton) {
+ } else if (button == Qt::MidButton) {
if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
focusFrame->editor()->paste();
ev->setAccepted(true);
@@ -676,12 +728,46 @@ void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
#endif
}
+void QWebPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
+{
+ q->setView(ev->widget());
+
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 0);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ ev->setAccepted(accepted);
+
+ handleClipboard(ev, ev->button());
+}
+
+void QWebPagePrivate::mouseReleaseEvent(QMouseEvent *ev)
+{
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ bool accepted = false;
+ PlatformMouseEvent mev(ev, 0);
+ // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton
+ if (mev.button() != NoButton)
+ accepted = frame->eventHandler()->handleMouseReleaseEvent(mev);
+ ev->setAccepted(accepted);
+
+ handleClipboard(ev, ev->button());
+}
+
#ifndef QT_NO_CONTEXTMENU
-void QWebPagePrivate::contextMenuEvent(QContextMenuEvent *ev)
+void QWebPagePrivate::contextMenuEvent(const QPoint& globalPos)
{
QMenu *menu = q->createStandardContextMenu();
if (menu) {
- menu->exec(ev->globalPos());
+ menu->exec(globalPos);
delete menu;
}
}
@@ -706,6 +792,19 @@ QMenu *QWebPage::createStandardContextMenu()
}
#ifndef QT_NO_WHEELEVENT
+void QWebPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev)
+{
+ q->setView(ev->widget());
+
+ WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
+ if (!frame->view())
+ return;
+
+ WebCore::PlatformWheelEvent pev(ev);
+ bool accepted = frame->eventHandler()->handleWheelEvent(pev);
+ ev->setAccepted(accepted);
+}
+
void QWebPagePrivate::wheelEvent(QWheelEvent *ev)
{
WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
@@ -776,7 +875,6 @@ void QWebPagePrivate::keyPressEvent(QKeyEvent *ev)
{
bool handled = false;
WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
- WebCore::Editor* editor = frame->editor();
// we forward the key event to WebCore first to handle potential DOM
// defined event handlers and later on end up in EditorClientQt::handleKeyboardEvent
// to trigger editor commands via triggerAction().
@@ -788,7 +886,6 @@ void QWebPagePrivate::keyPressEvent(QKeyEvent *ev)
if (view)
defaultFont = view->font();
QFontMetrics fm(defaultFont);
- int fontHeight = fm.height();
if (!handleScrolling(ev, frame)) {
switch (ev->key()) {
case Qt::Key_Back:
@@ -852,7 +949,21 @@ void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
focusController->setFocused(false);
}
-void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev)
+void QWebPagePrivate::dragEnterEvent(QGraphicsSceneDragDropEvent* ev)
+{
+ q->setView(ev->widget());
+
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos().toPoint(),
+ QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData));
+ ev->setDropAction(action);
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragEnterEvent(QDragEnterEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
@@ -864,8 +975,10 @@ void QWebPagePrivate::dragEnterEvent(QDragEnterEvent *ev)
#endif
}
-void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent *ev)
+void QWebPagePrivate::dragLeaveEvent(QGraphicsSceneDragDropEvent* ev)
{
+ q->setView(ev->widget());
+
#ifndef QT_NO_DRAGANDDROP
DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone);
page->dragController()->dragExited(&dragData);
@@ -873,7 +986,30 @@ void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent *ev)
#endif
}
-void QWebPagePrivate::dragMoveEvent(QDragMoveEvent *ev)
+void QWebPagePrivate::dragLeaveEvent(QDragLeaveEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(0, IntPoint(), QCursor::pos(), DragOperationNone);
+ page->dragController()->dragExited(&dragData);
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragMoveEvent(QGraphicsSceneDragDropEvent* ev)
+{
+ q->setView(ev->widget());
+
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos().toPoint(),
+ QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->dragUpdated(&dragData));
+ ev->setDropAction(action);
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dragMoveEvent(QDragMoveEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
@@ -885,7 +1021,18 @@ void QWebPagePrivate::dragMoveEvent(QDragMoveEvent *ev)
#endif
}
-void QWebPagePrivate::dropEvent(QDropEvent *ev)
+void QWebPagePrivate::dropEvent(QGraphicsSceneDragDropEvent* ev)
+{
+#ifndef QT_NO_DRAGANDDROP
+ DragData dragData(ev->mimeData(), ev->pos().toPoint(),
+ QCursor::pos(), dropActionToDragOp(ev->possibleActions()));
+ Qt::DropAction action = dragOpToDropAction(page->dragController()->performDrag(&dragData));
+ if (action != Qt::IgnoreAction)
+ ev->accept();
+#endif
+}
+
+void QWebPagePrivate::dropEvent(QDropEvent* ev)
{
#ifndef QT_NO_DRAGANDDROP
DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(),
@@ -1087,6 +1234,54 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const
}
/*!
+ \internal
+*/
+void QWebPagePrivate::setInspector(QWebInspector* insp)
+{
+ if (inspector)
+ inspector->d->setFrontend(0);
+
+ if (inspectorIsInternalOnly) {
+ QWebInspector* inspToDelete = inspector;
+ inspector = 0;
+ inspectorIsInternalOnly = false;
+ delete inspToDelete; // Delete after to prevent infinite recursion
+ }
+
+ inspector = insp;
+
+ // Give inspector frontend web view if previously created
+ if (inspector && inspectorFrontend)
+ inspector->d->setFrontend(inspectorFrontend);
+}
+
+/*!
+ \internal
+ Returns the inspector and creates it if it wasn't created yet.
+ The instance created here will not be available through QWebPage's API.
+*/
+QWebInspector* QWebPagePrivate::getOrCreateInspector()
+{
+ if (!inspector) {
+ QWebInspector* insp = new QWebInspector;
+ insp->setPage(q);
+ insp->connect(q, SIGNAL(webInspectorTriggered(const QWebElement&)), SLOT(show()));
+ insp->show(); // The inspector is expected to be shown on inspection
+ inspectorIsInternalOnly = true;
+
+ Q_ASSERT(inspector); // Associated through QWebInspector::setPage(q)
+ }
+ return inspector;
+}
+
+/*! \internal */
+InspectorController* QWebPagePrivate::inspectorController()
+{
+ return page->inspectorController();
+}
+
+
+/*!
\enum QWebPage::FindFlag
This enum describes the options available to QWebPage's findText() function. The options
@@ -1298,6 +1493,8 @@ QWebPage::~QWebPage()
FrameLoader *loader = d->mainFrame->d->frame->loader();
if (loader)
loader->detachFromParent();
+ if (d->inspector)
+ d->inspector->setPage(0);
delete d;
}
@@ -1593,12 +1790,16 @@ void QWebPage::triggerAction(WebAction action, bool checked)
case SetTextDirectionRightToLeft:
editor->setBaseWritingDirection(RightToLeftWritingDirection);
break;
- case InspectElement:
- if (!d->hitTestResult.isNull())
+ case InspectElement: {
+ QWebElement inspectedElement(QWebElement::enclosingElement(d->hitTestResult.d->innerNonSharedNode.get()));
+ emit webInspectorTriggered(inspectedElement);
+
+ if (!d->hitTestResult.isNull()) {
+ d->getOrCreateInspector(); // Make sure the inspector is created
d->page->inspectorController()->inspect(d->hitTestResult.d->innerNonSharedNode.get());
- else
- d->page->inspectorController()->show();
+ }
break;
+ }
default:
command = QWebPagePrivate::editorCommandForWebActions(action);
break;
@@ -2053,24 +2254,42 @@ bool QWebPage::event(QEvent *ev)
case QEvent::MouseMove:
d->mouseMoveEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMouseMove:
+ d->mouseMoveEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
case QEvent::MouseButtonPress:
d->mousePressEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMousePress:
+ d->mousePressEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
case QEvent::MouseButtonDblClick:
d->mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMouseDoubleClick:
+ d->mouseDoubleClickEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
case QEvent::MouseButtonRelease:
d->mouseReleaseEvent(static_cast<QMouseEvent*>(ev));
break;
+ case QEvent::GraphicsSceneMouseRelease:
+ d->mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent*>(ev));
+ break;
#ifndef QT_NO_CONTEXTMENU
case QEvent::ContextMenu:
- d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev));
+ d->contextMenuEvent(static_cast<QContextMenuEvent*>(ev)->globalPos());
+ break;
+ case QEvent::GraphicsSceneContextMenu:
+ d->contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(ev)->screenPos());
break;
#endif
#ifndef QT_NO_WHEELEVENT
case QEvent::Wheel:
d->wheelEvent(static_cast<QWheelEvent*>(ev));
break;
+ case QEvent::GraphicsSceneWheel:
+ d->wheelEvent(static_cast<QGraphicsSceneWheelEvent*>(ev));
+ break;
#endif
case QEvent::KeyPress:
d->keyPressEvent(static_cast<QKeyEvent*>(ev));
@@ -2088,15 +2307,27 @@ bool QWebPage::event(QEvent *ev)
case QEvent::DragEnter:
d->dragEnterEvent(static_cast<QDragEnterEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDragEnter:
+ d->dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
case QEvent::DragLeave:
d->dragLeaveEvent(static_cast<QDragLeaveEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDragLeave:
+ d->dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
case QEvent::DragMove:
d->dragMoveEvent(static_cast<QDragMoveEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDragMove:
+ d->dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
case QEvent::Drop:
d->dropEvent(static_cast<QDropEvent*>(ev));
break;
+ case QEvent::GraphicsSceneDrop:
+ d->dropEvent(static_cast<QGraphicsSceneDragDropEvent*>(ev));
+ break;
#endif
case QEvent::InputMethod:
d->inputMethodEvent(static_cast<QInputMethodEvent*>(ev));
@@ -2538,7 +2769,7 @@ QWebPluginFactory *QWebPage::pluginFactory() const
The default implementation returns the following value:
- "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko, Safari/419.3) %AppVersion"
+ "Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%"
In this string the following values are replaced at run-time:
\list
@@ -2546,7 +2777,7 @@ QWebPluginFactory *QWebPage::pluginFactory() const
\o %Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true.
\o %Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage,
then a default constructed QLocale is used instead.
- \o %WebKitVersion% currently expands to 527+
+ \o %WebKitVersion% is the version of WebKit the application was compiled against.
\o %AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
\endlist
*/
@@ -2678,6 +2909,9 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
case QSysInfo::WV_VISTA:
ver = "Windows NT 6.0";
break;
+ case QSysInfo::WV_WINDOWS7:
+ ver = "Windows NT 6.1";
+ break;
case QSysInfo::WV_CE:
ver = "Windows CE";
break;
@@ -2704,12 +2938,13 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
ua.append(QLatin1String(") "));
// webkit/qt version
- ua.append(QLatin1String("AppleWebKit/" WEBKIT_VERSION " (KHTML, like Gecko, Safari/419.3) "));
+ ua.append(QString(QLatin1String("AppleWebKit/%1 (KHTML, like Gecko) "))
+ .arg(QString(qWebKitVersion())));
// Application name/version
QString appName = QCoreApplication::applicationName();
if (!appName.isEmpty()) {
- ua.append(QLatin1Char(' ') + appName);
+ ua.append(appName);
#if QT_VERSION >= 0x040400
QString appVer = QCoreApplication::applicationVersion();
if (!appVer.isEmpty())
@@ -2720,6 +2955,10 @@ QString QWebPage::userAgentForUrl(const QUrl& url) const
ua.append(QLatin1String("Qt/"));
ua.append(QLatin1String(qVersion()));
}
+
+ ua.append(QString(QLatin1String(" Safari/%1"))
+ .arg(qWebKitVersion()));
+
return ua;
}
@@ -2911,6 +3150,24 @@ quint64 QWebPage::bytesReceived() const
*/
/*!
+ \fn void QWebPage::webInspectorTriggered(const QWebElement& inspectedElement);
+ \since 4.6
+
+ This signal is emitted when the user triggered an inspection through the
+ context menu. If a QWebInspector is associated to this page, it should be
+ visible to the user after this signal has been emitted.
+
+ If still no QWebInspector is associated to this QWebPage after the emission
+ of this signal, a privately owned inspector will be shown to the user.
+
+ \note \a inspectedElement contains the QWebElement under the context menu.
+ It is not garanteed to be the same as the focused element in the web
+ inspector.
+
+ \sa QWebInspector
+*/
+
+/*!
\fn void QWebPage::toolBarVisibilityChangeRequested(bool visible)
This signal is emitted whenever the visibility of the toolbar in a web browser
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
index 24741a1654..aecd860615 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.h
@@ -37,6 +37,7 @@ class QNetworkReply;
class QNetworkAccessManager;
QT_END_NAMESPACE
+class QWebElement;
class QWebFrame;
class QWebNetworkRequest;
class QWebHistory;
@@ -306,6 +307,7 @@ Q_SIGNALS:
void windowCloseRequested();
void printRequested(QWebFrame *frame);
void linkClicked(const QUrl &url);
+ void webInspectorTriggered(const QWebElement& inspectedElement);
void toolBarVisibilityChangeRequested(bool visible);
void statusBarVisibilityChangeRequested(bool visible);
@@ -343,14 +345,15 @@ protected:
private:
Q_PRIVATE_SLOT(d, void _q_onLoadProgressChanged(int))
Q_PRIVATE_SLOT(d, void _q_webActionTriggered(bool checked))
-#ifndef NDEBUG
Q_PRIVATE_SLOT(d, void _q_cleanupLeakMessages())
-#endif
+
QWebPagePrivate *d;
friend class QWebFrame;
friend class QWebPagePrivate;
friend class QWebView;
+ friend class QWebGraphicsItem;
+ friend class QWebInspector;
friend class WebCore::ChromeClientQt;
friend class WebCore::EditorClientQt;
friend class WebCore::FrameLoaderClientQt;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
index 87c624d6e1..f765f98d63 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage_p.h
@@ -25,6 +25,7 @@
#include <qnetworkproxy.h>
#include <qpointer.h>
#include <qevent.h>
+#include <qgraphicssceneevent.h>
#include "qwebpage.h"
#include "qwebhistory.h"
@@ -42,21 +43,10 @@ namespace WebCore {
class ContextMenu;
class EditorClientQt;
class Element;
+ class InspectorController;
class Node;
class Page;
class Frame;
-
-#ifndef QT_NO_CURSOR
- class SetCursorEvent : public QEvent {
- public:
- static const int EventType = 724;
- SetCursorEvent(const QCursor&);
-
- QCursor cursor() const;
- private:
- QCursor m_cursor;
- };
-#endif
}
QT_BEGIN_NAMESPACE
@@ -65,6 +55,8 @@ class QMenu;
class QBitArray;
QT_END_NAMESPACE
+class QWebInspector;
+
class QWebPagePrivate {
public:
QWebPagePrivate(QWebPage*);
@@ -75,9 +67,7 @@ public:
#endif
void _q_onLoadProgressChanged(int);
void _q_webActionTriggered(bool checked);
-#ifndef NDEBUG
void _q_cleanupLeakMessages();
-#endif
void updateAction(QWebPage::WebAction action);
void updateNavigationActions();
void updateEditorActions();
@@ -85,32 +75,47 @@ public:
void timerEvent(QTimerEvent*);
void mouseMoveEvent(QMouseEvent*);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent*);
void mousePressEvent(QMouseEvent*);
+ void mousePressEvent(QGraphicsSceneMouseEvent*);
void mouseDoubleClickEvent(QMouseEvent*);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
void mouseTripleClickEvent(QMouseEvent*);
+ void mouseTripleClickEvent(QGraphicsSceneMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
#ifndef QT_NO_CONTEXTMENU
- void contextMenuEvent(QContextMenuEvent*);
+ void contextMenuEvent(const QPoint& globalPos);
#endif
#ifndef QT_NO_WHEELEVENT
void wheelEvent(QWheelEvent*);
+ void wheelEvent(QGraphicsSceneWheelEvent*);
#endif
void keyPressEvent(QKeyEvent*);
void keyReleaseEvent(QKeyEvent*);
void focusInEvent(QFocusEvent*);
void focusOutEvent(QFocusEvent*);
- void dragEnterEvent(QDragEnterEvent *);
- void dragLeaveEvent(QDragLeaveEvent *);
- void dragMoveEvent(QDragMoveEvent *);
- void dropEvent(QDropEvent *);
+ void dragEnterEvent(QDragEnterEvent*);
+ void dragEnterEvent(QGraphicsSceneDragDropEvent*);
+ void dragLeaveEvent(QDragLeaveEvent*);
+ void dragLeaveEvent(QGraphicsSceneDragDropEvent*);
+ void dragMoveEvent(QDragMoveEvent*);
+ void dragMoveEvent(QGraphicsSceneDragDropEvent*);
+ void dropEvent(QDropEvent*);
+ void dropEvent(QGraphicsSceneDragDropEvent*);
void inputMethodEvent(QInputMethodEvent*);
void shortcutOverrideEvent(QKeyEvent*);
- void leaveEvent(QEvent *);
+ void leaveEvent(QEvent*);
+ void handleClipboard(QEvent*, Qt::MouseButton);
bool handleScrolling(QKeyEvent*, WebCore::Frame*);
+ void setInspector(QWebInspector*);
+ QWebInspector* getOrCreateInspector();
+ WebCore::InspectorController* inspectorController();
+
#ifndef QT_NO_SHORTCUT
static QWebPage::WebAction editorActionForKeyEvent(QKeyEvent* event);
#endif
@@ -168,6 +173,10 @@ public:
QWebPluginFactory *pluginFactory;
+ QWidget* inspectorFrontend;
+ QWebInspector* inspector;
+ bool inspectorIsInternalOnly; // True if created through the Inspect context menu action
+
static bool drtRun;
};
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
new file mode 100644
index 0000000000..a3781e6ce3
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.cpp
@@ -0,0 +1,376 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "qwebplugindatabase.h"
+
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
+
+using namespace WebCore;
+
+/*!
+ \typedef QWebPluginInfo::MimeType
+ \since 4.6
+ \brief Represents a single MIME type supported by a plugin.
+*/
+
+/*!
+ \class QWebPluginInfo
+ \since 4.6
+ \brief The QWebPluginInfo class represents a single Netscape plugin.
+
+ A QWebPluginInfo object represents a Netscape plugin picked up by WebKit
+ and included in the plugin database. This class contains information about
+ the plugin, such as its name(), description(), a list of MIME types that it
+ supports (can be accessed with mimeTypes()) and the path of the plugin
+ file.
+
+ Plugins can be enabled and disabled with setEnabled(). If a plugin is
+ disabled, it will not be used by WebKit to handle supported MIME types. To
+ check if a plugin is enabled or not, use enabled().
+
+ \sa QWebPluginDatabase
+*/
+
+/*!
+ Constructs a null QWebPluginInfo.
+*/
+QWebPluginInfo::QWebPluginInfo()
+ : m_package(0)
+{
+}
+
+QWebPluginInfo::QWebPluginInfo(PluginPackage* package)
+ : m_package(package)
+{
+ if (m_package)
+ m_package->ref();
+}
+
+/*!
+ Contructs a copy of \a other.
+*/
+QWebPluginInfo::QWebPluginInfo(const QWebPluginInfo& other)
+ : m_package(other.m_package)
+{
+ if (m_package)
+ m_package->ref();
+}
+
+/*!
+ Destroys the plugin info.
+*/
+QWebPluginInfo::~QWebPluginInfo()
+{
+ if (m_package)
+ m_package->deref();
+}
+
+/*!
+ Returns the name of the plugin.
+
+ \sa description()
+*/
+QString QWebPluginInfo::name() const
+{
+ if (!m_package)
+ return QString();
+ return m_package->name();
+}
+
+/*!
+ Returns the description of the plugin.
+
+ \sa name()
+*/
+QString QWebPluginInfo::description() const
+{
+ if (!m_package)
+ return QString();
+ return m_package->description();
+}
+
+/*!
+ Returns a list of MIME types supported by the plugin.
+
+ \sa supportsMimeType()
+*/
+QList<QWebPluginInfo::MimeType> QWebPluginInfo::mimeTypes() const
+{
+ if (m_package && m_mimeTypes.isEmpty()) {
+ const MIMEToDescriptionsMap& mimeToDescriptions = m_package->mimeToDescriptions();
+ MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
+
+ for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
+ MimeType mimeType;
+ mimeType.name = it->first;
+ mimeType.description = it->second;
+
+ QStringList fileExtensions;
+ Vector<String> extensions = m_package->mimeToExtensions().get(mimeType.name);
+
+ for (unsigned i = 0; i < extensions.size(); ++i)
+ fileExtensions.append(extensions[i]);
+
+ mimeType.fileExtensions = fileExtensions;
+ m_mimeTypes.append(mimeType);
+ }
+ }
+
+ return m_mimeTypes;
+}
+
+/*!
+ Returns true if the plugin supports a specific \a mimeType; otherwise
+ returns false.
+
+ \sa mimeTypes()
+*/
+bool QWebPluginInfo::supportsMimeType(const QString& mimeType) const
+{
+ if (!m_package)
+ return false;
+ return m_package->mimeToDescriptions().contains(mimeType);
+}
+
+/*!
+ Returns an absolute path to the plugin file.
+*/
+QString QWebPluginInfo::path() const
+{
+ if (!m_package)
+ return QString();
+ return m_package->path();
+}
+
+/*!
+ Returns true if the plugin is a null plugin; otherwise returns false.
+*/
+bool QWebPluginInfo::isNull() const
+{
+ return !m_package;
+}
+
+/*!
+ Enables or disables the plugin, depending on the \a enabled parameter.
+
+ Disabled plugins will not be picked up by WebKit when looking for a plugin
+ supporting a particular MIME type.
+
+ \sa isEnabled()
+*/
+void QWebPluginInfo::setEnabled(bool enabled)
+{
+ if (!m_package)
+ return;
+ m_package->setEnabled(enabled);
+}
+
+/*!
+ Returns true if the plugin is enabled; otherwise returns false.
+
+ \sa setEnabled()
+*/
+bool QWebPluginInfo::isEnabled() const
+{
+ if (!m_package)
+ return false;
+ return m_package->isEnabled();
+}
+
+bool QWebPluginInfo::operator==(const QWebPluginInfo& other) const
+{
+ return m_package == other.m_package;
+}
+
+bool QWebPluginInfo::operator!=(const QWebPluginInfo& other) const
+{
+ return m_package != other.m_package;
+}
+
+QWebPluginInfo &QWebPluginInfo::operator=(const QWebPluginInfo& other)
+{
+ if (this == &other)
+ return *this;
+
+ if (m_package)
+ m_package->deref();
+ m_package = other.m_package;
+ if (m_package)
+ m_package->ref();
+ m_mimeTypes = other.m_mimeTypes;
+
+ return *this;
+}
+
+/*!
+ \class QWebPluginDatabase
+ \since 4.6
+ \brief The QWebPluginDatabase class provides an interface for managing
+ Netscape plugins used by WebKit in QWebPages.
+
+ The QWebPluginDatabase class is a database of Netscape plugins that are used
+ by WebKit. The plugins are picked up by WebKit by looking up a set of search paths.
+ The default set can be accessed using defaultSearchPaths(). The search paths
+ can be changed, see searchPaths() and setSearchPaths(). Additional search paths
+ can also be added using addSearchPath().
+
+ The plugins that have been detected are exposed by the plugins() method.
+ The list contains QWebPlugin objects that hold both the metadata and the MIME
+ types that are supported by particular plugins.
+
+ WebKit specifies a plugin for a MIME type by looking for the first plugin that
+ supports the specific MIME type. To get a plugin, that is used by WebKit to
+ handle a specific MIME type, you can use the pluginForMimeType() function.
+
+ To change the way of resolving MIME types ambiguity, you can explicitly set
+ a preferred plugin for a specific MIME type, using setPreferredPluginForMimeType().
+
+ \sa QWebPluginInfo, QWebSettings::pluginDatabase()
+*/
+
+QWebPluginDatabase::QWebPluginDatabase(QObject* parent)
+ : QObject(parent)
+ , m_database(PluginDatabase::installedPlugins())
+{
+}
+
+QWebPluginDatabase::~QWebPluginDatabase()
+{
+}
+
+/*!
+ Returns a list of plugins installed in the search paths.
+
+ This list will contain disabled plugins, although they will not be used by
+ WebKit.
+
+ \sa pluginForMimeType()
+*/
+QList<QWebPluginInfo> QWebPluginDatabase::plugins() const
+{
+ QList<QWebPluginInfo> qwebplugins;
+ const Vector<PluginPackage*>& plugins = m_database->plugins();
+
+ for (unsigned int i = 0; i < plugins.size(); ++i) {
+ PluginPackage* plugin = plugins[i];
+ qwebplugins.append(QWebPluginInfo(plugin));
+ }
+
+ return qwebplugins;
+}
+
+/*!
+ Returns a default set of search paths.
+
+ \sa searchPaths(), setSearchPaths()
+*/
+QStringList QWebPluginDatabase::defaultSearchPaths()
+{
+ QStringList paths;
+
+ const Vector<String>& directories = PluginDatabase::defaultPluginDirectories();
+ for (unsigned int i = 0; i < directories.size(); ++i)
+ paths.append(directories[i]);
+
+ return paths;
+}
+
+/*!
+ Returns a list of search paths that are used by WebKit to look for plugins.
+
+ \sa defaultSearchPaths(), setSearchPaths()
+*/
+QStringList QWebPluginDatabase::searchPaths() const
+{
+ QStringList paths;
+
+ const Vector<String>& directories = m_database->pluginDirectories();
+ for (unsigned int i = 0; i < directories.size(); ++i)
+ paths.append(directories[i]);
+
+ return paths;
+}
+
+/*!
+ Changes the search paths to \a paths.
+ The database is automatically refreshed.
+
+ \sa searchPaths(), defaultSearchPaths()
+*/
+void QWebPluginDatabase::setSearchPaths(const QStringList& paths)
+{
+ Vector<String> directories;
+
+ for (int i = 0; i < paths.count(); ++i)
+ directories.append(paths.at(i));
+
+ m_database->setPluginDirectories(directories);
+ // PluginDatabase::setPluginDirectories() does not refresh the database.
+ m_database->refresh();
+}
+
+/*!
+ Adds an additional \a path to the current set.
+ The database is automatically refreshed.
+
+ \sa searchPaths(), setSearchPaths()
+*/
+void QWebPluginDatabase::addSearchPath(const QString& path)
+{
+ m_database->addExtraPluginDirectory(path);
+ // PluginDatabase::addExtraPluginDirectory() does refresh the database.
+}
+
+/*!
+ Refreshes the plugin database, adds new plugins that have been found and removes
+ the ones that are no longer available in the search paths.
+
+ You can call this function when the set of plugins installed in the search paths
+ changes. You do not need to call this function when changing search paths,
+ in that case WebKit automatically refreshes the database.
+*/
+void QWebPluginDatabase::refresh()
+{
+ m_database->refresh();
+}
+
+/*!
+ Returns the plugin that is currently used by WebKit for a given \a mimeType.
+
+ \sa setPreferredPluginForMimeType()
+*/
+QWebPluginInfo QWebPluginDatabase::pluginForMimeType(const QString& mimeType)
+{
+ return QWebPluginInfo(m_database->pluginForMIMEType(mimeType));
+}
+
+/*!
+ Changes the preferred plugin for a given \a mimeType to \a plugin. The \a plugin
+ has to support the given \a mimeType, otherwise the setting will have no effect.
+
+ Calling the function with a null \a plugin resets the setting.
+
+ \sa pluginForMimeType()
+*/
+void QWebPluginDatabase::setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin)
+{
+ m_database->setPreferredPluginForMIMEType(mimeType, plugin.m_package);
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h
new file mode 100644
index 0000000000..b22c3de59e
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebplugindatabase.h
@@ -0,0 +1,98 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef QWEBPLUGINDATABASE_H
+#define QWEBPLUGINDATABASE_H
+
+#include "qwebkitglobal.h"
+#include "qwebpluginfactory.h"
+
+#include <QtCore/qobject.h>
+#include <QtCore/qstringlist.h>
+
+namespace WebCore {
+ class PluginDatabase;
+ class PluginPackage;
+}
+
+class QWebPluginInfoPrivate;
+class QWEBKIT_EXPORT QWebPluginInfo {
+public:
+ QWebPluginInfo();
+ QWebPluginInfo(const QWebPluginInfo& other);
+ QWebPluginInfo &operator=(const QWebPluginInfo& other);
+ ~QWebPluginInfo();
+
+private:
+ QWebPluginInfo(WebCore::PluginPackage* package);
+
+public:
+ typedef QWebPluginFactory::MimeType MimeType;
+
+ QString name() const;
+ QString description() const;
+ QList<MimeType> mimeTypes() const;
+ bool supportsMimeType(const QString& mimeType) const;
+ QString path() const;
+
+ bool isNull() const;
+
+ void setEnabled(bool enabled);
+ bool isEnabled() const;
+
+ bool operator==(const QWebPluginInfo& other) const;
+ bool operator!=(const QWebPluginInfo& other) const;
+
+ friend class QWebPluginDatabase;
+
+private:
+ QWebPluginInfoPrivate* d;
+ WebCore::PluginPackage* m_package;
+ mutable QList<MimeType> m_mimeTypes;
+};
+
+class QWebPluginDatabasePrivate;
+class QWEBKIT_EXPORT QWebPluginDatabase : public QObject {
+ Q_OBJECT
+
+private:
+ QWebPluginDatabase(QObject* parent = 0);
+ ~QWebPluginDatabase();
+
+public:
+ QList<QWebPluginInfo> plugins() const;
+
+ static QStringList defaultSearchPaths();
+ QStringList searchPaths() const;
+ void setSearchPaths(const QStringList& paths);
+ void addSearchPath(const QString& path);
+
+ void refresh();
+
+ QWebPluginInfo pluginForMimeType(const QString& mimeType);
+ void setPreferredPluginForMimeType(const QString& mimeType, const QWebPluginInfo& plugin);
+
+ friend class QWebSettings;
+
+private:
+ QWebPluginDatabasePrivate* d;
+ WebCore::PluginDatabase* m_database;
+};
+
+#endif // QWEBPLUGINDATABASE_H
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
index 8506099952..e63ba41c51 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp
@@ -76,6 +76,13 @@
\inmodule QtWebKit
*/
+bool QWebPluginFactory::MimeType::operator==(const MimeType& other) const
+{
+ return name == other.name
+ && description == other.description
+ && fileExtensions == other.fileExtensions;
+}
+
/*!
\variable QWebPluginFactory::MimeType::name
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
index cff774d60f..4a06b5999e 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.h
@@ -34,10 +34,12 @@ class QWebPluginFactoryPrivate;
class QWEBKIT_EXPORT QWebPluginFactory : public QObject {
Q_OBJECT
public:
- struct MimeType {
+ struct QWEBKIT_EXPORT MimeType {
QString name;
QString description;
QStringList fileExtensions;
+ bool operator==(const MimeType& other) const;
+ inline bool operator!=(const MimeType& other) const { return !operator==(other); }
};
struct Plugin {
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
index ed2e95941e..45c49c61e3 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -200,3 +200,49 @@ QList<QWebDatabase> QWebSecurityOrigin::databases() const
return databases;
}
+/*!
+ \since 4.6
+ Allow applications to use a custome scheme instead of file: scheme,
+ without being subjected to cross domain restrictions.
+*/
+void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
+{
+ SecurityOrigin::registerURLSchemeAsLocal(scheme);
+}
+
+/*!
+ \since 4.6
+ Allow applications to stop using a custome scheme that was previously used,
+ \sa addLocalScheme().
+*/
+void QWebSecurityOrigin::removeLocalScheme(const QString& scheme)
+{
+ SecurityOrigin::removeURLSchemeRegisteredAsLocal(scheme);
+}
+
+/*!
+ \since 4.6
+ Returns a list of all the schemes that were set by the application as local schemes,
+ \sa addLocalScheme(), removeLocalScheme().
+*/
+QStringList QWebSecurityOrigin::localSchemes()
+{
+ QStringList list;
+ const URLSchemesMap& map = SecurityOrigin::localURLSchemes();
+ URLSchemesMap::const_iterator end = map.end();
+ for (URLSchemesMap::const_iterator i = map.begin(); i != end; ++i) {
+ const QString scheme = *i;
+ list.append(scheme);
+ }
+ return list;
+}
+
+void QWebSecurityOrigin::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+{
+ SecurityOrigin::whiteListAccessFromOrigin(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void QWebSecurityOrigin::resetOriginAccessWhiteLists()
+{
+ SecurityOrigin::resetOriginAccessWhiteLists();
+}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
index 3cfb0f49c3..94b96f0aa3 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsecurityorigin.h
@@ -37,6 +37,11 @@ class QWebFrame;
class QWEBKIT_EXPORT QWebSecurityOrigin {
public:
static QList<QWebSecurityOrigin> allOrigins();
+ static void addLocalScheme(const QString& scheme);
+ static void removeLocalScheme(const QString& scheme);
+ static QStringList localSchemes();
+ static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
+ static void resetOriginAccessWhiteLists();
~QWebSecurityOrigin();
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
index 89595c39e1..e99ebbfd24 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.cpp
@@ -22,6 +22,7 @@
#include "qwebpage.h"
#include "qwebpage_p.h"
+#include "qwebplugindatabase.h"
#include "Cache.h"
#include "CrossOriginPreflightResultCache.h"
@@ -36,7 +37,11 @@
#include "IntSize.h"
#include "ApplicationCacheStorage.h"
#include "DatabaseTracker.h"
+#include "FileSystem.h"
+#include <QApplication>
+#include <QDesktopServices>
+#include <QDir>
#include <QHash>
#include <QSharedData>
#include <QUrl>
@@ -54,7 +59,7 @@ public:
QHash<int, bool> attributes;
QUrl userStyleSheetLocation;
QString defaultTextEncoding;
- QString localStorageDatabasePath;
+ QString localStoragePath;
QString offlineWebApplicationCachePath;
qint64 offlineStorageDefaultQuota;
@@ -166,8 +171,8 @@ void QWebSettingsPrivate::apply()
QString encoding = !defaultTextEncoding.isEmpty() ? defaultTextEncoding: global->defaultTextEncoding;
settings->setDefaultTextEncodingName(encoding);
- QString localStoragePath = !localStorageDatabasePath.isEmpty() ? localStorageDatabasePath : global->localStorageDatabasePath;
- settings->setLocalStorageDatabasePath(localStoragePath);
+ QString storagePath = !localStoragePath.isEmpty() ? localStoragePath : global->localStoragePath;
+ settings->setLocalStorageDatabasePath(storagePath);
value = attributes.value(QWebSettings::ZoomTextOnly,
global->attributes.value(QWebSettings::ZoomTextOnly));
@@ -185,13 +190,18 @@ void QWebSettingsPrivate::apply()
global->attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled));
settings->setOfflineWebApplicationCacheEnabled(value);
- value = attributes.value(QWebSettings::LocalStorageDatabaseEnabled,
- global->attributes.value(QWebSettings::LocalStorageDatabaseEnabled));
+ value = attributes.value(QWebSettings::LocalStorageEnabled,
+ global->attributes.value(QWebSettings::LocalStorageEnabled));
+
settings->setLocalStorageEnabled(value);
value = attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls,
global->attributes.value(QWebSettings::LocalContentCanAccessRemoteUrls));
settings->setAllowUniversalAccessFromFileURLs(value);
+
+ value = attributes.value(QWebSettings::SessionStorageEnabled,
+ global->attributes.value(QWebSettings::SessionStorageEnabled));
+ settings->setSessionStorageEnabled(value);
} else {
QList<QWebSettingsPrivate*> settings = *::allSettings();
for (int i = 0; i < settings.count(); ++i)
@@ -303,6 +313,8 @@ QWebSettings* QWebSettings::globalSettings()
\value AutoLoadImages Specifies whether images are automatically loaded in
web pages.
+ \value DnsPrefetchEnabled Specifies whether QtWebkit will try to pre-fetch DNS entries to
+ speed up browsing. This only works as a global attribute. Only for Qt 4.6 and later.
\value JavascriptEnabled Enables or disables the running of JavaScript
programs.
\value JavaEnabled Enables or disables Java applets.
@@ -315,8 +327,9 @@ QWebSettings* QWebSettings::globalSettings()
\value JavascriptCanAccessClipboard Specifies whether JavaScript programs
can read or write to the clipboard.
\value DeveloperExtrasEnabled Enables extra tools for Web developers.
- Currently this enables the "Inspect" element in the context menu,
- which shows the WebKit WebInspector for web site debugging.
+ Currently this enables the "Inspect" element in the context menu as
+ well as the use of QWebInspector which controls the WebKit WebInspector
+ for web site debugging.
\value LinksIncludedInFocusChain Specifies whether hyperlinks should be
included in the keyboard focus chain.
\value ZoomTextOnly Specifies whether the zoom factor on a frame applies to
@@ -324,12 +337,14 @@ QWebSettings* QWebSettings::globalSettings()
\value PrintElementBackgrounds Specifies whether the background color and images
are also drawn when the page is printed.
\value OfflineStorageDatabaseEnabled Specifies whether support for the HTML 5
- offline storage feature is enabled or not.
+ offline storage feature is enabled or not. Disabled by default.
\value OfflineWebApplicationCacheEnabled Specifies whether support for the HTML 5
- web application cache feature is enabled or not.
- \value LocalStorageDatabaseEnabled Specifies whether support for the HTML 5
- local storage feature is enabled or not.
+ web application cache feature is enabled or not. Disabled by default.
+ \value LocalStorageEnabled Specifies whether support for the HTML 5
+ local storage feature is enabled or not. Disabled by default.
\value LocalContentCanAccessRemoteUrls Specifies whether locally loaded documents are allowed to access remote urls.
+ \value SessionStorageEnabled Specifies whether support for the HTML 5
+ session storage feature is enabled or not. Enabled by default.
*/
/*!
@@ -351,16 +366,17 @@ QWebSettings::QWebSettings()
d->fontFamilies.insert(QWebSettings::FantasyFont, QLatin1String("Arial"));
d->attributes.insert(QWebSettings::AutoLoadImages, true);
+ d->attributes.insert(QWebSettings::DnsPrefetchEnabled, false);
d->attributes.insert(QWebSettings::JavascriptEnabled, true);
d->attributes.insert(QWebSettings::LinksIncludedInFocusChain, true);
d->attributes.insert(QWebSettings::ZoomTextOnly, false);
d->attributes.insert(QWebSettings::PrintElementBackgrounds, true);
- d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, true);
- d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, true);
- d->attributes.insert(QWebSettings::LocalStorageDatabaseEnabled, true);
- d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, true);
+ d->attributes.insert(QWebSettings::OfflineStorageDatabaseEnabled, false);
+ d->attributes.insert(QWebSettings::OfflineWebApplicationCacheEnabled, false);
+ d->attributes.insert(QWebSettings::LocalStorageEnabled, false);
+ d->attributes.insert(QWebSettings::LocalContentCanAccessRemoteUrls, false);
+ d->attributes.insert(QWebSettings::SessionStorageEnabled, true);
d->offlineStorageDefaultQuota = 5 * 1024 * 1024;
-
}
/*!
@@ -542,6 +558,17 @@ QIcon QWebSettings::iconForUrl(const QUrl& url)
}
/*!
+ Returns the plugin database object.
+*/
+QWebPluginDatabase *QWebSettings::pluginDatabase()
+{
+ static QWebPluginDatabase* database = 0;
+ if (!database)
+ database = new QWebPluginDatabase();
+ return database;
+}
+
+/*!
Sets \a graphic to be drawn when QtWebKit needs to draw an image of the
given \a type.
@@ -629,7 +656,7 @@ int QWebSettings::maximumPagesInCache()
The \a cacheMinDeadCapacity specifies the \e minimum number of bytes that
dead objects should consume when the cache is under pressure.
-
+
\a cacheMaxDead is the \e maximum number of bytes that dead objects should
consume when the cache is \bold not under pressure.
@@ -689,7 +716,7 @@ void QWebSettings::resetFontFamily(FontFamily which)
/*!
\fn void QWebSettings::setAttribute(WebAttribute attribute, bool on)
-
+
Enables or disables the specified \a attribute feature depending on the
value of \a on.
*/
@@ -786,27 +813,35 @@ qint64 QWebSettings::offlineStorageDefaultQuota()
return QWebSettings::globalSettings()->d->offlineStorageDefaultQuota;
}
-/*
- \internal
+/*!
+ \since 4.6
\relates QWebSettings
Sets the path for HTML5 offline web application cache storage to \a path.
+ An application cache acts like an HTTP cache in some sense. For documents
+ that use the application cache via JavaScript, the loader mechinery will
+ first ask the application cache for the contents, before hitting the
+ network.
+
+ The feature is described in details at:
+ http://dev.w3.org/html5/spec/Overview.html#appcache
+
\a path must point to an existing directory where the cache is stored.
Setting an empty path disables the feature.
\sa offlineWebApplicationCachePath()
*/
-void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QString& path)
+void QWebSettings::setOfflineWebApplicationCachePath(const QString& path)
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
WebCore::cacheStorage().setCacheDirectory(path);
#endif
}
-/*
- \internal
+/*!
+ \since 4.6
\relates QWebSettings
Returns the path of the HTML5 offline web application cache storage
@@ -814,7 +849,7 @@ void QWEBKIT_EXPORT qt_websettings_setOfflineWebApplicationCachePath(const QStri
\sa setOfflineWebApplicationCachePath()
*/
-QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
+QString QWebSettings::offlineWebApplicationCachePath()
{
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
return WebCore::cacheStorage().cacheDirectory();
@@ -823,37 +858,98 @@ QString QWEBKIT_EXPORT qt_websettings_offlineWebApplicationCachePath()
#endif
}
-/*
- \since 4.5
- \relates QWebSettings
+/*!
+ \since 4.6
- Sets the path for HTML5 local storage databases to \a path.
+ Sets the value of the quota for the offline web application cache
+ to \a maximumSize.
+*/
+void QWebSettings::setOfflineWebApplicationCacheQuota(qint64 maximumSize)
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ WebCore::cacheStorage().setMaximumSize(maximumSize);
+#endif
+}
- \a path must point to an existing directory where the cache is stored.
+/*!
+ \since 4.6
- Setting an empty path disables the feature.
+ Returns the value of the quota for the offline web application cache.
+*/
+qint64 QWebSettings::offlineWebApplicationCacheQuota()
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ return WebCore::cacheStorage().maximumSize();
+#else
+ return 0;
+#endif
+}
- \sa localStorageDatabasePath()
+/*!
+ \since 4.6
+ \relates QWebSettings
+
+ Sets the path for HTML5 local storage to \a path.
+
+ For more information on HTML5 local storage see the
+ \l{http://www.w3.org/TR/webstorage/#the-localstorage-attribute}{Web Storage standard}.
+
+ Support for local storage can enabled by setting the
+ \l{QWebSettings::LocalStorageEnabled}{LocalStorageEnabled} attribute.
+
+ \sa localStoragePath()
*/
-void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path)
+void QWebSettings::setLocalStoragePath(const QString& path)
{
- QWebSettingsPrivate* d = settings->handle();
- d->localStorageDatabasePath = path;
+ d->localStoragePath = path;
d->apply();
}
-/*
- \since 4.5
+/*!
+ \since 4.6
\relates QWebSettings
- Returns the path for HTML5 local storage databases
- or an empty string if the feature is disabled.
+ Returns the path for HTML5 local storage.
+
+ \sa setLocalStoragePath()
+*/
+QString QWebSettings::localStoragePath() const
+{
+ return d->localStoragePath;
+}
+
+/*!
+ \since 4.6
+ \relates QWebSettings
- \sa setLocalStorageDatabasePath()
+ Enables WebKit persistent data and sets the path to \a path.
+ If the \a path is empty the path for persistent data is set to the
+ user-specific data location specified by
+ \l{QDesktopServices::DataLocation}{DataLocation}.
+
+ \sa localStoragePath()
*/
-QString QWEBKIT_EXPORT qt_websettings_localStorageDatabasePath(QWebSettings* settings)
+void QWebSettings::enablePersistentStorage(const QString& path)
{
- return settings->handle()->localStorageDatabasePath;
+ QString storagePath;
+
+ if (path.isEmpty()) {
+ storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+
+ if (storagePath.isEmpty())
+ storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
+ } else
+ storagePath = path;
+
+ WebCore::makeAllDirectories(storagePath);
+
+ QWebSettings::setIconDatabasePath(storagePath);
+ QWebSettings::setOfflineWebApplicationCachePath(storagePath);
+ QWebSettings::setOfflineStoragePath(WebCore::pathByAppendingComponent(storagePath, "Databases"));
+ QWebSettings::globalSettings()->setLocalStoragePath(WebCore::pathByAppendingComponent(storagePath, "LocalStorage"));
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
}
/*!
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
index 63144cb403..4790823e89 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebsettings.h
@@ -32,6 +32,7 @@ namespace WebCore {
}
class QWebPage;
+class QWebPluginDatabase;
class QWebSettingsPrivate;
QT_BEGIN_NAMESPACE
class QUrl;
@@ -61,8 +62,13 @@ public:
PrintElementBackgrounds,
OfflineStorageDatabaseEnabled,
OfflineWebApplicationCacheEnabled,
- LocalStorageDatabaseEnabled,
- LocalContentCanAccessRemoteUrls
+ LocalStorageEnabled,
+#ifdef QT_DEPRECATED
+ LocalStorageDatabaseEnabled = LocalStorageEnabled,
+#endif
+ LocalContentCanAccessRemoteUrls,
+ SessionStorageEnabled,
+ DnsPrefetchEnabled
};
enum WebGraphic {
MissingImageGraphic,
@@ -102,6 +108,8 @@ public:
static void clearIconDatabase();
static QIcon iconForUrl(const QUrl &url);
+ static QWebPluginDatabase *pluginDatabase();
+
static void setWebGraphic(WebGraphic type, const QPixmap &graphic);
static QPixmap webGraphic(WebGraphic type);
@@ -114,8 +122,18 @@ public:
static void setOfflineStorageDefaultQuota(qint64 maximumSize);
static qint64 offlineStorageDefaultQuota();
+ static void setOfflineWebApplicationCachePath(const QString& path);
+ static QString offlineWebApplicationCachePath();
+ static void setOfflineWebApplicationCacheQuota(qint64 maximumSize);
+ static qint64 offlineWebApplicationCacheQuota();
+
+ void setLocalStoragePath(const QString& path);
+ QString localStoragePath() const;
+
static void clearMemoryCaches();
+ static void enablePersistentStorage(const QString& path = QString());
+
inline QWebSettingsPrivate* handle() const { return d; }
private:
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index 422b5e60ca..d12de9416a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -36,40 +36,22 @@ public:
: view(view)
, page(0)
, renderHints(QPainter::TextAntialiasing)
-#ifndef QT_NO_CURSOR
- , cursorSetByWebCore(false)
- , usesWebCoreCursor(true)
-#endif
{}
+ void _q_pageDestroyed();
+
QWebView *view;
QWebPage *page;
QPainter::RenderHints renderHints;
-
-#ifndef QT_NO_CURSOR
- /*
- * We keep track of if we have called setCursor and if the CursorChange
- * event is sent due our setCursor call and if we currently use the WebCore
- * Cursor and use it to decide if we can update to another WebCore Cursor.
- */
- bool cursorSetByWebCore;
- bool usesWebCoreCursor;
-
- void setCursor(const QCursor& newCursor)
- {
- webCoreCursor = newCursor;
-
- if (usesWebCoreCursor) {
- cursorSetByWebCore = true;
- view->setCursor(webCoreCursor);
- }
- }
-
- QCursor webCoreCursor;
-#endif
};
+void QWebViewPrivate::_q_pageDestroyed()
+{
+ page = 0;
+ view->setPage(0);
+}
+
/*!
\class QWebView
\since 4.4
@@ -244,6 +226,8 @@ void QWebView::setPage(QWebPage* page)
connect(d->page, SIGNAL(microFocusChanged()),
this, SLOT(updateMicroFocus()));
+ connect(d->page, SIGNAL(destroyed()),
+ this, SLOT(_q_pageDestroyed()));
}
setAttribute(Qt::WA_OpaquePaintEvent, d->page);
update();
@@ -696,18 +680,25 @@ bool QWebView::event(QEvent *e)
if (e->type() == QEvent::ShortcutOverride) {
d->page->event(e);
#ifndef QT_NO_CURSOR
- } else if (e->type() == static_cast<QEvent::Type>(WebCore::SetCursorEvent::EventType)) {
- d->setCursor(static_cast<WebCore::SetCursorEvent*>(e)->cursor());
#if QT_VERSION >= 0x040400
} else if (e->type() == QEvent::CursorChange) {
- // Okay we might use the WebCore Cursor now.
- d->usesWebCoreCursor = d->cursorSetByWebCore;
- d->cursorSetByWebCore = false;
-
- // Go back to the WebCore Cursor. QWidget::unsetCursor is appromixated with this
- if (!d->usesWebCoreCursor && cursor().shape() == Qt::ArrowCursor) {
- d->usesWebCoreCursor = true;
- d->setCursor(d->webCoreCursor);
+ // might be a QWidget::unsetCursor()
+ if (cursor().shape() == Qt::ArrowCursor) {
+ QVariant prop = property("WebCoreCursor");
+ if (prop.isValid()) {
+ QCursor webCoreCursor = qvariant_cast<QCursor>(prop);
+ if (webCoreCursor.shape() != Qt::ArrowCursor)
+ setCursor(webCoreCursor);
+ }
+ }
+ } else if (e->type() == QEvent::DynamicPropertyChange) {
+ const QByteArray& propName = static_cast<QDynamicPropertyChangeEvent *>(e)->propertyName();
+ if (!qstrcmp(propName, "WebCoreCursor")) {
+ QVariant prop = property("WebCoreCursor");
+ if (prop.isValid()) {
+ QCursor webCoreCursor = qvariant_cast<QCursor>(prop);
+ setCursor(webCoreCursor);
+ }
}
#endif
#endif
@@ -1096,3 +1087,6 @@ void QWebView::changeEvent(QEvent *e)
\sa QWebPage::linkDelegationPolicy()
*/
+
+#include "moc_qwebview.cpp"
+
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
index e8861444d5..0f2649d17a 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -50,7 +50,13 @@ class QWEBKIT_EXPORT QWebView : public QWidget {
//Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
+
+// FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject
+// symbol from Qt lib; it should be reverted after the right symbol is exported.
+// See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893
+#if !defined(Q_OS_SYMBIAN)
Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints)
+#endif
Q_FLAGS(QPainter::RenderHints)
public:
explicit QWebView(QWidget* parent = 0);
@@ -162,6 +168,7 @@ protected:
private:
friend class QWebPage;
QWebViewPrivate* d;
+ Q_PRIVATE_SLOT(d, void _q_pageDestroyed())
};
#endif // QWEBVIEW_H
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index e8f5ad08b9..8ec6b86df2 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,1178 @@
+2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Symbian build fix.
+
+ Moved the #ifdefs around _q_cleanupLeakMessages() into the function
+ definition.
+
+ QMake is not being able to distinguish between release and debug builds
+ in Symbian build. This is a Symbian toolchain issue.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::_q_cleanupLeakMessages):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+
+2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Small cosmetic documentation fixlet in the QWebInspector.
+
+ * Api/qwebinspector.cpp:
+
+2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Detect and add Windows7 properly to the user agent.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+
+2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk>
+
+ Rubberstamped by Kenneth Christiansen.
+
+ [Qt] Build fix for previous changes.
+
+ * QGVLauncher/main.cpp:
+ (MainView::flip):
+
+2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed potential Qt < 4.6 build fix.
+
+ * QGVLauncher/main.cpp:
+ (MainView::flip):
+
+2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add a "Flip effect" to our GraphicsView based launcher.
+
+ * QGVLauncher/main.cpp:
+ (MainView::resizeEvent):
+ (MainView::flip):
+ (MainWindow::flip):
+ (MainWindow::buildUI):
+
+2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Typo fix. Pass the window object to the Format
+ menu. In this way Qt can free its internal graphical
+ objects during exit.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::setupUI):
+
+2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Build break fix on gcc ARM.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItemPrivate::_q_doLoadProgress):
+
+2009-09-16 Warwick Allison <warwick.allison@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a crash in QWebFrame::hasFocus() with a simple null pointer check
+ when the focused frame is null. We do the same check in other places
+ where we call kit().
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::hasFocus):
+
+2009-09-16 Jure Repinc <jlp@holodeck1.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fixed a typo found during translation.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
+
+2009-09-14 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QWebGraphicsItem should check for null QWebPage.
+ https://bugs.webkit.org/show_bug.cgi?id=29185
+
+ Don't crash in QWebGraphicsItem when the page is still null, by
+ either checking if it's the case or constructing the default one.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::icon):
+ (QWebGraphicsItem::setZoomFactor):
+ (QWebGraphicsItem::zoomFactor):
+ (QWebGraphicsItem::setGeometry):
+ (QWebGraphicsItem::load):
+ (QWebGraphicsItem::setHtml):
+ (QWebGraphicsItem::toHtml):
+ (QWebGraphicsItem::setContent):
+ (QWebGraphicsItem::history):
+ (QWebGraphicsItem::settings):
+
+2009-09-11 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: Note that Netscape plugins are only available on desktop platforms.
+
+ * docs/qtwebkit.qdoc:
+
+2009-09-11 Martin Smith <msmith@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ Adjust the name of the contentspage for the documentation
+ to the new name used in Qt 4.6.
+
+ * docs/qtwebkit.qdoc:
+
+2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general
+ renaming.
+
+ * Api/qwebpluginfactory.cpp:
+ * docs/webkitsnippets/simple/main.cpp:
+ (main):
+ * docs/webkitsnippets/webpage/main.cpp:
+ (main):
+
+2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Restructure the documentation, both on a file and on a content level.
+
+ * Api/qwebdatabase.cpp:
+ * Api/qwebelement.cpp:
+ * Api/qwebframe.cpp:
+ * Api/qwebhistory.cpp:
+ * Api/qwebhistoryinterface.cpp:
+ * Api/qwebpage.cpp:
+ * Api/qwebpluginfactory.cpp:
+ * Api/qwebsecurityorigin.cpp:
+ * Api/qwebsettings.cpp:
+ * Api/qwebview.cpp:
+ * docs/qtwebkit.qdoc:
+
+2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29136
+ [Qt] emit microFocusChanged() signal when no QWidget-based view is present.
+
+ emit microFocusChange() signal regardless of view.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+
+2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28806
+
+ [Qt] Make the WebInspector available as a QWidget.
+
+ * Api/headers.pri:
+ * Api/qwebelement.cpp:
+ (QWebElement::enclosingElement):
+ * Api/qwebelement.h:
+ * Api/qwebinspector.cpp: Added.
+ * Api/qwebinspector.h: Added.
+ * Api/qwebinspector_p.h: Added.
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ (QWebPagePrivate::setInspector):
+ (QWebPagePrivate::getOrCreateInspector):
+ (QWebPagePrivate::inspectorController):
+ (QWebPage::~QWebPage):
+ (QWebPage::triggerAction):
+ * Api/qwebpage.h:
+ * Api/qwebpage_p.h:
+ * Api/qwebsettings.cpp:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientWebPage::InspectorClientWebPage):
+ (WebCore::InspectorClientWebPage::createWindow):
+ (WebCore::InspectorClientQt::createPage):
+ (WebCore::InspectorClientQt::showWindow):
+ (WebCore::InspectorClientQt::closeWindow):
+ (WebCore::InspectorClientQt::attachWindow):
+ (WebCore::InspectorClientQt::detachWindow):
+ (WebCore::InspectorClientQt::updateWindowTitle):
+ * WebCoreSupport/InspectorClientQt.h:
+ * docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added.
+
+2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Fix comparison between signed and unsigned integer warnings
+ https://bugs.webkit.org/show_bug.cgi?id=29162
+
+ No functional change.
+
+ * Api/qwebelement.cpp:
+ (QWebElement::findAll):
+ * Api/qwebhistory.cpp:
+ (QWebHistory::items):
+ (QWebHistory::backItems):
+ (QWebHistory::forwardItems):
+ (QWebHistory::saveState):
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginDatabase::setSearchPaths):
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::runOpenPanel):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::createPlugin):
+
+2009-09-10 Simon Hausmann <hausmann@webkit.org>
+
+ Rubber-stamped by Ariya Hidayat.
+
+ Fix a bunch of qdoc warnings: Invalid references, non-standard
+ wording, etc.
+
+ * Api/qwebelement.cpp:
+ * Api/qwebgraphicsitem.cpp:
+ * Api/qwebsecurityorigin.cpp:
+
+2009-09-10 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Fix context menu event delivery with QWebGraphicsItem.
+
+ Re-implement the correct context menu virtual function using
+ a QGraphicsSceneContextMenuEvent and forward & handle it in
+ QWebPage.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::contextMenuEvent):
+ * Api/qwebgraphicsitem.h:
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::contextMenuEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+
+2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed.
+
+ Build fix for QtWebKit for Mac after r48219.
+
+ qevent and qstyleoption are QtGui interfaces.
+
+ * Api/qwebgraphicsitem.cpp:
+ * Api/qwebgraphicsitem.h:
+
+2009-09-09 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Call the right base class function QGraphicsWidget::event() instead
+ of skipping it and using QObject::event() instead.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::event):
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed.
+
+ Fix comment at Tor Arne Vestbø's request.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::sceneEvent):
+ (QWebGraphicsItem::event):
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Implement some virtual event methods so that we can fix
+ event-related bugs in Qt patch releases.
+
+ * Api/qwebgraphicsitem.cpp:
+ (QWebGraphicsItem::sceneEvent):
+ (QWebGraphicsItem::event):
+ * Api/qwebgraphicsitem.h:
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add a new QGraphicsWidget based version of the "QWebView"
+ under the name "QWebGraphicsItem".
+
+ https://bugs.webkit.org/show_bug.cgi?id=28862
+
+ Includes an alternative Qt launcher using the QGraphicsView.
+
+ * Api/headers.pri:
+ * Api/qwebgraphicsitem.cpp: Added.
+ * Api/qwebgraphicsitem.h: Added.
+ * Api/qwebpage.h:
+ * QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro.
+ * QGVLauncher/main.cpp: Added.
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::repaint):
+ (WebCore::ChromeClientQt::scroll):
+
+2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed build fix.
+
+ Potential build fix for Qt 4.5
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mousePressEvent):
+
+2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29007
+ Add a test for the signal QWebFrame::javaScriptWindowObjectCleared()
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix unused variable warnings
+ https://bugs.webkit.org/show_bug.cgi?id=29018
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::keyPressEvent):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::startDownload):
+ (WebCore::FrameLoaderClientQt::createFrame):
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Use the declaration order in initializer lists
+ https://bugs.webkit.org/show_bug.cgi?id=29017
+
+ * Api/qwebframe_p.h:
+
+2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add support for handling QGraphicsScene events.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::mouseMoveEvent):
+ (QWebPagePrivate::mousePressEvent):
+ (QWebPagePrivate::mouseDoubleClickEvent):
+ (QWebPagePrivate::mouseTripleClickEvent):
+ (QWebPagePrivate::handleClipboard):
+ (QWebPagePrivate::mouseReleaseEvent):
+ (QWebPagePrivate::wheelEvent):
+ (QWebPagePrivate::dragEnterEvent):
+ (QWebPagePrivate::dragLeaveEvent):
+ (QWebPagePrivate::dragMoveEvent):
+ (QWebPagePrivate::dropEvent):
+ (QWebPage::event):
+ * Api/qwebpage_p.h:
+
+2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack.
+ https://bugs.webkit.org/show_bug.cgi?id=28865
+
+ Clean up the unserCursor hack to use the QCursor set
+ as a property of the QWidget by WebCore::WidgetQt.
+
+ Remove all code that are no longer necessary for getting
+ cursor change events.
+
+ Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and
+ Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07
+
+ * Api/qwebpage.cpp:
+ * Api/qwebpage_p.h:
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::QWebViewPrivate):
+ (QWebView::event):
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebKit single API to enable persistency
+ https://bugs.webkit.org/show_bug.cgi?id=28682
+
+ Disable LocalStorage, ApplicationCache, HTML5 offline storage by
+ default.
+
+ If persistency is enabled the default directory for LocalStorage and
+ ApplicationCache is now based on QDesktopServices::DataLocation and not
+ QDesktopServices::CacheLocation (as it is expected to keep this data
+ around after a reboot).
+
+ If persistency is enabled initialize HTML5 offline storage as well - this
+ fixed offline Storage for QtLauncher.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ (QWebSettings::enablePersistentStorage):
+ * Api/qwebsettings.h: Add a new API called enablePersistentStorage
+ * QtLauncher/main.cpp: Use the new enablePersistentStorage API
+ (main):
+
+2009-09-07 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Speed up the QWebPluginInfo::supportsMimeType() function.
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ Instead of going through the MIME types list constructed with
+ mimeTypes() function, look up the internal mimeToDescriptions map.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfo::supportsMimeType):
+
+2009-09-07 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Speed up the QWebPluginInfo::mimeTypes() function.
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ Instead of constructing a list of MIME types every time it is called,
+ do this only once.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfo::mimeTypes):
+ (QWebPluginInfo::operator=):
+ * Api/qwebplugindatabase.h:
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
+ (tst_QWebPluginDatabase::operatorassign_data):
+ (tst_QWebPluginDatabase::operatorassign):
+
+2009-09-07 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Remove the private classes from QWebPluginDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ Instead, hold the PluginDatabase and PluginPackage objects as class
+ members and take care of refcounting on our own instead of using RefPtr.
+
+ This way we not only made the code cleaner but also got rid of
+ redundant allocations when constructing null QWebPluginInfo objects.
+
+ The private classes have been forward-declared and the d-pointers left
+ to be on the safe side.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfo::QWebPluginInfo):
+ (QWebPluginInfo::~QWebPluginInfo):
+ (QWebPluginInfo::name):
+ (QWebPluginInfo::description):
+ (QWebPluginInfo::mimeTypes):
+ (QWebPluginInfo::path):
+ (QWebPluginInfo::isNull):
+ (QWebPluginInfo::setEnabled):
+ (QWebPluginInfo::isEnabled):
+ (QWebPluginInfo::operator==):
+ (QWebPluginInfo::operator!=):
+ (QWebPluginInfo::operator=):
+ (QWebPluginDatabase::QWebPluginDatabase):
+ (QWebPluginDatabase::~QWebPluginDatabase):
+ (QWebPluginDatabase::plugins):
+ (QWebPluginDatabase::searchPaths):
+ (QWebPluginDatabase::setSearchPaths):
+ (QWebPluginDatabase::addSearchPath):
+ (QWebPluginDatabase::refresh):
+ (QWebPluginDatabase::pluginForMimeType):
+ (QWebPluginDatabase::setPreferredPluginForMimeType):
+ * Api/qwebplugindatabase.h:
+ * Api/qwebplugindatabase_p.h: Removed.
+
+2009-09-05 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] r47424 broke binary compatibility
+ https://bugs.webkit.org/show_bug.cgi?id=28996
+
+ Append the new DnsPrefetchEnabled attribute at the end of the enum.
+
+ * Api/qwebsettings.h:
+
+2009-09-04 Mark Mentovai <mark@chromium.org>
+
+ Reviewed by Dave Hyatt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28614
+
+ Account for scrollbar state changes that occur during layout.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::setScrollBarPolicy):
+
+ Eliminate duplicated (and incorrect) scrollbar mode tracking between
+ FrameView and ScrollView.
+
+2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Fix tst_QWebPage::database autotest failure
+ https://bugs.webkit.org/show_bug.cgi?id=28961
+
+ Make sure that the test case enables the feature before
+ the feature gets tested
+
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::database):
+
+2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Any QtWebKit application crashes on exit if the inspector is
+ used during the session rather then exiting.
+
+ If a QWebView has a QWebPage that is destroyed the QWebView
+ does not update its pointer and will crash the next time
+ it access the page pointers (such as in its destructor).
+
+ InspectorClientView should not call deleteLater when the page
+ is destroyed because it does not have a parent and is a top
+ level widget. close() needs to be called so that QApplication
+ can exit the application if quitOnLastWindowClosed is set
+ and a InspectorClientView is the last window, otherwise
+ the application will never exit.
+
+ * Api/qwebview.cpp:
+ (QWebViewPrivate::_q_pageDestroyed):
+ (QWebView::setPage):
+ * Api/qwebview.h:
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientView::InspectorClientView):
+
+2009-09-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by eric@webkit.org.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24696
+
+ Stub implementations of mixed content methods of FrameLoaderClient.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::didDisplayInsecureContent):
+ (WebCore::FrameLoaderClientQt::didRunInsecureContent):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Add a setting to turn SessionStorage on/off
+ https://bugs.webkit.org/show_bug.cgi?id=28836
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (testFlag):
+ (tst_QWebPage::testOptionalJSObjects):
+
+2009-09-02 Richard Moore <rich@kde.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Make sure we relayout the page after evaluating JS
+
+ https://bugs.webkit.org/show_bug.cgi?id=28235
+
+ QtWebKit does not always seem to reflow the page when evaluating
+ javascript. This patch changes the way evaluateJavaScript works to
+ use the frameloader which ensures that this is done properly.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateJavaScript):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=25889
+ [GTK] scrollbar policy for main frame is not implementable
+
+ Add empty implementation for new ChromeClient method.
+
+ * WebCoreSupport/ChromeClientQt.h:
+ (WebCore::ChromeClientQt::scrollbarsModeDidChange):
+
+2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ QWebHistory::clear() modifications.
+
+ Clear() method was changed. If QWebHistory is empty (there is no
+ elements even current) clear() do nothing. If there at least one
+ element clear() will delete everything apart of current.
+
+ New autotests in QWebHistory
+
+ New autotests were added to QWebHistory. They should check some crashes
+ in save and restore state process and clear() method and general
+ behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1
+
+ Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::clear):
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ (tst_QWebHistory::back):
+ (tst_QWebHistory::forward):
+ (tst_QWebHistory::saveAndRestore_crash_1):
+ (tst_QWebHistory::saveAndRestore_crash_2):
+ (tst_QWebHistory::saveAndRestore_crash_3):
+ (tst_QWebHistory::clear):
+
+2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Cleanup, old and commented part of source code was removed.
+ Fix some formatting problems.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28712
+
+ * Api/qwebhistory_p.h:
+ (QWebHistoryPrivate::QWebHistoryPrivate):
+
+2009-08-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Don't let local files access web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28480
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::requestedUrl):
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
+ (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+ (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
+2009-08-22 Adam Barth <abarth@webkit.org>
+
+ Revert 47684. We're going to do this later once clients have had a
+ chance to opt into the setting they like.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-08-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't let local files access web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28480
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+
+2009-08-19 Aaron Boodman <aa@chromium.org>
+
+ Speculative build break fix for qt.
+
+ * Api/qwebsecurityorigin.cpp:
+ (QWebSecurityOrigin::whiteListAccessFromOrigin):
+ * Api/qwebsecurityorigin.h:
+
+2009-08-19 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by David Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
+ specify a more granular policy for cross-origin XHR access.
+
+ * Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists.
+ (QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto.
+ (QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto.
+ * Api/qwebsecurityorigin.h: Ditto.
+
+2009-08-18 Markus Goetz <Markus.Goetz@nokia.com>
+
+ Reviwed by Ariya Hidayat.
+
+ [Qt] For prefecthDNS, the pre-fetching has to be enabled in the
+ WebSettings.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ * Api/qwebsettings.h:
+
+2009-08-17 Darin Adler <darin@apple.com>
+
+ Try to fix Qt build again.
+
+ * WebCoreSupport/EditorClientQt.cpp: Move "using namespace".
+
+2009-08-17 Darin Adler <darin@apple.com>
+
+ Try to fix Qt build.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::shouldShowDeleteInterface):
+ Use getAttribute(classAttr) instead of className() function.
+
+2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ RVCT elftran fails to resolve QPainter::staticMetaObject coming with
+ QWebView::RenderHints property.
+
+ This is a temporary fix and will be revereted when the right symbols
+ exported from Qt lib in S60.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28181
+
+ * Api/qwebview.h:
+
+2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Public API to configure the storage path for HTML5 localStorage
+ https://bugs.webkit.org/show_bug.cgi?id=28036
+
+ Disables LocalStorage for QtWebKit by default by setting
+ QWebSettings::LocalStorageEnabled to false.
+
+ Sets up a default for the LocalStorage path so that clients would only
+ need to enable the LocalStorageEnabled setting to turn on LocalStoragre
+ support.
+
+ Turn on LocalStorage support for QtLauncher and the relevant test
+ since LocalStorage is now disabled by default for QtWebkit.
+
+ * Api/qwebpage.cpp:
+ (defaultCachePath):
+ (initializeApplicationCachePathIfNecessary):
+ (QWebPagePrivate::QWebPagePrivate):
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setLocalStoragePath):
+ (QWebSettings::localStoragePath):
+ * Api/qwebsettings.h:
+ * QtLauncher/main.cpp:
+ (main):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::multiplePageGroupsAndLocalStorage):
+
+2009-08-14 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Allow applications to register their own local URL scheme.
+ https://bugs.webkit.org/show_bug.cgi?id=28240
+
+ * Api/qwebsecurityorigin.cpp:
+ (QWebSecurityOrigin::addLocalScheme):
+ (QWebSecurityOrigin::removeLocalScheme):
+ (QWebSecurityOrigin::localSchemes):
+ * Api/qwebsecurityorigin.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::localURLSchemes):
+
+2009-08-13 Mark Rowe <mrowe@apple.com>
+
+ Try and fix the Qt build.
+
+ * Api/qwebelement.cpp:
+
+2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc - Some cleanup on the documentation of QWebElement
+
+ * Api/qwebelement.cpp:
+
+2009-08-13 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Symbian target components (library and executable files)
+ require Unique Identifiers (i.e., UID3).
+ These identifiers are defined in the respective project
+ files, conditionally for "symbian" platform.
+
+ * QtLauncher/QtLauncher.pro:
+ * tests/qwebelement/qwebelement.pro:
+ * tests/qwebframe/qwebframe.pro:
+ * tests/qwebhistory/qwebhistory.pro:
+ * tests/qwebhistoryinterface/qwebhistoryinterface.pro:
+ * tests/qwebpage/qwebpage.pro:
+ * tests/qwebview/qwebview.pro:
+
+2009-08-12 George Wright <george.wright@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Initialise zoom levels independent of whether a URL is valid or not to
+ fix https://bugs.webkit.org/show_bug.cgi?id=28162
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+
+2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ QtWebKit compile fix for Windows CE
+
+ There's no getenv on Windows CE, use qgetenv instead.
+
+ * Api/qwebpage.cpp:
+ (qt_drt_overwritePluginDirectories):
+
+2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation.
+
+ * Api/qwebplugindatabase.cpp:
+ * Api/qwebsettings.cpp:
+
+2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Doc: there is no group of explicitly shared classes, only one class uses this.
+
+ Explain the implications in the QWebHistoryItem documentation, and get rid
+ of the "group".
+
+ * Api/qwebhistory.cpp:
+
+2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix build error caused by http://trac.webkit.org/changeset/46763
+
+ * Api/qwebpluginfactory.h: Export macro added.
+
+2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors.
+ https://bugs.webkit.org/show_bug.cgi?id=27804
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::requestedUrl):
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-08-04 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Rename QWebPlugin to QWebPluginInfo, as discussed on IRC.
+
+ * Api/qwebplugindatabase.cpp:
+ (QWebPluginInfoPrivate::QWebPluginInfoPrivate):
+ (QWebPluginInfo::QWebPluginInfo):
+ (QWebPluginInfo::~QWebPluginInfo):
+ (QWebPluginInfo::name):
+ (QWebPluginInfo::description):
+ (QWebPluginInfo::mimeTypes):
+ (QWebPluginInfo::supportsMimeType):
+ (QWebPluginInfo::path):
+ (QWebPluginInfo::isNull):
+ (QWebPluginInfo::setEnabled):
+ (QWebPluginInfo::isEnabled):
+ (QWebPluginInfo::operator==):
+ (QWebPluginInfo::operator!=):
+ (QWebPluginInfo::operator=):
+ (QWebPluginDatabase::plugins):
+ (QWebPluginDatabase::pluginForMimeType):
+ (QWebPluginDatabase::setPreferredPluginForMimeType):
+ * Api/qwebplugindatabase.h:
+ * Api/qwebplugindatabase_p.h:
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
+ (tst_QWebPluginDatabase::installedPlugins):
+ (tst_QWebPluginDatabase::searchPaths):
+ (tst_QWebPluginDatabase::null_data):
+ (tst_QWebPluginDatabase::null):
+ (tst_QWebPluginDatabase::pluginForMimeType):
+ (tst_QWebPluginDatabase::enabled):
+ (tst_QWebPluginDatabase::operatorequal_data):
+ (tst_QWebPluginDatabase::operatorequal):
+ (tst_QWebPluginDatabase::preferredPlugin):
+
+2009-08-04 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Adam Treat.
+
+ Replace QWebPlugin::MimeType with a typedef to
+ QWebPluginFactory::MimeType.
+
+ * Api/qwebplugindatabase.cpp:
+ * Api/qwebplugindatabase.h:
+ * Api/qwebpluginfactory.cpp:
+ (QWebPluginFactory::MimeType::operator==):
+ * Api/qwebpluginfactory.h:
+
+2009-08-04 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add QWebPluginDatabase API to the Qt API.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27651
+
+ * Api/headers.pri:
+ * Api/qwebplugindatabase.cpp: Added.
+ (QWebPluginPrivate::QWebPluginPrivate):
+ (QWebPluginDatabasePrivate::QWebPluginDatabasePrivate):
+ (QWebPlugin::MimeType::operator==):
+ (QWebPlugin::QWebPlugin):
+ (QWebPlugin::~QWebPlugin):
+ (QWebPlugin::name):
+ (QWebPlugin::description):
+ (QWebPlugin::mimeTypes):
+ (QWebPlugin::supportsMimeType):
+ (QWebPlugin::path):
+ (QWebPlugin::isNull):
+ (QWebPlugin::setEnabled):
+ (QWebPlugin::isEnabled):
+ (QWebPlugin::operator==):
+ (QWebPlugin::operator!=):
+ (QWebPlugin::operator=):
+ (QWebPluginDatabase::QWebPluginDatabase):
+ (QWebPluginDatabase::~QWebPluginDatabase):
+ (QWebPluginDatabase::plugins):
+ (QWebPluginDatabase::defaultSearchPaths):
+ (QWebPluginDatabase::searchPaths):
+ (QWebPluginDatabase::setSearchPaths):
+ (QWebPluginDatabase::addSearchPath):
+ (QWebPluginDatabase::refresh):
+ (QWebPluginDatabase::pluginForMimeType):
+ (QWebPluginDatabase::setPreferredPluginForMimeType):
+ * Api/qwebplugindatabase.h: Added.
+ * Api/qwebplugindatabase_p.h: Added.
+ * Api/qwebsettings.cpp:
+ (QWebSettings::pluginDatabase):
+ * Api/qwebsettings.h:
+ * tests/qwebplugindatabase/qwebplugindatabase.pro: Added.
+ * tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added.
+ (tst_QWebPluginDatabase::installedPlugins):
+ (tst_QWebPluginDatabase::searchPaths):
+ (tst_QWebPluginDatabase::null_data):
+ (tst_QWebPluginDatabase::null):
+ (tst_QWebPluginDatabase::pluginForMimeType):
+ (tst_QWebPluginDatabase::enabled):
+ (tst_QWebPluginDatabase::operatorequal_data):
+ (tst_QWebPluginDatabase::operatorequal):
+ (tst_QWebPluginDatabase::preferredPlugin):
+ * tests/tests.pro:
+
+2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Do memory cleanup when running robotized QtLauncher in debug as well.
+
+ * QtLauncher/main.cpp:
+ (launcherMain):
+ (main):
+
+2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default
+ https://bugs.webkit.org/show_bug.cgi?id=27866
+
+ * Api/qwebpage.cpp:
+ (initializeApplicationCachePathIfNecessary):
+ (QWebPagePrivate::QWebPagePrivate):
+
+2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Build QtWebKit without benchmark tests for Qt < 4.5.
+ https://bugs.webkit.org/show_bug.cgi?id=27886
+
+ The QBENCHMARK macro is only available from 4.5 on,
+ so builds for Qt < 4.5 shouldn't try to build those.
+
+ * tests/tests.pro:
+
+2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Fix warning by migrating use of QString.sprintf(...) to
+ QString.arg().arg()...
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (dumpRange):
+
+2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Expose the Offline Web Application Cache in the Qt API.
+
+ * Api/qwebsettings.cpp:
+ (QWebSettings::QWebSettings):
+ (QWebSettings::setOfflineWebApplicationCachePath):
+ (QWebSettings::offlineWebApplicationCachePath):
+ (QWebSettings::setOfflineWebApplicationCacheQuota):
+ (QWebSettings::offlineWebApplicationCacheQuota):
+ * Api/qwebsettings.h:
+
+2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Add missing Q_OBJECT to class inheriting from QObject.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Fix indentation.
+
+ * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix documentation links to examples.
+
+ * Api/qwebview.cpp:
+
+2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Allocate MainWindow on heap in robotized QtLauncher as well.
+
+ * QtLauncher/main.cpp:
+ (main):
+
+2009-07-29 Kevin McCullough <kmccullough@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Added foundation work to allow a testing infrastructure for the Web
+ Inspector.
+
+ * WebCoreSupport/InspectorClientQt.cpp:
+ (WebCore::InspectorClientQt::inspectorWindowObjectCleared):
+ * WebCoreSupport/InspectorClientQt.h:
+
+2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] In debug mode, this fix frees cached resources
+ and other unreferenced objects (by calling the
+ garbage collector) to remove the LEAK messages.
+ https://bugs.webkit.org/show_bug.cgi?id=27767
+
+ * Api/qwebframe.cpp:
+ (qt_drt_cache_clear):
+ * QtLauncher/main.cpp:
+ (main):
+
+2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Fix the Qt build by adapting to the changes of ScriptObject.
+
+ * Api/qwebelement.cpp:
+ (setupScriptObject):
+
+2009-07-28 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ Add WebKit version API to Qt.
+
+ Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig
+ at compile time and make it available to Qt applications through
+ qWebKitVersion().
+
+ Also amend the User Agent string to place the Safari clause outside
+ the final bracket and to the end of the UA string.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27158
+
+ Minor build tweak by Simon Hausmann (adding export macros to new functions).
+
+ * Api/headers.pri:
+ * Api/qwebkitversion.cpp: Added.
+ (webKitVersion):
+ (webKitMajorVersion):
+ (webKitMinorVersion):
+ * Api/qwebkitversion.h: Added.
+ * Api/qwebpage.cpp:
+ (QWebPage::userAgentForUrl):
+ * tests/qwebview/tst_qwebview.cpp:
+ (tst_QWebView::getWebKitVersion):
+
2009-07-28 Simon Hausmann <simon.hausmann@nokia.com>
Rubber-stamped by Ariya Hidayat.
diff --git a/src/3rdparty/webkit/WebKit/qt/QGVLauncher/QGVLauncher.pro b/src/3rdparty/webkit/WebKit/qt/QGVLauncher/QGVLauncher.pro
new file mode 100644
index 0000000000..b883b5239f
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/QGVLauncher/QGVLauncher.pro
@@ -0,0 +1,13 @@
+TEMPLATE = app
+SOURCES += main.cpp
+CONFIG -= app_bundle
+CONFIG += uitools
+DESTDIR = ../../../bin
+
+include(../../../WebKit.pri)
+
+QT += network
+macx:QT+=xml
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267D0
diff --git a/src/3rdparty/webkit/WebKit/qt/QGVLauncher/main.cpp b/src/3rdparty/webkit/WebKit/qt/QGVLauncher/main.cpp
new file mode 100644
index 0000000000..9d4742ac31
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/QGVLauncher/main.cpp
@@ -0,0 +1,317 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
+ * Copyright (C) 2009 Kenneth Christiansen <kenneth@webkit.org>
+ * Copyright (C) 2009 Antonio Gomes <antonio.gomes@openbossa.org>
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <QDebug>
+#include <QFile>
+#include <QGraphicsScene>
+#include <QGraphicsView>
+#include <QGraphicsWidget>
+#include <QNetworkRequest>
+#include <QTextStream>
+#include <QVector>
+#include <QtGui>
+#include <QtNetwork/QNetworkProxy>
+#include <cstdio>
+#include <qwebelement.h>
+#include <qwebframe.h>
+#include <qwebgraphicsitem.h>
+#include <qwebpage.h>
+#include <qwebsettings.h>
+#include <qwebview.h>
+
+class WebPage : public QWebPage {
+ Q_OBJECT
+
+public:
+ WebPage(QWidget* parent = 0) : QWebPage(parent)
+ {
+ applyProxy();
+ }
+ virtual QWebPage* createWindow(QWebPage::WebWindowType);
+
+private:
+ void applyProxy();
+};
+
+class MainView : public QGraphicsView {
+ Q_OBJECT
+
+public:
+ MainView(QWidget* parent) : QGraphicsView(parent), m_mainWidget(0)
+ {
+ setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ }
+
+ void setMainWidget(QGraphicsWidget* widget)
+ {
+ QRectF rect(QRect(QPoint(0, 0), size()));
+ widget->setGeometry(rect);
+ m_mainWidget = widget;
+ }
+
+ void resizeEvent(QResizeEvent* event)
+ {
+ QGraphicsView::resizeEvent(event);
+ if (!m_mainWidget)
+ return;
+ QRectF rect(QPoint(0, 0), event->size());
+ m_mainWidget->setGeometry(rect);
+ }
+
+public slots:
+ void flip()
+ {
+#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QSizeF center = m_mainWidget->boundingRect().size() / 2;
+ QPointF centerPoint = QPointF(center.width(), center.height());
+ m_mainWidget->setTransformOriginPoint(centerPoint);
+
+ m_mainWidget->setRotation(m_mainWidget->rotation() ? 0 : 180);
+#endif
+ }
+
+private:
+ QGraphicsWidget* m_mainWidget;
+};
+
+class SharedScene : public QSharedData {
+public:
+ SharedScene()
+ {
+ m_scene = new QGraphicsScene;
+
+ m_item = new QWebGraphicsItem;
+ m_item->setPage(new WebPage());
+
+ m_scene->addItem(m_item);
+ m_scene->setActiveWindow(m_item);
+ }
+
+ ~SharedScene()
+ {
+ delete m_item;
+ delete m_scene;
+ }
+
+ QGraphicsScene* scene() const { return m_scene; }
+ QWebGraphicsItem* webItem() const { return m_item; }
+
+private:
+ QGraphicsScene* m_scene;
+ QWebGraphicsItem* m_item;
+};
+
+
+class MainWindow : public QMainWindow {
+ Q_OBJECT
+
+public:
+ MainWindow(QExplicitlySharedDataPointer<SharedScene> other)
+ : QMainWindow(), view(new MainView(this)), scene(other)
+ {
+ init();
+ }
+
+ MainWindow()
+ : QMainWindow(), view(new MainView(this)), scene(new SharedScene())
+ {
+ init();
+ }
+
+ void init()
+ {
+ setAttribute(Qt::WA_DeleteOnClose);
+
+ view->setScene(scene->scene());
+ view->setFrameShape(QFrame::NoFrame);
+ view->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ setCentralWidget(view);
+
+ view->setMainWidget(scene->webItem());
+
+ connect(scene->webItem(), SIGNAL(loadFinished()), this, SLOT(loadFinished()));
+ connect(scene->webItem(), SIGNAL(titleChanged(const QString&)), this, SLOT(setWindowTitle(const QString&)));
+ connect(scene->webItem()->page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));
+
+ resize(640, 480);
+ buildUI();
+ }
+
+ void load(const QString& url)
+ {
+ QUrl deducedUrl = guessUrlFromString(url);
+ if (!deducedUrl.isValid())
+ deducedUrl = QUrl("http://" + url + "/");
+
+ urlEdit->setText(deducedUrl.toEncoded());
+ scene->webItem()->load(deducedUrl);
+ scene->webItem()->setFocus(Qt::OtherFocusReason);
+ }
+
+ QUrl guessUrlFromString(const QString& string)
+ {
+ QString input(string);
+ QFileInfo fi(input);
+ if (fi.exists() && fi.isRelative())
+ input = fi.absoluteFilePath();
+
+ return QWebView::guessUrlFromString(input);
+ }
+
+ QWebPage* page() const
+ {
+ return scene->webItem()->page();
+ }
+
+protected slots:
+ void changeLocation()
+ {
+ load(urlEdit->text());
+ }
+
+ void loadFinished()
+ {
+ QUrl url = scene->webItem()->url();
+ urlEdit->setText(url.toString());
+
+ QUrl::FormattingOptions opts;
+ opts |= QUrl::RemoveScheme;
+ opts |= QUrl::RemoveUserInfo;
+ opts |= QUrl::StripTrailingSlash;
+ QString s = url.toString(opts);
+ s = s.mid(2);
+ if (s.isEmpty())
+ return;
+ //FIXME: something missing here
+ }
+
+public slots:
+ void newWindow(const QString &url = QString())
+ {
+ MainWindow* mw = new MainWindow();
+ mw->load(url);
+ mw->show();
+ }
+
+ void clone()
+ {
+ MainWindow* mw = new MainWindow(scene);
+ mw->show();
+ }
+
+ void flip()
+ {
+ view->flip();
+ }
+
+private:
+ void buildUI()
+ {
+ QWebPage* page = scene->webItem()->page();
+ urlEdit = new QLineEdit(this);
+ urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());
+ connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
+
+ QToolBar* bar = addToolBar("Navigation");
+ bar->addAction(page->action(QWebPage::Back));
+ bar->addAction(page->action(QWebPage::Forward));
+ bar->addAction(page->action(QWebPage::Reload));
+ bar->addAction(page->action(QWebPage::Stop));
+ bar->addWidget(urlEdit);
+
+ QMenu* fileMenu = menuBar()->addMenu("&File");
+ fileMenu->addAction("New Window", this, SLOT(newWindow()));
+ fileMenu->addAction("Clone view", this, SLOT(clone()));
+ fileMenu->addAction("Close", this, SLOT(close()));
+
+ QMenu* viewMenu = menuBar()->addMenu("&View");
+ viewMenu->addAction(page->action(QWebPage::Stop));
+ viewMenu->addAction(page->action(QWebPage::Reload));
+
+ QMenu* fxMenu = menuBar()->addMenu("&Effects");
+ fxMenu->addAction("Flip", this, SLOT(flip()));
+ }
+
+private:
+ MainView* view;
+ QExplicitlySharedDataPointer<SharedScene> scene;
+
+ QLineEdit* urlEdit;
+};
+
+QWebPage* WebPage::createWindow(QWebPage::WebWindowType)
+{
+ MainWindow* mw = new MainWindow;
+ mw->show();
+ return mw->page();
+}
+
+void WebPage::applyProxy()
+{
+ QUrl proxyUrl = QWebView::guessUrlFromString(qgetenv("http_proxy"));
+
+ if (proxyUrl.isValid() && !proxyUrl.host().isEmpty()) {
+ int proxyPort = (proxyUrl.port() > 0) ? proxyUrl.port() : 8080;
+ networkAccessManager()->setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, proxyUrl.host(), proxyPort));
+ }
+}
+
+int main(int argc, char** argv)
+{
+ QApplication app(argc, argv);
+ QString url = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
+
+ app.setApplicationName("GQVLauncher");
+
+ QWebSettings::setObjectCacheCapacities((16 * 1024 * 1024) / 8, (16 * 1024 * 1024) / 8, 16 * 1024 * 1024);
+ QWebSettings::setMaximumPagesInCache(4);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+
+ const QStringList args = app.arguments();
+ if (args.count() > 1)
+ url = args.at(1);
+
+ MainWindow* window = new MainWindow;
+ window->load(url);
+
+ for (int i = 2; i < args.count(); i++)
+ window->newWindow(args.at(i));
+
+ window->show();
+ return app.exec();
+}
+
+#include "main.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index d659833880..9a63e85956 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -45,6 +45,7 @@
#include "qwebframe_p.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
+#include "qwebview.h"
#include <qtooltip.h>
#include <qtextdocument.h>
@@ -307,8 +308,8 @@ void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, boo
{
// No double buffer, so only update the QWidget if content changed.
if (contentChanged) {
- QWidget* view = m_webPage->view();
- if (view) {
+ // Only do implicit paints for QWebView's
+ if (QWebView* view = qobject_cast<QWebView*>(m_webPage->view())) {
QRect rect(windowRect);
rect = rect.intersected(QRect(QPoint(0, 0), m_webPage->viewportSize()));
if (!rect.isEmpty())
@@ -323,8 +324,8 @@ void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, boo
void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&)
{
- QWidget* view = m_webPage->view();
- if (view)
+ // Only do implicit paints for QWebView's
+ if (QWebView* view = qobject_cast<QWebView*>(m_webPage->view()))
view->scroll(delta.width(), delta.height(), scrollViewRect);
emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect);
}
@@ -419,7 +420,7 @@ void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileC
option.parentFrame = QWebFramePrivate::kit(frame);
if (!fileChooser->filenames().isEmpty())
- for (int i = 0; i < fileChooser->filenames().size(); ++i)
+ for (unsigned i = 0; i < fileChooser->filenames().size(); ++i)
option.suggestedFileNames += fileChooser->filenames()[i];
QWebPage::ChooseMultipleFilesExtensionReturn output;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 96c7faba9b..7ea6a705c2 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -108,6 +108,7 @@ namespace WebCore {
virtual PlatformWidget platformWindow() const;
virtual void contentsSizeChanged(Frame*, const IntSize&) const;
+ virtual void scrollbarsModeDidChange() const { }
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
virtual void setToolTip(const String&, TextDirection);
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 6c31bd85d1..40833f2e9c 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -41,6 +41,7 @@
#include "FocusController.h"
#include "Frame.h"
#include "HTMLElement.h"
+#include "HTMLNames.h"
#include "KeyboardCodes.h"
#include "KeyboardEvent.h"
#include "NotImplemented.h"
@@ -84,17 +85,19 @@ static QString dumpRange(WebCore::Range *range)
{
if (!range)
return QLatin1String("(null)");
- QString str;
WebCore::ExceptionCode code;
- str.sprintf("range from %ld of %ls to %ld of %ls",
- range->startOffset(code), dumpPath(range->startContainer(code)).unicode(),
- range->endOffset(code), dumpPath(range->endContainer(code)).unicode());
+
+ QString str = QString("range from %1 of %2 to %3 of %4")
+ .arg(range->startOffset(code)).arg(dumpPath(range->startContainer(code)))
+ .arg(range->endOffset(code)).arg(dumpPath(range->endContainer(code)));
+
return str;
}
namespace WebCore {
+using namespace HTMLNames;
bool EditorClientQt::shouldDeleteRange(Range* range)
{
@@ -107,7 +110,7 @@ bool EditorClientQt::shouldDeleteRange(Range* range)
bool EditorClientQt::shouldShowDeleteInterface(HTMLElement* element)
{
if (QWebPagePrivate::drtRun)
- return element->className() == "needsDeletionUI";
+ return element->getAttribute(classAttr) == "needsDeletionUI";
return false;
}
@@ -592,10 +595,10 @@ bool EditorClientQt::isEditing() const
void EditorClientQt::setInputMethodState(bool active)
{
QWidget *view = m_page->view();
- if (view) {
+ if (view)
view->setAttribute(Qt::WA_InputMethodEnabled, active);
- emit m_page->microFocusChanged();
- }
+
+ emit m_page->microFocusChanged();
}
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 43ef08e97b..0c636f6d45 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -144,7 +144,7 @@ FrameLoaderClientQt::FrameLoaderClientQt()
, m_pluginView(0)
, m_hasSentResponseToPlugin(false)
, m_firstData(false)
- , m_loadSucceeded(false)
+ , m_loadError (ResourceError())
{
}
@@ -376,7 +376,7 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
if (dumpFrameLoaderCallbacks)
printf("%s - didFinishLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadSucceeded = true;
+ m_loadError = ResourceError(); // clears the previous error
if (!m_webFrame)
return;
@@ -461,7 +461,7 @@ void FrameLoaderClientQt::postProgressFinishedNotification()
}
if (m_webFrame && m_frame->page())
- emit loadFinished(m_loadSucceeded);
+ emit loadFinished(m_loadError.isNull());
}
void FrameLoaderClientQt::setMainFrameDocumentReady(bool b)
@@ -637,6 +637,16 @@ bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) cons
return true;
}
+void FrameLoaderClientQt::didDisplayInsecureContent()
+{
+ notImplemented();
+}
+
+void FrameLoaderClientQt::didRunInsecureContent(WebCore::SecurityOrigin*)
+{
+ notImplemented();
+}
+
void FrameLoaderClientQt::saveViewStateToItem(WebCore::HistoryItem* item)
{
QWebHistoryItem historyItem(new QWebHistoryItemPrivate(item));
@@ -850,20 +860,20 @@ void FrameLoaderClientQt::dispatchDidLoadResourceByXMLHttpRequest(unsigned long,
notImplemented();
}
-void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError&)
+void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError& error)
{
if (dumpFrameLoaderCallbacks)
printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadSucceeded = false;
+ m_loadError = error;
}
-void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError&)
+void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError& error)
{
if (dumpFrameLoaderCallbacks)
printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
- m_loadSucceeded = false;
+ m_loadError = error;
}
WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage()
@@ -946,7 +956,6 @@ void FrameLoaderClientQt::startDownload(const WebCore::ResourceRequest& request)
if (!m_webFrame)
return;
- QWebPage *page = m_webFrame->page();
emit m_webFrame->page()->downloadRequested(request.toNetworkRequest());
#endif
}
@@ -976,9 +985,6 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String
// ### set override encoding if we have one
- FrameLoadType loadType = m_frame->loader()->loadType();
- FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
-
frameData.frame->loader()->loadURLIntoChildFrame(frameData.url, frameData.referrer, frameData.frame.get());
// The frame's onload handler may have removed it from the document.
@@ -1087,12 +1093,12 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
QStringList values;
QString classid(element->getAttribute("classid"));
- for (int i = 0; i < paramNames.size(); ++i) {
+ for (unsigned i = 0; i < paramNames.size(); ++i) {
params.append(paramNames[i]);
if (paramNames[i] == "classid")
classid = paramValues[i];
}
- for (int i = 0; i < paramValues.size(); ++i)
+ for (unsigned i = 0; i < paramValues.size(); ++i)
values.append(paramValues[i]);
QString urlStr(url.string());
@@ -1110,7 +1116,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
if (!styleSheet.isEmpty())
styleSheet += QLatin1Char(';');
- for (int i = 0; i < numqStyleSheetProperties; ++i) {
+ for (unsigned i = 0; i < numqStyleSheetProperties; ++i) {
CSSPropertyID property = qstyleSheetProperties[i];
styleSheet += QString::fromLatin1(::getPropertyName(property));
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
index 754d8bc7c6..8a7e428fd2 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
@@ -148,6 +148,9 @@ namespace WebCore {
virtual void updateGlobalHistoryRedirectLinks();
virtual bool shouldGoToHistoryItem(HistoryItem*) const;
+ virtual void didDisplayInsecureContent();
+ virtual void didRunInsecureContent(SecurityOrigin*);
+
virtual ResourceError cancelledError(const ResourceRequest&);
virtual ResourceError blockedError(const ResourceRequest&);
virtual ResourceError cannotShowURLError(const ResourceRequest&);
@@ -211,7 +214,7 @@ namespace WebCore {
WebCore::PluginView* m_pluginView;
bool m_hasSentResponseToPlugin;
- bool m_loadSucceeded;
+ ResourceError m_loadError;
};
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index fe4d43ad62..ce08d42252 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "InspectorClientQt.h"
+#include "qwebinspector.h"
+#include "qwebinspector_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include "qwebview.h"
@@ -44,46 +46,24 @@
namespace WebCore {
-class InspectorClientWebPage : public QWebPage
-{
+class InspectorClientWebPage : public QWebPage {
Q_OBJECT
friend class InspectorClientQt;
public:
- QWebPage* createWindow(QWebPage::WebWindowType)
- {
- QWidget *w = new QWebView(0);
- QWebPage *page = new QWebPage(w);
- page->setView(w);
- connect(page, SIGNAL(destroyed()), w, SLOT(deleteLater()));
- return page;
- }
-
-Q_SIGNALS:
- void attachRequested();
- void detachRequested();
-};
-
-
-class InspectorClientView : public QWebView {
-public:
- InspectorClientView(InspectorController* controller)
- : QWebView(0)
- , m_controller(controller)
+ InspectorClientWebPage(QObject* parent = 0)
+ : QWebPage(parent)
{
- setPage(new InspectorClientWebPage);
- connect(page(), SIGNAL(destroyed()), SLOT(deleteLater()));
+ settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
}
-protected:
-
- void closeEvent(QCloseEvent* ev)
+ QWebPage* createWindow(QWebPage::WebWindowType)
{
- QWidget::closeEvent(ev);
- m_controller->setWindowVisible(false);
+ QWebView* view = new QWebView;
+ QWebPage* page = new QWebPage;
+ view->setPage(page);
+ view->setAttribute(Qt::WA_DeleteOnClose);
+ return page;
}
-
-private:
- InspectorController* m_controller;
};
@@ -98,14 +78,19 @@ void InspectorClientQt::inspectorDestroyed()
Page* InspectorClientQt::createPage()
{
- if (m_webPage)
- return m_webPage->d->page;
+ if (m_inspectorView)
+ return m_inspectorView->page()->d->page;
+
+ QWebView* inspectorView = new QWebView;
+ InspectorClientWebPage* inspectorPage = new InspectorClientWebPage(inspectorView);
+ inspectorView->setPage(inspectorPage);
+ m_inspectorView.set(inspectorView);
+
+ inspectorPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
+ m_inspectedWebPage->d->inspectorFrontend = inspectorView;
+ m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(inspectorView);
- InspectorClientView* view = new InspectorClientView(m_inspectedWebPage->d->page->inspectorController());
- m_webPage.set(qobject_cast<InspectorClientWebPage*>(view->page()));
- m_webPage->mainFrame()->load(QString::fromLatin1("qrc:/webkit/inspector/inspector.html"));
- m_webPage->view()->setMinimumSize(400,300);
- return m_webPage->d->page;
+ return m_inspectorView->page()->d->page;
}
String InspectorClientQt::localizedStringsURL()
@@ -122,44 +107,29 @@ String InspectorClientQt::hiddenPanels()
void InspectorClientQt::showWindow()
{
- if (!m_webPage)
- return;
-
updateWindowTitle();
- m_webPage->view()->show();
- m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(true);
-}
-
-void InspectorClientQt::closeWindow()
-{
- if (!m_webPage)
- return;
- m_webPage->view()->hide();
- m_inspectedWebPage->d->page->inspectorController()->setWindowVisible(false);
+ m_inspectedWebPage->d->inspectorController()->setWindowVisible(true, true);
+ // We don't allow the inspector to ask for widget visibility itself because showWindow is
+ // not always called when we want.
+ // Inspecting an element or calling QWebInspector::show() should already have made the
+ // widget visible.
}
-bool InspectorClientQt::windowVisible()
+void InspectorClientQt::closeWindow()
{
- if (!m_webPage)
- return false;
- return m_webPage->view()->isVisible();
+ if (m_inspectedWebPage->d->inspector)
+ m_inspectedWebPage->d->inspector->close();
}
void InspectorClientQt::attachWindow()
{
- if (!m_webPage)
- return;
-
- emit m_webPage->attachRequested();
+ notImplemented();
}
void InspectorClientQt::detachWindow()
{
- if (!m_webPage)
- return;
-
- emit m_webPage->detachRequested();
+ notImplemented();
}
void InspectorClientQt::setAttachedWindowHeight(unsigned height)
@@ -183,13 +153,18 @@ void InspectorClientQt::inspectedURLChanged(const String& newURL)
updateWindowTitle();
}
-void InspectorClientQt::updateWindowTitle()
+void InspectorClientQt::inspectorWindowObjectCleared()
{
- if (!m_webPage)
- return;
+ notImplemented();
+}
- QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2");
- m_webPage->view()->setWindowTitle(caption.arg(m_inspectedURL));
+void InspectorClientQt::updateWindowTitle()
+{
+ if (m_inspectedWebPage->d->inspector) {
+ QString caption = QCoreApplication::translate("QWebPage", "Web Inspector - %2").arg(m_inspectedURL);
+ m_inspectedWebPage->d->inspector->setWindowTitle(caption);
+ emit m_inspectedWebPage->d->inspector->windowTitleChanged(caption);
+ }
}
void InspectorClientQt::populateSetting(const String& key, InspectorController::Setting& setting)
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
index 60ed77a6b6..ccf8b69b46 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.h
@@ -35,12 +35,12 @@
#include <QtCore/QString>
class QWebPage;
+class QWebView;
namespace WebCore {
class Node;
class Page;
class String;
- class InspectorClientWebPage;
class InspectorClientQt : public InspectorClient {
public:
@@ -56,7 +56,6 @@ namespace WebCore {
virtual void showWindow();
virtual void closeWindow();
- virtual bool windowVisible();
virtual void attachWindow();
virtual void detachWindow();
@@ -71,10 +70,12 @@ namespace WebCore {
virtual void storeSetting(const String& key, const InspectorController::Setting&);
virtual void removeSetting(const String& key);
+ virtual void inspectorWindowObjectCleared();
+
private:
void updateWindowTitle();
QWebPage* m_inspectedWebPage;
- OwnPtr<InspectorClientWebPage> m_webPage;
+ OwnPtr<QWebView> m_inspectorView;
QString m_inspectedURL;
};
}
diff --git a/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
new file mode 100644
index 0000000000..0ba1cadaa6
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp
@@ -0,0 +1,17 @@
+
+void wrapInFunction()
+{
+
+//! [0]
+ // ...
+ QWebPage *page = new QWebPage;
+ // ...
+
+ QWebInspector *inspector = new QWebInspector;
+ inspector->setPage(page);
+
+ connect(page, SIGNAL(webInspectorTriggered(const QWebElement&)), inspector, SLOT(show()));
+//! [0]
+
+}
+
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
index dd0b88af47..ea2bc7950d 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebelement/qwebelement.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebelement.cpp
RESOURCES += qwebelement.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C3
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index e45e6dc203..a3e099bfdf 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebframe.cpp
RESOURCES += qwebframe.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C6
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index a3bcd20ca3..561087f684 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -33,6 +33,8 @@
#include <QRegExp>
#include <QNetworkRequest>
#include <QNetworkReply>
+#include <qsslerror.h>
+
//TESTED_CLASS=
//TESTED_FILES=
@@ -576,6 +578,9 @@ private slots:
void urlChange();
void domCycles();
void requestedUrl();
+ void javaScriptWindowObjectCleared_data();
+ void javaScriptWindowObjectCleared();
+ void javaScriptWindowObjectClearedOnEvaluate();
void setHtml();
void setHtmlWithResource();
void ipv6HostEncoding();
@@ -590,6 +595,7 @@ private slots:
void hasSetFocus();
void render();
void scrollPosition();
+ void evaluateWillCauseRepaint();
private:
QString evalJS(const QString&s) {
@@ -2167,56 +2173,70 @@ void tst_QWebFrame::domCycles()
class FakeReply : public QNetworkReply {
Q_OBJECT
- public:
- FakeReply(const QNetworkRequest& request, QObject* parent = 0)
- : QNetworkReply(parent)
- {
- setOperation(QNetworkAccessManager::GetOperation);
- setRequest(request);
- if (request.url() == QUrl("qrc:/test1.html")) {
- setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
- setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
- } else
- setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
-
- open(QIODevice::ReadOnly);
- QTimer::singleShot(0, this, SLOT(timeout()));
- }
- ~FakeReply()
- {
- close();
- }
- virtual void abort() {}
- virtual void close() {}
- protected:
- qint64 readData(char*, qint64)
- {
- return 0;
- }
- private slots:
- void timeout()
- {
- if (request().url() == QUrl("qrc://test1.html"))
- emit error(this->error());
- else if (request().url() == QUrl("http://abcdef.abcdef/"))
- emit metaDataChanged();
+public:
+ FakeReply(const QNetworkRequest& request, QObject* parent = 0)
+ : QNetworkReply(parent)
+ {
+ setOperation(QNetworkAccessManager::GetOperation);
+ setRequest(request);
+ if (request.url() == QUrl("qrc:/test1.html")) {
+ setHeader(QNetworkRequest::LocationHeader, QString("qrc:/test2.html"));
+ setAttribute(QNetworkRequest::RedirectionTargetAttribute, QUrl("qrc:/test2.html"));
+ } else if (request.url() == QUrl("qrc:/fake-ssl-error.html"))
+ setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error
+ else if (request.url() == QUrl("http://abcdef.abcdef/"))
+ setError(QNetworkReply::HostNotFoundError, tr("Invalid URL"));
- emit readyRead();
- emit finished();
- }
+ open(QIODevice::ReadOnly);
+ QTimer::singleShot(0, this, SLOT(timeout()));
+ }
+ ~FakeReply()
+ {
+ close();
+ }
+ virtual void abort() {}
+ virtual void close() {}
+
+protected:
+ qint64 readData(char*, qint64)
+ {
+ return 0;
+ }
+
+private slots:
+ void timeout()
+ {
+ if (request().url() == QUrl("qrc://test1.html"))
+ emit error(this->error());
+ else if (request().url() == QUrl("http://abcdef.abcdef/"))
+ emit metaDataChanged();
+ else if (request().url() == QUrl("qrc:/fake-ssl-error.html"))
+ return;
+
+ emit readyRead();
+ emit finished();
+ }
};
class FakeNetworkManager : public QNetworkAccessManager {
+ Q_OBJECT
+
public:
FakeNetworkManager(QObject* parent) : QNetworkAccessManager(parent) { }
protected:
virtual QNetworkReply* createRequest(Operation op, const QNetworkRequest& request, QIODevice* outgoingData)
{
- if (op == QNetworkAccessManager::GetOperation
- && (request.url().toString() == "qrc:/test1.html"
- || request.url().toString() == "http://abcdef.abcdef/"))
- return new FakeReply(request, this);
+ QString url = request.url().toString();
+ if (op == QNetworkAccessManager::GetOperation)
+ if (url == "qrc:/test1.html" || url == "http://abcdef.abcdef/")
+ return new FakeReply(request, this);
+ else if (url == "qrc:/fake-ssl-error.html") {
+ FakeReply* reply = new FakeReply(request, this);
+ QList<QSslError> errors;
+ emit sslErrors(reply, errors << QSslError(QSslError::UnspecifiedError));
+ return reply;
+ }
return QNetworkAccessManager::createRequest(op, request, outgoingData);
}
@@ -2249,6 +2269,50 @@ void tst_QWebFrame::requestedUrl()
QCOMPARE(spy.count(), 3);
QCOMPARE(frame->requestedUrl(), QUrl("http://abcdef.abcdef/"));
QCOMPARE(frame->url(), QUrl("http://abcdef.abcdef/"));
+
+ qRegisterMetaType<QList<QSslError> >("QList<QSslError>");
+ qRegisterMetaType<QNetworkReply* >("QNetworkReply*");
+
+ QSignalSpy spy2(page.networkAccessManager(), SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)));
+ frame->setUrl(QUrl("qrc:/fake-ssl-error.html"));
+ QTest::qWait(200);
+ QCOMPARE(spy2.count(), 1);
+ QCOMPARE(frame->requestedUrl(), QUrl("qrc:/fake-ssl-error.html"));
+ QCOMPARE(frame->url(), QUrl("qrc:/fake-ssl-error.html"));
+}
+
+void tst_QWebFrame::javaScriptWindowObjectCleared_data()
+{
+ QTest::addColumn<QString>("html");
+ QTest::addColumn<int>("signalCount");
+ QTest::newRow("with <script>") << "<html><body><script></script><p>hello world</p></body></html>" << 1;
+ QTest::newRow("without <script>") << "<html><body><p>hello world</p></body></html>" << 0;
+}
+
+void tst_QWebFrame::javaScriptWindowObjectCleared()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
+ QFETCH(QString, html);
+ frame->setHtml(html);
+
+ QFETCH(int, signalCount);
+ QCOMPARE(spy.count(), signalCount);
+}
+
+void tst_QWebFrame::javaScriptWindowObjectClearedOnEvaluate()
+{
+ QWebPage page;
+ QWebFrame* frame = page.mainFrame();
+ QSignalSpy spy(frame, SIGNAL(javaScriptWindowObjectCleared()));
+ frame->setHtml("<html></html>");
+ QCOMPARE(spy.count(), 0);
+ frame->evaluateJavaScript("var a = 'a';");
+ QCOMPARE(spy.count(), 1);
+ // no new clear for a new script:
+ frame->evaluateJavaScript("var a = 1;");
+ QCOMPARE(spy.count(), 1);
}
void tst_QWebFrame::setHtml()
@@ -2643,5 +2707,24 @@ void tst_QWebFrame::scrollPosition()
QCOMPARE(y, 29);
}
+void tst_QWebFrame::evaluateWillCauseRepaint()
+{
+ QWebView view;
+ QString html("<html><body>top<div id=\"junk\" style=\"display: block;\">"
+ "junk</div>bottom</body></html>");
+ view.setHtml(html);
+ view.show();
+
+ QTest::qWait(200);
+
+ view.page()->mainFrame()->evaluateJavaScript(
+ "document.getElementById('junk').style.display = 'none';");
+
+ ::waitForSignal(view.page(), SIGNAL(repaintRequested( const QRect &)));
+
+ QTest::qWait(2000);
+}
+
+
QTEST_MAIN(tst_QWebFrame)
#include "tst_qwebframe.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
index fd1074c9a2..55ed4144fe 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/qwebhistory.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebhistory.cpp
RESOURCES += tst_qwebhistory.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C4
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 5b55613b08..ec7a040d16 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -58,6 +58,11 @@ private slots:
void saveAndRestore_1(); //simple checks saveState and restoreState
void saveAndRestore_2(); //bad parameters saveState and restoreState
void saveAndRestore_3(); //try use different version
+ void saveAndRestore_crash_1();
+ void saveAndRestore_crash_2();
+ void saveAndRestore_crash_3();
+ void clear();
+
private:
QWebPage* page;
@@ -119,6 +124,8 @@ void tst_QWebHistory::back()
hist->back();
waitForLoadFinished.exec();
}
+ //try one more time (too many). crash test
+ hist->back();
}
/**
@@ -137,6 +144,8 @@ void tst_QWebHistory::forward()
hist->forward();
waitForLoadFinished.exec();
}
+ //try one more time (too many). crash test
+ hist->forward();
}
/**
@@ -322,5 +331,63 @@ void tst_QWebHistory::saveAndRestore_3()
QVERIFY(hist->itemAt(3).isValid());
}
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_1()
+{
+ QByteArray tmp = hist->saveState();
+ for (unsigned i = 0; i < 5; i++){
+ hist->restoreState(tmp);
+ hist->saveState();
+ }
+}
+
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_2()
+{
+ QByteArray tmp = hist->saveState();
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist2 = page2->history();
+ for (unsigned i = 0; i < 5; i++){
+ hist2->restoreState(tmp);
+ hist2->saveState();
+ }
+ delete page2;
+}
+
+/** The test shouldn't crash */
+void tst_QWebHistory::saveAndRestore_crash_3()
+{
+ QByteArray tmp = hist->saveState();
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist1 = hist;
+ QWebHistory* hist2 = page2->history();
+ for (unsigned i = 0; i < 5; i++){
+ hist1->restoreState(tmp);
+ hist2->restoreState(tmp);
+ QVERIFY(hist1->count() == hist2->count());
+ QVERIFY(hist1->count() == histsize);
+ hist2->back();
+ tmp = hist2->saveState();
+ hist2->clear();
+ }
+ delete page2;
+}
+
+/** ::clear */
+void tst_QWebHistory::clear()
+{
+ hist->saveState();
+ QVERIFY(hist->count() > 1);
+ hist->clear();
+ QVERIFY(hist->count() == 1); //leave current item
+
+ QWebPage* page2 = new QWebPage(this);
+ QWebHistory* hist2 = page2->history();
+ QVERIFY(hist2->count() == 0);
+ hist2->clear();
+ QVERIFY(hist2->count() == 0); //do not change anything
+ delete page2;
+}
+
QTEST_MAIN(tst_QWebHistory)
#include "tst_qwebhistory.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
index af3b348615..011869d4d7 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebhistoryinterface/qwebhistoryinterface.pro
@@ -4,3 +4,5 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebhistoryinterface.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C5
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 2f3a108972..e4b11c2b5f 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -5,3 +5,5 @@ SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C7
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 966f049927..121d7cb16c 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -110,6 +110,9 @@ private slots:
void frameAt();
void requestCache();
void protectBindingsRuntimeObjectsFromCollector();
+ void localURLSchemes();
+ void testOptionalJSObjects();
+ void testEnablePersistentStorage();
private:
@@ -405,6 +408,10 @@ void tst_QWebPage::database()
QWebSettings::setOfflineStorageDefaultQuota(1024 * 1024);
QVERIFY(QWebSettings::offlineStorageDefaultQuota() == 1024 * 1024);
+ m_page->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ m_page->settings()->setAttribute(QWebSettings::SessionStorageEnabled, true);
+ m_page->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
+
QString dbFileName = path + "Databases.db";
if (QFile::exists(dbFileName))
@@ -627,7 +634,6 @@ void tst_QWebPage::createViewlessPlugin()
// import private API
void QWEBKIT_EXPORT qt_webpage_setGroupName(QWebPage* page, const QString& groupName);
QString QWEBKIT_EXPORT qt_webpage_groupName(QWebPage* page);
-void QWEBKIT_EXPORT qt_websettings_setLocalStorageDatabasePath(QWebSettings* settings, const QString& path);
void tst_QWebPage::multiplePageGroupsAndLocalStorage()
{
@@ -638,9 +644,11 @@ void tst_QWebPage::multiplePageGroupsAndLocalStorage()
QWebView view1;
QWebView view2;
- qt_websettings_setLocalStorageDatabasePath(view1.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
+ view1.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ view1.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path1"));
qt_webpage_setGroupName(view1.page(), "group1");
- qt_websettings_setLocalStorageDatabasePath(view2.page()->settings(), QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
+ view2.page()->settings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
+ view2.page()->settings()->setLocalStoragePath(QDir::toNativeSeparators(QDir::currentPath() + "/path2"));
qt_webpage_setGroupName(view2.page(), "group2");
QCOMPARE(qt_webpage_groupName(view1.page()), QString("group1"));
QCOMPARE(qt_webpage_groupName(view2.page()), QString("group2"));
@@ -1190,5 +1198,81 @@ void tst_QWebPage::protectBindingsRuntimeObjectsFromCollector()
newPage->mainFrame()->evaluateJavaScript("testme('bar')");
}
+void tst_QWebPage::localURLSchemes()
+{
+ int i = QWebSecurityOrigin::localSchemes().size();
+ QWebSecurityOrigin::removeLocalScheme("file");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QWebSecurityOrigin::addLocalScheme("file");
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QString myscheme = "myscheme";
+ QWebSecurityOrigin::addLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i + 1);
+ QVERIFY(QWebSecurityOrigin::localSchemes().contains(myscheme));
+ QWebSecurityOrigin::removeLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+ QWebSecurityOrigin::removeLocalScheme(myscheme);
+ QTRY_COMPARE(QWebSecurityOrigin::localSchemes().size(), i);
+}
+
+static inline bool testFlag(QWebPage& webPage, QWebSettings::WebAttribute settingAttribute, const QString& jsObjectName, bool settingValue)
+{
+ webPage.settings()->setAttribute(settingAttribute, settingValue);
+ return webPage.mainFrame()->evaluateJavaScript(QString("(window.%1 != undefined)").arg(jsObjectName)).toBool();
+}
+
+void tst_QWebPage::testOptionalJSObjects()
+{
+ // Once a feature is enabled and the JS object is accessed turning off the setting will not turn off
+ // the visibility of the JS object any more. For this reason this test uses two QWebPage instances.
+ // Part of the test is to make sure that the QWebPage instances do not interfere with each other so turning on
+ // a feature for one instance will not turn it on for another.
+
+ QWebPage webPage1;
+ QWebPage webPage2;
+
+ webPage1.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl());
+ webPage2.currentFrame()->setHtml(QString("<html><body>test</body></html>"), QUrl());
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::OfflineWebApplicationCacheEnabled, "applicationCache", false), true);
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::LocalStorageEnabled, "localStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::LocalStorageEnabled, "localStorage", false), true);
+
+ QCOMPARE(testFlag(webPage1, QWebSettings::SessionStorageEnabled, "sessionStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::SessionStorageEnabled, "sessionStorage", true), true);
+ QCOMPARE(testFlag(webPage1, QWebSettings::SessionStorageEnabled, "sessionStorage", false), false);
+ QCOMPARE(testFlag(webPage2, QWebSettings::SessionStorageEnabled, "sessionStorage", false), true);
+}
+
+void tst_QWebPage::testEnablePersistentStorage()
+{
+ QWebPage webPage;
+
+ // By default all persistent options should be disabled
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), false);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), false);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), false);
+ QVERIFY(webPage.settings()->iconDatabasePath().isEmpty());
+
+ QWebSettings::enablePersistentStorage();
+
+ // Give it some time to initialize - icon database needs it
+ QTest::qWait(1000);
+
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::LocalStorageEnabled), true);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled), true);
+ QCOMPARE(webPage.settings()->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled), true);
+
+ QVERIFY(!webPage.settings()->offlineStoragePath().isEmpty());
+ QVERIFY(!webPage.settings()->offlineWebApplicationCachePath().isEmpty());
+ QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
new file mode 100644
index 0000000000..5d10993e1c
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/qwebplugindatabase.pro
@@ -0,0 +1,6 @@
+TEMPLATE = app
+TARGET = tst_qwebplugindatabase
+include(../../../../WebKit.pri)
+SOURCES += tst_qwebplugindatabase.cpp
+QT += testlib network
+QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
new file mode 100644
index 0000000000..1ee6206c54
--- /dev/null
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebplugindatabase/tst_qwebplugindatabase.cpp
@@ -0,0 +1,437 @@
+/*
+ Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <QtTest/QtTest>
+
+#include <qdir.h>
+#include <qwebframe.h>
+#include <qwebpage.h>
+#include <qwebplugindatabase.h>
+#include <qwebsettings.h>
+#include <qvariant.h>
+
+class tst_QWebPluginDatabase : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void installedPlugins();
+ void searchPaths();
+ void null_data();
+ void null();
+ void pluginForMimeType();
+ void enabled();
+ void operatorequal_data();
+ void operatorequal();
+ void preferredPlugin();
+ void operatorassign_data();
+ void operatorassign();
+};
+
+typedef QWebPluginInfo::MimeType MimeType;
+
+void tst_QWebPluginDatabase::installedPlugins()
+{
+ QWebPage page;
+ page.settings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebFrame* frame = page.mainFrame();
+
+ QVariantMap jsPluginsMap = frame->evaluateJavaScript("window.navigator.plugins").toMap();
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ QCOMPARE(plugins, QWebSettings::pluginDatabase()->plugins());
+
+ int length = jsPluginsMap["length"].toInt();
+ QCOMPARE(length, plugins.count());
+
+ for (int i = 0; i < length; ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QVariantMap jsPlugin = frame->evaluateJavaScript(QString("window.navigator.plugins[%1]").arg(i)).toMap();
+ QString name = jsPlugin["name"].toString();
+ QString description = jsPlugin["description"].toString();
+ QString fileName = jsPlugin["filename"].toString();
+
+ QCOMPARE(plugin.name(), name);
+ QCOMPARE(plugin.description(), description);
+ QCOMPARE(QFileInfo(plugin.path()).fileName(), fileName);
+
+ QList<MimeType> mimeTypes;
+ int mimeTypesCount = jsPlugin["length"].toInt();
+
+ for (int j = 0; j < mimeTypesCount; ++j) {
+ QVariantMap jsMimeType = frame->evaluateJavaScript(QString("window.navigator.plugins[%1][%2]").arg(i).arg(j)).toMap();
+
+ MimeType mimeType;
+ mimeType.name = jsMimeType["type"].toString();
+ mimeType.description = jsMimeType["description"].toString();
+ mimeType.fileExtensions = jsMimeType["suffixes"].toString().split(',', QString::SkipEmptyParts);
+
+ mimeTypes.append(mimeType);
+ QVERIFY(plugin.supportsMimeType(mimeType.name));
+ }
+
+ QCOMPARE(plugin.mimeTypes(), mimeTypes);
+
+ QVERIFY(!plugin.isNull());
+ QVERIFY(plugin.isEnabled());
+ }
+}
+
+void tst_QWebPluginDatabase::searchPaths()
+{
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+ QStringList directories = database->searchPaths();
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+
+ database->setSearchPaths(directories);
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), directories);
+ QCOMPARE(database->plugins(), plugins);
+ database->refresh();
+ QCOMPARE(database->plugins(), plugins);
+
+ database->setSearchPaths(QStringList());
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), QStringList());
+ QCOMPARE(database->plugins().count(), 0);
+
+ database->setSearchPaths(directories);
+ QCOMPARE(database->searchPaths(), directories);
+ database->addSearchPath(QDir::tempPath());
+ QCOMPARE(database->searchPaths().count(), directories.count() + 1);
+ QVERIFY(database->searchPaths().contains(QDir::tempPath()));
+ directories.append(QDir::tempPath());
+ QCOMPARE(database->searchPaths(), directories);
+
+ // As an empty set of search paths has been set, the database has been rebuilt
+ // from scratch after bringing the old path set back.
+ // Because the QWebPlugins no longer point to the same PluginPackages,
+ // the list is also no longer equal to the older one, even though it contains
+ // the same information.
+ QCOMPARE(database->plugins().count(), plugins.count());
+ plugins = database->plugins();
+ QCOMPARE(database->plugins(), plugins);
+
+ for (int i = (directories.count() - 1); i >= 0; --i) {
+ QDir directory(directories.at(i));
+ if (!directory.exists() || !directory.count())
+ directories.removeAt(i);
+ }
+
+ database->setSearchPaths(directories);
+ QCOMPARE(database->plugins(), plugins);
+ database->refresh();
+ QCOMPARE(database->plugins(), plugins);
+
+ database->setSearchPaths(QWebPluginDatabase::defaultSearchPaths());
+ directories = QWebPluginDatabase::defaultSearchPaths();
+ QCOMPARE(QWebPluginDatabase::defaultSearchPaths(), directories);
+ QCOMPARE(database->searchPaths(), directories);
+ QCOMPARE(database->plugins(), plugins);
+}
+
+Q_DECLARE_METATYPE(QWebPluginInfo)
+void tst_QWebPluginDatabase::null_data()
+{
+ QTest::addColumn<QWebPluginInfo>("plugin");
+ QTest::addColumn<bool>("null");
+
+ QTest::newRow("null") << QWebPluginInfo() << true;
+ QTest::newRow("foo") << QWebSettings::pluginDatabase()->pluginForMimeType("foobarbaz") << true;
+
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ for (int i = 0; i < plugins.count(); ++i)
+ QTest::newRow(QString::number(i).toUtf8().constData()) << plugins.at(i) << false;
+}
+
+void tst_QWebPluginDatabase::null()
+{
+ QFETCH(QWebPluginInfo, plugin);
+ QFETCH(bool, null);
+
+ QCOMPARE(plugin.isNull(), null);
+}
+
+void tst_QWebPluginDatabase::pluginForMimeType()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ }
+ }
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+
+ QVERIFY(pluginsMap.count(mimeType) > 0);
+ if (pluginsMap.count(mimeType) > 1)
+ continue;
+
+ QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType);
+ QCOMPARE(pluginForMimeType, plugin);
+ database->setSearchPaths(database->searchPaths());
+ QCOMPARE(pluginForMimeType, plugin);
+ QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toUpper()));
+ QCOMPARE(pluginForMimeType, database->pluginForMimeType(mimeType.toLower()));
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ QVERIFY(!pluginForMimeType.isNull());
+ QVERIFY(!plugin.isNull());
+ }
+ }
+}
+
+void tst_QWebPluginDatabase::enabled()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ }
+ }
+
+ QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin();
+ while (it != pluginsMap.end()) {
+ QString mimeType = it.key();
+ QWebPluginInfo plugin = it.value();
+ QWebPluginInfo pluginForMimeType = database->pluginForMimeType(mimeType);
+
+ QVERIFY(pluginsMap.count(mimeType) > 0);
+
+ if (pluginsMap.count(mimeType) == 1) {
+ QCOMPARE(plugin, pluginForMimeType);
+
+ QVERIFY(plugin.isEnabled());
+ QVERIFY(pluginForMimeType.isEnabled());
+ plugin.setEnabled(false);
+ QVERIFY(!plugin.isEnabled());
+ QVERIFY(!pluginForMimeType.isEnabled());
+ } else {
+ QVERIFY(plugin.isEnabled());
+ QVERIFY(pluginForMimeType.isEnabled());
+ plugin.setEnabled(false);
+ QVERIFY(!plugin.isEnabled());
+ }
+
+ QVERIFY(!plugin.isNull());
+ QVERIFY(!pluginForMimeType.isNull());
+
+ QWebPluginInfo pluginForMimeType2 = database->pluginForMimeType(mimeType);
+ if (pluginsMap.count(mimeType) == 1) {
+ QVERIFY(pluginForMimeType2 != plugin);
+ QVERIFY(pluginForMimeType2.isNull());
+ } else {
+ QVERIFY(pluginForMimeType2 != plugin);
+ QVERIFY(!pluginForMimeType2.isNull());
+ }
+
+ plugin.setEnabled(true);
+
+ ++it;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorequal_data()
+{
+ QTest::addColumn<QWebPluginInfo>("first");
+ QTest::addColumn<QWebPluginInfo>("second");
+ QTest::addColumn<bool>("equal");
+
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo() << true;
+ QTest::newRow("application/x-shockwave-flash") << database->pluginForMimeType("application/x-shockwave-flash")
+ << database->pluginForMimeType("application/x-shockwave-flash") << true;
+ QTest::newRow("foo/bar-baz") << database->pluginForMimeType("foo/bar-baz")
+ << database->pluginForMimeType("foo/bar-baz") << true;
+
+ QList<QWebPluginInfo> plugins = database->plugins();
+ for (int i = 0; i < (plugins.count() - 1); ++i) {
+ QWebPluginInfo first = plugins.at(i);
+ QWebPluginInfo second = plugins.at(i + 1);
+
+ QTest::newRow(QString("%1==%2").arg(first.name(), second.name()).toUtf8().constData())
+ << first << second << false;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorequal()
+{
+ QFETCH(QWebPluginInfo, first);
+ QFETCH(QWebPluginInfo, second);
+ QFETCH(bool, equal);
+
+ QCOMPARE(first == second, equal);
+}
+
+void tst_QWebPluginDatabase::preferredPlugin()
+{
+ QMultiMap<QString, QWebPluginInfo> pluginsMap;
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QList<QWebPluginInfo> plugins = database->plugins();
+
+ for (int i = 0; i < plugins.count(); ++i) {
+ QWebPluginInfo plugin = plugins.at(i);
+
+ QList<MimeType> mimeTypes = plugin.mimeTypes();
+ for (int j = 0; j < mimeTypes.count(); ++j) {
+ QString mimeType = mimeTypes.at(j).name;
+ pluginsMap.insert(mimeType, plugin);
+ }
+ }
+
+ QMultiMap<QString, QWebPluginInfo>::iterator it = pluginsMap.begin();
+ while (it != pluginsMap.end()) {
+ QString mimeType = it.key();
+
+ if (pluginsMap.count(mimeType) > 1) {
+ QList<QWebPluginInfo> pluginsForMimeType = pluginsMap.values(mimeType);
+ QWebPluginInfo plugin = database->pluginForMimeType(mimeType);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+
+ pluginsForMimeType.removeAll(plugin);
+ for (int i = 0; i < pluginsForMimeType.count(); ++i) {
+ QWebPluginInfo anotherPlugin = pluginsForMimeType.at(i);
+ QVERIFY(plugin.supportsMimeType(mimeType));
+ QVERIFY(plugin != anotherPlugin);
+
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ database->setPreferredPluginForMimeType(mimeType, anotherPlugin);
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+
+ anotherPlugin.setEnabled(false);
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+
+ anotherPlugin.setEnabled(true);
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+ database->setSearchPaths(database->searchPaths());
+ QCOMPARE(database->pluginForMimeType(mimeType), anotherPlugin);
+
+ database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo());
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ }
+ } else {
+ QWebPluginInfo plugin = database->pluginForMimeType(mimeType);
+ QCOMPARE(pluginsMap.value(mimeType), plugin);
+
+ database->setPreferredPluginForMimeType(mimeType, plugin);
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+
+ plugin.setEnabled(false);
+ QCOMPARE(database->pluginForMimeType(mimeType), QWebPluginInfo());
+ plugin.setEnabled(true);
+
+ database->setPreferredPluginForMimeType(mimeType, QWebPluginInfo());
+ QCOMPARE(database->pluginForMimeType(mimeType), plugin);
+ }
+
+ ++it;
+ }
+
+ if (pluginsMap.keys().count() >= 2) {
+ QStringList mimeTypes = pluginsMap.uniqueKeys();
+
+ QString mimeType1 = mimeTypes.at(0);
+ QString mimeType2 = mimeTypes.at(1);
+ QWebPluginInfo plugin1 = database->pluginForMimeType(mimeType1);
+ QWebPluginInfo plugin2 = database->pluginForMimeType(mimeType2);
+
+ int i = 2;
+ while (plugin2.supportsMimeType(mimeType1)
+ && !mimeType2.isEmpty()
+ && i < mimeTypes.count()) {
+ mimeType2 = mimeTypes.at(i);
+ plugin2 = database->pluginForMimeType(mimeType2);
+ ++i;
+ }
+
+ plugin1 = database->pluginForMimeType(mimeType1);
+ QVERIFY(plugin1.supportsMimeType(mimeType1));
+ QVERIFY(!plugin1.isNull());
+ plugin2 = database->pluginForMimeType(mimeType2);
+ QVERIFY(plugin2.supportsMimeType(mimeType2));
+ QVERIFY(!plugin2.isNull());
+
+ database->setPreferredPluginForMimeType(mimeType2, plugin1);
+ QVERIFY(!plugin1.supportsMimeType(mimeType2));
+ QCOMPARE(database->pluginForMimeType(mimeType2), plugin2);
+
+ database->setPreferredPluginForMimeType(mimeType1, plugin1);
+ QVERIFY(!plugin2.supportsMimeType(mimeType1));
+ QCOMPARE(database->pluginForMimeType(mimeType2), plugin2);
+ }
+}
+
+void tst_QWebPluginDatabase::operatorassign_data()
+{
+ QTest::addColumn<QWebPluginInfo>("first");
+ QTest::addColumn<QWebPluginInfo>("second");
+
+ QWebPluginDatabase* database = QWebSettings::pluginDatabase();
+ QTest::newRow("null") << QWebPluginInfo() << QWebPluginInfo();
+
+ QList<QWebPluginInfo> plugins = database->plugins();
+ for (int i = 0; i < (plugins.count() - 1); ++i) {
+ QWebPluginInfo first = plugins.at(i);
+ QWebPluginInfo second = plugins.at(i + 1);
+
+ QTest::newRow(QString("%1=%2").arg(first.name(), second.name()).toUtf8().constData()) << first << second;
+ }
+}
+
+void tst_QWebPluginDatabase::operatorassign()
+{
+ QFETCH(QWebPluginInfo, first);
+ QFETCH(QWebPluginInfo, second);
+
+ QWebPluginInfo info;
+ QCOMPARE(info.mimeTypes(), QList<MimeType>());
+ QCOMPARE(info = first, first);
+ QCOMPARE(info, first);
+ QCOMPARE(info.mimeTypes(), first.mimeTypes());
+ QCOMPARE(info = second, second);
+ QCOMPARE(info, second);
+ QCOMPARE(info.mimeTypes(), second.mimeTypes());
+ QCOMPARE(info = QWebPluginInfo(), QWebPluginInfo());
+ QCOMPARE(info.mimeTypes(), QList<MimeType>());
+}
+
+QTEST_MAIN(tst_QWebPluginDatabase)
+
+#include "tst_qwebplugindatabase.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
index 799ccfb32e..b7e0fb1cbd 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/qwebview.pro
@@ -4,3 +4,5 @@ include(../../../../WebKit.pri)
SOURCES += tst_qwebview.cpp
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+
+symbian:TARGET.UID3 = 0x200267C8
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
index 6501bfc3e7..01d0e9295e 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebview/tst_qwebview.cpp
@@ -25,6 +25,7 @@
#include <qwebpage.h>
#include <qnetworkrequest.h>
#include <qdiriterator.h>
+#include <qwebkitversion.h>
class tst_QWebView : public QObject
{
@@ -40,6 +41,7 @@ private slots:
void renderHints();
void guessUrlFromString_data();
void guessUrlFromString();
+ void getWebKitVersion();
};
// This will be called before the first test function is executed.
@@ -160,6 +162,11 @@ void tst_QWebView::guessUrlFromString()
QCOMPARE(url, guessUrlFromString);
}
+void tst_QWebView::getWebKitVersion()
+{
+ QVERIFY(qWebKitVersion().toDouble() > 0);
+}
+
QTEST_MAIN(tst_QWebView)
#include "tst_qwebview.moc"
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
index 7000d32f08..b5f66eeddf 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/tests.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS = qwebframe qwebpage qwebelement qwebhistoryinterface qwebview qwebhistory
-SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro
+SUBDIRS = qwebframe qwebpage qwebelement qwebhistoryinterface qwebplugindatabase qwebview qwebhistory
+greaterThan(QT_MINOR_VERSION, 4): SUBDIRS += benchmarks/painting/tst_painting.pro benchmarks/loading/tst_loading.pro