Lines 563-574
void FrameLoader::submitForm(const char*
WebCore/loader/FrameLoader.cpp_sec1
|
563 |
targetFrame->loader()->scheduleFormSubmission(frameRequest, lockHistory, event, formState); |
563 |
targetFrame->loader()->scheduleFormSubmission(frameRequest, lockHistory, event, formState); |
564 |
} |
564 |
} |
565 |
|
565 |
|
566 |
void FrameLoader::stopLoading(bool sendUnload, DatabasePolicy databasePolicy) |
566 |
void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolicy databasePolicy) |
567 |
{ |
567 |
{ |
568 |
if (m_frame->document() && m_frame->document()->tokenizer()) |
568 |
if (m_frame->document() && m_frame->document()->tokenizer()) |
569 |
m_frame->document()->tokenizer()->stopParsing(); |
569 |
m_frame->document()->tokenizer()->stopParsing(); |
570 |
|
570 |
|
571 |
if (sendUnload) { |
571 |
if (unloadEventPolicy != UnloadEventPolicyNone) { |
572 |
if (m_frame->document()) { |
572 |
if (m_frame->document()) { |
573 |
if (m_didCallImplicitClose && !m_wasUnloadEventEmitted) { |
573 |
if (m_didCallImplicitClose && !m_wasUnloadEventEmitted) { |
574 |
Node* currentFocusedNode = m_frame->document()->focusedNode(); |
574 |
Node* currentFocusedNode = m_frame->document()->focusedNode(); |
Lines 576-582
void FrameLoader::stopLoading(bool sendU
WebCore/loader/FrameLoader.cpp_sec2
|
576 |
currentFocusedNode->aboutToUnload(); |
576 |
currentFocusedNode->aboutToUnload(); |
577 |
m_unloadEventBeingDispatched = true; |
577 |
m_unloadEventBeingDispatched = true; |
578 |
if (m_frame->domWindow()) { |
578 |
if (m_frame->domWindow()) { |
579 |
m_frame->domWindow()->dispatchPageTransitionEvent(EventNames().pagehideEvent, m_frame->document()->inPageCache()); |
579 |
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide) |
|
|
580 |
m_frame->domWindow()->dispatchPageTransitionEvent(EventNames().pagehideEvent, m_frame->document()->inPageCache()); |
580 |
m_frame->domWindow()->dispatchUnloadEvent(); |
581 |
m_frame->domWindow()->dispatchUnloadEvent(); |
581 |
} |
582 |
} |
582 |
m_unloadEventBeingDispatched = false; |
583 |
m_unloadEventBeingDispatched = false; |
Lines 614-620
void FrameLoader::stopLoading(bool sendU
WebCore/loader/FrameLoader.cpp_sec3
|
614 |
|
615 |
|
615 |
// tell all subframes to stop as well |
616 |
// tell all subframes to stop as well |
616 |
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) |
617 |
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) |
617 |
child->loader()->stopLoading(sendUnload); |
618 |
child->loader()->stopLoading(unloadEventPolicy); |
618 |
|
619 |
|
619 |
cancelRedirection(); |
620 |
cancelRedirection(); |
620 |
} |
621 |
} |
Lines 636-642
void FrameLoader::stop()
WebCore/loader/FrameLoader.cpp_sec4
|
636 |
bool FrameLoader::closeURL() |
637 |
bool FrameLoader::closeURL() |
637 |
{ |
638 |
{ |
638 |
saveDocumentState(); |
639 |
saveDocumentState(); |
639 |
stopLoading(true); |
640 |
|
|
|
641 |
// Should only send the pagehide event here if the current document exists and has not been placed in the page cache. |
642 |
Document* currentDocument = m_frame->document(); |
643 |
stopLoading(currentDocument && !currentDocument->inPageCache() ? UnloadEventPolicyUnloadAndPageHide : UnloadEventPolicyUnloadOnly); |
644 |
|
640 |
m_frame->editor()->clearUndoRedoOperations(); |
645 |
m_frame->editor()->clearUndoRedoOperations(); |
641 |
return true; |
646 |
return true; |
642 |
} |
647 |
} |
Lines 2081-2087
void FrameLoader::scheduleRedirection(Sc
WebCore/loader/FrameLoader.cpp_sec5
|
2081 |
if (redirection->wasDuringLoad) { |
2086 |
if (redirection->wasDuringLoad) { |
2082 |
if (m_provisionalDocumentLoader) |
2087 |
if (m_provisionalDocumentLoader) |
2083 |
m_provisionalDocumentLoader->stopLoading(); |
2088 |
m_provisionalDocumentLoader->stopLoading(); |
2084 |
stopLoading(true); |
2089 |
stopLoading(UnloadEventPolicyUnloadAndPageHide); |
2085 |
} |
2090 |
} |
2086 |
|
2091 |
|
2087 |
stopRedirectionTimer(); |
2092 |
stopRedirectionTimer(); |
Lines 4233-4244
void FrameLoader::cachePageForHistoryIte
WebCore/loader/FrameLoader.cpp_sec6
|
4233 |
if (!canCachePage() || item->isInPageCache()) |
4238 |
if (!canCachePage() || item->isInPageCache()) |
4234 |
return; |
4239 |
return; |
4235 |
|
4240 |
|
|
|
4241 |
pageHidden(); |
4242 |
|
4236 |
if (Page* page = m_frame->page()) { |
4243 |
if (Page* page = m_frame->page()) { |
4237 |
RefPtr<CachedPage> cachedPage = CachedPage::create(page); |
4244 |
RefPtr<CachedPage> cachedPage = CachedPage::create(page); |
4238 |
pageCache()->add(item, cachedPage.release()); |
4245 |
pageCache()->add(item, cachedPage.release()); |
4239 |
} |
4246 |
} |
4240 |
} |
4247 |
} |
4241 |
|
4248 |
|
|
|
4249 |
void FrameLoader::pageHidden() |
4250 |
{ |
4251 |
m_unloadEventBeingDispatched = true; |
4252 |
if (m_frame->domWindow()) |
4253 |
m_frame->domWindow()->dispatchPageTransitionEvent(EventNames().pagehideEvent, true); |
4254 |
m_unloadEventBeingDispatched = false; |
4255 |
|
4256 |
// Send pagehide event for subframes as well |
4257 |
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) |
4258 |
child->loader()->pageHidden(); |
4259 |
} |
4260 |
|
4242 |
bool FrameLoader::shouldTreatURLAsSameAsCurrent(const KURL& url) const |
4261 |
bool FrameLoader::shouldTreatURLAsSameAsCurrent(const KURL& url) const |
4243 |
{ |
4262 |
{ |
4244 |
if (!m_currentHistoryItem) |
4263 |
if (!m_currentHistoryItem) |