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

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

Issue 2628683003: Add DidSaveScrollOrScaleState flag to prevent restoreScrollPositionAndViewState restore from default (Closed)
Patch Set: fix test Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/ParentNode-querySelector-All-xht-expected.txt ('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 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 if (client()) { 627 if (client()) {
628 ScriptForbiddenScope forbidScripts; 628 ScriptForbiddenScope forbidScripts;
629 client()->dispatchDidFinishDocumentLoad(); 629 client()->dispatchDidFinishDocumentLoad();
630 } 630 }
631 631
632 if (client()) { 632 if (client()) {
633 client()->runScriptsAtDocumentReady( 633 client()->runScriptsAtDocumentReady(
634 m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true); 634 m_documentLoader ? m_documentLoader->isCommittedButEmpty() : true);
635 } 635 }
636 636
637 // RestoreScrollPositionAndViewState maybe called in checkCompleted. We need
638 // to ensure processFragment called before restoreScrollPositionAndViewState.
639 processFragment(m_frame->document()->url(), NavigationToDifferentDocument);
637 checkCompleted(); 640 checkCompleted();
638 641
639 if (!m_frame->view()) 642 if (!m_frame->view())
640 return; 643 return;
641 644
642 // Check if the scrollbars are really needed for the content. If not, remove 645 // Check if the scrollbars are really needed for the content. If not, remove
643 // them, relayout, and repaint. 646 // them, relayout, and repaint.
644 m_frame->view()->restoreScrollbar(); 647 m_frame->view()->restoreScrollbar();
645 processFragment(m_frame->document()->url(), NavigationToDifferentDocument); 648 processFragment(m_frame->document()->url(), NavigationToDifferentDocument);
chaopeng 2017/01/12 19:56:02 We need to keep the processFragment here (after th
646 } 649 }
647 650
648 static bool allDescendantsAreComplete(Frame* frame) { 651 static bool allDescendantsAreComplete(Frame* frame) {
649 for (Frame* child = frame->tree().firstChild(); child; 652 for (Frame* child = frame->tree().firstChild(); child;
650 child = child->tree().traverseNext(frame)) { 653 child = child->tree().traverseNext(frame)) {
651 if (child->isLoading()) 654 if (child->isLoading())
652 return false; 655 return false;
653 } 656 }
654 return true; 657 return true;
655 } 658 }
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 m_documentLoader ? m_documentLoader->url() : String()); 1909 m_documentLoader ? m_documentLoader->url() : String());
1907 return tracedValue; 1910 return tracedValue;
1908 } 1911 }
1909 1912
1910 inline void FrameLoader::takeObjectSnapshot() const { 1913 inline void FrameLoader::takeObjectSnapshot() const {
1911 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, 1914 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
1912 toTracedValue()); 1915 toTracedValue());
1913 } 1916 }
1914 1917
1915 } // namespace blink 1918 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/ParentNode-querySelector-All-xht-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698