pub struct CssStyleSheet {
pub rules: Vec<CssStyleRule>,
pub disabled: bool,
pub owner_id: Option<String>,
}Expand description
CSSStyleSheet — a single stylesheet as exposed to JS.
Fields§
§rules: Vec<CssStyleRule>The parsed CSS rules.
disabled: boolWhether the stylesheet is disabled.
owner_id: Option<String>Owner element ID (for <style> tags).
Implementations§
Source§impl CssStyleSheet
impl CssStyleSheet
Sourcepub fn from_parsed(sheet: &StyleSheet) -> Self
pub fn from_parsed(sheet: &StyleSheet) -> Self
Create from a parsed StyleSheet.
Sourcepub fn insert_rule(&mut self, rule: &str, index: usize) -> Result<(), String>
pub fn insert_rule(&mut self, rule: &str, index: usize) -> Result<(), String>
Insert a new rule at the given index.
Sourcepub fn delete_rule(&mut self, index: usize)
pub fn delete_rule(&mut self, index: usize)
Delete a rule at the given index.
Sourcepub fn to_js_json(&self) -> String
pub fn to_js_json(&self) -> String
Convert to JavaScript-consumable JSON.
Trait Implementations§
Source§impl Clone for CssStyleSheet
impl Clone for CssStyleSheet
Source§fn clone(&self) -> CssStyleSheet
fn clone(&self) -> CssStyleSheet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CssStyleSheet
impl RefUnwindSafe for CssStyleSheet
impl Send for CssStyleSheet
impl Sync for CssStyleSheet
impl Unpin for CssStyleSheet
impl UnsafeUnpin for CssStyleSheet
impl UnwindSafe for CssStyleSheet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more