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

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

Issue 267613003: location.replace() breaks same-document back/forward navigations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 m_shouldCallCheckCompleted = false; 250 m_shouldCallCheckCompleted = false;
251 251
252 if (m_stateMachine.isDisplayingInitialEmptyDocument()) 252 if (m_stateMachine.isDisplayingInitialEmptyDocument())
253 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad ); 253 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad );
254 } 254 }
255 255
256 void FrameLoader::setHistoryItemStateForCommit(HistoryCommitType historyCommitTy pe, bool isPushOrReplaceState, PassRefPtr<SerializedScriptValue> stateObject) 256 void FrameLoader::setHistoryItemStateForCommit(HistoryCommitType historyCommitTy pe, bool isPushOrReplaceState, PassRefPtr<SerializedScriptValue> stateObject)
257 { 257 {
258 if (m_provisionalItem) 258 if (m_provisionalItem)
259 m_currentItem = m_provisionalItem.release(); 259 m_currentItem = m_provisionalItem.release();
260 if (!m_currentItem || historyCommitType == StandardCommit) 260
261 if (!m_currentItem || historyCommitType == StandardCommit) {
261 m_currentItem = HistoryItem::create(); 262 m_currentItem = HistoryItem::create();
262 else if (!isPushOrReplaceState && m_documentLoader->url() != m_currentItem-> url()) 263 } else if (!isPushOrReplaceState && m_documentLoader->url() != m_currentItem ->url()) {
263 m_currentItem->generateNewSequenceNumbers(); 264 m_currentItem->generateNewItemSequenceNumber();
265 if (!equalIgnoringFragmentIdentifier(m_documentLoader->url(), m_currentI tem->url()))
266 m_currentItem->generateNewDocumentSequenceNumber();
267 }
268
264 m_currentItem->setURL(m_documentLoader->urlForHistory()); 269 m_currentItem->setURL(m_documentLoader->urlForHistory());
265 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); 270 m_currentItem->setDocumentState(m_frame->document()->formElementsState());
266 m_currentItem->setTarget(m_frame->tree().uniqueName()); 271 m_currentItem->setTarget(m_frame->tree().uniqueName());
267 if (isPushOrReplaceState) 272 if (isPushOrReplaceState)
268 m_currentItem->setStateObject(stateObject); 273 m_currentItem->setStateObject(stateObject);
269 m_currentItem->setReferrer(Referrer(m_documentLoader->request().httpReferrer (), m_documentLoader->request().referrerPolicy())); 274 m_currentItem->setReferrer(Referrer(m_documentLoader->request().httpReferrer (), m_documentLoader->request().referrerPolicy()));
270 m_currentItem->setFormInfoFromRequest(isPushOrReplaceState ? ResourceRequest () : m_documentLoader->request()); 275 m_currentItem->setFormInfoFromRequest(isPushOrReplaceState ? ResourceRequest () : m_documentLoader->request());
271 } 276 }
272 277
273 static HistoryCommitType loadTypeToCommitType(FrameLoadType type, bool isValidHi storyURL) 278 static HistoryCommitType loadTypeToCommitType(FrameLoadType type, bool isValidHi storyURL)
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 { 1396 {
1392 SandboxFlags flags = m_forcedSandboxFlags; 1397 SandboxFlags flags = m_forcedSandboxFlags;
1393 if (LocalFrame* parentFrame = m_frame->tree().parent()) 1398 if (LocalFrame* parentFrame = m_frame->tree().parent())
1394 flags |= parentFrame->document()->sandboxFlags(); 1399 flags |= parentFrame->document()->sandboxFlags();
1395 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement()) 1400 if (HTMLFrameOwnerElement* ownerElement = m_frame->ownerElement())
1396 flags |= ownerElement->sandboxFlags(); 1401 flags |= ownerElement->sandboxFlags();
1397 return flags; 1402 return flags;
1398 } 1403 }
1399 1404
1400 } // namespace WebCore 1405 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/loader/back-after-same-document-location-replace-expected.txt ('k') | Source/core/loader/HistoryItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698