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

Unified Diff: Source/web/PopupListBox.cpp

Issue 1013303004: Fix issue on <select> style change when popup is visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/PopupListBox.h ('k') | Source/web/PopupMenuImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/PopupListBox.cpp
diff --git a/Source/web/PopupListBox.cpp b/Source/web/PopupListBox.cpp
index 3378f5895f67f4dd243d371d5e4457f5cc8b8faf..455f79861a2b7226d0d01895414d2efa7cb2ea58 100644
--- a/Source/web/PopupListBox.cpp
+++ b/Source/web/PopupListBox.cpp
@@ -75,7 +75,6 @@ PopupListBox::PopupListBox(PopupMenuClient* client, bool deviceSupportsTouch, Po
: m_deviceSupportsTouch(deviceSupportsTouch)
, m_originalIndex(0)
, m_selectedIndex(0)
- , m_acceptedIndexOnAbandon(-1)
, m_visibleRows(0)
, m_baseWidth(0)
, m_maxHeight(defaultMaxHeight)
@@ -254,14 +253,8 @@ bool PopupListBox::handleKeyEvent(const PlatformKeyboardEvent& event)
}
if (m_originalIndex != m_selectedIndex) {
- // Keyboard events should update the selection immediately (but we don't
- // want to fire the onchange event until the popup is closed, to match
- // IE). We change the original index so we revert to that when the
- // popup is closed.
- m_acceptedIndexOnAbandon = m_selectedIndex;
-
setOriginalIndex(m_selectedIndex);
Xianzhu 2015/03/18 16:46:22 Can we have a better name for the method? The curr
keishi 2015/03/30 22:20:52 Seemed to be barely used so I removed m_originalIn
- m_popupClient->setTextFromItem(m_selectedIndex);
+ m_popupClient->setProvisionallySelectedListIndex(m_selectedIndex);
}
if (event.windowsVirtualKeyCode() == VKEY_TAB) {
// TAB is a special case as it should select the current item if any and
@@ -271,7 +264,6 @@ bool PopupListBox::handleKeyEvent(const PlatformKeyboardEvent& event)
// Return false so the TAB key event is propagated to the page.
return false;
}
- // Call abandon() so we honor m_acceptedIndexOnAbandon if set.
abandon();
// Return false so the TAB key event is propagated to the page.
return false;
@@ -505,12 +497,6 @@ void PopupListBox::abandon()
m_selectedIndex = m_originalIndex;
hidePopup();
-
- if (m_acceptedIndexOnAbandon >= 0) {
- if (m_popupClient)
- m_popupClient->valueChanged(m_acceptedIndexOnAbandon);
- m_acceptedIndexOnAbandon = -1;
- }
}
int PopupListBox::pointToRowIndex(const IntPoint& point)
@@ -532,10 +518,6 @@ int PopupListBox::pointToRowIndex(const IntPoint& point)
bool PopupListBox::acceptIndex(int index)
{
- // Clear m_acceptedIndexOnAbandon once user accepts the selected index.
- if (m_acceptedIndexOnAbandon >= 0)
- m_acceptedIndexOnAbandon = -1;
-
if (index >= numItems())
return false;
« no previous file with comments | « Source/web/PopupListBox.h ('k') | Source/web/PopupMenuImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698