Implement ToCss serialization for CSSRules

This commit is contained in:
Nazım Can Altınova 2016-11-15 23:25:03 +03:00
parent 22aebdf5d4
commit fdbadcdce2
10 changed files with 198 additions and 28 deletions

View file

@ -12,6 +12,7 @@ use dom::window::Window;
use parking_lot::RwLock;
use std::sync::Arc;
use style::font_face::FontFaceRule;
use style_traits::ToCss;
#[dom_struct]
pub struct CSSFontFaceRule {
@ -44,7 +45,6 @@ impl SpecificCSSRule for CSSFontFaceRule {
}
fn get_css(&self) -> DOMString {
// self.fontfacerule.read().to_css_string().into()
"".into()
self.fontfacerule.read().to_css_string().into()
}
}

View file

@ -12,6 +12,7 @@ use dom::window::Window;
use parking_lot::RwLock;
use std::sync::Arc;
use style::stylesheets::KeyframesRule;
use style_traits::ToCss;
#[dom_struct]
pub struct CSSKeyframesRule {
@ -44,7 +45,6 @@ impl SpecificCSSRule for CSSKeyframesRule {
}
fn get_css(&self) -> DOMString {
// self.keyframesrule.read().to_css_string().into()
"".into()
self.keyframesrule.read().to_css_string().into()
}
}

View file

@ -13,6 +13,7 @@ use dom::window::Window;
use parking_lot::RwLock;
use std::sync::Arc;
use style::stylesheets::MediaRule;
use style_traits::ToCss;
#[dom_struct]
pub struct CSSMediaRule {
@ -45,7 +46,6 @@ impl SpecificCSSRule for CSSMediaRule {
}
fn get_css(&self) -> DOMString {
// self.mediarule.read().to_css_string().into()
"".into()
self.mediarule.read().to_css_string().into()
}
}

View file

@ -12,6 +12,7 @@ use dom::window::Window;
use parking_lot::RwLock;
use std::sync::Arc;
use style::stylesheets::NamespaceRule;
use style_traits::ToCss;
#[dom_struct]
pub struct CSSNamespaceRule {
@ -44,7 +45,6 @@ impl SpecificCSSRule for CSSNamespaceRule {
}
fn get_css(&self) -> DOMString {
// self.namespacerule.read().to_css_string().into()
"".into()
self.namespacerule.read().to_css_string().into()
}
}

View file

@ -12,6 +12,7 @@ use dom::window::Window;
use parking_lot::RwLock;
use std::sync::Arc;
use style::viewport::ViewportRule;
use style_traits::ToCss;
#[dom_struct]
pub struct CSSViewportRule {
@ -44,7 +45,6 @@ impl SpecificCSSRule for CSSViewportRule {
}
fn get_css(&self) -> DOMString {
// self.viewportrule.read().to_css_string().into()
"".into()
self.viewportrule.read().to_css_string().into()
}
}