OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 return; | 579 return; |
580 } | 580 } |
581 m_loadType = type; | 581 m_loadType = type; |
582 saveScrollState(); | 582 saveScrollState(); |
583 | 583 |
584 KURL oldURL = m_frame->document()->url(); | 584 KURL oldURL = m_frame->document()->url(); |
585 // If we were in the autoscroll/panScroll mode we want to stop it before fol
lowing the link to the anchor | 585 // If we were in the autoscroll/panScroll mode we want to stop it before fol
lowing the link to the anchor |
586 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragme
ntIdentifier() != oldURL.fragmentIdentifier(); | 586 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragme
ntIdentifier() != oldURL.fragmentIdentifier(); |
587 if (hashChange) { | 587 if (hashChange) { |
588 m_frame->eventHandler().stopAutoscroll(); | 588 m_frame->eventHandler().stopAutoscroll(); |
589 m_frame->domWindow()->enqueueHashchangeEvent(oldURL, url); | 589 m_frame->localDOMWindow()->enqueueHashchangeEvent(oldURL, url); |
590 } | 590 } |
591 m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirect); | 591 m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirect); |
592 m_documentLoader->setReplacesCurrentHistoryItem(m_loadType == FrameLoadTypeS
tandard); | 592 m_documentLoader->setReplacesCurrentHistoryItem(m_loadType == FrameLoadTypeS
tandard); |
593 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
type); | 593 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
type); |
594 | 594 |
595 m_frame->view()->setWasScrolledByUser(false); | 595 m_frame->view()->setWasScrolledByUser(false); |
596 | 596 |
597 // We need to scroll to the fragment whether or not a hash change occurred,
since | 597 // We need to scroll to the fragment whether or not a hash change occurred,
since |
598 // the user might have scrolled since the previous navigation. | 598 // the user might have scrolled since the previous navigation. |
599 scrollToFragmentWithParentBoundary(url); | 599 scrollToFragmentWithParentBoundary(url); |
600 checkCompleted(); | 600 checkCompleted(); |
601 | 601 |
602 m_frame->domWindow()->statePopped(stateObject ? stateObject : SerializedScri
ptValue::nullValue()); | 602 m_frame->localDOMWindow()->statePopped(stateObject ? stateObject : Serialize
dScriptValue::nullValue()); |
603 } | 603 } |
604 | 604 |
605 void FrameLoader::completed() | 605 void FrameLoader::completed() |
606 { | 606 { |
607 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); | 607 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
608 | 608 |
609 for (Frame* descendant = m_frame->tree().traverseNext(m_frame); descendant;
descendant = descendant->tree().traverseNext(m_frame)) { | 609 for (Frame* descendant = m_frame->tree().traverseNext(m_frame); descendant;
descendant = descendant->tree().traverseNext(m_frame)) { |
610 if (descendant->isLocalFrame()) | 610 if (descendant->isLocalFrame()) |
611 toLocalFrame(descendant)->navigationScheduler().startTimer(); | 611 toLocalFrame(descendant)->navigationScheduler().startTimer(); |
612 } | 612 } |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 m_frame->page()->chrome().client().needTouchEvents(false); | 936 m_frame->page()->chrome().client().needTouchEvents(false); |
937 | 937 |
938 client()->transitionToCommittedForNewPage(); | 938 client()->transitionToCommittedForNewPage(); |
939 m_frame->navigationScheduler().cancel(); | 939 m_frame->navigationScheduler().cancel(); |
940 m_frame->editor().clearLastEditCommand(); | 940 m_frame->editor().clearLastEditCommand(); |
941 | 941 |
942 // If we are still in the process of initializing an empty document then | 942 // If we are still in the process of initializing an empty document then |
943 // its frame is not in a consistent state for rendering, so avoid setJSStatu
sBarText | 943 // its frame is not in a consistent state for rendering, so avoid setJSStatu
sBarText |
944 // since it may cause clients to attempt to render the frame. | 944 // since it may cause clients to attempt to render the frame. |
945 if (!m_stateMachine.creatingInitialEmptyDocument()) { | 945 if (!m_stateMachine.creatingInitialEmptyDocument()) { |
946 LocalDOMWindow* window = m_frame->domWindow(); | 946 DOMWindow* window = m_frame->domWindow(); |
947 window->setStatus(String()); | 947 window->setStatus(String()); |
948 window->setDefaultStatus(String()); | 948 window->setDefaultStatus(String()); |
949 } | 949 } |
950 } | 950 } |
951 | 951 |
952 bool FrameLoader::isLoadingMainFrame() const | 952 bool FrameLoader::isLoadingMainFrame() const |
953 { | 953 { |
954 return m_frame->isMainFrame(); | 954 return m_frame->isMainFrame(); |
955 } | 955 } |
956 | 956 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 // the new page is ready. | 1032 // the new page is ready. |
1033 | 1033 |
1034 // Retry restoring scroll offset since FrameStateComplete disables content | 1034 // Retry restoring scroll offset since FrameStateComplete disables content |
1035 // size clamping. | 1035 // size clamping. |
1036 restoreScrollPositionAndViewState(); | 1036 restoreScrollPositionAndViewState(); |
1037 | 1037 |
1038 if (!m_stateMachine.committedFirstRealDocumentLoad()) | 1038 if (!m_stateMachine.committedFirstRealDocumentLoad()) |
1039 return true; | 1039 return true; |
1040 | 1040 |
1041 m_progressTracker->progressCompleted(); | 1041 m_progressTracker->progressCompleted(); |
1042 m_frame->domWindow()->finishedLoading(); | 1042 m_frame->localDOMWindow()->finishedLoading(); |
1043 | 1043 |
1044 const ResourceError& error = m_documentLoader->mainDocumentError(); | 1044 const ResourceError& error = m_documentLoader->mainDocumentError(); |
1045 if (!error.isNull()) { | 1045 if (!error.isNull()) { |
1046 client()->dispatchDidFailLoad(error); | 1046 client()->dispatchDidFailLoad(error); |
1047 } else { | 1047 } else { |
1048 // Report mobile vs. desktop page statistics. This will only report on A
ndroid. | 1048 // Report mobile vs. desktop page statistics. This will only report on A
ndroid. |
1049 if (m_frame->isMainFrame()) | 1049 if (m_frame->isMainFrame()) |
1050 m_frame->document()->viewportDescription().reportMobilePageStats(m_f
rame); | 1050 m_frame->document()->viewportDescription().reportMobilePageStats(m_f
rame); |
1051 | 1051 |
1052 client()->dispatchDidFinishLoad(); | 1052 client()->dispatchDidFinishLoad(); |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. | 1453 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. |
1454 Frame* parentFrame = m_frame->tree().parent(); | 1454 Frame* parentFrame = m_frame->tree().parent(); |
1455 if (parentFrame && parentFrame->isLocalFrame()) | 1455 if (parentFrame && parentFrame->isLocalFrame()) |
1456 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); | 1456 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); |
1457 if (FrameOwner* frameOwner = m_frame->owner()) | 1457 if (FrameOwner* frameOwner = m_frame->owner()) |
1458 flags |= frameOwner->sandboxFlags(); | 1458 flags |= frameOwner->sandboxFlags(); |
1459 return flags; | 1459 return flags; |
1460 } | 1460 } |
1461 | 1461 |
1462 } // namespace blink | 1462 } // namespace blink |
OLD | NEW |