mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Propagate CanGc
arguments through callers in constructors (#35541)
Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
parent
5465bfc2af
commit
863d2ce871
260 changed files with 986 additions and 603 deletions
|
@ -25,6 +25,7 @@ use crate::dom::cssstylerule::CSSStyleRule;
|
|||
use crate::dom::cssstylesheet::CSSStyleSheet;
|
||||
use crate::dom::csssupportsrule::CSSSupportsRule;
|
||||
use crate::dom::window::Window;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub(crate) struct CSSRule {
|
||||
|
@ -82,38 +83,65 @@ impl CSSRule {
|
|||
) -> DomRoot<CSSRule> {
|
||||
// be sure to update the match in as_specific when this is updated
|
||||
match rule {
|
||||
StyleCssRule::Import(s) => {
|
||||
DomRoot::upcast(CSSImportRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::Style(s) => {
|
||||
DomRoot::upcast(CSSStyleRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::FontFace(s) => {
|
||||
DomRoot::upcast(CSSFontFaceRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::Import(s) => DomRoot::upcast(CSSImportRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::Style(s) => DomRoot::upcast(CSSStyleRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::FontFace(s) => DomRoot::upcast(CSSFontFaceRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::FontFeatureValues(_) => unimplemented!(),
|
||||
StyleCssRule::CounterStyle(_) => unimplemented!(),
|
||||
StyleCssRule::Keyframes(s) => {
|
||||
DomRoot::upcast(CSSKeyframesRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::Media(s) => {
|
||||
DomRoot::upcast(CSSMediaRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::Namespace(s) => {
|
||||
DomRoot::upcast(CSSNamespaceRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::Supports(s) => {
|
||||
DomRoot::upcast(CSSSupportsRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::Keyframes(s) => DomRoot::upcast(CSSKeyframesRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::Media(s) => DomRoot::upcast(CSSMediaRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::Namespace(s) => DomRoot::upcast(CSSNamespaceRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::Supports(s) => DomRoot::upcast(CSSSupportsRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::Page(_) => unreachable!(),
|
||||
StyleCssRule::Container(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::Document(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::LayerBlock(s) => {
|
||||
DomRoot::upcast(CSSLayerBlockRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::LayerStatement(s) => {
|
||||
DomRoot::upcast(CSSLayerStatementRule::new(window, parent_stylesheet, s))
|
||||
},
|
||||
StyleCssRule::LayerBlock(s) => DomRoot::upcast(CSSLayerBlockRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::LayerStatement(s) => DomRoot::upcast(CSSLayerStatementRule::new(
|
||||
window,
|
||||
parent_stylesheet,
|
||||
s,
|
||||
CanGc::note(),
|
||||
)),
|
||||
StyleCssRule::FontPaletteValues(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::Property(_) => unimplemented!(), // TODO
|
||||
StyleCssRule::Margin(_) => unimplemented!(), // TODO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue