Format script component

This commit is contained in:
chansuke 2018-09-18 23:24:15 +09:00 committed by Josh Matthews
parent 2ca7a13473
commit c37a345dc9
357 changed files with 25485 additions and 18076 deletions

View file

@ -22,9 +22,10 @@ pub struct CSSImportRule {
}
impl CSSImportRule {
fn new_inherited(parent_stylesheet: &CSSStyleSheet,
import_rule: Arc<Locked<ImportRule>>)
-> Self {
fn new_inherited(
parent_stylesheet: &CSSStyleSheet,
import_rule: Arc<Locked<ImportRule>>,
) -> Self {
CSSImportRule {
cssrule: CSSRule::new_inherited(parent_stylesheet),
import_rule: import_rule,
@ -32,12 +33,16 @@ impl CSSImportRule {
}
#[allow(unrooted_must_root)]
pub fn new(window: &Window,
parent_stylesheet: &CSSStyleSheet,
import_rule: Arc<Locked<ImportRule>>) -> DomRoot<Self> {
reflect_dom_object(Box::new(Self::new_inherited(parent_stylesheet, import_rule)),
window,
CSSImportRuleBinding::Wrap)
pub fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,
import_rule: Arc<Locked<ImportRule>>,
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(Self::new_inherited(parent_stylesheet, import_rule)),
window,
CSSImportRuleBinding::Wrap,
)
}
}
@ -49,6 +54,9 @@ impl SpecificCSSRule for CSSImportRule {
fn get_css(&self) -> DOMString {
let guard = self.cssrule.shared_lock().read();
self.import_rule.read_with(&guard).to_css_string(&guard).into()
self.import_rule
.read_with(&guard)
.to_css_string(&guard)
.into()
}
}