Implements StyleSheet.media

This commit is contained in:
Vincent Ricard 2020-10-10 21:12:58 +02:00
parent 2af9648235
commit 66223f7596
18 changed files with 16 additions and 980 deletions

View file

@ -9,6 +9,7 @@ use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::cssstylesheet::CSSStyleSheet;
use crate::dom::element::Element;
use crate::dom::medialist::MediaList;
use dom_struct::dom_struct;
#[dom_struct]
@ -51,6 +52,11 @@ impl StyleSheetMethods for StyleSheet {
self.downcast::<CSSStyleSheet>().and_then(|s| s.get_owner())
}
// https://drafts.csswg.org/cssom/#dom-stylesheet-media
fn Media(&self) -> DomRoot<MediaList> {
self.downcast::<CSSStyleSheet>().unwrap().medialist()
}
// https://drafts.csswg.org/cssom/#dom-stylesheet-title
fn GetTitle(&self) -> Option<DOMString> {
self.title.clone()