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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 if (action.policy() == NavigationPolicyDownload) | 756 if (action.policy() == NavigationPolicyDownload) |
757 m_client->loadURLExternally(action.resourceRequest(), NavigationPoli
cyDownload); | 757 m_client->loadURLExternally(action.resourceRequest(), NavigationPoli
cyDownload); |
758 else | 758 else |
759 createWindowForRequest(request, *m_frame, action.policy(), request.s
houldSendReferrer()); | 759 createWindowForRequest(request, *m_frame, action.policy(), request.s
houldSendReferrer()); |
760 return; | 760 return; |
761 } | 761 } |
762 | 762 |
763 const KURL& url = request.resourceRequest().url(); | 763 const KURL& url = request.resourceRequest().url(); |
764 if (!action.shouldOpenInNewWindow() && shouldPerformFragmentNavigation(reque
st.formState(), request.resourceRequest().httpMethod(), newLoadType, url)) { | 764 if (!action.shouldOpenInNewWindow() && shouldPerformFragmentNavigation(reque
st.formState(), request.resourceRequest().httpMethod(), newLoadType, url)) { |
765 m_documentLoader->setTriggeringAction(action); | 765 m_documentLoader->setTriggeringAction(action); |
766 loadInSameDocument(url, nullptr, newLoadType == FrameLoadTypeStandard &&
!shouldTreatURLAsSameAsCurrent(url) ? UpdateBackForwardList : DoNotUpdateBackFo
rwardList, request.clientRedirect()); | 766 loadInSameDocument(url, nullptr, newLoadType == FrameLoadTypeStandard ?
UpdateBackForwardList : DoNotUpdateBackForwardList, request.clientRedirect()); |
767 return; | 767 return; |
768 } | 768 } |
769 bool sameURL = url == m_documentLoader->urlForHistory(); | 769 bool sameURL = url == m_documentLoader->urlForHistory(); |
770 loadWithNavigationAction(action, newLoadType, request.formState(), request.s
ubstituteData(), request.clientRedirect()); | 770 loadWithNavigationAction(action, newLoadType, request.formState(), request.s
ubstituteData(), request.clientRedirect()); |
771 // Example of this case are sites that reload the same URL with a different
cookie | 771 // Example of this case are sites that reload the same URL with a different
cookie |
772 // driving the generated content, or a master frame with links that drive a
target | 772 // driving the generated content, or a master frame with links that drive a
target |
773 // frame, where the user has clicked on the same link repeatedly. | 773 // frame, where the user has clicked on the same link repeatedly. |
774 if (sameURL && newLoadType != FrameLoadTypeReload && newLoadType != FrameLoa
dTypeReloadFromOrigin && request.resourceRequest().httpMethod() != "POST") | 774 if (sameURL && newLoadType != FrameLoadTypeReload && newLoadType != FrameLoa
dTypeReloadFromOrigin && request.resourceRequest().httpMethod() != "POST") |
775 m_loadType = FrameLoadTypeSame; | 775 m_loadType = FrameLoadTypeSame; |
776 } | 776 } |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 return true; | 1394 return true; |
1395 case XFrameOptionsInvalid: | 1395 case XFrameOptionsInvalid: |
1396 m_frame->document()->addConsoleMessageWithRequestIdentifier(JSMessageSou
rce, ErrorMessageLevel, "Invalid 'X-Frame-Options' header encountered when loadi
ng '" + url.elidedString() + "': '" + content + "' is not a recognized directive
. The header will be ignored.", requestIdentifier); | 1396 m_frame->document()->addConsoleMessageWithRequestIdentifier(JSMessageSou
rce, ErrorMessageLevel, "Invalid 'X-Frame-Options' header encountered when loadi
ng '" + url.elidedString() + "': '" + content + "' is not a recognized directive
. The header will be ignored.", requestIdentifier); |
1397 return false; | 1397 return false; |
1398 default: | 1398 default: |
1399 ASSERT_NOT_REACHED(); | 1399 ASSERT_NOT_REACHED(); |
1400 return false; | 1400 return false; |
1401 } | 1401 } |
1402 } | 1402 } |
1403 | 1403 |
1404 bool FrameLoader::shouldTreatURLAsSameAsCurrent(const KURL& url) const | |
1405 { | |
1406 return m_currentItem && url == m_currentItem->url(); | |
1407 } | |
1408 | |
1409 bool FrameLoader::shouldTreatURLAsSrcdocDocument(const KURL& url) const | 1404 bool FrameLoader::shouldTreatURLAsSrcdocDocument(const KURL& url) const |
1410 { | 1405 { |
1411 if (!equalIgnoringCase(url.string(), "about:srcdoc")) | 1406 if (!equalIgnoringCase(url.string(), "about:srcdoc")) |
1412 return false; | 1407 return false; |
1413 HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement(); | 1408 HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement(); |
1414 if (!isHTMLIFrameElement(ownerElement)) | 1409 if (!isHTMLIFrameElement(ownerElement)) |
1415 return false; | 1410 return false; |
1416 return ownerElement->fastHasAttribute(srcdocAttr); | 1411 return ownerElement->fastHasAttribute(srcdocAttr); |
1417 } | 1412 } |
1418 | 1413 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1474 { | 1469 { |
1475 SandboxFlags flags = m_forcedSandboxFlags; | 1470 SandboxFlags flags = m_forcedSandboxFlags; |
1476 if (LocalFrame* parentFrame = m_frame->tree().parent()) | 1471 if (LocalFrame* parentFrame = m_frame->tree().parent()) |
1477 flags |= parentFrame->document()->sandboxFlags(); | 1472 flags |= parentFrame->document()->sandboxFlags(); |
1478 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) | 1473 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) |
1479 flags |= ownerElement->sandboxFlags(); | 1474 flags |= ownerElement->sandboxFlags(); |
1480 return flags; | 1475 return flags; |
1481 } | 1476 } |
1482 | 1477 |
1483 } // namespace WebCore | 1478 } // namespace WebCore |
OLD | NEW |