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

Unified Diff: Source/core/html/HTMLSelectElement.cpp

Issue 159743002: Select when disabled should not allow value change and popup is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Popup menu is not shown when select is disabled Created 6 years, 10 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
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 097f90eed19660aaa225dc054ff684f1bd2821c3..585417fefee3fe7b642271b96979577027bdef4a 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -1061,8 +1061,10 @@ bool HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event)
// gets called from RenderMenuList::valueChanged, which gets called
// after the user makes a selection from the menu.
saveLastSelection();
- if (RenderMenuList* menuList = toRenderMenuList(renderer()))
- menuList->showPopup();
+ if (RenderMenuList* menuList = toRenderMenuList(renderer())) {
+ if (!isDisabledOrReadOnly())
tkent 2014/02/17 00:14:30 * <select> can not be read-only. * This check has
Habib Virji 2014/02/18 10:23:21 Done. "<select> can not be read-only." --> Select
+ menuList->showPopup();
+ }
event->setDefaultHandled();
}
return true;
@@ -1148,8 +1150,10 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
// gets called from RenderMenuList::valueChanged, which gets called
// after the user makes a selection from the menu.
saveLastSelection();
- if (RenderMenuList* menuList = toRenderMenuList(renderer()))
- menuList->showPopup();
+ if (RenderMenuList* menuList = toRenderMenuList(renderer())) {
+ if (!isDisabledOrReadOnly())
+ menuList->showPopup();
+ }
handled = true;
}
} else if (renderTheme.popsMenuByArrowKeys()) {
@@ -1166,8 +1170,10 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
// gets called from RenderMenuList::valueChanged, which gets called
// after the user makes a selection from the menu.
saveLastSelection();
- if (RenderMenuList* menuList = toRenderMenuList(renderer()))
- menuList->showPopup();
+ if (RenderMenuList* menuList = toRenderMenuList(renderer())) {
+ if (!isDisabledOrReadOnly())
+ menuList->showPopup();
+ }
handled = true;
} else if (keyCode == '\r') {
if (form())
@@ -1194,7 +1200,8 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* event)
// which gets called after the user makes a selection from
// the menu.
saveLastSelection();
- menuList->showPopup();
+ if (!isDisabledOrReadOnly())
+ menuList->showPopup();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698