Title: [95055] trunk/Source/WebKit/qt
- Revision
- 95055
- Author
- [email protected]
- Date
- 2011-09-13 16:10:21 -0700 (Tue, 13 Sep 2011)
Log Message
[Qt] Fix state of stop/reload actions in QWebPage
https://bugs.webkit.org/show_bug.cgi?id=65977
FrameLoader does ask its DocumentLoader to stop loading subresources before
setting the state to FrameStateCommittedPage. But it does
not check if the the DocumentLoader actually stopped loading before
it changes the state.
Therefore a subresourceLoader can still be active, when we receive the
call to dispatchDidFinishLoad(). This leads to an inconsistent behavior
of the stop/reload actions in QWebPage.
This changeset fixes the inconsistent state by updating the action states
also when frameLoadCompleted() is called.
Patch by Zeno Albisser <[email protected]> on 2011-09-13
Reviewed by Chang Shu.
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::frameLoadCompleted):
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebKit/qt/ChangeLog (95054 => 95055)
--- trunk/Source/WebKit/qt/ChangeLog 2011-09-13 22:49:15 UTC (rev 95054)
+++ trunk/Source/WebKit/qt/ChangeLog 2011-09-13 23:10:21 UTC (rev 95055)
@@ -1,3 +1,23 @@
+2011-09-13 Zeno Albisser <[email protected]>
+
+ [Qt] Fix state of stop/reload actions in QWebPage
+ https://bugs.webkit.org/show_bug.cgi?id=65977
+
+ FrameLoader does ask its DocumentLoader to stop loading subresources before
+ setting the state to FrameStateCommittedPage. But it does
+ not check if the the DocumentLoader actually stopped loading before
+ it changes the state.
+ Therefore a subresourceLoader can still be active, when we receive the
+ call to dispatchDidFinishLoad(). This leads to an inconsistent behavior
+ of the stop/reload actions in QWebPage.
+ This changeset fixes the inconsistent state by updating the action states
+ also when frameLoadCompleted() is called.
+
+ Reviewed by Chang Shu.
+
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::frameLoadCompleted):
+
2011-09-12 Csaba Osztrogonác <[email protected]>
[Qt] Fix "Unmatched parentheses are deprecated." warnings
Modified: trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (95054 => 95055)
--- trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp 2011-09-13 22:49:15 UTC (rev 95054)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp 2011-09-13 23:10:21 UTC (rev 95055)
@@ -684,6 +684,9 @@
void FrameLoaderClientQt::frameLoadCompleted()
{
// Note that this can be called multiple times.
+ if (!m_webFrame)
+ return;
+ m_webFrame->page()->d->updateNavigationActions();
}
Added: trunk/Source/WebKit/qt/tests/qwebpage/resources/script.html (0 => 95055)
--- trunk/Source/WebKit/qt/tests/qwebpage/resources/script.html (rev 0)
+++ trunk/Source/WebKit/qt/tests/qwebpage/resources/script.html 2011-09-13 23:10:21 UTC (rev 95055)
@@ -0,0 +1,3 @@
+<html><head>
+<script language="_javascript_" type="text/_javascript_" src=""
+</head></html>
Modified: trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp (95054 => 95055)
--- trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 2011-09-13 22:49:15 UTC (rev 95054)
+++ trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 2011-09-13 23:10:21 UTC (rev 95055)
@@ -98,6 +98,7 @@
void acceptNavigationRequest();
void geolocationRequestJS();
void loadFinished();
+ void actionStates();
void popupFormSubmission();
void acceptNavigationRequestWithNewWindow();
void userStyleSheet();
@@ -344,6 +345,19 @@
QCOMPARE(spyLoadFinished.count(), 1);
}
+void tst_QWebPage::actionStates()
+{
+ QWebPage* page = m_view->page();
+
+ page->mainFrame()->load(QUrl("qrc:///resources/script.html"));
+
+ QAction* reloadAction = page->action(QWebPage::Reload);
+ QAction* stopAction = page->action(QWebPage::Stop);
+
+ QTRY_VERIFY(reloadAction->isEnabled());
+ QTRY_VERIFY(!stopAction->isEnabled());
+}
+
class ConsolePage : public QWebPage
{
public:
Modified: trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc (95054 => 95055)
--- trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc 2011-09-13 22:49:15 UTC (rev 95054)
+++ trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.qrc 2011-09-13 23:10:21 UTC (rev 95055)
@@ -8,6 +8,7 @@
<file>resources/iframe3.html</file>
<file>resources/framedindex.html</file>
<file>resources/content.html</file>
+ <file>resources/script.html</file>
</qresource>
</RCC>
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes