diff options
author | Josh Matthews <josh@joshmatthews.net> | 2016-07-04 10:24:32 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-07-04 11:25:17 -0400 |
commit | 29d3cbf34a85d1117294e37a5fbcd5a7a061b1fb (patch) | |
tree | f7d33e38a2395ef5cab0ea661bab368905483824 /components/script/dom | |
parent | 736feec0ad14650e21cb899d01e60d168b3e7e2e (diff) | |
download | servo-29d3cbf34a85d1117294e37a5fbcd5a7a061b1fb.tar.gz servo-29d3cbf34a85d1117294e37a5fbcd5a7a061b1fb.zip |
Avoid loading stylesheets in inactive documents.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/htmllinkelement.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index 0af076950b3..0b84bc38501 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -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>(); |