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

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

Issue 198553002: Use new is*Element() helper functions even more in HTML code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months 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 | Source/core/html/HTMLAnchorElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/FormAssociatedElement.cpp
diff --git a/Source/core/html/FormAssociatedElement.cpp b/Source/core/html/FormAssociatedElement.cpp
index f18b19ef212796f363120b253128c3d923ef3b55..c8d69c34ee269fa10103e37996f2b68176f3d61c 100644
--- a/Source/core/html/FormAssociatedElement.cpp
+++ b/Source/core/html/FormAssociatedElement.cpp
@@ -108,11 +108,8 @@ HTMLFormElement* FormAssociatedElement::findAssociatedForm(const HTMLElement* el
// value is a form element, then associate the form-associated element
// with that form element.
// 3.2. Abort the "reset the form owner" steps.
- HTMLFormElement* newForm = 0;
Element* newFormCandidate = element->treeScope().getElementById(formId);
- if (newFormCandidate && newFormCandidate->hasTagName(formTag))
- newForm = toHTMLFormElement(newFormCandidate);
- return newForm;
+ return isHTMLFormElement(newFormCandidate) ? toHTMLFormElement(newFormCandidate) : 0;
}
// 4. Otherwise, if the form-associated element in question has an ancestor
// form element, then associate the form-associated element with the nearest
« no previous file with comments | « no previous file | Source/core/html/HTMLAnchorElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698