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; |