Ask for reset when option is removed.

This commit is contained in:
Dongie Agnir 2015-12-27 21:47:13 -10:00
parent 941653da65
commit 12afd837a0
2 changed files with 6 additions and 5 deletions

View file

@ -210,6 +210,12 @@ impl VirtualMethods for HTMLOptionElement {
fn unbind_from_tree(&self, context: &UnbindContext) {
self.super_type().unwrap().unbind_from_tree(context);
if let Some(select) = context.parent.inclusive_ancestors()
.filter_map(Root::downcast::<HTMLSelectElement>)
.next() {
select.ask_for_reset();
}
let node = self.upcast::<Node>();
let el = self.upcast::<Element>();
if node.GetParentNode().is_some() {