Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named form getter #25070

Merged
merged 13 commits into from Dec 16, 2019

Fixed is_listed_element() call and DomRoot child reference

  • Loading branch information
hkshah6
hkshah6 committed Dec 4, 2019
commit 5e67dbda540338f2cd8b45fb28039763eb165e5b
@@ -285,21 +285,21 @@ 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.downcast::<HTMLElement>().map_or(false, |c| c.is_listed_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(),
element: DomRoot::from_ref(&*child),
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(),
element: DomRoot::from_ref(&*child),
source: SourcedNameSource::Name,
};
sourcedNamesVec.push(entry);
@@ -318,14 +318,14 @@ impl HTMLFormElementMethods for HTMLFormElement {
// https://learning-rust.github.io/docs/b2.structs.html
let entry = SourcedName {
name: child.get_string_attribute(&local_name!("id")),
element: child.root_element(),
element: DomRoot::from_ref(&*child),
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(),
element: DomRoot::from_ref(&*child),
source: SourcedNameSource::Name,
};
sourcedNamesVec.push(entry);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.