servo: Merge #13461 - Pass the correct attribute to handle_stylesheet_url (from servo:media); r=Manishearth
authorMs2ger <Ms2ger@gmail.com>
Fri, 30 Sep 2016 01:21:08 -0500
changeset 339781 164955232a8734c9dae47841439a3bf4fb34ce95
parent 339780 e8a71b34c922ee2da331d84231a8e60b3597f031
child 339782 4d61566cdbbfbb9927abc862f32d67e2a06b1021
push id31307
push usergszorc@mozilla.com
push dateSat, 04 Feb 2017 00:59:06 +0000
treeherdermozilla-central@94079d43835f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersManishearth
servo: Merge #13461 - Pass the correct attribute to handle_stylesheet_url (from servo:media); r=Manishearth Source-Repo: https://github.com/servo/servo Source-Revision: 7fe688b8e932d60c1b588b1dd80e939d80be2706
servo/components/script/dom/htmllinkelement.rs
--- a/servo/components/script/dom/htmllinkelement.rs
+++ b/servo/components/script/dom/htmllinkelement.rs
@@ -149,17 +149,19 @@ impl VirtualMethods for HTMLLinkElement 
                 if is_favicon(&rel) {
                     if let Some(ref href) = get_attr(self.upcast(), &atom!("href")) {
                         self.handle_favicon_url(rel.as_ref().unwrap(), href, &Some(attr.value().to_string()));
                     }
                 }
             },
             &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());
+                    }
                 }
             },
             _ => {},
         }
     }
 
     fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
         match name {