Changeset 25395 in webkit
- Timestamp:
- Sep 6, 2007, 12:39:32 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r25387 r25395 1 2007-09-06 Darin Adler <darin@apple.com> 2 3 Reviewed by Hyatt. 4 5 - <rdar://problem/5457865> REGRESSION (9A527): Safari crashes when opening a page 6 that immediately redirects to a PDF 7 8 I don't know how to make an automated test that trips over this. 9 10 The immediate cause of this regression was making a back/forward list entry in 11 this case. Earlier, the quick redirect would not results in a separate entry. 12 That's possibly a bug too, but it's better to fix the crash first. 13 14 The page cache was putting the document into a strange state: Still attached but 15 with the renderer set to 0. There was no good reason to do this, so got rid of it. 16 Moved the responsibility to the caller of not calling detach() when moving into 17 the page cache. This is more of a frame loader thing than a document thing. 18 19 * dom/Document.cpp: (WebCore::Document::detach): Added assertions that this is 20 only called on a document that's attached and not in the page cache. Also moved 21 the call to willRemove in here, so that callers can't make the mistake of not 22 calling that function. Removed the incorrectly-positioned code that made this 23 function do less if it was called on a document in the page cache. 24 25 * history/CachedPage.cpp: (WebCore::CachedPage::clear): Removed the code to handle 26 a document with a renderer of 0. There was no need to put the document into this 27 state. Any document in the page cache will always be "attached". 28 29 * loader/FrameLoader.cpp: (WebCore::FrameLoader::clear): Added a check to prevent 30 from calling an unnecessary cancelParsing() on a document that's in the page cache 31 and guard the call to detach() with a check of attached(), like all other calls to 32 detach() on DOM objects. 33 34 * page/Frame.cpp: 35 (WebCore::Frame::setView): Added a missing check of attached(), like all other 36 calls to detach() on DOM objects. Also added code to not call detach() on the 37 document when it's in the page cache. 38 (WebCore::Frame::setDocument): This call site already had the attached() check, 39 but was missing the page cache check. 40 1 41 2007-09-05 David Harrison <harrison@apple.com> 2 42 -
trunk/WebCore/dom/Document.cpp
r25346 r25395 1138 1138 void Document::detach() 1139 1139 { 1140 ASSERT(attached()); 1141 ASSERT(!m_inPageCache); 1142 1143 willRemove(); 1144 1140 1145 RenderObject* render = renderer(); 1141 1146 … … 1143 1148 setRenderer(0); 1144 1149 1145 if (m_inPageCache) {1146 if (render)1147 axObjectCache()->remove(render);1148 return;1149 }1150 1151 1150 // Empty out these lists as a performance optimization, since detaching 1152 1151 // all the individual render objects will cause all the RenderImage -
trunk/WebCore/history/CachedPage.cpp
r24495 r25395 163 163 Frame::clearTimers(m_view.get()); 164 164 165 bool detached = !m_document->renderer();166 165 m_document->setInPageCache(false); 167 if (detached) { 168 m_document->detach(); 169 m_document->removeAllEventListenersFromAllNodes(); 170 } 166 m_document->detach(); 167 m_document->removeAllEventListenersFromAllNodes(); 171 168 172 169 m_view->clearFrame(); -
trunk/WebCore/loader/FrameLoader.cpp
r25283 r25395 780 780 m_needsClear = false; 781 781 782 if (m_frame->document() ) {782 if (m_frame->document() && !m_frame->document()->inPageCache()) { 783 783 m_frame->document()->cancelParsing(); 784 m_frame->document()->willRemove();785 m_frame->document()->detach();784 if (m_frame->document()->attached()) 785 m_frame->document()->detach(); 786 786 } 787 787 -
trunk/WebCore/page/Frame.cpp
r25361 r25395 232 232 // we wait until the view is destroyed, then things won't be 233 233 // hooked up enough for some JavaScript calls to work. 234 if ( d->m_doc && view == 0) {234 if (!view && d->m_doc && d->m_doc->attached() && !d->m_doc->inPageCache()) { 235 235 d->m_doc->detach(); 236 236 if (d->m_view) … … 268 268 void Frame::setDocument(PassRefPtr<Document> newDoc) 269 269 { 270 if (d->m_doc && d->m_doc->attached() )270 if (d->m_doc && d->m_doc->attached() && !d->m_doc->inPageCache()) 271 271 d->m_doc->detach(); 272 272
Note:
See TracChangeset
for help on using the changeset viewer.