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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp

Issue 1837533002: LayoutObject::localOverflowRectForPaintInvalidation() and localSelectionRect() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pi0
Patch Set: Rebase Created 4 years, 9 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/LayoutReplaced.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
index 4e67e03aea40990e3c1592219ef180bb19a0f644..1e02150baec48565c4699980e750d19875eb791c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -709,21 +709,6 @@ PositionWithAffinity LayoutReplaced::positionForPoint(const LayoutPoint& point)
return LayoutBox::positionForPoint(point);
}
-LayoutRect LayoutReplaced::selectionRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer) const
-{
- ASSERT(!needsLayout());
-
- LayoutRect rect = localSelectionRect();
- if (rect.isEmpty())
- return rect;
-
- mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, 0);
- // FIXME: groupedMapping() leaks the squashing abstraction.
- if (paintInvalidationContainer->layer()->groupedMapping())
- PaintLayer::mapRectInPaintInvalidationContainerToBacking(paintInvalidationContainer, rect);
- return rect;
-}
-
LayoutRect LayoutReplaced::localSelectionRect() const
{
if (getSelectionState() == SelectionNone)
@@ -751,8 +736,11 @@ void LayoutReplaced::setSelectionState(SelectionState state)
// We only include the space below the baseline in our layer's cached paint invalidation rect if the
// image is selected. Since the selection state has changed update the rect.
- if (hasLayer())
- setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(containerForPaintInvalidation()));
+ if (hasLayer()) {
+ LayoutRect rect = localOverflowRectForPaintInvalidation();
+ PaintLayer::mapRectToPaintInvalidationBacking(this, &containerForPaintInvalidation(), rect);
+ setPreviousPaintInvalidationRect(rect);
+ }
if (canUpdateSelectionOnRootLineBoxes())
inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone);

Powered by Google App Engine
This is Rietveld 408576698