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

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

Issue 141683004: Use more const references in HTMLCollection / LiveNodeList (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Get rid of const_cast Created 6 years, 11 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/RadioNodeList.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/RadioNodeList.cpp
diff --git a/Source/core/html/RadioNodeList.cpp b/Source/core/html/RadioNodeList.cpp
index 9468b75e79d13bd0c6254371cb0656a32c3b0c4a..8c150d5ca256d0d9dd0cb077557271b3b5ea60f0 100644
--- a/Source/core/html/RadioNodeList.cpp
+++ b/Source/core/html/RadioNodeList.cpp
@@ -89,28 +89,28 @@ void RadioNodeList::setValue(const String& value)
}
}
-bool RadioNodeList::checkElementMatchesRadioNodeListFilter(Element* testElement) const
+bool RadioNodeList::checkElementMatchesRadioNodeListFilter(const Element& testElement) const
{
ASSERT(!m_onlyMatchImgElements);
- ASSERT(testElement->hasTagName(objectTag) || testElement->isFormControlElement());
+ ASSERT(testElement.hasTagName(objectTag) || testElement.isFormControlElement());
if (ownerNode()->hasTagName(formTag)) {
- HTMLFormElement* formElement = toHTMLElement(testElement)->formOwner();
+ HTMLFormElement* formElement = toHTMLElement(testElement).formOwner();
if (!formElement || formElement != ownerNode())
return false;
}
- return testElement->getIdAttribute() == m_name || testElement->getNameAttribute() == m_name;
+ return testElement.getIdAttribute() == m_name || testElement.getNameAttribute() == m_name;
}
-bool RadioNodeList::nodeMatches(Element* testElement) const
+bool RadioNodeList::nodeMatches(const Element& testElement) const
{
if (m_onlyMatchImgElements)
- return testElement->hasTagName(imgTag);
+ return testElement.hasTagName(imgTag);
- if (!testElement->hasTagName(objectTag) && !testElement->isFormControlElement())
+ if (!testElement.hasTagName(objectTag) && !testElement.isFormControlElement())
return false;
- if (testElement->hasTagName(inputTag) && toHTMLInputElement(testElement)->isImageButton())
+ if (testElement.hasTagName(inputTag) && toHTMLInputElement(testElement).isImageButton())
return false;
return checkElementMatchesRadioNodeListFilter(testElement);
« no previous file with comments | « Source/core/html/RadioNodeList.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698