[iOS] Multiple select appearance doesn't update when selecting or deselecting rows...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 22:03:04 +0000 (22:03 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Mar 2018 22:03:04 +0000 (22:03 +0000)
commite5ea0e1c3549a76d4f0c748ba3c25140db4b379f
treef5fd9d4740510af85d69a5da563b2215ae858a18
parent29a675b5eb01c323627ce3b5464610841db55363
[iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
https://bugs.webkit.org/show_bug.cgi?id=184110
<rdar://problem/38796648>

Reviewed by Tim Horton.

Source/WebCore:

HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
renderer, and then dispatches a `change` event if needed.

However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
without updating the renderer, leaving it stale.

Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html

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

Update the renderer after updating the DOM to reflect the selected option.

LayoutTests:

Adds a new layout test to verify that after tapping on a multiple select and choosing an option, the select's
renderer is updated to reflect its new state.

* fast/forms/ios/ipad/multiple-select-updates-renderer-expected.txt: Added.
* fast/forms/ios/ipad/multiple-select-updates-renderer.html: Added.
* resources/basic-gestures.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/ios/ipad/multiple-select-updates-renderer-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/ios/ipad/multiple-select-updates-renderer.html [new file with mode: 0644]
LayoutTests/resources/basic-gestures.js
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLSelectElement.cpp