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

Unified Diff: Source/core/css/SelectorChecker.cpp

Issue 298253009: Add iterator object to iterate efficiently over an Element's attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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/css/SelectorChecker.h ('k') | Source/core/dom/DatasetDOMStringMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/SelectorChecker.cpp
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 015bda730c7d0c8e77308efb4a7501bc624a78f0..8f8b1c845bc35570498fd1168b272a0016998921 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -500,9 +500,10 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons
const AtomicString& selectorValue = selector.value();
- unsigned attributeCount = element.attributeCount();
- for (size_t i = 0; i < attributeCount; ++i) {
- const Attribute& attributeItem = element.attributeItem(i);
+ AttributeIteratorAccessor attributes = element.attributesIterator();
+ AttributeConstIterator end = attributes.end();
+ for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
+ const Attribute& attributeItem = **it;
if (!attributeItem.matches(selectorAttr))
continue;
« no previous file with comments | « Source/core/css/SelectorChecker.h ('k') | Source/core/dom/DatasetDOMStringMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698