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

Unified Diff: Source/web/WebSearchableFormData.cpp

Issue 406843002: Optimize hasTagName when called on an HTMLElement / SVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/xml/parser/XMLDocumentParser.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebSearchableFormData.cpp
diff --git a/Source/web/WebSearchableFormData.cpp b/Source/web/WebSearchableFormData.cpp
index b92d461a7f27b493b31666676356a65bd9c363df..370064b8c72223b531f224eb3906ba5655119484 100644
--- a/Source/web/WebSearchableFormData.cpp
+++ b/Source/web/WebSearchableFormData.cpp
@@ -102,7 +102,7 @@ bool IsSelectInDefaultState(HTMLSelectElement* select)
const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
if (select->multiple() || select->size() > 1) {
for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
- if (!(*i)->hasLocalName(HTMLNames::optionTag))
+ if (!isHTMLOptionElement(*i))
continue;
HTMLOptionElement* optionElement = toHTMLOptionElement(*i);
if (optionElement->selected() != optionElement->hasAttribute(selectedAttr))
@@ -115,7 +115,7 @@ bool IsSelectInDefaultState(HTMLSelectElement* select)
// least one item is selected, determine which one.
HTMLOptionElement* initialSelected = 0;
for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
- if (!(*i)->hasLocalName(HTMLNames::optionTag))
+ if (!isHTMLOptionElement(*i))
continue;
HTMLOptionElement* optionElement = toHTMLOptionElement(*i);
if (optionElement->hasAttribute(selectedAttr)) {
« no previous file with comments | « Source/core/xml/parser/XMLDocumentParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698