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

eric at webkit.org eric at webkit.org
Thu Oct 29 20:32:40 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit c7e3938f3210cd06d417da5f27fdb0e8297f3480
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 24 00:33:10 2009 +0000

    2009-09-23  Jedrzej Nowacki  <jedrzej.nowacki at nokia.com>
    
            Reviewed by Simon Hausmann.
    
            [Qt] Bug fix. QWebHistory should call QWebPage::updateNavigationActions
    
            In QWebHistory's methods that change item count or current item call
            to QWebPage::updateNavigationActions should be executed.
            QWebHistory::clear() and QWebHistory::restorState() were changed.
            New helper method, QWebPagePrivate accesor, were created in
            QWebHistoryPrivate class.
            Two autotest were developed.
    
            https://bugs.webkit.org/show_bug.cgi?id=29246
    
            * Api/qwebhistory.cpp:
            (QWebHistory::clear):
            (QWebHistory::restoreState):
            (QWebHistoryPrivate::page):
            * Api/qwebhistory_p.h:
            * tests/qwebhistory/tst_qwebhistory.cpp:
            (tst_QWebHistory::saveAndRestore_1):
            (tst_QWebHistory::clear):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48688 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qwebhistory.cpp b/WebKit/qt/Api/qwebhistory.cpp
index b57272d..6065e4d 100644
--- a/WebKit/qt/Api/qwebhistory.cpp
+++ b/WebKit/qt/Api/qwebhistory.cpp
@@ -20,6 +20,7 @@
 #include "config.h"
 #include "qwebhistory.h"
 #include "qwebhistory_p.h"
+#include "qwebframe_p.h"
 
 #include "PlatformString.h"
 #include "Image.h"
@@ -267,6 +268,8 @@ void QWebHistory::clear()
     lst->setCapacity(capacity);   //revert capacity
     lst->addItem(current.get());  //insert old current item
     lst->goToItem(current.get()); //and set it as current again
+
+    d->page()->updateNavigationActions();
 }
 
 /*!
@@ -516,6 +519,8 @@ bool QWebHistory::restoreState(const QByteArray& buffer)
     default: {} // result is false;
     }
 
+    d->page()->updateNavigationActions();
+
     return result;
 };
 
@@ -592,4 +597,7 @@ QDataStream& operator>>(QDataStream& stream, QWebHistory& history)
     return stream;
 }
 
-
+QWebPagePrivate* QWebHistoryPrivate::page()
+{
+    return QWebFramePrivate::kit(lst->page()->mainFrame())->page()->handle();
+}
diff --git a/WebKit/qt/Api/qwebhistory_p.h b/WebKit/qt/Api/qwebhistory_p.h
index 809d405..a6682cd 100644
--- a/WebKit/qt/Api/qwebhistory_p.h
+++ b/WebKit/qt/Api/qwebhistory_p.h
@@ -25,6 +25,8 @@
 #include <QtCore/qglobal.h>
 #include <QtCore/qshareddata.h>
 
+class QWebPagePrivate;
+
 class Q_AUTOTEST_EXPORT QWebHistoryItemPrivate : public QSharedData {
 public:
     static QExplicitlySharedDataPointer<QWebHistoryItemPrivate> get(QWebHistoryItem* q)
@@ -57,6 +59,9 @@ public:
     {
         lst->deref();
     }
+
+    QWebPagePrivate* page();
+
     WebCore::BackForwardList* lst;
 };
 
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 9298f3d..0c24a04 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,27 @@
+2009-09-23  Jedrzej Nowacki  <jedrzej.nowacki at nokia.com>
+
+        Reviewed by Simon Hausmann.
+
+        [Qt] Bug fix. QWebHistory should call QWebPage::updateNavigationActions
+        
+        In QWebHistory's methods that change item count or current item call
+        to QWebPage::updateNavigationActions should be executed.
+        QWebHistory::clear() and QWebHistory::restorState() were changed.
+        New helper method, QWebPagePrivate accesor, were created in
+        QWebHistoryPrivate class.
+        Two autotest were developed.
+
+        https://bugs.webkit.org/show_bug.cgi?id=29246
+
+        * Api/qwebhistory.cpp:
+        (QWebHistory::clear):
+        (QWebHistory::restoreState):
+        (QWebHistoryPrivate::page):
+        * Api/qwebhistory_p.h:
+        * tests/qwebhistory/tst_qwebhistory.cpp:
+        (tst_QWebHistory::saveAndRestore_1):
+        (tst_QWebHistory::clear):
+
 2009-09-23  Norbert Leser  <norbert.leser at nokia.com>
 
         Reviewed by Tor Arne Vestbø.
diff --git a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index ec7a040..4f4d3c4 100644
--- a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -18,6 +18,7 @@
 */
 
 #include <QtTest/QtTest>
+#include <QAction>
 
 #include "qwebpage.h"
 #include "qwebview.h"
@@ -296,10 +297,13 @@ void tst_QWebHistory::serialize_3()
 /** Simple checks should be a bit redundant to streaming operators */
 void tst_QWebHistory::saveAndRestore_1() 
 {
+    QAction* actionBack = page->action(QWebPage::Back);
     hist->back();
     waitForLoadFinished.exec();
+    QVERIFY(actionBack->isEnabled());
     QByteArray buffer(hist->saveState());
     hist->clear();
+    QVERIFY(!actionBack->isEnabled());
     QVERIFY(hist->count() == 1);
     hist->restoreState(buffer);
 
@@ -310,6 +314,7 @@ void tst_QWebHistory::saveAndRestore_1()
     QCOMPARE(hist->currentItemIndex(), histsize - 2);
     QCOMPARE(hist->itemAt(0).title(), QString("page1"));
     QCOMPARE(hist->itemAt(histsize - 1).title(), QString("page") + QString::number(histsize));
+    QVERIFY(actionBack->isEnabled());
 }
 
 /** Check returns value if there are bad parameters. Actually, result
@@ -376,16 +381,20 @@ void tst_QWebHistory::saveAndRestore_crash_3()
 /** ::clear */
 void tst_QWebHistory::clear()
 {
+    QAction* actionBack = page->action(QWebPage::Back);
+    QVERIFY(actionBack->isEnabled());
     hist->saveState();
     QVERIFY(hist->count() > 1);
     hist->clear();
-    QVERIFY(hist->count() == 1);  //leave current item
+    QVERIFY(hist->count() == 1);  // Leave current item.
+    QVERIFY(!actionBack->isEnabled());
+
 
     QWebPage* page2 = new QWebPage(this);
     QWebHistory* hist2 = page2->history();
     QVERIFY(hist2->count() == 0);
     hist2->clear();
-    QVERIFY(hist2->count() == 0); //do not change anything
+    QVERIFY(hist2->count() == 0); // Do not change anything.
     delete page2;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list