aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/script/dom/htmllinkelement.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs
index 1c84fbba784..773f1630489 100644
--- a/components/script/dom/htmllinkelement.rs
+++ b/components/script/dom/htmllinkelement.rs
@@ -154,7 +154,9 @@ impl VirtualMethods for HTMLLinkElement {
},
&atom!("media") => {
if string_is_stylesheet(&rel) {
- self.handle_stylesheet_url(&attr.value());
+ if let Some(href) = self.upcast::<Element>().get_attribute(&ns!(), &atom!("href")) {
+ self.handle_stylesheet_url(&href.value());
+ }
}
},
_ => {},