Chromium Code Reviews| Index: Source/core/rendering/RenderReplaced.cpp |
| diff --git a/Source/core/rendering/RenderReplaced.cpp b/Source/core/rendering/RenderReplaced.cpp |
| index 353f974bcd0a68e8ae1361e7457ee17ef4d388dc..dcad512a47dc149e9bd4a2ca4f187f478b32d543 100644 |
| --- a/Source/core/rendering/RenderReplaced.cpp |
| +++ b/Source/core/rendering/RenderReplaced.cpp |
| @@ -575,7 +575,15 @@ void RenderReplaced::setSelectionState(SelectionState state) |
| // The selection state for our containing block hierarchy is updated by the base class call. |
| RenderBox::setSelectionState(state); |
| - if (inlineBoxWrapper() && canUpdateSelectionOnRootLineBoxes()) |
| + if (!inlineBoxWrapper()) |
| + return; |
| + |
| + // We only include the space below the baseline in our layer's cached repaint rect if the |
| + // image is selected. Since the selection state has changed update the rect. |
| + if (hasLayer()) |
| + layer()->repainter().computeRepaintRects(containerForRepaint()); |
|
Julien - ping for review
2014/05/02 00:23:35
I would expect this to fail with repaint-after-lay
rhogan
2014/05/02 15:36:27
If the layer-based repainter goes away then it wil
|
| + |
| + if (canUpdateSelectionOnRootLineBoxes()) |
| inlineBoxWrapper()->root().setHasSelectedChildren(isSelected()); |
| } |
| @@ -602,24 +610,4 @@ bool RenderReplaced::isSelected() const |
| return false; |
| } |
| -LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const |
| -{ |
| - if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent()) |
| - return LayoutRect(); |
| - |
| - // The selectionRect can project outside of the overflowRect, so take their union |
| - // for repainting to avoid selection painting glitches. |
| - LayoutRect r = unionRect(localSelectionRect(false), visualOverflowRect()); |
| - |
| - RenderView* v = view(); |
| - if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && v) { |
| - // FIXME: layoutDelta needs to be applied in parts before/after transforms and |
| - // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 |
| - r.move(v->layoutDelta()); |
| - } |
| - |
| - computeRectForRepaint(repaintContainer, r); |
| - return r; |
| -} |
| - |
| } |