Changeset 194888 in webkit
- Timestamp:
- Jan 12, 2016 12:23:36 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194887 r194888 1 2016-01-11 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Inconsistencies in main resource load delegates when loading from history 4 https://bugs.webkit.org/show_bug.cgi?id=150927 5 6 Reviewed by Michael Catanzaro. 7 8 Add test to check that main resource load delegates are emitted in 9 the same order before the load is committed when loading a page 10 from history with the page cache enabled and disabled. 11 12 * http/tests/loading/main-resource-delegates-on-back-navigation-expected.txt: Added. 13 * http/tests/loading/main-resource-delegates-on-back-navigation.html: Added. 14 * http/tests/loading/resources/page-go-back-onload.html: Added. 15 * loader/go-back-cached-main-resource-expected.txt: 16 1 17 2016-01-11 Johan K. Jensen <jj@johanjensen.dk> 2 18 -
trunk/LayoutTests/loader/go-back-cached-main-resource-expected.txt
r153903 r194888 12 12 resources/other-page.html - didReceiveResponse <NSURLResponse resources/other-page.html, http status code 0> 13 13 resources/other-page.html - didFinishLoading 14 resources/first-page.html - willSendRequest <NSURLRequest URL resources/first-page.html, main document URL (null), http method GET> redirectResponse (null)14 resources/first-page.html - willSendRequest <NSURLRequest URL resources/first-page.html, main document URL resources/first-page.html, http method GET> redirectResponse (null) 15 15 resources/first-page.html - didReceiveResponse <NSURLResponse resources/first-page.html, http status code 0> 16 16 resources/first-page.html - didFinishLoading -
trunk/Source/WebCore/ChangeLog
r194880 r194888 1 2016-01-11 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Inconsistencies in main resource load delegates when loading from history 4 https://bugs.webkit.org/show_bug.cgi?id=150927 5 6 Reviewed by Michael Catanzaro. 7 8 When restoring a page from the page cache, even though there 9 isn't an actual load of resources, we are still emitting the load 10 delegates to let the API layer know there are contents being 11 loaded in the web view. This makes the page cache restoring 12 transparent for the API layer. However, when restoring a page from 13 the cache, all the delegates are emitted after the load is 14 committed. This is not consistent with real loads, where we first 15 load the main resource and once we get a response we commit the 16 load. This inconsistency is problematic if the API layer expects 17 to always have a main resource with a response when the load is 18 committed. This is the case of the GTK+ port, for example. So, 19 this patch ensures that when a page is restored from the page 20 cache, the main resource load delegates that are emitted until a 21 response is received in normal loads, are emitted before the load 22 is committed. 23 24 Test: http/tests/loading/main-resource-delegates-on-back-navigation.html 25 26 * loader/FrameLoader.cpp: 27 (WebCore::FrameLoader::commitProvisionalLoad): When loading from 28 the page cache, send delegate messages up to didReceiveResponse 29 for the main resource before the load is committed, and the 30 remaining messages afterwards. 31 1 32 2016-01-09 Andy Estes <aestes@apple.com> 2 33 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r194666 r194888 1801 1801 prepareForCachedPageRestore(); 1802 1802 1803 // Start request for the main resource and dispatch didReceiveResponse before the load is committed for 1804 // consistency with all other loads. See https://bugs.webkit.org/show_bug.cgi?id=150927. 1805 ResourceError mainResouceError; 1806 unsigned long mainResourceIdentifier; 1807 ResourceRequest mainResourceRequest(cachedPage->documentLoader()->request()); 1808 requestFromDelegate(mainResourceRequest, mainResourceIdentifier, mainResouceError); 1809 notifier().dispatchDidReceiveResponse(cachedPage->documentLoader(), mainResourceIdentifier, cachedPage->documentLoader()->response()); 1810 1803 1811 // FIXME: This API should be turned around so that we ground CachedPage into the Page. 1804 1812 cachedPage->restore(*m_frame.page()); … … 1814 1822 m_client.dispatchDidReceiveTitle(title); 1815 1823 1824 // Send remaining notifications for the main resource. 1825 notifier().sendRemainingDelegateMessages(m_documentLoader.get(), mainResourceIdentifier, mainResourceRequest, ResourceResponse(), 1826 nullptr, static_cast<int>(m_documentLoader->response().expectedContentLength()), 0, mainResouceError); 1827 1816 1828 checkCompleted(); 1817 1829 } else … … 1840 1852 #endif 1841 1853 1842 for (auto& response : m_documentLoader->responses()) { 1854 // Main resource delegates were already sent, so we skip the first response here. 1855 for (unsigned i = 1; i < m_documentLoader->responses().size(); ++i) { 1856 const auto& response = m_documentLoader->responses()[i]; 1843 1857 // FIXME: If the WebKit client changes or cancels the request, this is not respected. 1844 1858 ResourceError error;
Note: See TracChangeset
for help on using the changeset viewer.