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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1117 | 1117 |
1118 void FrameLoader::restoreScrollPositionAndViewState() | 1118 void FrameLoader::restoreScrollPositionAndViewState() |
1119 { | 1119 { |
1120 FrameView* view = m_frame->view(); | 1120 FrameView* view = m_frame->view(); |
1121 if (!m_frame->page() || !view || !view->layoutViewportScrollableArea() || !m _currentItem || !m_stateMachine.committedFirstRealDocumentLoad()) | 1121 if (!m_frame->page() || !view || !view->layoutViewportScrollableArea() || !m _currentItem || !m_stateMachine.committedFirstRealDocumentLoad()) |
1122 return; | 1122 return; |
1123 | 1123 |
1124 if (!needsHistoryItemRestore(m_loadType)) | 1124 if (!needsHistoryItemRestore(m_loadType)) |
1125 return; | 1125 return; |
1126 | 1126 |
1127 if (!documentLoader()) | |
Nate Chapin
2015/12/03 17:49:13
Maybe add this to the first if() statement? It's s
skobes
2015/12/03 18:40:32
Done.
| |
1128 return; | |
1129 | |
1127 bool shouldRestoreScroll = m_currentItem->scrollRestorationType() != ScrollR estorationManual; | 1130 bool shouldRestoreScroll = m_currentItem->scrollRestorationType() != ScrollR estorationManual; |
1128 bool shouldRestoreScale = m_currentItem->pageScaleFactor(); | 1131 bool shouldRestoreScale = m_currentItem->pageScaleFactor(); |
1129 | 1132 |
1130 // This tries to balance: | 1133 // This tries to balance: |
1131 // 1. restoring as soon as possible | 1134 // 1. restoring as soon as possible |
1132 // 2. not overriding user scroll (TODO(majidvp): also respect user scale) | 1135 // 2. not overriding user scroll (TODO(majidvp): also respect user scale) |
1133 // 3. detecting clamping to avoid repeatedly popping the scroll position | 1136 // 3. detecting clamping to avoid repeatedly popping the scroll position |
1134 // down as the page height increases | 1137 // down as the page height increases |
1135 // 4. ignore clamp detection if we are not restoring scroll or after load | 1138 // 4. ignore clamp detection if we are not restoring scroll or after load |
1136 // completes because that may be because the page will never reach its | 1139 // completes because that may be because the page will never reach its |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1547 // FIXME: We need a way to propagate insecure requests policy flags to | 1550 // FIXME: We need a way to propagate insecure requests policy flags to |
1548 // out-of-process frames. For now, we'll always use default behavior. | 1551 // out-of-process frames. For now, we'll always use default behavior. |
1549 if (!parentFrame->isLocalFrame()) | 1552 if (!parentFrame->isLocalFrame()) |
1550 return nullptr; | 1553 return nullptr; |
1551 | 1554 |
1552 ASSERT(toLocalFrame(parentFrame)->document()); | 1555 ASSERT(toLocalFrame(parentFrame)->document()); |
1553 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; | 1556 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; |
1554 } | 1557 } |
1555 | 1558 |
1556 } // namespace blink | 1559 } // namespace blink |
OLD | NEW |