asMappedDOMNode method
Returns domNode or recursively a domNode.parent that is mapped.
If domNode hierarchy doesn't have a mapped node, will return null.
Implementation
DOMNode? asMappedDOMNode(DOMNode? domNode) {
if (domNode == null) return null;
if (isMappedDOMNode(domNode)) {
return domNode;
}
var parent = domNode.parent;
if (parent == null) return null;
return asMappedDOMNode(parent);
}