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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp

Issue 2845613002: Fix the bug that sticky element may not be correctly invalidated due to non-promotion (Closed)
Patch Set: Address comments 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/layout/compositing/CompositingRequirementsUpdater.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
index 43d57ebe4b042d11783e96ac70281c34fc84ca55..30520dedadfc56e718a1b6313c22f9b4132c6e5c 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingRequirementsUpdater.cpp
@@ -272,9 +272,19 @@ void CompositingRequirementsUpdater::UpdateRecursive(
false) &
kCompositingReasonOverflowScrollingTouch);
+ // We have to promote the sticky element to work around the bug
+ // (https://crbug.com/698358) of not being able to invalidate the ancestor
+ // after updating the sticky layer position.
+ // TODO(yigu): We should check if we have already lost lcd text. This
+ // would require tracking if we think the current compositing ancestor
+ // layer meets the requirements (i.e. opaque, integer transform, etc).
+ const bool moves_with_respect_to_compositing_ancestor =
+ layer->SticksToScroller() &&
+ !current_recursion_data.compositing_ancestor_->IsRootLayer();
// TODO(chrishtr): use |hasCompositedScrollingAncestor| instead.
const bool ignore_lcd_text =
- current_recursion_data.has_composited_scrolling_ancestor_;
+ current_recursion_data.has_composited_scrolling_ancestor_ ||
+ moves_with_respect_to_compositing_ancestor;
direct_reasons |=
compositing_reason_finder_.DirectReasons(layer, ignore_lcd_text);

Powered by Google App Engine
This is Rietveld 408576698