mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Add support for LinkStyle's sheet getter on <style> and <link>
This commit is contained in:
parent
1d20d75cb2
commit
972e9ac0fb
5 changed files with 23 additions and 2 deletions
|
@ -22,6 +22,7 @@ use dom::eventtarget::EventTarget;
|
|||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{Node, document_from_node, window_from_node};
|
||||
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use encoding::EncodingRef;
|
||||
use encoding::all::UTF_8;
|
||||
|
@ -452,4 +453,9 @@ impl HTMLLinkElementMethods for HTMLLinkElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-link-target
|
||||
make_setter!(SetTarget, "target");
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet
|
||||
fn GetSheet(&self) -> Option<Root<DOMStyleSheet>> {
|
||||
self.get_cssom_stylesheet().map(Root::upcast)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue