Index: Source/core/html/HTMLOptionElement.cpp |
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp |
index 0240fb2871ea6c8a0ec960bf935dbee467317c9a..35137457a60907b59b21bc21690d2c2825342ce0 100644 |
--- a/Source/core/html/HTMLOptionElement.cpp |
+++ b/Source/core/html/HTMLOptionElement.cpp |
@@ -146,8 +146,7 @@ void HTMLOptionElement::setText(const String &text, ExceptionState& exceptionSta |
void HTMLOptionElement::accessKeyAction(bool) |
{ |
- HTMLSelectElement* select = ownerSelectElement(); |
- if (select) |
+ if (HTMLSelectElement* select = ownerSelectElement()) |
select->accessKeySetSelectedIndex(index()); |
} |
@@ -368,11 +367,10 @@ String HTMLOptionElement::collectOptionInnerText() const |
HTMLFormElement* HTMLOptionElement::form() const |
{ |
- HTMLSelectElement* selectElement = ownerSelectElement(); |
- if (!selectElement) |
- return 0; |
+ if (HTMLSelectElement* selectElement = ownerSelectElement()) |
+ return selectElement->formOwner(); |
- return selectElement->formOwner(); |
+ return 0; |
} |
} // namespace WebCore |