mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Fixed is_listed_element() call and DomRoot child reference
This commit is contained in:
parent
2ee6150990
commit
5e67dbda54
1 changed files with 5 additions and 5 deletions
|
@ -285,21 +285,21 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
||||||
// controls - list of form elements
|
// controls - list of form elements
|
||||||
// check all listed elements first, push to sourcedNamesVec as per spec
|
// check all listed elements first, push to sourcedNamesVec as per spec
|
||||||
for child in controls.iter() {
|
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.is_listed()
|
||||||
|
|
||||||
if child.has_attribute(&local_name!("id")) {
|
if child.has_attribute(&local_name!("id")) {
|
||||||
// https://learning-rust.github.io/docs/b2.structs.html
|
// https://learning-rust.github.io/docs/b2.structs.html
|
||||||
let entry = SourcedName {
|
let entry = SourcedName {
|
||||||
name: child.get_string_attribute(&local_name!("id")),
|
name: child.get_string_attribute(&local_name!("id")),
|
||||||
element: child.root_element(),
|
element: DomRoot::from_ref(&*child),
|
||||||
source: SourcedNameSource::Id,
|
source: SourcedNameSource::Id,
|
||||||
};
|
};
|
||||||
sourcedNamesVec.push(entry);
|
sourcedNamesVec.push(entry);
|
||||||
} else if child.has_attribute(&local_name!("name")) {
|
} else if child.has_attribute(&local_name!("name")) {
|
||||||
let entry = SourcedName {
|
let entry = SourcedName {
|
||||||
name: child.get_string_attribute(&local_name!("name")),
|
name: child.get_string_attribute(&local_name!("name")),
|
||||||
element: child.root_element(),
|
element: DomRoot::from_ref(&*child),
|
||||||
source: SourcedNameSource::Name,
|
source: SourcedNameSource::Name,
|
||||||
};
|
};
|
||||||
sourcedNamesVec.push(entry);
|
sourcedNamesVec.push(entry);
|
||||||
|
@ -318,14 +318,14 @@ impl HTMLFormElementMethods for HTMLFormElement {
|
||||||
// https://learning-rust.github.io/docs/b2.structs.html
|
// https://learning-rust.github.io/docs/b2.structs.html
|
||||||
let entry = SourcedName {
|
let entry = SourcedName {
|
||||||
name: child.get_string_attribute(&local_name!("id")),
|
name: child.get_string_attribute(&local_name!("id")),
|
||||||
element: child.root_element(),
|
element: DomRoot::from_ref(&*child),
|
||||||
source: SourcedNameSource::Id,
|
source: SourcedNameSource::Id,
|
||||||
};
|
};
|
||||||
sourcedNamesVec.push(entry);
|
sourcedNamesVec.push(entry);
|
||||||
} else if child.has_attribute(&local_name!("name")) {
|
} else if child.has_attribute(&local_name!("name")) {
|
||||||
let entry = SourcedName {
|
let entry = SourcedName {
|
||||||
name: child.get_string_attribute(&local_name!("name")),
|
name: child.get_string_attribute(&local_name!("name")),
|
||||||
element: child.root_element(),
|
element: DomRoot::from_ref(&*child),
|
||||||
source: SourcedNameSource::Name,
|
source: SourcedNameSource::Name,
|
||||||
};
|
};
|
||||||
sourcedNamesVec.push(entry);
|
sourcedNamesVec.push(entry);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue