Bug 1250401 - HTMLOptionElement::GetSelect should not return an element if we have nested OptGroup elements - patch 2, r=bz

This commit is contained in:
Andrea Marchesini
2016-03-03 09:47:36 +01:00
parent 29dd823d04
commit ac489182c3

View File

@@ -355,7 +355,11 @@ HTMLSelectElement*
HTMLOptionElement::GetSelect()
{
nsIContent* parent = GetParent();
HTMLSelectElement* select = HTMLSelectElement::FromContentOrNull(parent);
if (!parent) {
return nullptr;
}
HTMLSelectElement* select = HTMLSelectElement::FromContent(parent);
if (select) {
return select;
}