0.7.0
Release Notes v0.7.0 (October 27, 2024)
🚀 New Features
Node Tree API
- Added
Node::ancestors
method to get all or limited number of node ancestors - New methods for working with related elements:
Node::element_children
: returns child nodes ofNodeData::Element
typeNode::children_it
: provides an iterator over child nodesNode::ancestors_it
: provides an iterator over ancestor nodes
- Added
Node::immediate_text
method to get node's text without descendants- Similarly,
Selection::immediate_text
does the same for every node in selection
- Similarly,
Tree API Extensions
- New methods for working with node IDs:
Tree:child_ids_of
andTree:child_ids_of_it
: get child node IDs as vec and as iterator respectivelyTree:ancestor_ids_of
andTree:ancestor_ids_of_it
: get ancestor node IDs as vec and as iterator respectively
Selector Improvements
- Enabled support for
:is()
and:where()
pseudo-classes - Implemented
:has
support from theselectors
crate - Added
From<Vec<Node>>
implementation forSelection
🔄 Changes
Performance Optimizations
- Improved performance for several core operations:
Document::from
Selection::select
- Other related methods
- Switched from
rustc-hash
tofoldhash
API Changes
- Exposed
Matcher::match_element
for use outside the crate - Updated
selectors::Element
implementation forNode<'a>::opaque
- Removed
&mut
requirement fromSelection
methods
Dependencies
- Updated to
selectors
v0.26.0
Full Changelog: 0.6.0...0.7.0