[][src]Crate style

Calculate specified and computed values from a tree of DOM nodes and a set of stylesheets.

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.

Major dependencies are the cssparser and selectors crates.

Re-exports

pub use servo_arc;

Modules

animation

CSS transitions and animations.

applicable_declarations

Applicable declarations management.

attr

Parsed representations of DOM attributes.

author_styles

A set of author stylesheets and their computed representation, such as the ones used for ShadowRoot.

bezier

Parametric Bézier curves.

bloom

The style bloom filter is used as an optimization when matching deep descendant selectors.

computed_value_flags

Misc information about a given computed style.

computed_values

Types for computed values.

context

The context within which style is calculated.

counter_style

The @counter-style at-rule.

custom_properties

Support for custom properties for cascading variables.

data

Per-node data used in style calculation.

dom

Types and traits used to access the DOM from style calculation.

dom_apis

Generic implementations of some DOM APIs so they can be shared between Servo and Gecko.

driver

Implements traversal over the DOM tree. The traversal starts in sequential mode, and optionally parallelizes as it discovers work.

element_state

States elements can be in.

encoding_support

Parsing stylesheets from bytes (not &str).

error_reporting

Types used to report parsing errors.

font_face

The @font-face at-rule.

font_metrics

Access to font metrics from the style system.

global_style_data

Global style data

hash

Reexports of hashglobe types in Gecko mode, and stdlib hashmap shims in Servo mode

invalidation

Different bits of code related to invalidating style.

logical_geometry

Geometry in flow-relative space.

macros

Various macro helpers.

matching

High-level interface to CSS selector matching.

media_queries

Media queries.

parallel

Implements parallel traversal over the DOM tree.

parser

The context within which CSS code is parsed.

properties

The CSS properties supported by the style system. Generated from the properties.mako.rs template by build.rs

rule_cache

A cache from rule node to computed values, in order to cache reset properties.

rule_collector

Collects a series of applicable rules for a given element.

rule_tree

The rule tree.

scoped_tls

Stack-scoped thread-local storage for rayon thread pools.

selector_map

A data structure to efficiently index structs containing selectors by local name, ids and hash.

selector_parser

The pseudo-classes and pseudo-elements supported by the style system.

servo

Servo-specific bits of the style system.

shared_lock

Different objects protected by the same lock

sharing

Code related to the style sharing cache, an optimization that allows similar nodes to share style without having to run selector matching twice.

str

String utils for attributes and similar stuff.

style_adjuster

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.

style_resolver

Style resolution for a given element or pseudo-element.

stylesheet_set

A centralized set of stylesheets for a document.

stylesheets

Style sheets and their CSS rules.

stylist

Selector matching.

thread_state

Supports dynamic assertions in about what sort of thread is running and what state it's in.

traversal

Traversing the DOM tree; the bloom filter.

traversal_flags

Flags that control the traversal process.

use_counters

Various stuff for CSS property use counters.

values

Common values used in CSS.

Macros

css_properties_accessors

Call the given macro with tokens like this for each longhand and shorthand properties that is enabled in content:

longhand_properties_idents

Call the given macro with tokens like this for each longhand properties:

profiler_label

No-op when the Gecko profiler is not available.

Structs

ArcSlice

A wrapper type for a refcounted slice using ThinArc.

OwnedSlice

A struct that basically replaces a Box<[T]>, but which cbindgen can understand.

OwnedStr

A struct that basically replaces a Box, but with a defined layout, suitable for FFI.

Traits

CaseSensitivityExt

Extension methods for selectors::attr::CaseSensitivity

One

A trait pretty much similar to num_traits::One, but without the need of implementing Mul.

Zero

A trait pretty much similar to num_traits::Zero, but without the need of implementing Add.

Type Definitions

Atom
LocalName
Namespace
Prefix