Invalidate node list when associated form control element is removed
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 15:41:10 +0000 (15:41 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Nov 2017 15:41:10 +0000 (15:41 +0000)
commit8b2f1874e0727bb207e8e4625870763b3d75dc5e
treeedb3fdeb5bcb5fe51279fe3db5f084e4dc928a98
parent9b865304969ad32b4654dc338ac34e6a97ca9af6
Invalidate node list when associated form control element is removed
https://bugs.webkit.org/show_bug.cgi?id=179232
<rdar://problem/35308269>

Reviewed by Ryosuke Niwa.

Source/WebCore:

A node list represents a live view of the DOM. Invalidate the node list
associated with a form element whenever one of its associated form control
elements is removed.

Test: fast/forms/node-list-remove-button-from-form.html

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::removeFormElement):

LayoutTests:

Add a test to ensure the node list returned by HTMLFormElement.elements stays synchronized
with the document.

* fast/forms/node-list-remove-button-from-form-expected.txt: Added.
* fast/forms/node-list-remove-button-from-form.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/node-list-remove-button-from-form-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/node-list-remove-button-from-form.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLFormElement.cpp