Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: Source/web/PopupMenuImpl.cpp

Issue 1013303004: Fix issue on <select> style change when popup is visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed test expectation Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/PopupMenuImpl.h ('k') | Source/web/PopupMenuTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupMenuImpl.cpp
diff --git a/Source/web/PopupMenuImpl.cpp b/Source/web/PopupMenuImpl.cpp
index 0a5023640525945b9aaf98fa3203826921b07a9a..0a8da75644ec1aeef9c11bf9de061cb93a1d9388 100644
--- a/Source/web/PopupMenuImpl.cpp
+++ b/Source/web/PopupMenuImpl.cpp
@@ -69,7 +69,6 @@ PopupMenuImpl::PopupMenuImpl(ChromeClientImpl* chromeClient, PopupMenuClient* cl
: m_chromeClient(chromeClient)
, m_client(client)
, m_popup(nullptr)
- , m_indexToSetOnClose(-1)
, m_needsUpdate(false)
{
}
@@ -240,8 +239,8 @@ void PopupMenuImpl::setValueAndClosePopup(int numValue, const String& stringValu
ASSERT(success);
m_client->selectionChanged(listIndex);
m_client->valueChanged(listIndex);
- m_indexToSetOnClose = -1;
- closePopup();
+ if (m_popup)
+ m_chromeClient->closePagePopup(m_popup);
}
void PopupMenuImpl::setValue(const String& value)
@@ -250,8 +249,7 @@ void PopupMenuImpl::setValue(const String& value)
bool success;
int listIndex = value.toInt(&success);
ASSERT(success);
- m_client->setTextFromItem(listIndex);
- m_indexToSetOnClose = listIndex;
+ m_client->provisionalSelectionChanged(listIndex);
}
void PopupMenuImpl::didClosePopup()
@@ -259,11 +257,6 @@ void PopupMenuImpl::didClosePopup()
// Clearing m_popup first to prevent from trying to close the popup again.
m_popup = nullptr;
RefPtrWillBeRawPtr<PopupMenuImpl> protector(this);
- if (m_client && m_indexToSetOnClose >= 0) {
- // valueChanged() will dispatch a 'change' event.
- m_client->valueChanged(m_indexToSetOnClose);
- }
- m_indexToSetOnClose = -1;
if (m_client)
m_client->popupDidHide();
}
@@ -282,11 +275,14 @@ void PopupMenuImpl::closePopup()
{
if (m_popup)
m_chromeClient->closePagePopup(m_popup);
+ if (m_client)
+ m_client->popupDidCancel();
}
void PopupMenuImpl::dispose()
{
- closePopup();
+ if (m_popup)
+ m_chromeClient->closePagePopup(m_popup);
}
void PopupMenuImpl::show(const FloatQuad& /*controlPosition*/, const IntSize& /*controlSize*/, int /*index*/)
« no previous file with comments | « Source/web/PopupMenuImpl.h ('k') | Source/web/PopupMenuTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698