Name Description Size Coverage
applicable_declarations.rs Applicable declarations management. 10944 100 %
author_styles.rs A set of author stylesheets and their computed representation, such as the ones used for ShadowRoot. 2272 100 %
bezier.rs Parametric Bézier curves. This is based on `WebCore/platform/graphics/UnitBezier.h` in WebKit. 4876 91 %
bloom.rs The style bloom filter is used as an optimization when matching deep descendant selectors. 14443 98 %
build.rs 2410 -
build_gecko.rs 13159 -
Cargo.toml 3125 -
color 94 %
context.rs The context within which style is calculated. 26728 57 %
counter_style 98 %
custom_properties.rs Support for [custom properties for cascading variables][custom]. [custom]: https://drafts.csswg.org/css-variables/ 75239 96 %
custom_properties_map.rs The structure that contains the custom properties of a given element. 7234 91 %
data.rs Per-node data used in style calculation. 24610 84 %
device 92 %
dom.rs Types and traits used to access the DOM from style calculation. 40826 93 %
dom_apis.rs Generic implementations of some DOM APIs so they can be shared between Servo and Gecko. 31716 87 %
driver.rs Implements traversal over the DOM tree. The traversal starts in sequential mode, and optionally parallelizes as it discovers work. 6484 87 %
error_reporting.rs Types used to report parsing errors. 21166 42 %
font_face.rs The [`@font-face`][ff] at-rule. [ff]: https://drafts.csswg.org/css-fonts/#at-font-face-rule 19405 98 %
font_metrics.rs Access to font metrics from the style system. 4728 -
gecko 95 %
gecko_bindings 97 %
gecko_string_cache 89 %
global_style_data.rs Global style data 7939 97 %
invalidation 93 %
lib.rs Calculate [specified][specified] and [computed values][computed] from a tree of DOM nodes and a set of stylesheets. [computed]: https://drafts.csswg.org/css-cascade/#computed [specified]: https://drafts.csswg.org/css-cascade/#specified In particular, this crate contains the definitions of supported properties, the code to parse them into specified values and calculate the computed values based on the specified values, as well as the code to serialize both specified and computed values. The main entry point is [`recalc_style_at`][recalc_style_at]. [recalc_style_at]: traversal/fn.recalc_style_at.html A list of supported style properties can be found as [docs::supported_properties] Major dependencies are the [cssparser][cssparser] and [selectors][selectors] crates. [cssparser]: ../cssparser/index.html [selectors]: ../selectors/index.html 9243 100 %
logical_geometry.rs Geometry in flow-relative space. 53261 71 %
macros.rs Various macro helpers. 2052 100 %
matching.rs High-level interface to CSS selector matching. 45411 97 %
media_queries 97 %
parallel.rs Implements parallel traversal over the DOM tree. This traversal is based on Rayon, and therefore its safety is largely verified by the type system. The primary trickiness and fine print for the above relates to the thread safety of the DOM nodes themselves. Accessing a DOM element concurrently on multiple threads is actually mostly "safe", since all the mutable state is protected by an AtomicRefCell, and so we'll generally panic if something goes wrong. Still, we try to to enforce our thread invariants at compile time whenever possible. As such, TNode and TElement are not Send, so ordinary style system code cannot accidentally share them with other threads. In the parallel traversal, we explicitly invoke |unsafe { SendNode::new(n) }| to put nodes in containers that may be sent to other threads. This occurs in only a handful of places and is easy to grep for. At the time of this writing, there is no other unsafe code in the parallel traversal. 8009 100 %
parser.rs The context within which CSS code is parsed. 9423 98 %
piecewise_linear.rs A piecewise linear function, following CSS linear easing 10178 83 %
properties 98 %
properties_and_values 89 %
queries 94 %
README.md servo-style 195 -
rule_cache.rs A cache from rule node to computed values, in order to cache reset properties. 9048 99 %
rule_collector.rs Collects a series of applicable rules for a given element. 19860 100 %
rule_tree 88 %
scoped_tls.rs Stack-scoped thread-local storage for rayon thread pools. 2973 100 %
selector_map.rs A data structure to efficiently index structs containing selectors by local name, ids and hash. 29476 95 %
selector_parser.rs The pseudo-classes and pseudo-elements supported by the style system. 10085 100 %
servo -
shared_lock.rs Different objects protected by the same lock 8752 88 %
sharing 97 %
simple_buckets_map.rs 1759 100 %
str.rs String utils for attributes and similar stuff. 4716 100 %
style_adjuster.rs A struct to encapsulate all the style fixups and flags propagations a computed style needs in order for it to adhere to the CSS spec. 42204 99 %
style_resolver.rs Style resolution for a given element or pseudo-element. 21268 100 %
stylesheet_set.rs A centralized set of stylesheets for a document. 21531 100 %
stylesheets 88 %
stylist.rs Selector matching. 188852 97 %
thread_state.rs Supports dynamic assertions about what sort of thread is running and what state it's in. 2782 36 %
traversal.rs Traversing the DOM tree; the bloom filter. 29211 94 %
traversal_flags.rs Flags that control the traversal process. We CamelCase rather than UPPER_CASING so that we can grep for the same strings across gecko and servo. 2827 67 %
typed_om 97 %
url 91 %
use_counters 100 %
values 90 %