clipX property

bool get clipX

Implementation

bool get clipX {
  RenderBoxModel renderBoxModel = this as RenderBoxModel;

  List<Radius>? borderRadius = renderBoxModel.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;
  }

  // Per spec, overflow other than 'visible' establishes a clipping context at the
  // padding edge. Always clip in this case so translated scroll contents (non-zero
  // paint offset) cannot bleed outside the container, even when the content size
  // currently fits within the viewport. This also ensures inner padding is honored.
  // https://www.w3.org/TR/css-overflow-3/#overflow-properties
  CSSOverflowType effectiveOverflowX = renderStyle.effectiveOverflowX;
  if (effectiveOverflowX != CSSOverflowType.visible) {
    return true;
  }

  return false;
}