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

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

Issue 2825343003: Clean compositing inputs for location APIs for sticky-affected elements. (Closed)
Patch Set: Rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e59fd92e24388367e640533f8a3d9c6eeb3d1eb2..ecf025f9b8bbdf102ff34cfc044e347942b63755 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2381,6 +2381,30 @@ PassRefPtr<ComputedStyle> Document::StyleForPage(int page_index) {
return EnsureStyleResolver().StyleForPage(page_index);
}
+void Document::EnsurePaintLocationDataValidForNode(const Node* node) {
+ DCHECK(node);
+ if (!node->InActiveDocument())
+ return;
+
+ // For all nodes we must have up-to-date style and have performed layout to do
+ // any location-based calculation.
+ UpdateStyleAndLayoutIgnorePendingStylesheets();
+
+ // The location of elements that are position: sticky is not known until
+ // compositing inputs are cleaned. Therefore, for any elements that are either
+ // sticky or are in a sticky sub-tree (e.g. are affected by a sticky element),
+ // we need to also clean compositing inputs.
+ if (View() && node->GetLayoutObject() &&
+ node->GetLayoutObject()->StyleRef().SubtreeIsSticky()) {
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ // In SPv2, compositing inputs are cleaned as part of PrePaint.
+ View()->UpdateAllLifecyclePhasesExceptPaint();
+ } else {
+ View()->UpdateLifecycleToCompositingInputsClean();
+ }
+ }
+}
+
bool Document::IsPageBoxVisible(int page_index) {
return StyleForPage(page_index)->Visibility() !=
EVisibility::kHidden; // display property doesn't apply to @page.
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/DocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698