isAuto property

bool get isAuto

Implementation

bool get isAuto {
  switch (propertyName) {
    // Length is considered as auto of following properties
    // if it computes to double.infinity in cases of percentage.
    // The percentage of height is calculated with respect to the height of the generated box's containing block.
    // If the height of the containing block is not specified explicitly (i.e., it depends on content height),
    // and this element is not absolutely positioned, the value computes to 'auto'.
    // https://www.w3.org/TR/CSS2/visudet.html#propdef-height
    case WIDTH:
    case MIN_WIDTH:
    case MAX_WIDTH:
    case HEIGHT:
    case MIN_HEIGHT:
    case MAX_HEIGHT:
    case TOP:
    case BOTTOM:
    case LEFT:
    case RIGHT:
      if (computedValue == double.infinity) {
        return true;
      }
      break;
  }
  return type == CSSLengthType.AUTO;
}