| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 return; | 578 return; |
| 579 } | 579 } |
| 580 m_loadType = type; | 580 m_loadType = type; |
| 581 saveScrollState(); | 581 saveScrollState(); |
| 582 | 582 |
| 583 KURL oldURL = m_frame->document()->url(); | 583 KURL oldURL = m_frame->document()->url(); |
| 584 // If we were in the autoscroll/panScroll mode we want to stop it before fol
lowing the link to the anchor | 584 // If we were in the autoscroll/panScroll mode we want to stop it before fol
lowing the link to the anchor |
| 585 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragme
ntIdentifier() != oldURL.fragmentIdentifier(); | 585 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragme
ntIdentifier() != oldURL.fragmentIdentifier(); |
| 586 if (hashChange) { | 586 if (hashChange) { |
| 587 m_frame->eventHandler().stopAutoscroll(); | 587 m_frame->eventHandler().stopAutoscroll(); |
| 588 m_frame->domWindow()->enqueueHashchangeEvent(oldURL, url); | 588 m_frame->localDOMWindow()->enqueueHashchangeEvent(oldURL, url); |
| 589 } | 589 } |
| 590 m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirect); | 590 m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirect); |
| 591 m_documentLoader->setReplacesCurrentHistoryItem(m_loadType == FrameLoadTypeS
tandard); | 591 m_documentLoader->setReplacesCurrentHistoryItem(m_loadType == FrameLoadTypeS
tandard); |
| 592 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
type); | 592 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
type); |
| 593 | 593 |
| 594 m_frame->view()->setWasScrolledByUser(false); | 594 m_frame->view()->setWasScrolledByUser(false); |
| 595 | 595 |
| 596 // We need to scroll to the fragment whether or not a hash change occurred,
since | 596 // We need to scroll to the fragment whether or not a hash change occurred,
since |
| 597 // the user might have scrolled since the previous navigation. | 597 // the user might have scrolled since the previous navigation. |
| 598 scrollToFragmentWithParentBoundary(url); | 598 scrollToFragmentWithParentBoundary(url); |
| 599 checkCompleted(); | 599 checkCompleted(); |
| 600 | 600 |
| 601 m_frame->domWindow()->statePopped(stateObject ? stateObject : SerializedScri
ptValue::nullValue()); | 601 m_frame->localDOMWindow()->statePopped(stateObject ? stateObject : Serialize
dScriptValue::nullValue()); |
| 602 } | 602 } |
| 603 | 603 |
| 604 void FrameLoader::completed() | 604 void FrameLoader::completed() |
| 605 { | 605 { |
| 606 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); | 606 RefPtrWillBeRawPtr<LocalFrame> protect(m_frame.get()); |
| 607 | 607 |
| 608 for (Frame* descendant = m_frame->tree().traverseNext(m_frame); descendant;
descendant = descendant->tree().traverseNext(m_frame)) { | 608 for (Frame* descendant = m_frame->tree().traverseNext(m_frame); descendant;
descendant = descendant->tree().traverseNext(m_frame)) { |
| 609 if (descendant->isLocalFrame()) | 609 if (descendant->isLocalFrame()) |
| 610 toLocalFrame(descendant)->navigationScheduler().startTimer(); | 610 toLocalFrame(descendant)->navigationScheduler().startTimer(); |
| 611 } | 611 } |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 m_frame->page()->chrome().client().needTouchEvents(false); | 935 m_frame->page()->chrome().client().needTouchEvents(false); |
| 936 | 936 |
| 937 client()->transitionToCommittedForNewPage(); | 937 client()->transitionToCommittedForNewPage(); |
| 938 m_frame->navigationScheduler().cancel(); | 938 m_frame->navigationScheduler().cancel(); |
| 939 m_frame->editor().clearLastEditCommand(); | 939 m_frame->editor().clearLastEditCommand(); |
| 940 | 940 |
| 941 // If we are still in the process of initializing an empty document then | 941 // If we are still in the process of initializing an empty document then |
| 942 // its frame is not in a consistent state for rendering, so avoid setJSStatu
sBarText | 942 // its frame is not in a consistent state for rendering, so avoid setJSStatu
sBarText |
| 943 // since it may cause clients to attempt to render the frame. | 943 // since it may cause clients to attempt to render the frame. |
| 944 if (!m_stateMachine.creatingInitialEmptyDocument()) { | 944 if (!m_stateMachine.creatingInitialEmptyDocument()) { |
| 945 LocalDOMWindow* window = m_frame->domWindow(); | 945 DOMWindow* window = m_frame->domWindow(); |
| 946 window->setStatus(String()); | 946 window->setStatus(String()); |
| 947 window->setDefaultStatus(String()); | 947 window->setDefaultStatus(String()); |
| 948 } | 948 } |
| 949 } | 949 } |
| 950 | 950 |
| 951 bool FrameLoader::isLoadingMainFrame() const | 951 bool FrameLoader::isLoadingMainFrame() const |
| 952 { | 952 { |
| 953 return m_frame->isMainFrame(); | 953 return m_frame->isMainFrame(); |
| 954 } | 954 } |
| 955 | 955 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 // the new page is ready. | 1023 // the new page is ready. |
| 1024 | 1024 |
| 1025 // Retry restoring scroll offset since FrameStateComplete disables content | 1025 // Retry restoring scroll offset since FrameStateComplete disables content |
| 1026 // size clamping. | 1026 // size clamping. |
| 1027 restoreScrollPositionAndViewState(); | 1027 restoreScrollPositionAndViewState(); |
| 1028 | 1028 |
| 1029 if (!m_stateMachine.committedFirstRealDocumentLoad()) | 1029 if (!m_stateMachine.committedFirstRealDocumentLoad()) |
| 1030 return true; | 1030 return true; |
| 1031 | 1031 |
| 1032 m_progressTracker->progressCompleted(); | 1032 m_progressTracker->progressCompleted(); |
| 1033 m_frame->domWindow()->finishedLoading(); | 1033 m_frame->localDOMWindow()->finishedLoading(); |
| 1034 | 1034 |
| 1035 const ResourceError& error = m_documentLoader->mainDocumentError(); | 1035 const ResourceError& error = m_documentLoader->mainDocumentError(); |
| 1036 if (!error.isNull()) { | 1036 if (!error.isNull()) { |
| 1037 client()->dispatchDidFailLoad(error); | 1037 client()->dispatchDidFailLoad(error); |
| 1038 } else { | 1038 } else { |
| 1039 // Report mobile vs. desktop page statistics. This will only report on A
ndroid. | 1039 // Report mobile vs. desktop page statistics. This will only report on A
ndroid. |
| 1040 if (m_frame->isMainFrame()) | 1040 if (m_frame->isMainFrame()) |
| 1041 m_frame->document()->viewportDescription().reportMobilePageStats(m_f
rame); | 1041 m_frame->document()->viewportDescription().reportMobilePageStats(m_f
rame); |
| 1042 | 1042 |
| 1043 client()->dispatchDidFinishLoad(); | 1043 client()->dispatchDidFinishLoad(); |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. | 1442 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. |
| 1443 Frame* parentFrame = m_frame->tree().parent(); | 1443 Frame* parentFrame = m_frame->tree().parent(); |
| 1444 if (parentFrame && parentFrame->isLocalFrame()) | 1444 if (parentFrame && parentFrame->isLocalFrame()) |
| 1445 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); | 1445 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); |
| 1446 if (FrameOwner* frameOwner = m_frame->owner()) | 1446 if (FrameOwner* frameOwner = m_frame->owner()) |
| 1447 flags |= frameOwner->sandboxFlags(); | 1447 flags |= frameOwner->sandboxFlags(); |
| 1448 return flags; | 1448 return flags; |
| 1449 } | 1449 } |
| 1450 | 1450 |
| 1451 } // namespace blink | 1451 } // namespace blink |
| OLD | NEW |