diff options
author | Patrick Shaughnessy <pshaughn@comcast.net> | 2020-01-07 11:57:52 -0500 |
---|---|---|
committer | Patrick Shaughnessy <pshaughn@comcast.net> | 2020-01-07 11:57:52 -0500 |
commit | 9ff671799298ac06973bed7fd16fe1c12d018ca7 (patch) | |
tree | 1af4cfb3feaebd92216739a190a46b0cfde18116 /components/script/dom/htmlformelement.rs | |
parent | 1d645f37418719a3f965f5729543c97c2d057d01 (diff) | |
download | servo-9ff671799298ac06973bed7fd16fe1c12d018ca7.tar.gz servo-9ff671799298ac06973bed7fd16fe1c12d018ca7.zip |
Past names expire when form owner is reset
Diffstat (limited to 'components/script/dom/htmlformelement.rs')
-rw-r--r-- | components/script/dom/htmlformelement.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 959bca74b54..37165d273b1 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -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); } } |