validity assertion fails after removing a child of an <optgroup> element
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Aug 2016 19:38:18 +0000 (19:38 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Aug 2016 19:38:18 +0000 (19:38 +0000)
commit313d40f62200623167366781bc0c5b0fc62350e4
treecc24a61d4f4fc8c390a38ba66f67908f598fff4f
parentcfee4d6c35385d04f3f010f8c6043e82993771d6
validity assertion fails after removing a child of an <optgroup> element
https://bugs.webkit.org/show_bug.cgi?id=155720
<rdar://problem/27720746>

Reviewed by Brent Fulgham.

Source/WebCore:

All calls to HTMLSelectElement::setRecalcListItems also need to call HTMLSelectElement::updateValidity.

Test: fast/dom/HTMLSelectElement/select-remove-from-optgroup.html

* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::recalcSelectOptions): Call 'updateValidity' after 'setRecalcListItems'.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::insertedInto): Ditto.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute): Ditto.

LayoutTests:

Add new test case that triggers a debug assertion when the HTMLSelectElement state
is not updated properly.

* fast/dom/HTMLSelectElement/select-remove-from-optgroup-expected.txt: Added.
* fast/dom/HTMLSelectElement/select-remove-from-optgroup.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLSelectElement/select-remove-from-optgroup-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/HTMLSelectElement/select-remove-from-optgroup.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLOptGroupElement.cpp
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/html/HTMLSelectElement.cpp