[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

hausmann at webkit.org hausmann at webkit.org
Thu Oct 29 20:35:46 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 2af07cb66d74791586f70134c4e85a968355a62c
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 29 14:06:27 2009 +0000

    Some QWebHistory and QWebPage autotest crash fixes.
    
    Patch by Jedrzej Nowacki <jedrzej.nowacki at nokia.com> on 2009-09-29
    Reviewed by Simon Hausmann.
    
    Some checking for m_mainFrame were added. MainFrame should be created
    at some point of QWebPage live cicle.
    
    https://bugs.webkit.org/show_bug.cgi?id=29803
    
    * Api/qwebpage.cpp:
    (QWebPage::~QWebPage):
    (QWebPage::currentFrame):
    (QWebPage::history):
    (QWebPage::selectedText):
    (QWebPage::updatePositionDependentActions):
    * tests/qwebpage/tst_qwebpage.cpp:
    (tst_QWebPage::crashTests_LazyInitializationOfMainFrame):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48871 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index aad718b..4b6248a 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -1491,6 +1491,7 @@ QWebPage::QWebPage(QObject *parent)
 */
 QWebPage::~QWebPage()
 {
+    d->createMainFrame();
     FrameLoader *loader = d->mainFrame->d->frame->loader();
     if (loader)
         loader->detachFromParent();
@@ -1520,6 +1521,7 @@ QWebFrame *QWebPage::mainFrame() const
 */
 QWebFrame *QWebPage::currentFrame() const
 {
+    d->createMainFrame();
     return static_cast<WebCore::FrameLoaderClientQt *>(d->page->focusController()->focusedOrMainFrame()->loader()->client())->webFrame();
 }
 
@@ -1545,6 +1547,7 @@ QWebFrame* QWebPage::frameAt(const QPoint& pos) const
 */
 QWebHistory *QWebPage::history() const
 {
+    d->createMainFrame();
     return &d->history;
 }
 
@@ -1932,6 +1935,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkReques
 */
 QString QWebPage::selectedText() const
 {
+    d->createMainFrame();
     return d->page->focusController()->focusedOrMainFrame()->selectedText();
 }
 
@@ -2487,6 +2491,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
         }
     }
 
+    d->createMainFrame();
     WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
     HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
 
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f58f27d..4877f9b 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,23 @@
+2009-09-29  Jedrzej Nowacki  <jedrzej.nowacki at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        Some QWebHistory and QWebPage autotest crash fixes.
+
+        Some checking for m_mainFrame were added. MainFrame should be created
+        at some point of QWebPage live cicle.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29803
+
+        * Api/qwebpage.cpp:
+        (QWebPage::~QWebPage):
+        (QWebPage::currentFrame):
+        (QWebPage::history):
+        (QWebPage::selectedText):
+        (QWebPage::updatePositionDependentActions):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (tst_QWebPage::crashTests_LazyInitializationOfMainFrame):
+
 2009-09-29  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Reviewed by Simon Hausmann and Tor Arne Vestbø.
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 0fb05b8..ce3a80f 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -113,11 +113,9 @@ private slots:
     void localURLSchemes();
     void testOptionalJSObjects();
     void testEnablePersistentStorage();
-
     void consoleOutput();
 
-private:
-
+    void crashTests_LazyInitializationOfMainFrame();
 
 private:
     QWebView* m_view;
@@ -1301,5 +1299,26 @@ void tst_QWebPage::testEnablePersistentStorage()
     QVERIFY(!webPage.settings()->iconDatabasePath().isEmpty());
 }
 
+void tst_QWebPage::crashTests_LazyInitializationOfMainFrame()
+{
+    {
+        QWebPage webPage;
+    }
+    {
+        QWebPage webPage;
+        webPage.selectedText();
+    }
+    {
+        QWebPage webPage;
+        webPage.triggerAction(QWebPage::Back, true);
+    }
+    {
+        QWebPage webPage;
+        QPoint pos(10,10);
+        webPage.updatePositionDependentActions(pos);
+    }
+}
+
+
 QTEST_MAIN(tst_QWebPage)
 #include "tst_qwebpage.moc"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list