Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2016 04:13:49 +0000 (04:13 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Oct 2016 04:13:49 +0000 (04:13 +0000)
commit3d20d7920c33b3f5950e7c3c4d2b8d33a74ca03b
treee4eedd30202450b21506eac43387f334884209ba
parent3a80105e619508f19a257a2c9b338f73be89c5db
Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements
https://bugs.webkit.org/show_bug.cgi?id=163358

Reviewed by Kent Tamura.

Source/WebCore:

Update HTMLSelectElement::recalcListItems() to ignore nested optgroup elements.
As per the specification, we only want optgroup elements that are direct
children of the select element. This also matches the behavior of Chrome.

Test: fast/dom/HTMLSelectElement/nested-optgroup.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::recalcListItems):

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLSelectElement/nested-optgroup-expected.txt: Added.
* fast/dom/HTMLSelectElement/nested-optgroup.html: Added.

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