Changeset 76357 in webkit
- Timestamp:
- Jan 21, 2011 10:26:42 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76356 r76357 1 2011-01-21 Charlie Reis <creis@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 FrameLoader::checkLoadCompleteForThisFrame uses wrong history item 6 https://bugs.webkit.org/show_bug.cgi?id=48812 7 8 Test that we avoid updating back/forward list on a canceled navigation 9 if a new navigation is already in process. Also update forward-and-cancel 10 to go forward, ensuring back/forward state is reset if user clicks stop. 11 12 * http/tests/navigation/back-twice-without-commit-expected.txt: Added. 13 * http/tests/navigation/back-twice-without-commit.html: Added. 14 * http/tests/navigation/forward-and-cancel-expected.txt: 15 * http/tests/navigation/forward-and-cancel.html: Go forward after stop, not back. 16 * http/tests/navigation/resources/back-twice-page-2.html: Added. 17 * http/tests/navigation/resources/back-twice-page-3.html: Added. 18 * http/tests/navigation/resources/forward-and-cancel-frames.html: Reduced delay. 19 1 20 2011-01-20 Mihai Parparita <mihaip@chromium.org> 2 21 -
trunk/LayoutTests/http/tests/navigation/forward-and-cancel-expected.txt
r75336 r76357 1 This test checks that the backForward list is not corrupted when a frame load is canceled. 2 3 If testing manually, click here. 1 4 2 5 3 ============== Back Forward List ============== 6 curr->http://127.0.0.1:8000/navigation/forward-and-cancel.html **nav target**4 http://127.0.0.1:8000/navigation/forward-and-cancel.html **nav target** 7 5 http://127.0.0.1:8000/navigation/resources/forward-and-cancel-frames-container.html **nav target** 8 6 http://127.0.0.1:8000/navigation/resources/forward-and-cancel-frames.html (in frame "<!--framePath //<!--frame0-->-->") 9 7 about:blank (in frame "frame1") 10 8 http://127.0.0.1:8000/navigation/resources/otherpage.html (in frame "<!--framePath //<!--frame1-->-->") 11 9 curr-> http://127.0.0.1:8000/navigation/resources/forward-and-cancel-frames-container.html 12 10 http://127.0.0.1:8000/navigation/resources/forward-and-cancel-frames.html (in frame "<!--framePath //<!--frame0-->-->") 13 http://127.0.0.1:8000/navigation/resources/slow-resource -1-sec.pl(in frame "frame1") **nav target**11 http://127.0.0.1:8000/navigation/resources/slow-resource.pl?delay=250 (in frame "frame1") **nav target** 14 12 http://127.0.0.1:8000/navigation/resources/otherpage.html (in frame "<!--framePath //<!--frame1-->-->") 15 13 =============================================== -
trunk/LayoutTests/http/tests/navigation/forward-and-cancel.html
r75336 r76357 8 8 // 5. Go forward to slow URL, but stop before the navigation commits. 9 9 // Important to cancel the load and ensure the history is not corrupted. 10 // 6. Go back to start page with no frames.11 // Important for testing that subframes can be removed.10 // 6. Go forward and let slow URL load. 11 // Important for testing that navigation state is reset after stopping. 12 12 if (window.layoutTestController) { 13 layoutTestController.clearBackForwardList(); 13 14 layoutTestController.dumpBackForwardList(); 14 15 layoutTestController.dumpAsText(); … … 22 23 23 24 // Now go back to make sure the backForwardList is not corrupted. 24 layoutTestController.queueNonLoadingScript("setTimeout('history.back();',50);"); 25 layoutTestController.queueNonLoadingScript("setTimeout('history.forward();',50);"); 26 layoutTestController.queueNonLoadingScript("setTimeout('layoutTestController.notifyDone();',100);"); 25 27 26 28 // Wait until we get back to this page. … … 30 32 <p>This test checks that the backForward list is not corrupted when a frame load is canceled. 31 33 <p>If testing manually, <a href="resources/forward-and-cancel-frames-container.html">click here</a>. 32 33 <script>34 if (window.layoutTestController) {35 // Only notify done when we return to this page a second time.36 if (!window.localStorage.started) {37 window.localStorage.started = true;38 } else {39 delete window.localStorage.started;40 layoutTestController.notifyDone();41 }42 }43 </script> -
trunk/LayoutTests/http/tests/navigation/resources/forward-and-cancel-frames.html
r75336 r76357 13 13 <br> 14 14 <p>This test checks that the backForward list is not corrupted when a frame load is canceled. 15 <p>If testing manually, <a id="link" href="slow-resource -1-sec.pl" target="frame1">click here</a> and then Back. Then click Forward and quickly click Stop. Ensure that Back and Forward still work.15 <p>If testing manually, <a id="link" href="slow-resource.pl?delay=250" target="frame1">click here</a> and then Back. Then click Forward and quickly click Stop. Ensure that Back and Forward still work. -
trunk/Source/WebCore/ChangeLog
r76351 r76357 1 2011-01-21 Charlie Reis <creis@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 FrameLoader::checkLoadCompleteForThisFrame uses wrong history item 6 https://bugs.webkit.org/show_bug.cgi?id=48812 7 8 Most calls to stopAllLoaders now clear the history's provisional item(s). 9 We can now avoid resetting the back/forward state if a new navigation 10 is in progress. 11 12 Test: http/tests/navigation/back-twice-without-commit.html 13 Test: http/tests/navigation/forward-and-cancel.html 14 15 * loader/FrameLoader.cpp: 16 * loader/FrameLoader.h: 17 * loader/FrameLoaderTypes.h: 18 * WebCore.exp.in: Update stopAllLoaders signature. 19 1 20 2011-01-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
trunk/Source/WebCore/WebCore.exp.in
r76292 r76357 164 164 __ZN7WebCore11FrameLoader12shouldReloadERKNS_4KURLES3_ 165 165 __ZN7WebCore11FrameLoader14detachChildrenEv 166 __ZN7WebCore11FrameLoader14stopAllLoadersENS_14DatabasePolicyE 166 __ZN7WebCore11FrameLoader14stopAllLoadersENS_14DatabasePolicyENS_26ClearProvisionalItemPolicyE 167 167 __ZN7WebCore11FrameLoader16detachFromParentEv 168 168 __ZN7WebCore11FrameLoader16loadFrameRequestERKNS_16FrameLoadRequestEbbN3WTF10PassRefPtrINS_5EventEEENS5_INS_9FormStateEEENS_14ReferrerPolicyE -
trunk/Source/WebCore/loader/FrameLoader.cpp
r76173 r76357 1683 1683 } 1684 1684 1685 void FrameLoader::stopLoadingSubframes( )1685 void FrameLoader::stopLoadingSubframes(DatabasePolicy databasePolicy, ClearProvisionalItemPolicy clearProvisionalItemPolicy) 1686 1686 { 1687 1687 for (RefPtr<Frame> child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) 1688 child->loader()->stopAllLoaders( );1689 } 1690 1691 void FrameLoader::stopAllLoaders(DatabasePolicy databasePolicy )1688 child->loader()->stopAllLoaders(databasePolicy, clearProvisionalItemPolicy); 1689 } 1690 1691 void FrameLoader::stopAllLoaders(DatabasePolicy databasePolicy, ClearProvisionalItemPolicy clearProvisionalItemPolicy) 1692 1692 { 1693 1693 ASSERT(!m_frame->document() || !m_frame->document()->inPageCache()); … … 1703 1703 policyChecker()->stopCheck(); 1704 1704 1705 stopLoadingSubframes(); 1705 // If no new load is in progress, we should clear the provisional item from history 1706 // before we call stopLoading. 1707 if (clearProvisionalItemPolicy == ShouldClearProvisionalItem) 1708 history()->setProvisionalItem(0); 1709 1710 stopLoadingSubframes(databasePolicy, clearProvisionalItemPolicy); 1706 1711 if (m_provisionalDocumentLoader) 1707 1712 m_provisionalDocumentLoader->stopLoading(databasePolicy); … … 2354 2359 item = page->mainFrame()->loader()->history()->currentItem(); 2355 2360 2356 bool shouldReset = true; 2361 // Only reset if we aren't already going to a new provisional item. 2362 bool shouldReset = !history()->provisionalItem(); 2357 2363 if (!(pdl->isLoadingInAPISense() && !pdl->isStopping())) { 2358 2364 m_delegateIsHandlingProvisionalLoadError = true; … … 2363 2369 // which it must be to be in this branch of the if? And is it OK to just do a full-on 2364 2370 // stopAllLoaders instead of stopLoadingSubframes? 2365 stopLoadingSubframes( );2371 stopLoadingSubframes(DatabasePolicyStop, ShouldNotClearProvisionalItem); 2366 2372 pdl->stopLoading(); 2367 2373 … … 2965 2971 2966 2972 FrameLoadType type = policyChecker()->loadType(); 2967 stopAllLoaders(); 2973 // A new navigation is in progress, so don't clear the history's provisional item. 2974 stopAllLoaders(DatabasePolicyStop, ShouldNotClearProvisionalItem); 2968 2975 2969 2976 // <rdar://problem/6250856> - In certain circumstances on pages with multiple frames, stopAllLoaders() -
trunk/Source/WebCore/loader/FrameLoader.h
r76248 r76357 129 129 130 130 // Also not cool. 131 void stopAllLoaders(DatabasePolicy = DatabasePolicyStop );131 void stopAllLoaders(DatabasePolicy = DatabasePolicyStop, ClearProvisionalItemPolicy = ShouldClearProvisionalItem); 132 132 void stopForUserCancel(bool deferCheckLoadComplete = false); 133 133 … … 356 356 357 357 // Also not cool. 358 void stopLoadingSubframes( );358 void stopLoadingSubframes(DatabasePolicy, ClearProvisionalItemPolicy); 359 359 360 360 void clearProvisionalLoad(); -
trunk/Source/WebCore/loader/FrameLoaderTypes.h
r64051 r76357 74 74 DatabasePolicyContinue 75 75 }; 76 77 enum ClearProvisionalItemPolicy { 78 ShouldClearProvisionalItem, 79 ShouldNotClearProvisionalItem 80 }; 76 81 77 82 enum ObjectContentType {
Note: See TracChangeset
for help on using the changeset viewer.