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

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

Issue 251783004: Don't paint below image's baseline unless it is selected. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 8 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/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;
-}
-
}
« Source/core/rendering/RenderReplaced.h ('K') | « Source/core/rendering/RenderReplaced.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698