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

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 1315203002: Fix selection invalidation in composited scrollers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index 6ddea1c970ff66b203ede634690f88b51eb529ca..605d5e05c6caa663014053fc37fc962c8f1f429c 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -1292,6 +1292,14 @@ inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject
LayoutRect oldSelectionRect = previousSelectionRectForPaintInvalidation();
LayoutRect newSelectionRect = selectionRectForPaintInvalidation(&paintInvalidationContainer);
+
+ // Composited scrolling should not be included in the bounds and position tracking, because the graphics layer backing the scroller
+ // does not move on scroll.
+ if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidationContainer != this) {
+ LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrolledContentOffset());
+ newSelectionRect.move(inverseOffset);
+ }
+
setPreviousSelectionRectForPaintInvalidation(newSelectionRect);
if (RuntimeEnabledFeatures::slimmingPaintEnabled() && shouldInvalidateSelection())
@@ -1370,6 +1378,7 @@ PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(PaintInvalidationS
}
fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBounds, newBounds);
+
return invalidationReason;
}
« no previous file with comments | « Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698