mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove styles when link node is removed from document
This commit is contained in:
parent
9760ea2953
commit
b3ce08f1b5
5 changed files with 68 additions and 1 deletions
|
@ -18,7 +18,7 @@ use dom::element::{AttributeMutation, Element, ElementCreator};
|
|||
use dom::element::{cors_setting_for_element, reflect_cross_origin_attribute, set_cross_origin_attribute};
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{Node, document_from_node, window_from_node};
|
||||
use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
|
||||
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use html5ever_atoms::LocalName;
|
||||
|
@ -213,6 +213,15 @@ impl VirtualMethods for HTMLLinkElement {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn unbind_from_tree(&self, context: &UnbindContext) {
|
||||
if let Some(ref s) = self.super_type() {
|
||||
s.unbind_from_tree(context);
|
||||
}
|
||||
|
||||
let document = document_from_node(self);
|
||||
document.invalidate_stylesheets();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue