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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2404393003: Tie scroll anchoring adjustments to frame lifecycle instead of layout. (Closed)
Patch Set: address review comments Created 4 years, 2 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 return false; 1988 return false;
1989 } 1989 }
1990 1990
1991 void Document::updateStyleAndLayoutTreeForNode(const Node* node) { 1991 void Document::updateStyleAndLayoutTreeForNode(const Node* node) {
1992 DCHECK(node); 1992 DCHECK(node);
1993 if (!needsLayoutTreeUpdateForNode(*node)) 1993 if (!needsLayoutTreeUpdateForNode(*node))
1994 return; 1994 return;
1995 updateStyleAndLayoutTree(); 1995 updateStyleAndLayoutTree();
1996 } 1996 }
1997 1997
1998 void Document::updateStyleAndLayoutIgnorePendingStylesheetsForNode(Node* node) { 1998 void Document::updateStyleAndLayoutIgnorePendingStylesheetsForNode(
1999 const Node* node) {
1999 DCHECK(node); 2000 DCHECK(node);
2000 if (!node->inActiveDocument()) 2001 if (!node->inActiveDocument())
2001 return; 2002 return;
2002 updateStyleAndLayoutIgnorePendingStylesheets(); 2003 updateStyleAndLayoutIgnorePendingStylesheets();
2003 } 2004 }
2004 2005
2006 void Document::updateScrollPosition(const Node* node) {
2007 if (node)
2008 updateStyleAndLayoutIgnorePendingStylesheetsForNode(node);
2009 else
2010 updateStyleAndLayoutIgnorePendingStylesheets();
2011
2012 if (FrameView* frameView = view())
2013 frameView->performScrollAnchoringAdjustments();
2014 }
2015
2005 void Document::updateStyleAndLayout() { 2016 void Document::updateStyleAndLayout() {
2006 DCHECK(isMainThread()); 2017 DCHECK(isMainThread());
2007 2018
2008 ScriptForbiddenScope forbidScript; 2019 ScriptForbiddenScope forbidScript;
2009 2020
2010 FrameView* frameView = view(); 2021 FrameView* frameView = view();
2011 if (frameView && frameView->isInPerformLayout()) { 2022 if (frameView && frameView->isInPerformLayout()) {
2012 // View layout should not be re-entrant. 2023 // View layout should not be re-entrant.
2013 NOTREACHED(); 2024 NOTREACHED();
2014 return; 2025 return;
(...skipping 4386 matching lines...) Expand 10 before | Expand all | Expand 10 after
6401 } 6412 }
6402 6413
6403 void showLiveDocumentInstances() { 6414 void showLiveDocumentInstances() {
6404 WeakDocumentSet& set = liveDocumentSet(); 6415 WeakDocumentSet& set = liveDocumentSet();
6405 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6416 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6406 for (Document* document : set) 6417 for (Document* document : set)
6407 fprintf(stderr, "- Document %p URL: %s\n", document, 6418 fprintf(stderr, "- Document %p URL: %s\n", document,
6408 document->url().getString().utf8().data()); 6419 document->url().getString().utf8().data());
6409 } 6420 }
6410 #endif 6421 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698