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

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

Issue 180143003: Have LiveNodeListBase::ownerNode() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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/HTMLCollection.idl ('k') | Source/core/html/HTMLFormControlsCollection.idl » ('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 6b2a2902e1454c6a8f2248db2b00d052da270c67..1443c1c78e00cddd0e44bab6e8cb16c90e26273b 100644
--- a/Source/core/html/HTMLFormControlsCollection.cpp
+++ b/Source/core/html/HTMLFormControlsCollection.cpp
@@ -58,17 +58,15 @@ HTMLFormControlsCollection::~HTMLFormControlsCollection()
const Vector<FormAssociatedElement*>& HTMLFormControlsCollection::formControlElements() const
{
- ASSERT(ownerNode());
- ASSERT(ownerNode()->hasTagName(formTag) || ownerNode()->hasTagName(fieldsetTag));
- if (ownerNode()->hasTagName(formTag))
- return toHTMLFormElement(ownerNode())->associatedElements();
- return toHTMLFieldSetElement(ownerNode())->associatedElements();
+ ASSERT(ownerNode().hasTagName(formTag) || ownerNode().hasTagName(fieldsetTag));
+ if (ownerNode().hasTagName(formTag))
+ return toHTMLFormElement(ownerNode()).associatedElements();
+ return toHTMLFieldSetElement(ownerNode()).associatedElements();
}
const Vector<HTMLImageElement*>& HTMLFormControlsCollection::formImageElements() const
{
- ASSERT(ownerNode());
- return toHTMLFormElement(ownerNode())->imageElements();
+ return toHTMLFormElement(ownerNode()).imageElements();
}
static unsigned findFormAssociatedElement(const Vector<FormAssociatedElement*>& associatedElements, Element* element)
@@ -143,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 = ownerNode().hasTagName(fieldsetTag) ? 0 : &formImageElements();
if (HTMLElement* item = firstNamedItem(formControlElements(), imagesElements, idAttr, name))
return item;
@@ -176,7 +174,7 @@ void HTMLFormControlsCollection::updateIdNameCache() const
}
}
- if (ownerNode()->hasTagName(formTag)) {
+ if (ownerNode().hasTagName(formTag)) {
const Vector<HTMLImageElement*>& imageElementsArray = formImageElements();
for (unsigned i = 0; i < imageElementsArray.size(); ++i) {
HTMLImageElement* element = imageElementsArray[i];
@@ -207,7 +205,7 @@ void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& rad
}
radioNodeListEnabled = true;
- radioNodeList = ownerNode()->radioNodeList(name);
+ radioNodeList = ownerNode().radioNodeList(name);
}
void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names)
« no previous file with comments | « Source/core/html/HTMLCollection.idl ('k') | Source/core/html/HTMLFormControlsCollection.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698