Require that matched nodes have the attribute attr.
attr
TagQuery hasAttribute(String attr) => where((n) => n.attributes.containsKey(attr));