diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-09-13 17:11:24 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-09-13 17:11:24 +0200 |
commit | 82c58d0a05d2bf00bbb64fc83dd05469eeec5a43 (patch) | |
tree | b7b60e0160d0733da921e8ad00b878bcca8069ac /components/script/dom | |
parent | 02d1264047c9aee63ae93c5624c591c42394690c (diff) | |
download | servo-82c58d0a05d2bf00bbb64fc83dd05469eeec5a43.tar.gz servo-82c58d0a05d2bf00bbb64fc83dd05469eeec5a43.zip |
script: Fix stylesheet adoption.
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/htmllinkelement.rs | 4 | ||||
-rw-r--r-- | components/script/dom/htmlmetaelement.rs | 4 | ||||
-rw-r--r-- | components/script/dom/htmlstyleelement.rs | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index 963f570700a..f1a8242b345 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -242,8 +242,8 @@ impl VirtualMethods for HTMLLinkElement { s.unbind_from_tree(context); } - if let Some(ref s) = *self.stylesheet.borrow() { - document_from_node(self).remove_stylesheet(self.upcast(), s); + if let Some(s) = self.stylesheet.borrow_mut().take() { + document_from_node(self).remove_stylesheet(self.upcast(), &s); } } } diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index 5e2d9c1c0b4..dbf5b676879 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -196,8 +196,8 @@ impl VirtualMethods for HTMLMetaElement { if context.tree_in_doc { self.process_referrer_attribute(); - if let Some(ref s) = *self.stylesheet.borrow() { - document_from_node(self).remove_stylesheet(self.upcast(), s); + if let Some(s) = self.stylesheet.borrow_mut().take() { + document_from_node(self).remove_stylesheet(self.upcast(), &s); } } } diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index 330ee738466..65c7d11c12f 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -190,9 +190,8 @@ impl VirtualMethods for HTMLStyleElement { } if context.tree_in_doc { - if let Some(ref s) = *self.stylesheet.borrow() { - let doc = document_from_node(self); - doc.remove_stylesheet(self.upcast(), s) + if let Some(s) = self.stylesheet.borrow_mut().take() { + document_from_node(self).remove_stylesheet(self.upcast(), &s) } } } |