diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-09 09:42:44 +0100 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-09 09:42:44 +0100 |
| commit | a59391482883479a9b28a6f1ace6d1ebd08a7ecd (patch) | |
| tree | fa539db054a20a67bff2fc891c33b0f4ec632916 /Source/WebKit/qt | |
| parent | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (diff) | |
| download | qtwebkit-a59391482883479a9b28a6f1ace6d1ebd08a7ecd.tar.gz | |
Imported WebKit commit 7bcdfab9a40db7d16b4b95bb77d78b8a59c9e701 (http://svn.webkit.org/repository/webkit/trunk@134025)
New snapshot with numerious build fixes, including MSVC 2012 and ARM Thumb-2.
Diffstat (limited to 'Source/WebKit/qt')
| -rw-r--r-- | Source/WebKit/qt/Api/qwebpage.cpp | 32 | ||||
| -rw-r--r-- | Source/WebKit/qt/Api/qwebpage.h | 2 | ||||
| -rw-r--r-- | Source/WebKit/qt/ChangeLog | 45 | ||||
| -rw-r--r-- | Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp | 63 |
4 files changed, 100 insertions, 42 deletions
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp index c2c9823f9..ade496fa4 100644 --- a/Source/WebKit/qt/Api/qwebpage.cpp +++ b/Source/WebKit/qt/Api/qwebpage.cpp @@ -253,6 +253,8 @@ static const char* editorCommandWebActions[] = 0, // CopyImageUrlToClipboard, + 0, // OpenLinkInThisWindow, + 0 // WebActionCount }; @@ -376,11 +378,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq) QWebPagePrivate::~QWebPagePrivate() { - if (inspector && inspectorIsInternalOnly) { - // Since we have to delete an internal inspector, - // call setInspector(0) directly to prevent potential crashes - setInspector(0); - } #ifndef QT_NO_CONTEXTMENU delete currentContextMenu.data(); #endif @@ -390,8 +387,13 @@ QWebPagePrivate::~QWebPagePrivate() delete settings; delete page; - if (inspector) - inspector->setPage(0); + if (inspector) { + // If the inspector is ours, delete it, otherwise just detach from it. + if (inspectorIsInternalOnly) + delete inspector; + else + inspector->setPage(0); + } #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) NotificationPresenterClientQt::notificationPresenter()->removeClient(); @@ -436,6 +438,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct switch (action) { case WebCore::ContextMenuItemTagOpenLink: return QWebPage::OpenLink; case WebCore::ContextMenuItemTagOpenLinkInNewWindow: return QWebPage::OpenLinkInNewWindow; + case WebCore::ContextMenuItemTagOpenLinkInThisWindow: return QWebPage::OpenLinkInThisWindow; case WebCore::ContextMenuItemTagDownloadLinkToDisk: return QWebPage::DownloadLinkToDisk; case WebCore::ContextMenuItemTagCopyLinkToClipboard: return QWebPage::CopyLinkToClipboard; case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow; @@ -1463,13 +1466,6 @@ 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 @@ -1693,6 +1689,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi \value NoWebAction No action is triggered. \value OpenLink Open the current link. \value OpenLinkInNewWindow Open the current link in a new window. + \value OpenLinkInThisWindow Open the current link without opening a new window. Used on links that would default to opening in another frame or a new window. (Added in Qt 5.0) \value OpenFrameInNewWindow Replicate the current frame in a new window. \value DownloadLinkToDisk Download the current link to the disk. \value CopyLinkToClipboard Copy the current link to the clipboard. @@ -2367,6 +2364,10 @@ void QWebPage::triggerAction(WebAction action, bool) case OpenLinkInNewWindow: openNewWindow(d->hitTestResult.linkUrl(), frame); break; + case OpenLinkInThisWindow: + frame->loader()->loadFrameRequest(frameLoadRequest(d->hitTestResult.linkUrl(), frame), + /*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0, /*FormState*/ 0, MaybeSendReferrer); + break; case OpenFrameInNewWindow: { KURL url = frame->loader()->documentLoader()->unreachableURL(); if (url.isEmpty()) @@ -2788,6 +2789,9 @@ QAction *QWebPage::action(WebAction action) const case OpenFrameInNewWindow: text = contextMenuItemTagOpenFrameInNewWindow(); break; + case OpenLinkInThisWindow: + text = contextMenuItemTagOpenLinkInThisWindow(); + break; case DownloadLinkToDisk: text = contextMenuItemTagDownloadLinkToDisk(); diff --git a/Source/WebKit/qt/Api/qwebpage.h b/Source/WebKit/qt/Api/qwebpage.h index 66f89609b..b2caa131d 100644 --- a/Source/WebKit/qt/Api/qwebpage.h +++ b/Source/WebKit/qt/Api/qwebpage.h @@ -180,6 +180,8 @@ public: CopyImageUrlToClipboard, + OpenLinkInThisWindow, + WebActionCount }; diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog index 43b99b3d3..52fbc7231 100644 --- a/Source/WebKit/qt/ChangeLog +++ b/Source/WebKit/qt/ChangeLog @@ -1,3 +1,48 @@ +2012-11-07 Allan Sandfeld Jensen <allan.jensen@digia.com> + + [Qt] API test tst_qwebinspector crashes + https://bugs.webkit.org/show_bug.cgi?id=101599 + + Reviewed by Simon Hausmann. + + Delete the internal inspector from QWebPage destructor, instead of causing recursions + between QWebPagePrivate::setInspector and QWebInspector::setPage. + + Also separate the three tests in tst_QWebInspector to better tell which one is failing. + + * Api/qwebpage.cpp: + (QWebPagePrivate::~QWebPagePrivate): + (QWebPagePrivate::setInspector): + * tests/qwebinspector/tst_qwebinspector.cpp: + (tst_QWebInspector): + (tst_QWebInspector::attachAndDestroyPageFirst): + (tst_QWebInspector::attachAndDestroyInspectorFirst): + (tst_QWebInspector::attachAndDestroyInternalInspector): + +2012-11-08 Allan Sandfeld Jensen <allan.jensen@digia.com> + + [Qt] Open link in this window action + https://bugs.webkit.org/show_bug.cgi?id=101226 + + Reviewed by Csaba Osztrogonác. + + * Api/qwebpage.cpp: Fix after r133763, move the initialization of OpenLinkInThisWindow to the proper place. + +2012-11-07 Allan Sandfeld Jensen <allan.jensen@digia.com> + + [Qt] Open link in this window action + https://bugs.webkit.org/show_bug.cgi?id=101226 + + Reviewed by Simon Hausmann. + + Adds the action to QtWebKit. + + * Api/qwebpage.cpp: + (webActionForContextMenuAction): + (QWebPage::triggerAction): + (QWebPage::action): + * Api/qwebpage.h: + 2012-11-01 Stephen White <senorblanco@chromium.org> Unreviewed, rolling out r133143. diff --git a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp index 181fdac45..37e62f67b 100644 --- a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp +++ b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp @@ -28,39 +28,46 @@ class tst_QWebInspector : public QObject { Q_OBJECT private Q_SLOTS: - void attachAndDestroy(); + void attachAndDestroyPageFirst(); + void attachAndDestroyInspectorFirst(); + void attachAndDestroyInternalInspector(); }; -void tst_QWebInspector::attachAndDestroy() +void tst_QWebInspector::attachAndDestroyPageFirst() { - { // External inspector + manual destruction of page first - QWebPage* page = new QWebPage(); - page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); - QWebInspector* inspector = new QWebInspector(); - inspector->setPage(page); - page->updatePositionDependentActions(QPoint(0, 0)); - page->triggerAction(QWebPage::InspectElement); + // External inspector + manual destruction of page first + QWebPage* page = new QWebPage(); + page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + QWebInspector* inspector = new QWebInspector(); + inspector->setPage(page); + page->updatePositionDependentActions(QPoint(0, 0)); + page->triggerAction(QWebPage::InspectElement); - delete page; - delete inspector; - } - { // External inspector + manual destruction of inspector first - QWebPage* page = new QWebPage(); - page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); - QWebInspector* inspector = new QWebInspector(); - inspector->setPage(page); - page->updatePositionDependentActions(QPoint(0, 0)); - page->triggerAction(QWebPage::InspectElement); + delete page; + delete inspector; +} + +void tst_QWebInspector::attachAndDestroyInspectorFirst() +{ + // External inspector + manual destruction of inspector first + QWebPage* page = new QWebPage(); + page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + QWebInspector* inspector = new QWebInspector(); + inspector->setPage(page); + page->updatePositionDependentActions(QPoint(0, 0)); + page->triggerAction(QWebPage::InspectElement); - delete inspector; - delete page; - } - { // Internal inspector - QWebPage page; - page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); - page.updatePositionDependentActions(QPoint(0, 0)); - page.triggerAction(QWebPage::InspectElement); - } + delete inspector; + delete page; +} + +void tst_QWebInspector::attachAndDestroyInternalInspector() +{ + // Internal inspector + QWebPage page; + page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + page.updatePositionDependentActions(QPoint(0, 0)); + page.triggerAction(QWebPage::InspectElement); } QTEST_MAIN(tst_QWebInspector) |
