mirror of
https://github.com/servo/servo.git
synced 2025-06-14 11:24:33 +00:00
Add fixes based on review.
- Whitespace and indentation issues - call as_for_reset on option insert - add link to 'pick' in standard
This commit is contained in:
parent
15a8b6b62c
commit
92e008307f
2 changed files with 12 additions and 11 deletions
|
@ -198,13 +198,13 @@ impl VirtualMethods for HTMLOptionElement {
|
||||||
|
|
||||||
self.upcast::<Element>().check_parent_disabled_state_for_option();
|
self.upcast::<Element>().check_parent_disabled_state_for_option();
|
||||||
|
|
||||||
if self.Selected() {
|
if let Some(select) = self.upcast::<Node>().ancestors()
|
||||||
let node = self.upcast::<Node>();
|
|
||||||
if let Some(select) = node.ancestors()
|
|
||||||
.filter_map(Root::downcast::<HTMLSelectElement>)
|
.filter_map(Root::downcast::<HTMLSelectElement>)
|
||||||
.next() {
|
.next() {
|
||||||
|
if self.Selected() {
|
||||||
select.pick_option(self);
|
select.pick_option(self);
|
||||||
}
|
}
|
||||||
|
select.ask_for_reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ impl HTMLSelectElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/#concept-select-pick
|
||||||
pub fn pick_option(&self, picked: &HTMLOptionElement) {
|
pub fn pick_option(&self, picked: &HTMLOptionElement) {
|
||||||
if !self.Multiple() {
|
if !self.Multiple() {
|
||||||
let node = self.upcast::<Node>();
|
let node = self.upcast::<Node>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue