findDirectPositionAbsoluteChildren method

List<Element> findDirectPositionAbsoluteChildren()

Implementation

List<Element> findDirectPositionAbsoluteChildren() {
  List<Element> directPositionAbsoluteChildren = [];

  if (!isRendererAttached) return directPositionAbsoluteChildren;

  RenderBox? child = (renderBoxModel as RenderLayoutBox).firstChild;

  while (child != null) {
    final ContainerParentDataMixin<RenderBox>? childParentData =
      child.parentData as ContainerParentDataMixin<RenderBox>?;
    if (child is! RenderLayoutBox) {
      child = childParentData!.nextSibling;
      continue;
    }
    if (child.renderStyle.position == CSSPositionType.absolute) {
      directPositionAbsoluteChildren.add(child.renderStyle.target);
    }
    child = childParentData!.nextSibling;
  }

  return directPositionAbsoluteChildren;
}