Trait style::stylesheets::CssRulesHelpers
[−]
[src]
pub trait CssRulesHelpers { fn insert_rule(
&self,
lock: &SharedRwLock,
rule: &str,
parent_stylesheet_contents: &StylesheetContents,
index: usize,
nested: bool,
loader: Option<&StylesheetLoader>
) -> Result<CssRule, RulesMutateError>; }
A trait to implement helpers for Arc<Locked<CssRules>>
.
Required Methods
fn insert_rule(
&self,
lock: &SharedRwLock,
rule: &str,
parent_stylesheet_contents: &StylesheetContents,
index: usize,
nested: bool,
loader: Option<&StylesheetLoader>
) -> Result<CssRule, RulesMutateError>
&self,
lock: &SharedRwLock,
rule: &str,
parent_stylesheet_contents: &StylesheetContents,
index: usize,
nested: bool,
loader: Option<&StylesheetLoader>
) -> Result<CssRule, RulesMutateError>
https://drafts.csswg.org/cssom/#insert-a-css-rule
Written in this funky way because parsing an @import rule may cause us to clone a stylesheet from the same document due to caching in the CSS loader.
TODO(emilio): We could also pass the write guard down into the loader instead, but that seems overkill.
Implementations on Foreign Types
impl CssRulesHelpers for RawOffsetArc<Locked<CssRules>>
[src]
fn insert_rule(
&self,
lock: &SharedRwLock,
rule: &str,
parent_stylesheet_contents: &StylesheetContents,
index: usize,
nested: bool,
loader: Option<&StylesheetLoader>
) -> Result<CssRule, RulesMutateError>
[src]
&self,
lock: &SharedRwLock,
rule: &str,
parent_stylesheet_contents: &StylesheetContents,
index: usize,
nested: bool,
loader: Option<&StylesheetLoader>
) -> Result<CssRule, RulesMutateError>