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

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

Issue 1063573002: history.pushState() should take care of scrolling state (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 m_currentItem = HistoryItem::create(); 298 m_currentItem = HistoryItem::create();
299 } else if (!isPushOrReplaceState && m_documentLoader->url() != m_currentItem ->url()) { 299 } else if (!isPushOrReplaceState && m_documentLoader->url() != m_currentItem ->url()) {
300 m_currentItem->generateNewItemSequenceNumber(); 300 m_currentItem->generateNewItemSequenceNumber();
301 if (!equalIgnoringFragmentIdentifier(m_documentLoader->url(), m_currentI tem->url())) 301 if (!equalIgnoringFragmentIdentifier(m_documentLoader->url(), m_currentI tem->url()))
302 m_currentItem->generateNewDocumentSequenceNumber(); 302 m_currentItem->generateNewDocumentSequenceNumber();
303 } 303 }
304 304
305 m_currentItem->setURL(m_documentLoader->urlForHistory()); 305 m_currentItem->setURL(m_documentLoader->urlForHistory());
306 m_currentItem->setDocumentState(m_frame->document()->formElementsState()); 306 m_currentItem->setDocumentState(m_frame->document()->formElementsState());
307 m_currentItem->setTarget(m_frame->tree().uniqueName()); 307 m_currentItem->setTarget(m_frame->tree().uniqueName());
308 if (isPushOrReplaceState) 308 if (isPushOrReplaceState) {
309 m_currentItem->setStateObject(stateObject); 309 m_currentItem->setStateObject(stateObject);
310 saveScrollState();
Nate Chapin 2015/04/06 17:17:15 I believe there's a saveScrollState() call in Fram
Abhijeet Kandalkar Slow 2015/04/07 08:14:49 Done.
311 }
312
310 m_currentItem->setReferrer(SecurityPolicy::generateReferrer(m_documentLoader ->request().referrerPolicy(), m_currentItem->url(), m_documentLoader->request(). httpReferrer())); 313 m_currentItem->setReferrer(SecurityPolicy::generateReferrer(m_documentLoader ->request().referrerPolicy(), m_currentItem->url(), m_documentLoader->request(). httpReferrer()));
311 m_currentItem->setFormInfoFromRequest(m_documentLoader->request()); 314 m_currentItem->setFormInfoFromRequest(m_documentLoader->request());
312 } 315 }
313 316
314 static HistoryCommitType loadTypeToCommitType(FrameLoadType type) 317 static HistoryCommitType loadTypeToCommitType(FrameLoadType type)
315 { 318 {
316 switch (type) { 319 switch (type) {
317 case FrameLoadTypeStandard: 320 case FrameLoadTypeStandard:
318 return StandardCommit; 321 return StandardCommit;
319 case FrameLoadTypeInitialInChildFrame: 322 case FrameLoadTypeInitialInChildFrame:
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 // FIXME: We need a way to propagate insecure requests policy flags to 1430 // FIXME: We need a way to propagate insecure requests policy flags to
1428 // out-of-process frames. For now, we'll always use default behavior. 1431 // out-of-process frames. For now, we'll always use default behavior.
1429 if (!parentFrame->isLocalFrame()) 1432 if (!parentFrame->isLocalFrame())
1430 return nullptr; 1433 return nullptr;
1431 1434
1432 ASSERT(toLocalFrame(parentFrame)->document()); 1435 ASSERT(toLocalFrame(parentFrame)->document());
1433 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1436 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1434 } 1437 }
1435 1438
1436 } // namespace blink 1439 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698