aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlformelement.rs
diff options
context:
space:
mode:
authorjaymodi98 <jaymodi98@gmail.com>2019-12-03 18:31:16 -0500
committerjaymodi98 <jaymodi98@gmail.com>2019-12-03 18:31:16 -0500
commit2ee6150990d2bb58ccf3bd634db640e155164eff (patch)
tree76bef6ef65dc70b8738c5c83c1d15c5081676753 /components/script/dom/htmlformelement.rs
parent2108a85764c4a7f4b9cdc6f2d2b1afaeb7ba4371 (diff)
downloadservo-2ee6150990d2bb58ccf3bd634db640e155164eff.tar.gz
servo-2ee6150990d2bb58ccf3bd634db640e155164eff.zip
Removed tidy-test errors
Diffstat (limited to 'components/script/dom/htmlformelement.rs')
-rw-r--r--components/script/dom/htmlformelement.rs41
1 files changed, 27 insertions, 14 deletions
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index fc96145e25e..09e055001ab 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -256,18 +256,18 @@ impl HTMLFormElementMethods for HTMLFormElement {
elements.IndexedGetter(index)
}
+ // https://html.spec.whatwg.org/multipage/#the-form-element%3Adetermine-the-value-of-a-named-property
fn NamedGetter(&self, name: DOMString) -> Option<RadioNodeListOrElement> {
// return Option::Some::<RadioNodeListOrElement>;
unimplemented!();
}
- // https://html.spec.whatwg.org/multipage/forms.html#the-form-element:supported-property-names
+ // https://html.spec.whatwg.org/multipage/#the-form-element:supported-property-names
fn SupportedPropertyNames(&self) -> Vec<DOMString> {
-
enum SourcedNameSource {
Id,
Name,
- Past(std::time::Duration)
+ Past(std::time::Duration),
}
struct SourcedName {
@@ -285,16 +285,23 @@ impl HTMLFormElementMethods for HTMLFormElement {
// controls - list of form elements
// check all listed elements first, push to sourcedNamesVec as per spec
for child in controls.iter() {
-
- if child.is_html_element() { // if child.is_listed()
+ if child.is_html_element() {
+ // if child.is_listed()
if child.has_attribute(&local_name!("id")) {
// https://learning-rust.github.io/docs/b2.structs.html
- let entry = SourcedName {name: child.get_string_attribute(&local_name!("id")), element: child.root_element(), source: SourcedNameSource::Id};
+ let entry = SourcedName {
+ name: child.get_string_attribute(&local_name!("id")),
+ element: child.root_element(),
+ source: SourcedNameSource::Id,
+ };
sourcedNamesVec.push(entry);
- }
- else if child.has_attribute(&local_name!("name")) {
- let entry = SourcedName {name: child.get_string_attribute(&local_name!("name")), element: child.root_element(), source: SourcedNameSource::Name};
+ } else if child.has_attribute(&local_name!("name")) {
+ let entry = SourcedName {
+ name: child.get_string_attribute(&local_name!("name")),
+ element: child.root_element(),
+ source: SourcedNameSource::Name,
+ };
sourcedNamesVec.push(entry);
}
}
@@ -307,14 +314,20 @@ impl HTMLFormElementMethods for HTMLFormElement {
// https://users.rust-lang.org/t/how-check-type-of-variable/33845/7
if child.is::<HTMLImageElement>() {
-
if child.has_attribute(&local_name!("id")) {
// https://learning-rust.github.io/docs/b2.structs.html
- let entry = SourcedName {name: child.get_string_attribute(&local_name!("id")), element: child.root_element(), source: SourcedNameSource::Id};
+ let entry = SourcedName {
+ name: child.get_string_attribute(&local_name!("id")),
+ element: child.root_element(),
+ source: SourcedNameSource::Id,
+ };
sourcedNamesVec.push(entry);
- }
- else if child.has_attribute(&local_name!("name")) {
- let entry = SourcedName {name: child.get_string_attribute(&local_name!("name")), element: child.root_element(), source: SourcedNameSource::Name};
+ } else if child.has_attribute(&local_name!("name")) {
+ let entry = SourcedName {
+ name: child.get_string_attribute(&local_name!("name")),
+ element: child.root_element(),
+ source: SourcedNameSource::Name,
+ };
sourcedNamesVec.push(entry);
}
}