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

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: Add intermediate sticky in StickySubtreesAreTrackedCorrectly test 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
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 9c73cbac6ab4afb45ac886dc77914bf1bbfdf3e8..ab1d00bf76433fd87d4ef6791ffde504e83da6b0 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::EnsureAuxiliaryLocationDataValidForNode(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().IsInStickySubtree()) {
+ 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.

Powered by Google App Engine
This is Rietveld 408576698