mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Auto merge of #9074 - dagnir:ask-for-reset-on-remove, r=nox
Ask for reset when option is removed. Now that `UnbindContext` is available, asking the `select` element for a reset when an option is removed is now possible. Link to the spec: https://html.spec.whatwg.org/multipage/#ask-for-a-reset <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9074) <!-- Reviewable:end -->
This commit is contained in:
commit
e7212953f1
2 changed files with 6 additions and 5 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue