d7f8d7b8ae
This patch adds measurement of Selectors within StyleRule. This requires exposing the pointer within ThinArc. The patch also adds measurement of the several CssRule variants, in order to measure nested CssRules (and PropertyDeclarationBlocks) within them: DocumentRule, MediaRule, PageRule, SupportsRule. <!-- Please describe your changes on the following line: --> r? @heycam --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because testing is in Gecko. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 54cd23adb8e9c10f5b5ef2c6f19b5d1e0351a1c5 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : c87b920a8a63ed2497bd3a7d1b11a2a43b123e74 |
||
---|---|---|
.. | ||
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.