+2008-08-12 Urs Wolfer <uwolfer@kde.org>
+
+ Reviewed by Simon.
+
+ https://bugs.webkit.org/show_bug.cgi?id=20357
+
+ Fix crash in QWebPage in case contextMenuEvent has been overwritten
+ because context menu has the view as parent and thus is deleted too early.
+
+ Add testcase for this crash.
+
+ * Api/qwebpage_p.h:
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (tst_QWebPage::contextMenuCrash):
+
2008-08-07 Simon Hausmann <hausmann@webkit.org>
Rubber-stamped by Lars.
#include <qwebhistory.h>
#include <qnetworkrequest.h>
#include <QDebug>
+#include <QMenu>
// Will try to wait for the condition while allowing event processing
#define QTRY_COMPARE(__expr, __expected) \
void acceptNavigationRequestWithNewWindow();
void userStyleSheet();
void modified();
+ void contextMenuCrash();
private:
QVERIFY(!m_page->isModified());
}
+void tst_QWebPage::contextMenuCrash()
+{
+ QWebView view;
+ view.setHtml("<p>test");
+ view.page()->updatePositionDependentActions(QPoint(0, 0));
+ QMenu* contextMenu = 0;
+ foreach (QObject* child, view.children()) {
+ contextMenu = qobject_cast<QMenu*>(child);
+ if (contextMenu)
+ break;
+ }
+ QVERIFY(contextMenu);
+ delete contextMenu;
+}
+
QTEST_MAIN(tst_QWebPage)
#include "tst_qwebpage.moc"