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

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

Issue 109533003: HTMLOptionElement code style: consistently access select owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698