Struct style::stylist::Stylist [] [src]

pub struct Stylist { /* fields omitted */ }

This structure holds all the selectors and device characteristics for a given document. The selectors are converted into Rules and sorted into SelectorMaps keyed off stylesheet origin and pseudo-element (see CascadeData).

This structure is effectively created once per pipeline, in the LayoutThread corresponding to that pipeline.

Methods

impl Stylist
[src]

[src]

Construct a new Stylist, using given Device and QuirksMode. If more members are added here, think about whether they should be reset in clear().

Important traits for ExtraStyleDataIterator<'a>
[src]

Iterate over the extra data in origin order.

Important traits for ExtraStyleDataIterator<'a>
[src]

Iterate over the extra data in reverse origin order.

[src]

Returns the number of selectors.

[src]

Returns the number of declarations.

[src]

Returns the number of times the stylist has been rebuilt.

[src]

Returns the number of revalidation_selectors.

[src]

Returns the number of entries in invalidation maps.

[src]

Invokes f with the InvalidationMap for each origin.

NOTE(heycam) This might be better as an iter_invalidation_maps, once we have impl trait and can return that easily without bothering to create a whole new iterator type.

[src]

Flush the list of stylesheets if they changed, ensuring the stylist is up-to-date.

[src]

Insert a given stylesheet before another stylesheet in the document.

[src]

Marks a given stylesheet origin as dirty, due to, for example, changes in the declarations that affect a given rule.

FIXME(emilio): Eventually it'd be nice for this to become more fine-grained.

[src]

Sets whether author style is enabled or not.

[src]

Returns whether we've recorded any stylesheet change so far.

[src]

Appends a new stylesheet to the current set.

[src]

Appends a new stylesheet to the current set.

[src]

Remove a given stylesheet to the current set.

[src]

Returns whether the given attribute might appear in an attribute selector of some rule in the stylist.

[src]

Returns whether the given ElementState bit is relied upon by a selector of some rule in the stylist.

[src]

Returns whether the given DocumentState bit is relied upon by a selector of some rule in the stylist.

[src]

Computes the style for a given "precomputed" pseudo-element, taking the universal rules and applying them.

If inherit_all is true, then all properties are inherited from the parent; otherwise, non-inherited properties are reset to their initial values. The flow constructor uses this flag when constructing anonymous flows.

[src]

Computes the style for a given "precomputed" pseudo-element with given rule node.

[src]

Returns the rule node for given precomputed pseudo-element.

If we want to include extra declarations to this precomputed pseudo-element, we can provide a vector of ApplicableDeclarationBlock to extra_declarations argument. This is useful for providing extra @page rules.

[src]

Returns the style for an anonymous box of the given type.

[src]

Computes a pseudo-element style lazily during layout.

This can only be done for a certain set of pseudo-elements, like :selection.

Check the documentation on lazy pseudo-elements in docs/components/style.md

[src]

Computes a pseudo-element style lazily using the given CascadeInputs. This can be used for truly lazy pseudo-elements or to avoid redoing selector matching for eager pseudo-elements when we need to recompute their style with a new parent style.

[src]

Computes a style using the given CascadeInputs. This can be used to compute a style any time we know what rules apply and just need to use the given parent styles.

parent_style is the style to inherit from for properties affected by first-line ancestors.

parent_style_ignoring_first_line is the style to inherit from for properties not affected by first-line ancestors.

layout_parent_style is the style used for some property fixups. It's the style of the nearest ancestor with a layout box.

is_link should be true if we're computing style for a link; that affects how :visited handling is done.

[src]

Set a given device, which may change the styles that apply to the document.

Returns the sheet origins that were actually affected.

This means that we may need to rebuild style data even if the stylesheets haven't changed.

Also, the device that arrives here may need to take the viewport rules into account.

For Gecko, this is called when XBL bindings are used by different documents.

[src]

Returns whether, given a media feature change, any previously-applicable style has become non-applicable, or vice-versa for each origin.

[src]

Returns the viewport constraints that apply to this document because of a @viewport rule.

[src]

Returns the Quirks Mode of the document.

[src]

Sets the quirks mode of the document.

[src]

Returns the applicable CSS declarations for the given element.

This corresponds to ElementRuleCollector in WebKit.

[src]

Given an id, returns whether there might be any rules for that id in any of our rule maps.

[src]

Returns the registered @keyframes animation for the specified name.

[src]

Computes the match results of a given element against the set of revalidation selectors.

[src]

Computes styles for a given declaration with parent_style.

[src]

Accessor for a shared reference to the device.

[src]

Accessor for a mutable reference to the device.

[src]

Accessor for a shared reference to the rule tree.

[src]

Shutdown the static data that this module stores.

Trait Implementations

impl MallocSizeOf for Stylist
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more