0.7.0
Release Notes v0.7.0 (October 27, 2024)
🚀 New Features
Node Tree API
- Added
Node::ancestorsmethod to get all or limited number of node ancestors - New methods for working with related elements:
Node::element_children: returns child nodes ofNodeData::ElementtypeNode::children_it: provides an iterator over child nodesNode::ancestors_it: provides an iterator over ancestor nodes
- Added
Node::immediate_textmethod to get node's text without descendants- Similarly,
Selection::immediate_textdoes the same for every node in selection
- Similarly,
Tree API Extensions
- New methods for working with node IDs:
Tree:child_ids_ofandTree:child_ids_of_it: get child node IDs as vec and as iterator respectivelyTree:ancestor_ids_ofandTree: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
:hassupport from theselectorscrate - Added
From<Vec<Node>>implementation forSelection
🔄 Changes
Performance Optimizations
- Improved performance for several core operations:
Document::fromSelection::select- Other related methods
- Switched from
rustc-hashtofoldhash
API Changes
- Exposed
Matcher::match_elementfor use outside the crate - Updated
selectors::Elementimplementation forNode<'a>::opaque - Removed
&mutrequirement fromSelectionmethods
Dependencies
- Updated to
selectorsv0.26.0
Full Changelog: 0.6.0...0.7.0