aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlmetaelement.rs
diff options
context:
space:
mode:
authorFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-02-05 20:50:44 +0100
committerFernando Jiménez Moreno <ferjmoreno@gmail.com>2019-04-26 10:17:47 +0200
commit3bb50cc4795c3ac98d25e2b54d871ded2c3f3fed (patch)
tree736690ba430ac32c66157ca93a2d304c5a969820 /components/script/dom/htmlmetaelement.rs
parent0d6bd24245df02e8e745a273e37cd53d70c19ce6 (diff)
downloadservo-3bb50cc4795c3ac98d25e2b54d871ded2c3f3fed.tar.gz
servo-3bb50cc4795c3ac98d25e2b54d871ded2c3f3fed.zip
ShadowRoot stylesheet list
Diffstat (limited to 'components/script/dom/htmlmetaelement.rs')
-rw-r--r--components/script/dom/htmlmetaelement.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs
index de605c31092..0c8794711f1 100644
--- a/components/script/dom/htmlmetaelement.rs
+++ b/components/script/dom/htmlmetaelement.rs
@@ -15,7 +15,9 @@ use crate::dom::document::Document;
use crate::dom::element::{AttributeMutation, Element};
use crate::dom::htmlelement::HTMLElement;
use crate::dom::htmlheadelement::HTMLHeadElement;
-use crate::dom::node::{document_from_node, window_from_node, Node, UnbindContext};
+use crate::dom::node::{
+ document_from_node, stylesheets_owner_from_node, window_from_node, Node, UnbindContext,
+};
use crate::dom::virtualmethods::VirtualMethods;
use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix};
@@ -106,6 +108,7 @@ impl HTMLMetaElement {
let content = content.value();
if !content.is_empty() {
if let Some(translated_rule) = ViewportRule::from_meta(&**content) {
+ let stylesheets_owner = stylesheets_owner_from_node(self);
let document = document_from_node(self);
let shared_lock = document.style_shared_lock();
let rule = CssRule::Viewport(Arc::new(shared_lock.wrap(translated_rule)));
@@ -124,7 +127,7 @@ impl HTMLMetaElement {
disabled: AtomicBool::new(false),
});
*self.stylesheet.borrow_mut() = Some(sheet.clone());
- document.add_stylesheet(self.upcast(), sheet);
+ stylesheets_owner.add_stylesheet(self.upcast(), sheet);
}
}
}
@@ -208,7 +211,7 @@ impl VirtualMethods for HTMLMetaElement {
self.process_referrer_attribute();
if let Some(s) = self.stylesheet.borrow_mut().take() {
- document_from_node(self).remove_stylesheet(self.upcast(), &s);
+ stylesheets_owner_from_node(self).remove_stylesheet(self.upcast(), &s);
}
}
}