clipY property

bool get clipY

Implementation

bool get clipY {
  final List<Radius>? borderRadius = renderStyle.borderRadius;

  // The content of replaced elements is always trimmed to the content edge curve.
  // https://www.w3.org/TR/css-backgrounds-3/#corner-clipping
  if (borderRadius != null && renderStyle.isSelfRenderReplaced() && renderStyle.aspectRatio != null) {
    return true;
  }

  // Always clip when overflow is not 'visible' to enforce the padding-edge
  // clipping boundary regardless of current content size. This prevents text
  // or children from painting outside the container when scrolled and ensures
  // padding acts as the inner clip inset.
  // https://www.w3.org/TR/css-overflow-3/#overflow-properties
  CSSOverflowType effectiveOverflowY = renderStyle.effectiveOverflowY;
  if (effectiveOverflowY != CSSOverflowType.visible) {
    return true;
  }
  return false;
}