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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 return false; | 546 return false; |
547 Settings* settings = m_frame->settings(); | 547 Settings* settings = m_frame->settings(); |
548 bool allowed = client()->allowPlugins(settings && settings->pluginsEnabled()
); | 548 bool allowed = client()->allowPlugins(settings && settings->pluginsEnabled()
); |
549 if (!allowed && reason == AboutToInstantiatePlugin) | 549 if (!allowed && reason == AboutToInstantiatePlugin) |
550 client()->didNotAllowPlugins(); | 550 client()->didNotAllowPlugins(); |
551 return allowed; | 551 return allowed; |
552 } | 552 } |
553 | 553 |
554 void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume
ntNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValu
e> data, FrameLoadType type) | 554 void FrameLoader::updateForSameDocumentNavigation(const KURL& newURL, SameDocume
ntNavigationSource sameDocumentNavigationSource, PassRefPtr<SerializedScriptValu
e> data, FrameLoadType type) |
555 { | 555 { |
556 saveScrollState(); | |
557 | |
558 // Update the data source's request with the new URL to fake the URL change | 556 // Update the data source's request with the new URL to fake the URL change |
559 m_frame->document()->setURL(newURL); | 557 m_frame->document()->setURL(newURL); |
560 documentLoader()->setReplacesCurrentHistoryItem(type != FrameLoadTypeStandar
d); | 558 documentLoader()->setReplacesCurrentHistoryItem(type != FrameLoadTypeStandar
d); |
561 documentLoader()->updateForSameDocumentNavigation(newURL, sameDocumentNaviga
tionSource); | 559 documentLoader()->updateForSameDocumentNavigation(newURL, sameDocumentNaviga
tionSource); |
562 | 560 |
563 // Generate start and stop notifications only when loader is completed so th
at we | 561 // Generate start and stop notifications only when loader is completed so th
at we |
564 // don't fire them for fragment redirection that happens in window.onload ha
ndler. | 562 // don't fire them for fragment redirection that happens in window.onload ha
ndler. |
565 // See https://bugs.webkit.org/show_bug.cgi?id=31838 | 563 // See https://bugs.webkit.org/show_bug.cgi?id=31838 |
566 if (m_frame->document()->loadEventFinished()) | 564 if (m_frame->document()->loadEventFinished()) |
567 client()->didStartLoading(NavigationWithinSameDocument); | 565 client()->didStartLoading(NavigationWithinSameDocument); |
(...skipping 17 matching lines...) Expand all Loading... |
585 // If we have a provisional request for a different document, a fragment scr
oll should cancel it. | 583 // If we have a provisional request for a different document, a fragment scr
oll should cancel it. |
586 if (m_provisionalDocumentLoader) { | 584 if (m_provisionalDocumentLoader) { |
587 m_provisionalDocumentLoader->stopLoading(); | 585 m_provisionalDocumentLoader->stopLoading(); |
588 if (m_provisionalDocumentLoader) | 586 if (m_provisionalDocumentLoader) |
589 m_provisionalDocumentLoader->detachFromFrame(); | 587 m_provisionalDocumentLoader->detachFromFrame(); |
590 m_provisionalDocumentLoader = nullptr; | 588 m_provisionalDocumentLoader = nullptr; |
591 if (!m_frame->host()) | 589 if (!m_frame->host()) |
592 return; | 590 return; |
593 } | 591 } |
594 m_loadType = type; | 592 m_loadType = type; |
| 593 saveScrollState(); |
595 | 594 |
596 KURL oldURL = m_frame->document()->url(); | 595 KURL oldURL = m_frame->document()->url(); |
597 // If we were in the autoscroll/panScroll mode we want to stop it before fol
lowing the link to the anchor | 596 // If we were in the autoscroll/panScroll mode we want to stop it before fol
lowing the link to the anchor |
598 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragme
ntIdentifier() != oldURL.fragmentIdentifier(); | 597 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && url.fragme
ntIdentifier() != oldURL.fragmentIdentifier(); |
599 if (hashChange) { | 598 if (hashChange) { |
600 m_frame->eventHandler().stopAutoscroll(); | 599 m_frame->eventHandler().stopAutoscroll(); |
601 m_frame->localDOMWindow()->enqueueHashchangeEvent(oldURL, url); | 600 m_frame->localDOMWindow()->enqueueHashchangeEvent(oldURL, url); |
602 } | 601 } |
603 m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirect); | 602 m_documentLoader->setIsClientRedirect(clientRedirect == ClientRedirect); |
604 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
type); | 603 updateForSameDocumentNavigation(url, SameDocumentNavigationDefault, nullptr,
type); |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 // FIXME: We need a way to propagate insecure requests policy flags to | 1435 // FIXME: We need a way to propagate insecure requests policy flags to |
1437 // out-of-process frames. For now, we'll always use default behavior. | 1436 // out-of-process frames. For now, we'll always use default behavior. |
1438 if (!parentFrame->isLocalFrame()) | 1437 if (!parentFrame->isLocalFrame()) |
1439 return nullptr; | 1438 return nullptr; |
1440 | 1439 |
1441 ASSERT(toLocalFrame(parentFrame)->document()); | 1440 ASSERT(toLocalFrame(parentFrame)->document()); |
1442 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; | 1441 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; |
1443 } | 1442 } |
1444 | 1443 |
1445 } // namespace blink | 1444 } // namespace blink |
OLD | NEW |