Changeset 128177 in webkit
- Timestamp:
- Sep 11, 2012 6:49:30 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r128174 r128177 1 2012-09-11 Marcelo Lira <marcelo.lira@openbossa.org> 2 3 [Qt][WK2] Page loading status API lacks a status for intentionally stopped loading 4 https://bugs.webkit.org/show_bug.cgi?id=83062 5 6 Reviewed by Tor Arne Vestbø. 7 8 When the loading of a page is intentionally interrupted, the loading 9 status is set to the new state LoadStoppedStatus. This reflects 10 reality more accurately because the page was not fully loaded 11 (a LoadSucceededStatus), and it wasn't an unexpected error 12 (a LoadFailedStatus). 13 14 * UIProcess/API/qt/qquickwebview.cpp: 15 (QQuickWebViewPrivate::loadDidStop): 16 * UIProcess/API/qt/qquickwebview_p.h: 17 * UIProcess/API/qt/qquickwebview_p_p.h: 18 (QQuickWebViewPrivate): 19 * UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp: 20 * UIProcess/API/qt/tests/qmltests/WebView/tst_loadUrl.qml: 21 * UIProcess/API/qt/tests/qmltests/common/TestWebView.qml: 22 * UIProcess/qt/QtWebPageLoadClient.cpp: 23 (WebKit::QtWebPageLoadClient::dispatchLoadStopped): 24 (WebKit): 25 (WebKit::QtWebPageLoadClient::dispatchLoadFailed): 26 * UIProcess/qt/QtWebPageLoadClient.h: 27 (QtWebPageLoadClient): 28 1 29 2012-09-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 30 -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
r127720 r128177 324 324 } 325 325 326 void QQuickWebViewPrivate::loadDidStop() 327 { 328 Q_Q(QQuickWebView); 329 ASSERT(!q->loading()); 330 QWebLoadRequest loadRequest(q->url(), QQuickWebView::LoadStoppedStatus); 331 emit q->loadingChanged(&loadRequest); 332 } 333 326 334 void QQuickWebViewPrivate::onComponentComplete() 327 335 { -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
r127726 r128177 97 97 enum LoadStatus { 98 98 LoadStartedStatus, 99 LoadStoppedStatus, 99 100 LoadSucceededStatus, 100 101 LoadFailedStatus -
trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
r128035 r128177 80 80 virtual void backForwardListDidChange(); 81 81 virtual void loadDidSucceed(); 82 virtual void loadDidStop(); 82 83 virtual void loadDidFail(const WebKit::QtWebError& error); 83 84 virtual void handleMouseEvent(QMouseEvent*); -
trunk/Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp
r125603 r128177 45 45 << "QQuickWebView.IgnoreRequest --> NavigationRequestAction" 46 46 << "QQuickWebView.LoadStartedStatus --> LoadStatus" 47 << "QQuickWebView.LoadStoppedStatus --> LoadStatus" 47 48 << "QQuickWebView.LoadSucceededStatus --> LoadStatus" 48 49 << "QQuickWebView.LoadFailedStatus --> LoadStatus" -
trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_loadUrl.qml
r118158 r128177 121 121 compare(webView.url, url) 122 122 } 123 124 function test_stopStatus() { 125 var url = Qt.resolvedUrl("../common/test1.html") 126 127 webView.loadingChanged.connect(function(loadRequest) { 128 if (loadRequest.status == WebView.LoadStopStatus) { 129 compare(webView.url, url) 130 compare(loadRequest.url, url) 131 } 132 }) 133 134 webView.url = url 135 compare(webView.url, url) 136 webView.stop() 137 verify(webView.waitForLoadStopped()) 138 compare(webView.url, url) 139 } 123 140 } 124 141 } -
trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/TestWebView.qml
r108815 r128177 29 29 return failure 30 30 } 31 function waitForLoadStopped() { 32 var timeout = 5000 33 var i = 0 34 while (i < timeout && loadStatus != WebView.LoadStoppedStatus) { 35 testResult.wait(50) 36 i += 50 37 } 38 var stop = loadStatus == WebView.LoadStoppedStatus 39 loadStatus = null 40 return stop 41 } 31 42 32 43 TestResult { id: testResult } -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.cpp
r118158 r128177 91 91 } 92 92 93 void QtWebPageLoadClient::dispatchLoadStopped() 94 { 95 m_webView->d_func()->loadDidStop(); 96 } 97 93 98 void QtWebPageLoadClient::dispatchLoadFailed(WebFrameProxy* frame, const QtWebError& error) 94 99 { 100 if (error.isCancellation()) { 101 dispatchLoadStopped(); 102 return; 103 } 104 95 105 int errorCode = error.errorCode(); 96 106 97 if (error .isCancellation() || errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad) {107 if (errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad) { 98 108 // The active url might have changed 99 109 m_webView->emitUrlChangeIfNeeded(); -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageLoadClient.h
r118158 r128177 51 51 52 52 void dispatchLoadSucceeded(); 53 void dispatchLoadStopped(); 53 54 void dispatchLoadFailed(WebFrameProxy*, const QtWebError&); 54 55
Note: See TracChangeset
for help on using the changeset viewer.