asMappedElement method

T? asMappedElement(
  1. T? element
)

Returns element or recursively a element.parent that is mapped.

If element hierarchy doesn't have a mapped node, will return null.

Implementation

T? asMappedElement(T? element) {
  if (element == null) return null;
  if (isMappedElement(element)) {
    return element;
  }
  var parent = domGenerator.getNodeParent(element);
  if (parent == null) return null;
  return asMappedElement(parent);
}