Struct eyeliner::Eyeliner [] [src]

pub struct Eyeliner<'a> {
    pub document: NodeRef,
    pub stylesheet: Stylesheet,
    pub options: Options<'a>,
    pub settings: Settings<'a>,
    pub node_style_map: HashMap<HashableNodeRef, PropertyDeclarationBlock>,
    pub rules: Rules,
}

Data and methods related to modifying HTML with CSS.

Fields

A strong reference to the root node of the HTML document.

A structure representing the CSS stylesheet.

Options for ways to modify the HTML document using CSS.

Settings referenced by features enabled through options.

A hashmap of HTML elements to CSS style.

Data collected from the CSS stylesheet.

Methods

impl<'a> Eyeliner<'a>
[src]

[src]

Create a new instance to inline HTML with CSS, using concreate options and settings.

  1. Opitionally extracts the CSS in <style /> tags from the HTML document. Then, optionally removes the <style /> tag from the HTML document.

  2. Any CSS extraced gets appended to the css argument.

Trait Implementations

impl<'a> Clone for Eyeliner<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for Eyeliner<'a>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a> CollectRules for Eyeliner<'a>
[src]

[src]

Collects CSS rules from the CSS stylesheet for other methods to use. Optionally removes any excluded CSS properties. Optionally preserves @media and @font-face rules.

impl<'a> ApplyRules for Eyeliner<'a>
[src]

[src]

Inlines the CSS rules extracted from the CSS stylesheet into the HTML document.

  1. For each CSS rule selector (excluding pseudo-selectors), find the matching nodes in the HTML document. Skips any non-visual elements.

  2. Each elements style is hashmapped. If any element has a style attribute is is extended by each of the CSS rules that apply to it. Optionally preserves !important.

impl<'a> ApplyAttributes for Eyeliner<'a>
[src]

[src]

Iterates over all elements and applies a matching attribute if it has the given CSS property.

impl<'a> ApplyWidthAttributes for Eyeliner<'a>
[src]

[src]

Optionally iterates over all elements and applies a width attribute if it has a width CSS property applied to it.

impl<'a> ApplyHeightAttributes for Eyeliner<'a>
[src]

[src]

Optionally iterates over all elements and applies a height attribute if it has a height CSS property applied to it.

impl<'a> ApplyTableElementAttributes for Eyeliner<'a>
[src]

[src]

Applies attributes to table elements.

  1. Iterates over all elements and matches those that are specified table elements.

  2. If elements have style properties that are mapped to attributes, then their mapped attributes are applied.

impl<'a> InsertPreservedCss for Eyeliner<'a>
[src]

[src]

Tries to insert any @media or @font-face rules collected into the locations specified

impl<'a> ToString for Eyeliner<'a>
[src]

[src]

Converts the given value to a String. Read more