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

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

Issue 189543012: Update <select> when any of its <option> children has "display: none" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update Test Expectations Created 6 years, 8 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/core/html/HTMLSelectElement.h ('k') | Source/core/rendering/RenderListBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 14b30889fbb04557c7b3011a44ea6fedf630e811..a503d05679a1338eefeb7275a60f19bd13588895 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -76,6 +76,7 @@ HTMLSelectElement::HTMLSelectElement(Document& document, HTMLFormElement* form)
, m_suggestedIndex(-1)
{
ScriptWrappable::init(this);
+ setHasCustomStyleCallbacks();
}
PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(Document& document)
@@ -521,11 +522,12 @@ int HTMLSelectElement::nextValidIndex(int listIndex, SkipDirection direction, in
int size = listItems.size();
for (listIndex += direction; listIndex >= 0 && listIndex < size; listIndex += direction) {
--skip;
- if (!listItems[listIndex]->isDisabledFormControl() && isHTMLOptionElement(*listItems[listIndex])) {
- lastGoodIndex = listIndex;
- if (skip <= 0)
- break;
- }
+ HTMLElement* element = listItems[listIndex];
+ if (!isHTMLOptionElement(*element) || toHTMLOptionElement(element)->isDisabledFormControl() || toHTMLOptionElement(element)->isDisplayNone())
+ continue;
+ lastGoodIndex = listIndex;
+ if (skip <= 0)
+ break;
}
return lastGoodIndex;
}
@@ -638,7 +640,7 @@ void HTMLSelectElement::updateListBoxSelection(bool deselectOtherOptions)
const Vector<HTMLElement*>& items = listItems();
for (unsigned i = 0; i < items.size(); ++i) {
HTMLElement* element = items[i];
- if (!isHTMLOptionElement(*element) || toHTMLOptionElement(element)->isDisabledFormControl())
+ if (!isHTMLOptionElement(*element) || toHTMLOptionElement(element)->isDisabledFormControl() || toHTMLOptionElement(element)->isDisplayNone())
continue;
if (i >= start && i <= end)
@@ -1652,4 +1654,9 @@ bool HTMLSelectElement::supportsAutofocus() const
return true;
}
+void HTMLSelectElement::updateListOnRenderer()
+{
+ setOptionsChangedOnRenderer();
+}
+
} // namespace
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | Source/core/rendering/RenderListBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698