mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Removing style element's styles when elements is removed from dom
This commit is contained in:
parent
b3ce08f1b5
commit
f0c72cb7fd
4 changed files with 59 additions and 1 deletions
|
@ -15,7 +15,7 @@ use dom::document::Document;
|
|||
use dom::element::{Element, ElementCreator};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{ChildrenMutation, Node, document_from_node, window_from_node};
|
||||
use dom::node::{ChildrenMutation, Node, UnbindContext, document_from_node, window_from_node};
|
||||
use dom::stylesheet::StyleSheet as DOMStyleSheet;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use html5ever_atoms::LocalName;
|
||||
|
@ -161,6 +161,15 @@ impl VirtualMethods for HTMLStyleElement {
|
|||
self.parse_own_css();
|
||||
}
|
||||
}
|
||||
|
||||
fn unbind_from_tree(&self, context: &UnbindContext) {
|
||||
if let Some(ref s) = self.super_type() {
|
||||
s.unbind_from_tree(context);
|
||||
}
|
||||
|
||||
let doc = document_from_node(self);
|
||||
doc.invalidate_stylesheets();
|
||||
}
|
||||
}
|
||||
|
||||
impl StylesheetOwner for HTMLStyleElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue