[macOS] Select element doesn't show popup if select element had lost focus while...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 06:22:42 +0000 (06:22 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Mar 2019 06:22:42 +0000 (06:22 +0000)
commit64fd914f711b71bbe17909bbaa9b85f8e8dade2f
tree3844d9403f86a1ef88c3901815acad5f0ca4e933
parentbb72478c150423cca14a7e3fd94d8089710325a7
[macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
https://bugs.webkit.org/show_bug.cgi?id=196336

Reviewed by Tim Horton.

Source/WebCore:

* rendering/RenderMenuList.cpp:
(RenderMenuList::popupDidHide): Added a comment.

Source/WebKit:

The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
This resulted in RenderMenuList::m_popupIsVisible to be never reset.

Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
Send cancelTracking to NSMenu instead, which DOES dismiss the popup.

Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
       fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html

* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::hidePopupMenu):
* WebProcess/WebCoreSupport/WebPopupMenu.cpp:
(WebKit::WebPopupMenu::hide):

Source/WebKitLegacy/mac:

Fixed the bug that we were not actually dismissing the popup in PopupMenuMac::hide as done in WebKit2.

Unfortunately no new tests since intenals.isSelectPopupVisible would always return false in WebKit1.

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::hide):

LayoutTests:

Added regression tests for dismissing the select element's popup menu by bluring the element then re-opening the popup.
Unfortunately these tests are only enabled in WebKit2 since intenals.isSelectPopupVisible would always return false in WebKit1.

* TestExpectations:
* fast/forms/select/mac-wk2: Added.
* fast/forms/select/mac-wk2/blur-dismisses-select-popup-expected.html: Added.
* fast/forms/select/mac-wk2/blur-dismisses-select-popup.html: Added.
* fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur-expected.txt: Added.
* fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html: Added.
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/forms/select/mac-wk2/blur-dismisses-select-popup-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/select/mac-wk2/blur-dismisses-select-popup.html [new file with mode: 0644]
LayoutTests/fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm
Source/WebKit/WebProcess/WebCoreSupport/WebPopupMenu.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm