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

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: fixme 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..1055b6091cf191b5313f42f8b3329c3121c872db 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(CompositingUpdateOnCompositedScroll);
abarth-chromium 2014/06/13 18:17:50 This compositing update type isn't sufficient. Yo
hartmanng 2014/06/13 18:42:58 Makes sense, thanks for the explanation. Done.
+}
+
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).
+
+ if (!renderer()->isRenderBlock())
+ return false;
+
+ return toRenderBlock(renderer())->shouldPaintSelectionGaps();
}
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