Changeset 92439 in webkit
- Timestamp:
- Aug 4, 2011 6:32:24 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r92427 r92439 1 2011-08-04 Scott Graham <scottmg@chromium.org> 2 3 Bad interaction between document destruction and unload events 4 https://bugs.webkit.org/show_bug.cgi?id=64741 5 6 Reviewed by Adam Barth. 7 8 * loader/document-destruction-within-unload-expected.txt: Added. 9 * loader/document-destruction-within-unload.html: Added. 10 * loader/resources/document-destruction-within-unload-iframe.html: Added. 11 * loader/resources/document-destruction-within-unload.svg: Added. 12 1 13 2011-08-04 Kent Tamura <tkent@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r92438 r92439 1 2011-08-04 Scott Graham <scottmg@chromium.org> 2 3 Bad interaction between document destruction and unload events 4 https://bugs.webkit.org/show_bug.cgi?id=64741 5 6 Reviewed by Adam Barth. 7 8 Three different errors triggered by this test case. The case to 9 consider is a subdocument with an onunload on an element, that 10 destroys the parent document during the onunload. One fix was a 11 lifetime issue fixed by a protecting RefPtr, and another was an 12 additional cancel of event triggers. The main fix was that during the 13 transition to commited state, the documentLoader is being replaced by 14 the provisionalDocumentLoader. But, because during firing events in 15 the subdocument the parent is destroyed, that subevent caused the 16 provisionalDocumentLoader to be detached from its frame. By marking 17 the page as being in committed state before the parent documentLoader 18 is set, this is avoided. 19 20 Test: loader/document-destruction-within-unload.html 21 22 * dom/Document.cpp: 23 (WebCore::Document::implicitOpen): 24 * loader/FrameLoader.cpp: 25 (WebCore::FrameLoader::transitionToCommitted): 26 (WebCore::FrameLoader::detachChildren): 27 1 28 2011-08-04 Simon Fraser <simon.fraser@apple.com> 2 29 -
trunk/Source/WebCore/dom/Document.cpp
r91928 r92439 1996 1996 removeChildren(); 1997 1997 1998 // cancel again, as removeChildren can cause event triggers to be added 1999 // again, which we don't want triggered on the old document. 2000 cancelParsing(); 2001 1998 2002 setCompatibilityMode(NoQuirksMode); 1999 2003 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r92314 r92439 1835 1835 m_documentLoader->stopLoadingPlugIns(); 1836 1836 1837 // State must be set before setting m_documentLoader to avoid 1838 // m_provisionalDocumentLoader getting detached from the frame via a sub 1839 // frame. See https://bugs.webkit.org/show_bug.cgi?id=64741 for more 1840 // discussion. 1841 setState(FrameStateCommittedPage); 1837 1842 setDocumentLoader(m_provisionalDocumentLoader.get()); 1838 1843 setProvisionalDocumentLoader(0); 1839 setState(FrameStateCommittedPage);1840 1844 1841 1845 #if ENABLE(TOUCH_EVENTS) … … 2333 2337 void FrameLoader::detachChildren() 2334 2338 { 2339 typedef Vector<RefPtr<Frame> > FrameVector; 2340 FrameVector protect; 2341 2335 2342 // FIXME: Is it really necessary to do this in reverse order? 2336 Frame* previous; 2337 for (Frame* child = m_frame->tree()->lastChild(); child; child = previous) { 2338 previous = child->tree()->previousSibling(); 2339 child->loader()->detachFromParent(); 2340 } 2343 for (Frame* child = m_frame->tree()->lastChild(); child; child = child->tree()->previousSibling()) 2344 protect.append(child); 2345 for (FrameVector::iterator it = protect.begin(); it != protect.end(); ++it) 2346 (*it)->loader()->detachFromParent(); 2341 2347 } 2342 2348
Note: See TracChangeset
for help on using the changeset viewer.