ab9afc9aeb
**Do not merge yet.** This pulls in unrelated cssparser changes which add a dependency to `dota`, and we’d like to resolve https://github.com/dtolnay/dtoa/pull/9 before landing dtoa in mozilla-central. Also, the dependency change may require manually revendoring in mozilla-central. Gecko’s CSS parsing microbenchmarks before: ``` 43.437 ± 0.391 ms Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench 29.244 ± 0.042 ms Stylo.Gecko_nsCSSParser_ParseSheet_Bench 281.884 ± 0.028 ms Stylo.Servo_DeclarationBlock_SetPropertyById_Bench 426.242 ± 0.008 ms Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench ``` After: ``` 29.779 ± 0.254 ms Stylo.Servo_StyleSheet_FromUTF8Bytes_Bench 28.841 ± 0.031 ms Stylo.Gecko_nsCSSParser_ParseSheet_Bench 296.240 ± 4.744 ms Stylo.Servo_DeclarationBlock_SetPropertyById_Bench 293.855 ± 4.304 ms Stylo.Servo_DeclarationBlock_SetPropertyById_WithInitialSpace_Bench ``` Source-Repo: https://github.com/servo/servo Source-Revision: 8812422bfa504633a7011b0b002e9a2682c7d045 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 04932cab7a8b02bce89111c0326689c84cf72d8c |
||
---|---|---|
.. | ||
attr.rs | ||
bloom.rs | ||
build.rs | ||
builder.rs | ||
Cargo.toml | ||
context.rs | ||
gecko_like_types.rs | ||
lib.rs | ||
matching.rs | ||
parser.rs | ||
README.md | ||
sink.rs | ||
size_of_tests.rs | ||
tree.rs | ||
visitor.rs |
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 Kuchiki’s 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 don’t already have a tree data structure,
consider using Kuchiki itself.