https://bugs.webkit.org/show_bug.cgi?id=82483
Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-04-10
Reviewed by Kenneth Rohde Christiansen.
Source/WebKit2:
titleChanged signal is not emitted on comitting a new load.
* UIProcess/API/qt/tests/html/basic_page.html:
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView):
(tst_QQuickWebView::titleUpdate):
* UIProcess/qt/QtWebPageLoadClient.cpp:
(QtWebPageLoadClient::didCommitLoadForFrame):
Tools:
Set window title to default if there is no page title.
* MiniBrowser/qt/BrowserWindow.cpp:
(BrowserWindow::BrowserWindow):
(BrowserWindow::onTitleChanged):
* MiniBrowser/qt/BrowserWindow.h:
(BrowserWindow):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113715
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-10 Dinu Jacob <dinu.jacob@nokia.com>
+
+ [Qt][WK2] Title in MiniBrowser is not updated for a page with no title
+ https://bugs.webkit.org/show_bug.cgi?id=82483
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ titleChanged signal is not emitted on comitting a new load.
+
+ * UIProcess/API/qt/tests/html/basic_page.html:
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ (tst_QQuickWebView):
+ (tst_QQuickWebView::titleUpdate):
+ * UIProcess/qt/QtWebPageLoadClient.cpp:
+ (QtWebPageLoadClient::didCommitLoadForFrame):
+
2012-04-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
[Qt][WK2] Implement PageClient::isViewWindowActive()
+<html>
+<head>
+<title> Basic Page </title>
+</head>
<h1>Basic page</h1>
+</html>
void removeFromCanvas();
void multipleWebViewWindows();
void multipleWebViews();
+ void titleUpdate();
void transparentWebViews();
private:
QTest::qWait(200);
}
+void tst_QQuickWebView::titleUpdate()
+{
+ QSignalSpy titleSpy(webView(), SIGNAL(titleChanged()));
+
+ // Load page with no title
+ webView()->setUrl(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page2.html")));
+ QVERIFY(waitForLoadSucceeded(webView()));
+ QCOMPARE(titleSpy.size(), 1);
+
+ titleSpy.clear();
+
+ // No titleChanged signal for failed load
+ webView()->setUrl(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/file_that_does_not_exist.html")));
+ QVERIFY(waitForLoadFailed(webView()));
+ QCOMPARE(titleSpy.size(), 0);
+
+}
+
void tst_QQuickWebView::transparentWebViews()
{
showWebView();
{
emit m_webView->navigationHistoryChanged();
emit m_webView->urlChanged();
+ emit m_webView->titleChanged();
m_webView->d_func()->loadDidCommit();
}
+2012-04-10 Dinu Jacob <dinu.jacob@nokia.com>
+
+ [Qt][WK2] Title in MiniBrowser is not updated for a page with no title
+ https://bugs.webkit.org/show_bug.cgi?id=82483
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Set window title to default if there is no page title.
+
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::onTitleChanged):
+ * MiniBrowser/qt/BrowserWindow.h:
+ (BrowserWindow):
+
2012-03-23 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
[Qt][WK2] Implement PageClient::isViewWindowActive()
engine()->rootContext()->setContextProperty("utils", utils);
engine()->rootContext()->setContextProperty("options", options);
setSource(QUrl("qrc:/qml/BrowserWindow.qml"));
- connect(rootObject(), SIGNAL(pageTitleChanged(QString)), this, SLOT(setWindowTitle(QString)));
+ connect(rootObject(), SIGNAL(pageTitleChanged(QString)), this, SLOT(onTitleChanged(QString)));
connect(rootObject(), SIGNAL(newWindow(QString)), this, SLOT(newWindow(QString)));
if (options->startFullScreen())
showFullScreen();
BrowserWindow::~BrowserWindow()
{
}
+
+void BrowserWindow::onTitleChanged(QString title)
+{
+ if (title.isEmpty())
+ title = QLatin1String("MiniBrowser");
+ setWindowTitle(title);
+}
protected slots:
void screenshot();
+private slots:
+ void onTitleChanged(QString);
+
private:
WindowOptions* m_windowOptions;
};