mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Format script component
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user