| Index: Source/core/html/HTMLOptGroupElement.cpp
|
| diff --git a/Source/core/html/HTMLOptGroupElement.cpp b/Source/core/html/HTMLOptGroupElement.cpp
|
| index 314e220d088510271d3c705f7d8c1ff1d8a13450..d9f835b0faf0c1bed924df7183c59ed7dc6dc81b 100644
|
| --- a/Source/core/html/HTMLOptGroupElement.cpp
|
| +++ b/Source/core/html/HTMLOptGroupElement.cpp
|
| @@ -75,11 +75,8 @@ void HTMLOptGroupElement::parseAttribute(const QualifiedName& name, const Atomic
|
|
|
| void HTMLOptGroupElement::recalcSelectOptions()
|
| {
|
| - ContainerNode* select = parentNode();
|
| - while (select && !isHTMLSelectElement(*select))
|
| - select = select->parentNode();
|
| - if (select)
|
| - toHTMLSelectElement(select)->setRecalcListItems();
|
| + if (HTMLSelectElement* select = Traversal<HTMLSelectElement>::firstAncestor(*this))
|
| + select->setRecalcListItems();
|
| }
|
|
|
| void HTMLOptGroupElement::attach(const AttachContext& context)
|
| @@ -127,14 +124,7 @@ String HTMLOptGroupElement::groupLabelText() const
|
|
|
| HTMLSelectElement* HTMLOptGroupElement::ownerSelectElement() const
|
| {
|
| - ContainerNode* select = parentNode();
|
| - while (select && !isHTMLSelectElement(*select))
|
| - select = select->parentNode();
|
| -
|
| - if (!select)
|
| - return 0;
|
| -
|
| - return toHTMLSelectElement(select);
|
| + return Traversal<HTMLSelectElement>::firstAncestor(*this);
|
| }
|
|
|
| void HTMLOptGroupElement::accessKeyAction(bool)
|
|
|