summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/Api
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-09-18 08:35:59 (GMT)
committerJocelyn Turcotte <jocelyn.turcotte@nokia.com>2009-09-18 08:38:07 (GMT)
commitef310719ef42cd09e2542fce96c529b5657bf167 (patch)
treec691bab10518e479ce40d4cac6c79daa312fce87 /src/3rdparty/webkit/WebKit/qt/Api
parent5b828316abb0ad1a33cdc11ebac0999d9b79576a (diff)
downloadQt-ef310719ef42cd09e2542fce96c529b5657bf167.zip
Qt-ef310719ef42cd09e2542fce96c529b5657bf167.tar.gz
Qt-ef310719ef42cd09e2542fce96c529b5657bf167.tar.bz2
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/Api')
-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
27 files changed, 2409 insertions, 185 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/headers.pri b/src/3rdparty/webkit/WebKit/qt/Api/headers.pri
index d92eb1c..51abba4 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 57c8b0d..ff086f6 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 bc6f8a9..5f4870c 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 f2fe108..fe813b8 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 d6afc01..632f83a 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 0000000..be8f6ab
--- /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 0000000..223ac42
--- /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 b11ae56..b57272d 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 e77adef..809d405 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 0000000..5a66cc6
--- /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 0000000..bb5bd64
--- /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 0000000..b7af4f8
--- /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 0000000..062839f
--- /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 0000000..f0fbef0
--- /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 7860cec..98c0770 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 24741a1..aecd860 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 87c624d..f765f98 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 0000000..a3781e6
--- /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 0000000..b22c3de
--- /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 8506099..e63ba41 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 cff774d..4a06b59 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 ed2e959..45c49c6 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 3cfb0f4..94b96f0 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 89595c3..e99ebbf 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 63144cb..4790823 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 422b5e6..d12de94 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 e886144..0f2649d 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