internal DomAttributeCollectionImpl SetComparer(DomNameComparer comparer, Action <DomAttribute> onRejected)
        {
            if (_comparer == comparer)
            {
                return(this);
            }

            var newItems = _items.DistinctWithEvents(
                DomNameComparer.AttributeAdapter(comparer), onRejected
                );

            return(new DomAttributeCollectionImpl(newItems, comparer));
        }