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

Unified Diff: Source/core/rendering/RenderObject.cpp

Issue 620553009: Move selection invalidations to the invalidation phase (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated change after review comments. Created 6 years, 3 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: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 6df1219266d8b59f039ae3f1d17d2e3a20732261..f52c2a2213205ad4267a4468e6e61197597dae57 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -1278,6 +1278,18 @@ static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForOldAndNewRe
return value;
}
+void RenderObject::invalidateSelectionIfNeeded(const RenderLayerModelObject& paintInvalidationContainer)
+{
+ if (!shouldInvalidateSelection())
+ return;
+
+ LayoutRect selection = selectionRectForPaintInvalidation(&paintInvalidationContainer);
+ // FIXME: groupedMapping() leaks the squashing abstraction. See RenderBlockSelectionInfo for more details.
+ if (paintInvalidationContainer.layer()->groupedMapping())
+ RenderLayer::mapRectToPaintBackingCoordinates(&paintInvalidationContainer, selection);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, selection, InvalidationSelection);
+}
+
InvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& paintInvalidationContainer)
{
RenderView* v = view();
@@ -1303,6 +1315,8 @@ InvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalidation
InvalidationReason invalidationReason = getPaintInvalidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newLocation);
+ invalidateSelectionIfNeeded(paintInvalidationContainer);
+
if (invalidationReason == InvalidationNone)
return invalidationReason;
@@ -3113,6 +3127,7 @@ void RenderObject::clearPaintInvalidationState(const PaintInvalidationState& pai
setShouldInvalidateOverflowForPaint(false);
setLayoutDidGetCalled(false);
setMayNeedPaintInvalidation(false);
+ clearShouldInvalidateSelection();
}
bool RenderObject::isAllowedToModifyRenderTreeStructure(Document& document)

Powered by Google App Engine
This is Rietveld 408576698