Source/core/rendering/RenderLayer.cpp
// FIXME: having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint
// is error-prone and misleading for reading code that uses these functions - especially compounded with
// the includeSelf option. It is very likely that we don't even want either of these functions; A layer
// should be told explicitly which GraphicsLayer is the repaintContainer for a RenderLayer, and
// any other use cases should probably have an API between the non-compositing and compositing sides of code.
having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint
is error-prone and misleading for reading code that uses these functions - especially compounded with
the includeSelf option. It is very likely that we don't even want either of these functions; A layer
should be told explicitly which GraphicsLayer is the repaintContainer for a RenderLayer, and
any other use cases should probably have an API between the non-compositing and compositing sides of code.
having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint is error - prone and misleading for reading code that uses these functions - especially compounded with the includeSelf option . It is very likely that we don ' t even want either of these functions ; A layer should be told explicitly which GraphicsLayer is the repaintContainer for a RenderLayer and any other use cases should probably have an API between the non - compositing and compositing sides of code .
RenderLayer* RenderLayer::enclosingCompositingLayer(IncludeSelfOrNot includeSelf) const
{
    ASSERT(isAllowedToQueryCompositingState());
    if ((includeSelf == IncludeSelf) && compositingState() != NotComposited && compositingState() != PaintsIntoGroupedBacking)
        return const_cast<RenderLayer*>(this);
    for (const RenderLayer* curr = compositingContainer(); curr; curr = curr->compositingContainer()) {
        if (curr->compositingState() != NotComposited && curr->compositingState() != PaintsIntoGroupedBacking)
            return const_cast<RenderLayer*>(curr);
    }
    return 0;
}
RenderLayer * RenderLayer :: enclosingCompositingLayer ( IncludeSelfOrNot includeSelf ) const { ASSERT ( isAllowedToQueryCompositingState ( ) ) ; if ( ( includeSelf == IncludeSelf ) && compositingState ( ) != NotComposited && compositingState ( ) != PaintsIntoGroupedBacking ) return const_cast < RenderLayer * > ( this ) ; for ( const RenderLayer * curr = compositingContainer ( ) ; curr ; curr = curr -> compositingContainer ( ) ) { if ( curr -> compositingState ( ) != NotComposited && curr -> compositingState ( ) != PaintsIntoGroupedBacking ) return const_cast < RenderLayer * > ( curr ) ; } return 0 ; }
FIXME: having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint
is error-prone and misleading for reading code that uses these functions - especially compounded with
the includeSelf option.
FIXME : having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint is error - prone and misleading for reading code that uses these functions - especially compounded with the includeSelf option .