Skip to content

Commit

Permalink
Past names expire when form owner is reset
Browse files Browse the repository at this point in the history
  • Loading branch information
pshaughn committed Jan 7, 2020
1 parent 1d645f3 commit 9ff6717
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 7 additions & 0 deletions components/script/dom/htmlformelement.rs
Expand Up @@ -1081,6 +1081,13 @@ impl HTMLFormElement {
.iter()
.position(|c| &**c == control)
.map(|idx| controls.remove(idx));

// https://html.spec.whatwg.org/multipage#forms.html#the-form-element:past-names-map-5
// "If an element listed in a form element's past names map
// changes form owner, then its entries must be removed
// from that map."
let mut past_names_map = self.past_names_map.borrow_mut();
past_names_map.retain(|_k, v| v.0 != control);
}
}

Expand Down
Expand Up @@ -15,6 +15,3 @@
[Trying to set an expando that would shadow an already-existing named property]
expected: FAIL

[Past names map should work correctly]
expected: FAIL

0 comments on commit 9ff6717

Please sign in to comment.