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

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

Issue 18970003: Introduce isHTMLOptGroupElement and toHTMLOptGroupElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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/HTMLOptionElement.cpp ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('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 f5f2bdf9f077e20402ed36a4af5ef94e01b858ad..53e16a6e76b25de86cff2ad0e40df0206e17c90c 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -40,6 +40,7 @@
#include "core/html/FormController.h"
#include "core/html/FormDataList.h"
#include "core/html/HTMLFormElement.h"
+#include "core/html/HTMLOptGroupElement.h"
#include "core/html/HTMLOptionElement.h"
#include "core/html/HTMLOptionsCollection.h"
#include "core/page/EventHandler.h"
@@ -339,7 +340,7 @@ bool HTMLSelectElement::childShouldCreateRenderer(const NodeRenderingContext& ch
if (!HTMLFormControlElementWithState::childShouldCreateRenderer(childContext))
return false;
if (!usesMenuList())
- return childContext.node()->hasTagName(HTMLNames::optionTag) || childContext.node()->hasTagName(HTMLNames::optgroupTag);
+ return childContext.node()->hasTagName(HTMLNames::optionTag) || isHTMLOptGroupElement(childContext.node());
return false;
}
@@ -745,7 +746,7 @@ void HTMLSelectElement::recalcListItems(bool updateSelectedStates) const
// optgroup tags may not nest. However, both FireFox and IE will
// flatten the tree automatically, so we follow suit.
// (http://www.w3.org/TR/html401/interact/forms.html#h-17.6)
- if (current->hasTagName(optgroupTag)) {
+ if (isHTMLOptGroupElement(current)) {
m_listItems.append(current);
if (Element* nextElement = ElementTraversal::firstWithin(current)) {
currentElement = nextElement;
« no previous file with comments | « Source/core/html/HTMLOptionElement.cpp ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698