Changeset 147548 in webkit


Ignore:
Timestamp:
Apr 3, 2013 6:20:29 AM (11 years ago)
Author:
kov@webkit.org
Message:

Should close select popup when the element loses focus
https://bugs.webkit.org/show_bug.cgi?id=113220

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2013-04-03
Reviewed by Kent Tamura.

Source/WebCore:

Test: fast/forms/select-popup-closes-on-blur.html

  • html/HTMLSelectElement.cpp:

(WebCore::HTMLSelectElement::menuListDefaultEventHandler): handle the blur event, closing
the popup menu if any.

  • testing/Internals.cpp:

(WebCore::Internals::isSelectPopupVisible): utility to query the select node renderer to
find out whether the popup is open or closed.
(WebCore):

  • testing/Internals.h: add the new method definition.
  • testing/Internals.idl: ditto.

Source/WebKit/win:

  • WebKit.vcproj/WebKitExports.def.in: export WebCore::HTMLNames::selectTag for Internals

LayoutTests:

  • fast/forms/select/popup-closes-on-blur-expected.txt: Added.
  • fast/forms/select/popup-closes-on-blur.html: Added.
  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
Location:
trunk
Files:
2 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147538 r147548  
     12013-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        Should close select popup when the element loses focus
     4        https://bugs.webkit.org/show_bug.cgi?id=113220
     5
     6        Reviewed by Kent Tamura.
     7
     8        * fast/forms/select/popup-closes-on-blur-expected.txt: Added.
     9        * fast/forms/select/popup-closes-on-blur.html: Added.
     10        * platform/mac/TestExpectations:
     11        * platform/win/TestExpectations:
     12
    1132013-04-03  Antoine Quint  <graouts@apple.com>
    214
  • trunk/LayoutTests/platform/mac/TestExpectations

    r147522 r147548  
    186186# Color input is not yet enabled.
    187187fast/forms/color
     188
     189# Times out only in non-wk2 Mac, possibly because of platform-specific behaviour
     190# interfering with how the test is executed.
     191# https://bugs.webkit.org/show_bug.cgi?id=113220
     192fast/forms/select/popup-closes-on-blur.html [ Timeout Pass ]
    188193
    189194# ENABLE_INPUT_TYPE_* are not enabled.
  • trunk/LayoutTests/platform/win/TestExpectations

    r147522 r147548  
    208208fast/events/option-tab.html
    209209fast/forms/focus2.html
     210
     211# Unidentified crash, possibly related to linking issues?
     212# https://bugs.webkit.org/show_bug.cgi?id=113220
     213fast/forms/select/popup-closes-on-blur.html [ Crash ]
    210214
    211215# fast/html/keygen.html is failing on boomer <rdar://problem/5133799>
  • trunk/Source/WebCore/ChangeLog

    r147545 r147548  
     12013-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        Should close select popup when the element loses focus
     4        https://bugs.webkit.org/show_bug.cgi?id=113220
     5
     6        Reviewed by Kent Tamura.
     7
     8        Test: fast/forms/select-popup-closes-on-blur.html
     9
     10        * html/HTMLSelectElement.cpp:
     11        (WebCore::HTMLSelectElement::menuListDefaultEventHandler): handle the blur event, closing
     12        the popup menu if any.
     13        * testing/Internals.cpp:
     14        (WebCore::Internals::isSelectPopupVisible): utility to query the select node renderer to
     15        find out whether the popup is open or closed.
     16        (WebCore):
     17        * testing/Internals.h: add the new method definition.
     18        * testing/Internals.idl: ditto.
     19
    1202013-03-28  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    221
  • trunk/Source/WebCore/html/HTMLSelectElement.cpp

    r147205 r147548  
    12251225        }
    12261226        event->setDefaultHandled();
     1227    }
     1228
     1229    if (event->type() == eventNames().blurEvent) {
     1230        if (RenderMenuList* menuList = toRenderMenuList(renderer())) {
     1231            if (menuList->popupIsVisible())
     1232                menuList->hidePopup();
     1233        }
    12271234    }
    12281235}
  • trunk/Source/WebCore/testing/Internals.cpp

    r147039 r147548  
    5656#endif
    5757#include "HTMLNames.h"
     58#include "HTMLSelectElement.h"
    5859#include "HTMLTextAreaElement.h"
    5960#include "HistoryItem.h"
     
    7879#include "PseudoElement.h"
    7980#include "Range.h"
     81#include "RenderMenuList.h"
    8082#include "RenderObject.h"
    8183#include "RenderTreeAsText.h"
     
    21032105#endif
    21042106
    2105 }
     2107bool Internals::isSelectPopupVisible(Node* node)
     2108{
     2109    if (!isHTMLSelectElement(node))
     2110        return false;
     2111
     2112    HTMLSelectElement* select = toHTMLSelectElement(node);
     2113
     2114    RenderObject* renderer = select->renderer();
     2115    if (!renderer->isMenuList())
     2116        return false;
     2117
     2118    RenderMenuList* menuList = toRenderMenuList(renderer);
     2119    return menuList->popupIsVisible();
     2120}
     2121
     2122}
  • trunk/Source/WebCore/testing/Internals.h

    r147039 r147548  
    310310#endif
    311311
     312    bool isSelectPopupVisible(Node*);
     313
    312314private:
    313315    explicit Internals(Document*);
  • trunk/Source/WebCore/testing/Internals.idl

    r147039 r147548  
    272272
    273273    DOMString getImageSourceURL(in Element element) raises(DOMException);
     274
     275    boolean isSelectPopupVisible(in Node node);
    274276};
  • trunk/Source/WebKit/win/ChangeLog

    r147482 r147548  
     12013-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
     2
     3        Should close select popup when the element loses focus
     4        https://bugs.webkit.org/show_bug.cgi?id=113220
     5
     6        Reviewed by Kent Tamura.
     7
     8        * WebKit.vcproj/WebKitExports.def.in: export WebCore::HTMLNames::selectTag for Internals
     9
    1102013-04-02  Timothy Hatcher  <timothy@apple.com>
    211
  • trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in

    r147046 r147548  
    197197        ?getReferencedFilePaths@FormController@WebCore@@SA?AV?$Vector@VString@WTF@@$0A@@WTF@@ABV34@@Z
    198198        ?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
     199        ?selectTag@HTMLNames@WebCore@@3VQualifiedName@2@B
    199200#if ENABLE(INSPECTOR)
    200201        ?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@@Z
  • trunk/Source/autotools/symbols.filter

    r147085 r147548  
    5252_ZN7WebCore8toUInt64EPN3JSC9ExecStateENS0_7JSValueENS_30IntegerConversionConfigurationE;
    5353_ZN7WebCore9HTMLNames8inputTagE;
     54_ZN7WebCore9HTMLNames9selectTagE;
    5455_ZN7WebCore9HTMLNames11textareaTagE;
    5556_ZN7WebCore10JSDocument10putVirtualEPN3JSC9ExecStateERKNS1_10IdentifierENS1_7JSValueERNS1_15PutPropertySlotE;
Note: See TracChangeset for help on using the changeset viewer.