Past names expire when form owner is reset

This commit is contained in:
Patrick Shaughnessy 2020-01-07 11:57:52 -05:00
parent 1d645f3741
commit 9ff6717992
2 changed files with 7 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -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