mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Format remaining files
This commit is contained in:
parent
bf47f90da6
commit
cb07debcb6
252 changed files with 5944 additions and 3744 deletions
|
@ -59,20 +59,28 @@ impl RadioNodeList {
|
|||
impl RadioNodeListMethods for RadioNodeList {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-radionodelist-value
|
||||
fn Value(&self) -> DOMString {
|
||||
self.upcast::<NodeList>().as_simple_list().iter().filter_map(|node| {
|
||||
// Step 1
|
||||
node.downcast::<HTMLInputElement>().and_then(|input| {
|
||||
if input.input_type() == InputType::Radio && input.Checked() {
|
||||
// Step 3-4
|
||||
let value = input.Value();
|
||||
Some(if value.is_empty() { DOMString::from("on") } else { value })
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.upcast::<NodeList>()
|
||||
.as_simple_list()
|
||||
.iter()
|
||||
.filter_map(|node| {
|
||||
// Step 1
|
||||
node.downcast::<HTMLInputElement>().and_then(|input| {
|
||||
if input.input_type() == InputType::Radio && input.Checked() {
|
||||
// Step 3-4
|
||||
let value = input.Value();
|
||||
Some(if value.is_empty() {
|
||||
DOMString::from("on")
|
||||
} else {
|
||||
value
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
})
|
||||
}).next()
|
||||
// Step 2
|
||||
.unwrap_or(DOMString::from(""))
|
||||
.next()
|
||||
// Step 2
|
||||
.unwrap_or(DOMString::from(""))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-radionodelist-value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue