mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Implements Stylesheet.ownerNode
This commit is contained in:
parent
406d15974f
commit
e7199c029f
14 changed files with 72 additions and 39 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue