Changeset 58370 in webkit


Ignore:
Timestamp:
Apr 27, 2010 7:29:23 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-27 Jay Civelli <jcivelli@chromium.org>

Reviewed by Darin Fisher.

Makes clicking a select element close its associated popup if
it is open.
https://bugs.webkit.org/show_bug.cgi?id=38105

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::mouseDown):
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r58369 r58370  
     12010-04-27  Jay Civelli  <jcivelli@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Makes clicking a select element close its associated popup if
     6        it is open.
     7        https://bugs.webkit.org/show_bug.cgi?id=38105
     8
     9        * src/WebViewImpl.cpp:
     10        (WebKit::WebViewImpl::mouseDown):
     11
    1122010-04-27  Jay Civelli  <jcivelli@chromium.org>
    213
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r58369 r58370  
    327327        return;
    328328
    329     // If there is a select popup opened, close it as the user is clicking on
    330     // the page (outside of the popup).
     329    // If there is a select popup open, close it as the user is clicking on
     330    // the page (outside of the popup).  We also save it so we can prevent a
     331    // click on the select element from immediately reopening the popup.
     332    RefPtr<WebCore::PopupContainer> selectPopup = m_selectPopup;
    331333    hideSelectPopup();
     334    ASSERT(!m_selectPopup);
    332335
    333336    m_lastMouseDownPoint = WebPoint(event.x, event.y);
     
    362365        static_cast<EditorClientImpl*>(m_page->editorClient())->
    363366            showFormAutofillForNode(clickedNode.get());
     367    }
     368    if (m_selectPopup && m_selectPopup == selectPopup) {
     369        // That click triggered a select popup which is the same as the one that
     370        // was showing before the click.  It means the user clicked the select
     371        // while the popup was showing, and as a result we first closed then
     372        // immediately reopened the select popup.  It needs to be closed.
     373        hideSelectPopup();
    364374    }
    365375
Note: See TracChangeset for help on using the changeset viewer.