absorbNode method

  1. @override
bool absorbNode(
  1. DOMNode other
)
override

Absorb the content of other and appends to this node.

Implementation

@override
bool absorbNode(DOMNode other) {
  if (other is DOMElement) {
    if (other.isEmptyContent) return true;
    var otherContent = other._content;
    if (otherContent != null) {
      addAll(otherContent);
      otherContent.clear();
    }
    return true;
  } else if (other is TextNode) {
    other.remove();
    add(other);
    return true;
  } else {
    return false;
  }
}