Skip to content

Finding target navigable by name should search in tree order #42343

@jdm

Description

@jdm

pub(crate) fn find_window_proxy_by_name(
&self,
name: &DOMString,
) -> Option<DomRoot<WindowProxy>> {
for (_, proxy) in self.map.borrow().iter() {
if proxy.get_name() == *name {
return Some(DomRoot::from_ref(&**proxy));
}
}
None
}
has no defined search order, so any window proxies with duplicate names can yield unexpected behaviour for automated tests.

The spec defines an algorithm for looking up target navigables by name, which we need to implement: https://html.spec.whatwg.org/multipage/document-sequences.html#find-a-navigable-by-target-name

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions