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

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

Issue 2710063002: Revert of Add DidSaveScrollOrScaleState flag to prevent restoreScrollPosition... (Closed)
Patch Set: rebase update Created 3 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 void FrameLoader::RestoreScrollPositionAndViewStateForLoadType( 1126 void FrameLoader::RestoreScrollPositionAndViewStateForLoadType(
1127 FrameLoadType load_type) { 1127 FrameLoadType load_type) {
1128 FrameView* view = frame_->View(); 1128 FrameView* view = frame_->View();
1129 if (!view || !view->LayoutViewportScrollableArea() || 1129 if (!view || !view->LayoutViewportScrollableArea() ||
1130 !state_machine_.CommittedFirstRealDocumentLoad()) { 1130 !state_machine_.CommittedFirstRealDocumentLoad()) {
1131 return; 1131 return;
1132 } 1132 }
1133 if (!NeedsHistoryItemRestore(load_type)) 1133 if (!NeedsHistoryItemRestore(load_type))
1134 return; 1134 return;
1135 HistoryItem* history_item = document_loader_->GetHistoryItem(); 1135 HistoryItem* history_item = document_loader_->GetHistoryItem();
1136 if (!history_item || !history_item->DidSaveScrollOrScaleState()) 1136 if (!history_item)
1137 return; 1137 return;
1138 1138
1139 bool should_restore_scroll = 1139 bool should_restore_scroll =
1140 history_item->ScrollRestorationType() != kScrollRestorationManual; 1140 history_item->ScrollRestorationType() != kScrollRestorationManual;
1141 bool should_restore_scale = history_item->PageScaleFactor(); 1141 bool should_restore_scale = history_item->PageScaleFactor();
1142 1142
1143 // This tries to balance: 1143 // This tries to balance:
1144 // 1. restoring as soon as possible 1144 // 1. restoring as soon as possible
1145 // 2. not overriding user scroll (TODO(majidvp): also respect user scale) 1145 // 2. not overriding user scroll (TODO(majidvp): also respect user scale)
1146 // 3. detecting clamping to avoid repeatedly popping the scroll position down 1146 // 3. detecting clamping to avoid repeatedly popping the scroll position down
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 // TODO(japhet): This is needed because the browser process DCHECKs if the 1741 // TODO(japhet): This is needed because the browser process DCHECKs if the
1742 // first entry we commit in a new frame has replacement set. It's unclear 1742 // first entry we commit in a new frame has replacement set. It's unclear
1743 // whether the DCHECK is right, investigate removing this special case. 1743 // whether the DCHECK is right, investigate removing this special case.
1744 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem && 1744 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem &&
1745 (!Opener() || !request.Url().IsEmpty()); 1745 (!Opener() || !request.Url().IsEmpty());
1746 loader->SetReplacesCurrentHistoryItem(replace_current_item); 1746 loader->SetReplacesCurrentHistoryItem(replace_current_item);
1747 return loader; 1747 return loader;
1748 } 1748 }
1749 1749
1750 } // namespace blink 1750 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/loader/HistoryItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698