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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2506353002: Incrementally build main thread scrolling reasons [spv2] (Closed)
Patch Set: Fix test mistake Created 4 years, 1 month 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 1a18940f27ba61f5dcab695b4fbeae4ef4d7c6fb..cf770db705a7f494c429bc953307657710d38693 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1480,8 +1480,12 @@ void FrameView::addBackgroundAttachmentFixedObject(LayoutObject* object) {
scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(
this);
- // TODO(pdr): When slimming paint v2 is enabled, invalidate the scroll paint
- // property subtree for this so main thread scroll reasons are recomputed.
+ // Ensure main thread scrolling reasons are recomputed.
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ setNeedsPaintPropertyUpdate();
+ // The object's scroll properties are not affected by its own background.
+ object->setAllAncestorsNeedPaintPropertyUpdate();
+ }
}
void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) {
@@ -1492,8 +1496,12 @@ void FrameView::removeBackgroundAttachmentFixedObject(LayoutObject* object) {
scrollingCoordinator->frameViewHasBackgroundAttachmentFixedObjectsDidChange(
this);
- // TODO(pdr): When slimming paint v2 is enabled, invalidate the scroll paint
- // property subtree for this so main thread scroll reasons are recomputed.
+ // Ensure main thread scrolling reasons are recomputed.
+ if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
+ setNeedsPaintPropertyUpdate();
+ // The object's scroll properties are not affected by its own background.
+ object->setAllAncestorsNeedPaintPropertyUpdate();
+ }
}
void FrameView::addViewportConstrainedObject(LayoutObject* object) {
@@ -1599,6 +1607,17 @@ void FrameView::invalidateBackgroundAttachmentFixedObjects() {
layoutObject->setShouldDoFullPaintInvalidation();
}
+bool FrameView::hasBackgroundAttachmentFixedDescendants(
+ const LayoutObject& object) const {
+ for (const auto* potentialDescendant : m_backgroundAttachmentFixedObjects) {
+ if (potentialDescendant == &object)
+ continue;
+ if (potentialDescendant->isDescendantOf(&object))
+ return true;
+ }
+ return false;
+}
+
bool FrameView::invalidateViewportConstrainedObjects() {
bool fastPathAllowed = true;
for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698