mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Implements Stylesheet.ownerNode
This commit is contained in:
@@ -5,8 +5,10 @@
|
||||
use crate::dom::bindings::codegen::Bindings::StyleSheetBinding::StyleSheetMethods;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::reflector::Reflector;
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::cssstylesheet::CSSStyleSheet;
|
||||
use crate::dom::element::Element;
|
||||
use dom_struct::dom_struct;
|
||||
|
||||
#[dom_struct]
|
||||
@@ -44,6 +46,11 @@ impl StyleSheetMethods for StyleSheet {
|
||||
self.href.clone()
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-stylesheet-ownernode
|
||||
fn GetOwnerNode(&self) -> Option<DomRoot<Element>> {
|
||||
self.downcast::<CSSStyleSheet>().and_then(|s| s.get_owner())
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-stylesheet-title
|
||||
fn GetTitle(&self) -> Option<DOMString> {
|
||||
self.title.clone()
|
||||
|
||||
Reference in New Issue
Block a user