gecko-dev/servo/components/selectors
Emilio Cobos Álvarez caae6da5e7 Bug 1837818 - Remove special selector-matching case in matches_simple_selector. r=boris
This doesn't regress stylebench.

Depends on D180592

Differential Revision: https://phabricator.services.mozilla.com/D180593
2023-06-19 09:51:38 +00:00
..
attr.rs Bug 1837734 - Remove the never_matches field from attr selectors. r=boris 2023-06-14 21:08:22 +00:00
bloom.rs
build.rs
builder.rs Bug 1835681 - Rustfmt servo/. r=zrhoffman 2023-05-30 08:04:52 +00:00
Cargo.toml Bug 1835681 - Remove matches from selectors. r=zrhoffman 2023-05-30 08:04:52 +00:00
context.rs Bug 1837351 - Skip positional pseudo-class matching during invalidation r=emilio 2023-06-16 03:33:18 +00:00
lib.rs Bug 1835681 - Remove matches from selectors. r=zrhoffman 2023-05-30 08:04:52 +00:00
matching.rs Bug 1837818 - Remove special selector-matching case in matches_simple_selector. r=boris 2023-06-19 09:51:38 +00:00
nth_index_cache.rs Bug 1808228 - Implement selector matching for :nth-child(An+B of selector list) and :nth-last-child(An+B of selector list) r=emilio 2023-01-16 11:26:41 +00:00
parser.rs Bug 1835068 - Parse relative selectors for nesting. r=dshin 2023-06-16 15:29:59 +00:00
README.md
sink.rs
tree.rs Bug 1837734 - Add a way to optimize the "attribute in no namespace exists" check. r=boris 2023-06-14 21:08:21 +00:00
visitor.rs Bug 1835681 - Update bitflags in the dom and style crates. r=zrhoffman 2023-05-30 08:04:51 +00:00

rust-selectors

CSS Selectors library for Rust. Includes parsing and serilization of selectors, as well as matching against a generic tree of elements. Pseudo-elements and most pseudo-classes are generic as well.

Warning: breaking changes are made to this library fairly frequently (13 times in 2016, for example). However you can use this crate without updating it that often, old versions stay available on crates.io and Cargo will only automatically update to versions that are numbered as compatible.

To see how to use this library with your own tree representation, see Kuchikis src/select.rs. (Note however that Kuchiki is not always up to date with the latest rust-selectors version, so that code may need to be tweaked.) If you dont already have a tree data structure, consider using Kuchiki itself.