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

Unified Diff: Source/core/html/HTMLFormControlsCollection.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 | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLFormElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormControlsCollection.cpp
diff --git a/Source/core/html/HTMLFormControlsCollection.cpp b/Source/core/html/HTMLFormControlsCollection.cpp
index b3ceed48a571865d346c56a1e7ea5784d6b2c04d..2d23716f5e38813ab133f0e4d6c11adbe5e4c19f 100644
--- a/Source/core/html/HTMLFormControlsCollection.cpp
+++ b/Source/core/html/HTMLFormControlsCollection.cpp
@@ -43,7 +43,7 @@ HTMLFormControlsCollection::HTMLFormControlsCollection(ContainerNode& ownerNode)
, m_cachedElement(0)
, m_cachedElementOffsetInArray(0)
{
- ASSERT(ownerNode.hasTagName(formTag) || ownerNode.hasTagName(fieldsetTag));
+ ASSERT(isHTMLFormElement(ownerNode) || isHTMLFieldSetElement(ownerNode));
ScriptWrappable::init(this);
}
@@ -58,8 +58,8 @@ HTMLFormControlsCollection::~HTMLFormControlsCollection()
const Vector<FormAssociatedElement*>& HTMLFormControlsCollection::formControlElements() const
{
- ASSERT(ownerNode().hasTagName(formTag) || ownerNode().hasTagName(fieldsetTag));
- if (ownerNode().hasTagName(formTag))
+ ASSERT(isHTMLFormElement(ownerNode()) || isHTMLFieldSetElement(ownerNode()));
+ if (isHTMLFormElement(ownerNode()))
return toHTMLFormElement(ownerNode()).associatedElements();
return toHTMLFieldSetElement(ownerNode()).associatedElements();
}
@@ -141,7 +141,7 @@ Element* HTMLFormControlsCollection::namedItem(const AtomicString& name) const
// attribute. If a match is not found, the method then searches for an
// object with a matching name attribute, but only on those elements
// that are allowed a name attribute.
- const Vector<HTMLImageElement*>* imagesElements = ownerNode().hasTagName(fieldsetTag) ? 0 : &formImageElements();
+ const Vector<HTMLImageElement*>* imagesElements = isHTMLFieldSetElement(ownerNode()) ? 0 : &formImageElements();
if (HTMLElement* item = firstNamedItem(formControlElements(), imagesElements, idAttr, name))
return item;
@@ -174,7 +174,7 @@ void HTMLFormControlsCollection::updateIdNameCache() const
}
}
- if (ownerNode().hasTagName(formTag)) {
+ if (isHTMLFormElement(ownerNode())) {
const Vector<HTMLImageElement*>& imageElementsArray = formImageElements();
for (unsigned i = 0; i < imageElementsArray.size(); ++i) {
HTMLImageElement* element = imageElementsArray[i];
« no previous file with comments | « Source/core/html/HTMLFormControlElement.cpp ('k') | Source/core/html/HTMLFormElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698