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

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 303253004: Allow proper highlighting on universal overflow scroll. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline tests 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
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index 8f63184303482ada56d28a7ef616b994e2ee7867..2c30b087c7771fd357df89206a1a85259fbb2f03 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -176,6 +176,7 @@ CompositedLayerMapping::CompositedLayerMapping(RenderLayer& layer)
, m_backgroundLayerPaintsFixedRootBackground(false)
, m_needToUpdateGraphicsLayer(false)
, m_needToUpdateGraphicsLayerOfAllDecendants(false)
+ , m_scrollingContentsAreEmpty(false)
{
if (layer.isRootLayer() && renderer()->frame()->isMainFrame())
m_isMainFrameRenderViewLayer = true;
@@ -1056,6 +1057,16 @@ void CompositedLayerMapping::updateContentsRect()
m_graphicsLayer->setContentsRect(pixelSnappedIntRect(contentsBox()));
}
+void CompositedLayerMapping::updateScrollingContentsForSelectionGaps()
+{
+ if (!m_scrollingContentsAreEmpty || !m_scrollingContentsLayer)
+ return;
+
+ // FIXME: in this case, the scrolling contents layer doesn't need to be full size. We should position and size
+ // it more conservatively. See crbug.com/381187.
+ m_scrollingContentsLayer->setDrawsContent(m_owningLayer.rendererHasBlockSelectionGaps() == RenderLayer::LayerHasBlockSelectionGaps);
+}
+
void CompositedLayerMapping::updateDrawsContent()
{
if (m_scrollingLayer) {
@@ -1067,7 +1078,11 @@ void CompositedLayerMapping::updateDrawsContent()
m_graphicsLayer->setDrawsContent(hasNonScrollingPaintedContent);
bool hasScrollingPaintedContent = m_owningLayer.hasVisibleContent() && (renderer()->hasBackground() || paintsChildren());
- m_scrollingContentsLayer->setDrawsContent(hasScrollingPaintedContent);
+ m_scrollingContentsAreEmpty = !hasScrollingPaintedContent;
+
+ RenderLayer::PresenceOfBlockSelectionGaps hasBlockSelectionGaps = owningLayer().rendererHasBlockSelectionGaps();
+ bool shouldDrawContent = !m_scrollingContentsAreEmpty || hasBlockSelectionGaps == RenderLayer::LayerHasBlockSelectionGaps;
+ m_scrollingContentsLayer->setDrawsContent(shouldDrawContent);
return;
}

Powered by Google App Engine
This is Rietveld 408576698