mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement CSSNestedDeclarations (#36248)
This is the CSSOM interface that represents a nested declarations rule. https://drafts.csswg.org/css-nesting/#the-cssnestrule Testing: `/_mozilla/mozilla/interfaces.https.html`. And once `CSSStyleRule` becomes a `CSSGroupingRule` subclass, this will be further covered by `/css/css-nestting/`. This is part of #36245 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
e8d5a019a4
commit
bc6926d1fe
7 changed files with 120 additions and 2 deletions
|
@ -21,6 +21,7 @@ use crate::dom::csslayerblockrule::CSSLayerBlockRule;
|
|||
use crate::dom::csslayerstatementrule::CSSLayerStatementRule;
|
||||
use crate::dom::cssmediarule::CSSMediaRule;
|
||||
use crate::dom::cssnamespacerule::CSSNamespaceRule;
|
||||
use crate::dom::cssnesteddeclarations::CSSNestedDeclarations;
|
||||
use crate::dom::cssstylerule::CSSStyleRule;
|
||||
use crate::dom::cssstylesheet::CSSStyleSheet;
|
||||
use crate::dom::csssupportsrule::CSSSupportsRule;
|
||||
|
@ -69,6 +70,8 @@ impl CSSRule {
|
|||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSLayerStatementRule>() {
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else if let Some(rule) = self.downcast::<CSSNestedDeclarations>() {
|
||||
rule as &dyn SpecificCSSRule
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
|
@ -125,7 +128,12 @@ impl CSSRule {
|
|||
StyleCssRule::Scope(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::StartingStyle(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::PositionTry(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::NestedDeclarations(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::NestedDeclarations(s) => DomRoot::upcast(CSSNestedDeclarations::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
can_gc,
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue