⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243601 in webkit


Ignore:
Timestamp:
Mar 27, 2019, 11:22:42 PM (7 years ago)
Author:
rniwa@webkit.org
Message:

[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:
Location:
trunk
Files:
5 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243594 r243601  
     12019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
     4        https://bugs.webkit.org/show_bug.cgi?id=196336
     5
     6        Reviewed by Tim Horton.
     7
     8        Added regression tests for dismissing the select element's popup menu by bluring the element then re-opening the popup.
     9        Unfortunately these tests are only enabled in WebKit2 since intenals.isSelectPopupVisible would always return false in WebKit1.
     10
     11        * TestExpectations:
     12        * fast/forms/select/mac-wk2: Added.
     13        * fast/forms/select/mac-wk2/blur-dismisses-select-popup-expected.html: Added.
     14        * fast/forms/select/mac-wk2/blur-dismisses-select-popup.html: Added.
     15        * fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur-expected.txt: Added.
     16        * fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html: Added.
     17        * platform/mac-wk2/TestExpectations:
     18
    1192019-03-27  Alicia Boya García  <aboya@igalia.com>
    220
  • trunk/LayoutTests/TestExpectations

    r243521 r243601  
    2424fast/css/watchos [ Skip ]
    2525fast/dom/Window/watchos [ Skip ]
     26fast/forms/select/mac-wk2 [ Skip ]
    2627fast/forms/textarea/ios [ Skip ]
    2728fast/forms/watchos [ Skip ]
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r243554 r243601  
    88editing/find [ Pass ]
    99editing/undo-manager [ Pass ]
     10fast/forms/select/mac-wk2 [ Pass ]
    1011fast/visual-viewport/tiled-drawing [ Pass ]
    1112fast/web-share [ Pass ]
  • trunk/Source/WebCore/ChangeLog

    r243563 r243601  
     12019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
     4        https://bugs.webkit.org/show_bug.cgi?id=196336
     5
     6        Reviewed by Tim Horton.
     7
     8        * rendering/RenderMenuList.cpp:
     9        (RenderMenuList::popupDidHide): Added a comment.
     10
    1112019-03-27  Justin Fan  <justin_fan@apple.com>
    212
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r237990 r243601  
    613613{
    614614#if !PLATFORM(IOS_FAMILY)
     615    // PopupMenuMac::show in WebKitLegacy can call this callback even when popup had already been dismissed.
    615616    m_popupIsVisible = false;
    616617#endif
  • trunk/Source/WebKit/ChangeLog

    r243595 r243601  
     12019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
     4        https://bugs.webkit.org/show_bug.cgi?id=196336
     5
     6        Reviewed by Tim Horton.
     7
     8        The bug was caused by WebPopupMenu::hide never notifying PopupClient that the popup had been dismissed.
     9        This resulted in RenderMenuList::m_popupIsVisible to be never reset.
     10
     11        Also fixed a bug in WebPopupMenuProxyMac::hidePopupMenu that this function was never dismissing
     12        the popup as the selector "dismissPopUp", on the contrary to its name, does not dimiss the popup.
     13        Send cancelTracking to NSMenu instead, which DOES dismiss the popup.
     14
     15        Tests: fast/forms/select/mac-wk2/blur-dismisses-select-popup.html
     16               fast/forms/select/mac-wk2/open-select-popup-after-dismissing-by-blur.html
     17
     18        * UIProcess/mac/WebPopupMenuProxyMac.mm:
     19        (WebKit::WebPopupMenuProxyMac::hidePopupMenu):
     20        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
     21        (WebKit::WebPopupMenu::hide):
     22
    1232019-03-27  Dean Jackson  <dino@apple.com>
    224
  • trunk/Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm

    r235935 r243601  
    204204void WebPopupMenuProxyMac::hidePopupMenu()
    205205{
    206     [m_popup dismissPopUp];
     206    [[m_popup menu] cancelTracking];
    207207}
    208208
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPopupMenu.cpp

    r235205 r243601  
    121121
    122122    WebProcess::singleton().parentProcessConnection()->send(Messages::WebPageProxy::HidePopupMenu(), m_page->pageID());
    123     m_page->setActivePopupMenu(0);
     123    m_page->setActivePopupMenu(nullptr);
     124    m_popupClient->popupDidHide();
    124125}
    125126
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r243471 r243601  
     12019-03-27  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        [macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
     4        https://bugs.webkit.org/show_bug.cgi?id=196336
     5
     6        Reviewed by Tim Horton.
     7
     8        Fixed the bug that we were not actually dismissing the popup in PopupMenuMac::hide as done in WebKit2.
     9
     10        Unfortunately no new tests since intenals.isSelectPopupVisible would always return false in WebKit1.
     11
     12        * WebCoreSupport/PopupMenuMac.mm:
     13        (PopupMenuMac::hide):
     14
    1152019-03-25  Andy Estes  <aestes@apple.com>
    216
  • trunk/Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm

    r237405 r243601  
    235235void PopupMenuMac::hide()
    236236{
    237     [m_popup dismissPopUp];
    238 }
    239    
     237    [[m_popup menu] cancelTracking];
     238    if (m_client)
     239        m_client->popupDidHide();
     240}
     241
    240242void PopupMenuMac::updateFromElement()
    241243{
Note: See TracChangeset for help on using the changeset viewer.