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

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

Issue 303253004: Allow proper highlighting on universal overflow scroll. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: CompositingUpdateAfterCompositingInputChange Created 6 years, 6 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
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayer.cpp
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index f458c9f1012d87accf86ba99bc0cb4f3f5391235..44ac8f7eb90a5077a439194fec996f88ada0730c 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -3146,9 +3146,16 @@ RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, Rend
return 0;
}
+void RenderLayer::blockSelectionGapsBoundsChanged()
+{
+ setNeedsCompositingInputsUpdate();
+ compositor()->setNeedsCompositingUpdate(CompositingUpdateAfterCompositingInputChange);
+}
+
void RenderLayer::addBlockSelectionGapsBounds(const LayoutRect& bounds)
{
m_blockSelectionGapsBounds.unite(enclosingIntRect(bounds));
+ blockSelectionGapsBoundsChanged();
}
void RenderLayer::clearBlockSelectionGapsBounds()
@@ -3156,6 +3163,7 @@ void RenderLayer::clearBlockSelectionGapsBounds()
m_blockSelectionGapsBounds = IntRect();
for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
child->clearBlockSelectionGapsBounds();
+ blockSelectionGapsBoundsChanged();
}
void RenderLayer::repaintBlockSelectionGaps()
@@ -3179,9 +3187,26 @@ void RenderLayer::repaintBlockSelectionGaps()
renderer()->invalidatePaintRectangle(rect);
}
+IntRect RenderLayer::blockSelectionGapsBounds() const
+{
+ if (!renderer()->isRenderBlock())
+ return IntRect();
+
+ RenderBlock* renderBlock = toRenderBlock(renderer());
+ LayoutRect gapRects = renderBlock->selectionGapRectsForRepaint(renderBlock);
+
+ return pixelSnappedIntRect(gapRects);
+}
+
bool RenderLayer::hasBlockSelectionGapBounds() const
{
- return !m_blockSelectionGapsBounds.isEmpty();
+ // FIXME: it would be more accurate to return !blockSelectionGapsBounds().isEmpty(), but this is impossible
+ // at the moment because it causes invalid queries to layout-dependent code (crbug.com/372802).
Julien - ping for review 2014/06/16 18:30:24 As mentioned, we should have a lifecycle ASSERT he
hartmanng 2014/06/16 19:19:14 Done.
+
+ if (!renderer()->isRenderBlock())
+ return false;
+
+ return toRenderBlock(renderer())->shouldPaintSelectionGaps();
abarth-chromium 2014/06/13 21:55:54 LGTM, but I'm not 100% sure about these last two s
Julien - ping for review 2014/06/16 18:30:24 This will yield to false positive as shouldPaintSe
}
bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const LayoutRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromRoot) const
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/compositing/CompositedLayerMapping.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698