aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/htmllinkelement.rs4
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>();