Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| index 24a0d0b1e03ec4aa37671718501d2108b2290ae4..b2d442b184778fa5d25d004e8995b49aa35e3e07 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -1369,7 +1369,10 @@ static PassOwnPtr<TracedValue> jsonObjectForOldAndNewRects(const LayoutRect& old |
| LayoutRect LayoutObject::selectionRectInViewCoordinates() const |
| { |
| - return selectionRectForPaintInvalidation(view()); |
| + LayoutRect selectionRect = localSelectionRect(); |
| + if (!selectionRect.isEmpty()) |
| + mapToVisibleRectInAncestorSpace(view(), selectionRect, nullptr); |
| + return selectionRect; |
| } |
| LayoutRect LayoutObject::previousSelectionRectForPaintInvalidation() const |
| @@ -1404,13 +1407,16 @@ inline void LayoutObject::invalidateSelectionIfNeeded(const LayoutBoxModelObject |
| return; |
| 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); |
| + LayoutRect newSelectionRect = localSelectionRect(); |
| + if (!newSelectionRect.isEmpty()) { |
| + PaintLayer::mapRectToPaintInvalidationBacking(this, &paintInvalidationContainer, newSelectionRect, &paintInvalidationState); |
| + |
| + // 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); |
| @@ -1632,7 +1638,14 @@ LayoutRect LayoutObject::absoluteClippedOverflowRect() const |
| return clippedOverflowRectForPaintInvalidation(view()); |
| } |
| -LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject*, const PaintInvalidationState*) const |
| +LayoutRect LayoutObject::clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState) const |
|
chrishtr
2016/03/25 20:20:14
Make this non-virtual?
chrishtr
2016/03/25 20:21:08
IOW: what subclasses still override it?
Xianzhu
2016/03/25 20:24:20
SVG objects still need to override. This function
|
| +{ |
| + LayoutRect rect = localOverflowRectForPaintInvalidation(); |
| + mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, paintInvalidationState); |
| + return rect; |
| +} |
| + |
| +LayoutRect LayoutObject::localOverflowRectForPaintInvalidation() const |
| { |
| ASSERT_NOT_REACHED(); |
| return LayoutRect(); |