mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
script: Add CSSImportRule WebIDL interface.
This commit is contained in:
parent
ca93a2dcec
commit
b86aa41568
6 changed files with 77 additions and 1 deletions
|
@ -9,6 +9,7 @@ use dom::bindings::js::{JS, Root};
|
|||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::cssfontfacerule::CSSFontFaceRule;
|
||||
use dom::cssimportrule::CSSImportRule;
|
||||
use dom::csskeyframerule::CSSKeyframeRule;
|
||||
use dom::csskeyframesrule::CSSKeyframesRule;
|
||||
use dom::cssmediarule::CSSMediaRule;
|
||||
|
@ -64,6 +65,8 @@ impl CSSRule {
|
|||
rule as &SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSKeyframeRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSImportRule>() {
|
||||
rule as &SpecificCSSRule
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
|
@ -75,6 +78,7 @@ impl CSSRule {
|
|||
rule: StyleCssRule) -> Root<CSSRule> {
|
||||
// be sure to update the match in as_specific when this is updated
|
||||
match rule {
|
||||
StyleCssRule::Import(s) => Root::upcast(CSSImportRule::new(window, parent_stylesheet, s)),
|
||||
StyleCssRule::Style(s) => Root::upcast(CSSStyleRule::new(window, parent_stylesheet, s)),
|
||||
StyleCssRule::FontFace(s) => Root::upcast(CSSFontFaceRule::new(window, parent_stylesheet, s)),
|
||||
StyleCssRule::Keyframes(s) => Root::upcast(CSSKeyframesRule::new(window, parent_stylesheet, s)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue