isEquivalentNode method

  1. @override
bool isEquivalentNode(
  1. DOMNode domNode,
  2. Node node
)
override

Implementation

@override
bool isEquivalentNode(DOMNode domNode, Node node) {
  if (!isEquivalentNodeType(domNode, node)) {
    return false;
  }

  if (domNode is TextNode) {
    return domNode.text == node.toString();
  } else if (domNode is DOMElement && node is Element) {
    var domAttributesSign =
        _toAttributesSignature(domNode.attributesAsString);
    var attributesSign = _toAttributesSignature(getElementAttributes(node)!);
    return domAttributesSign == attributesSign;
  }

  return false;
}