Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: Source/core/loader/FrameLoader.cpp

Issue 201773002: Do not trigger new history entry if iframe URL doesn't change (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests. Somehow getting different iframe dump on some bots. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 ? UpdateBackForwardList : DoNotUpdateBackForwardList, request.clientRedirect()); 766 loadInSameDocument(url, nullptr, newLoadType == FrameLoadTypeStandard && !shouldTreatURLAsSameAsCurrent(url) ? UpdateBackForwardList : DoNotUpdateBackFo rwardList, 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
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
1404 bool FrameLoader::shouldTreatURLAsSrcdocDocument(const KURL& url) const 1409 bool FrameLoader::shouldTreatURLAsSrcdocDocument(const KURL& url) const
1405 { 1410 {
1406 if (!equalIgnoringCase(url.string(), "about:srcdoc")) 1411 if (!equalIgnoringCase(url.string(), "about:srcdoc"))
1407 return false; 1412 return false;
1408 HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement(); 1413 HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement();
1409 if (!isHTMLIFrameElement(ownerElement)) 1414 if (!isHTMLIFrameElement(ownerElement))
1410 return false; 1415 return false;
1411 return ownerElement->fastHasAttribute(srcdocAttr); 1416 return ownerElement->fastHasAttribute(srcdocAttr);
1412 } 1417 }
1413 1418
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 { 1474 {
1470 SandboxFlags flags = m_forcedSandboxFlags; 1475 SandboxFlags flags = m_forcedSandboxFlags;
1471 if (LocalFrame* parentFrame = m_frame->tree().parent()) 1476 if (LocalFrame* parentFrame = m_frame->tree().parent())
1472 flags |= parentFrame->document()->sandboxFlags(); 1477 flags |= parentFrame->document()->sandboxFlags();
1473 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) 1478 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
1474 flags |= ownerElement->sandboxFlags(); 1479 flags |= ownerElement->sandboxFlags();
1475 return flags; 1480 return flags;
1476 } 1481 }
1477 1482
1478 } // namespace WebCore 1483 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698