Avoid loading stylesheets in inactive documents.

This commit is contained in:
Josh Matthews 2016-07-04 10:24:32 -04:00
parent 736feec0ad
commit 29d3cbf34a

View file

@ -194,6 +194,10 @@ impl VirtualMethods for HTMLLinkElement {
impl HTMLLinkElement {
fn handle_stylesheet_url(&self, href: &str) {
let document = document_from_node(self);
if document.browsing_context().is_none() {
return;
}
match document.base_url().join(href) {
Ok(url) => {
let element = self.upcast::<Element>();