Chromium Code Reviews

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2404393003: Tie scroll anchoring adjustments to frame lifecycle instead of layout. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 1d02cf51a8f803f3045df673fe1cb1b8534986fd..07ef46374045ad50d8da1febc73c18298d05acb8 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1995,13 +1995,24 @@ void Document::updateStyleAndLayoutTreeForNode(const Node* node) {
updateStyleAndLayoutTree();
}
-void Document::updateStyleAndLayoutIgnorePendingStylesheetsForNode(Node* node) {
+void Document::updateStyleAndLayoutIgnorePendingStylesheetsForNode(
+ const Node* node) {
DCHECK(node);
if (!node->inActiveDocument())
return;
updateStyleAndLayoutIgnorePendingStylesheets();
}
+void Document::updateScrollPosition(const Node* node) {
+ if (node)
+ updateStyleAndLayoutIgnorePendingStylesheetsForNode(node);
+ else
+ updateStyleAndLayoutIgnorePendingStylesheets();
+
+ if (FrameView* frameView = view())
+ frameView->performScrollAnchoringAdjustments();
+}
+
void Document::updateStyleAndLayout() {
DCHECK(isMainThread());

Powered by Google App Engine