{
LayoutRect localRawCompositingBounds = compositedBounds();
LayoutPoint rawDelta = computeOffsetFromCompositedAncestor(&m_owningLayer, compositedAncestor);
- delta = flooredIntPoint(rawDelta);
+ // We call toInt and not floor here because toInt truncates, but floor will floor negative numbers
+ // down e.g. floor(-1.1) would become -2.
+ delta = IntPoint(rawDelta.x().toInt(), rawDelta.y().toInt());
m_subpixelAccumulation = toLayoutSize(rawDelta).fraction();
RELEASE_ASSERT(m_subpixelAccumulation.width() < 1 && m_subpixelAccumulation.height() < 1);
}
if (compAncestor && m_ancestorClippingLayer) {
- ClipRectsContext clipRectsContext(compAncestor, CompositingClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip);
+ // FIXME: this should use cached clip rects, but this sometimes give
+ // inaccurate results (and trips the ASSERTS in RenderLayerClipper).
+ ClipRectsContext clipRectsContext(compAncestor, TemporaryClipRects, IgnoreOverlayScrollbarSize, IgnoreOverflowClip);
IntRect parentClipRect = pixelSnappedIntRect(m_owningLayer.clipper().backgroundClipRect(clipRectsContext).rect());
ASSERT(parentClipRect != PaintInfo::infiniteRect());
m_ancestorClippingLayer->setPosition(FloatPoint(parentClipRect.location() - graphicsLayerParentLocation));
m_foregroundLayer = createGraphicsLayer(CompositingReasonLayerForForeground);
m_foregroundLayer->setDrawsContent(true);
m_foregroundLayer->setPaintingPhase(GraphicsLayerPaintForeground);
+ // If the foreground layer pops content out of the graphics
+ // layer, then the graphics layer needs to be repainted.
+ // FIXME: This is conservative, as m_foregroundLayer could
+ // be smaller than m_graphicsLayer due to clipping.
+ m_graphicsLayer->setNeedsDisplay();
layerChanged = true;
}
} else if (m_foregroundLayer) {
+ FloatRect repaintRect(FloatPoint(), m_foregroundLayer->size());
+ m_graphicsLayer->setNeedsDisplayInRect(repaintRect);
m_foregroundLayer->removeFromParent();
m_foregroundLayer = nullptr;
layerChanged = true;