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

Unified Diff: third_party/WebKit/Source/web/PopupMenuImpl.cpp

Issue 2350303005: Fix a DCHECK failure in PopupMenuImpl::setValueAndClosePopup(). (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/platform/win/fast/forms/select-popup/popup-menu-key-operations-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/PopupMenuImpl.cpp
diff --git a/third_party/WebKit/Source/web/PopupMenuImpl.cpp b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
index af349b9e7f6245aae326b0df7cf01ac433649477..39d7b80a7bac4561f131de5fbb5c7e609133d4b5 100644
--- a/third_party/WebKit/Source/web/PopupMenuImpl.cpp
+++ b/third_party/WebKit/Source/web/PopupMenuImpl.cpp
@@ -394,10 +394,11 @@ void PopupMenuImpl::setValueAndClosePopup(int numValue, const String& stringValu
{
DCHECK(m_popup);
DCHECK(m_ownerElement);
- bool success;
- int listIndex = stringValue.toInt(&success);
- DCHECK(success);
- {
+ if (!stringValue.isEmpty()) {
+ bool success;
+ int listIndex = stringValue.toInt(&success);
+ DCHECK(success);
+
EventQueueScope scope;
m_ownerElement->selectOptionByPopup(listIndex);
if (m_popup)
@@ -405,6 +406,9 @@ void PopupMenuImpl::setValueAndClosePopup(int numValue, const String& stringValu
// 'change' event is dispatched here. For compatbility with
// Angular 1.2, we need to dispatch a change event before
// mouseup/click events.
+ } else {
+ if (m_popup)
+ m_chromeClient->closePagePopup(m_popup);
}
// We dispatch events on the owner element to match the legacy behavior.
// Other browsers dispatch click events before and after showing the popup.
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/fast/forms/select-popup/popup-menu-key-operations-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698