Changeset 214798 in webkit
- Timestamp:
- Apr 3, 2017 9:10:45 AM (7 years ago)
- Location:
- releases/WebKitGTK/webkit-2.16
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog
r214796 r214798 1 2017-03-24 Daniel Bates <dabates@apple.com> 2 3 Prevent new navigations during document unload 4 https://bugs.webkit.org/show_bug.cgi?id=169934 5 <rdar://problem/31247584> 6 7 Reviewed by Chris Dumez. 8 9 Add a test to ensure that we do not cause an assertion fail when calling setTimeout 10 after starting a navigation from an onunload event handler. 11 12 * fast/frames/frame-unload-navigate-and-setTimeout-assert-fail-expected.txt: Added. 13 * fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html: Added. 14 1 15 2017-03-24 Per Arne Vollan <pvollan@apple.com> 2 16 -
releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog
r214796 r214798 1 2017-03-24 Daniel Bates <dabates@apple.com> 2 3 Prevent new navigations during document unload 4 https://bugs.webkit.org/show_bug.cgi?id=169934 5 <rdar://problem/31247584> 6 7 Reviewed by Chris Dumez. 8 9 Similar to our policy of preventing new navigations from onbeforeunload handlers 10 we should prevent new navigations that are initiated during the document unload 11 process. 12 13 The significant part of this change is the instantiation of the RAII object NavigationDisabler 14 in Document::prepareForDestruction(). The rest of this change just renames class 15 NavigationDisablerForBeforeUnload to NavigationDisabler now that this RAII class is 16 used to prevent navigation from both onbeforeunload event handlers and when unloading 17 a document. 18 19 Test: fast/frames/frame-unload-navigate-and-setTimeout-assert-fail.html 20 21 * dom/Document.cpp: 22 (WebCore::Document::prepareForDestruction): Disable new navigations when disconnecting 23 subframes. Also assert that the document is not in the page cache before we fall off 24 the end of the function. 25 * loader/FrameLoader.cpp: 26 (WebCore::FrameLoader::isNavigationAllowed): Update for renaming below. 27 (WebCore::FrameLoader::shouldClose): Ditto. 28 * loader/NavigationScheduler.cpp: 29 (WebCore::NavigationScheduler::shouldScheduleNavigation): Ditto. 30 * loader/NavigationScheduler.h: 31 (WebCore::NavigationDisabler::NavigationDisabler): Renamed class; formerly named NavigationDisablerForBeforeUnload. 32 (WebCore::NavigationDisabler::~NavigationDisabler): Ditto. 33 (WebCore::NavigationDisabler::isNavigationAllowed): Ditto. 34 (WebCore::NavigationDisablerForBeforeUnload::NavigationDisablerForBeforeUnload): Deleted. 35 (WebCore::NavigationDisablerForBeforeUnload::~NavigationDisablerForBeforeUnload): Deleted. 36 (WebCore::NavigationDisablerForBeforeUnload::isNavigationAllowed): Deleted. 37 1 38 2017-03-24 Per Arne Vollan <pvollan@apple.com> 2 39 -
releases/WebKitGTK/webkit-2.16/Source/WebCore/dom/Document.cpp
r214747 r214798 2273 2273 } 2274 2274 #endif 2275 2276 disconnectDescendantFrames(); 2275 2276 { 2277 NavigationDisabler navigationDisabler; 2278 disconnectDescendantFrames(); 2279 } 2280 2277 2281 if (m_domWindow && m_frame) 2278 2282 m_domWindow->willDetachDocumentFromFrame(); … … 2328 2332 2329 2333 m_hasPreparedForDestruction = true; 2334 2335 // Note that m_pageCacheState can be Document::AboutToEnterPageCache if our frame 2336 // was removed in an onpagehide event handler fired when the top-level frame is 2337 // about to enter the page cache. 2338 ASSERT_WITH_SECURITY_IMPLICATION(m_pageCacheState != Document::InPageCache); 2330 2339 } 2331 2340 -
releases/WebKitGTK/webkit-2.16/Source/WebCore/loader/FrameLoader.cpp
r214783 r214798 1188 1188 bool FrameLoader::isNavigationAllowed() const 1189 1189 { 1190 return m_pageDismissalEventBeingDispatched == PageDismissalType::None && NavigationDisabler ForBeforeUnload::isNavigationAllowed();1190 return m_pageDismissalEventBeingDispatched == PageDismissalType::None && NavigationDisabler::isNavigationAllowed(); 1191 1191 } 1192 1192 … … 2909 2909 bool shouldClose = false; 2910 2910 { 2911 NavigationDisabler ForBeforeUnloadnavigationDisabler;2911 NavigationDisabler navigationDisabler; 2912 2912 size_t i; 2913 2913 -
releases/WebKitGTK/webkit-2.16/Source/WebCore/loader/NavigationScheduler.cpp
r212250 r214798 56 56 namespace WebCore { 57 57 58 unsigned NavigationDisabler ForBeforeUnload::s_navigationDisableCount = 0;58 unsigned NavigationDisabler::s_navigationDisableCount = 0; 59 59 60 60 class ScheduledNavigation { … … 365 365 if (protocolIsJavaScript(url)) 366 366 return true; 367 return NavigationDisabler ForBeforeUnload::isNavigationAllowed();367 return NavigationDisabler::isNavigationAllowed(); 368 368 } 369 369 -
releases/WebKitGTK/webkit-2.16/Source/WebCore/loader/NavigationScheduler.h
r210859 r214798 44 44 class URL; 45 45 46 class NavigationDisabler ForBeforeUnload{46 class NavigationDisabler { 47 47 public: 48 NavigationDisabler ForBeforeUnload()48 NavigationDisabler() 49 49 { 50 50 s_navigationDisableCount++; 51 51 } 52 ~NavigationDisabler ForBeforeUnload()52 ~NavigationDisabler() 53 53 { 54 54 ASSERT(s_navigationDisableCount);
Note: See TracChangeset
for help on using the changeset viewer.