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

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

Issue 436603003: Make Element::attributes() less error-prone and simplify call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take feedback into consideration Created 6 years, 4 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/AttributeCollection.h » ('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 5f4e62c301544cd3439a02905e558445a1536ee6..23f3acaf0412256026b41d82a76278b30d4ec907 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -463,13 +463,10 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons
// Currently all lazy properties have a null namespace, so only pass localName().
element.synchronizeAttribute(selectorAttr.localName());
- if (!element.hasAttributesWithoutUpdate())
- return false;
-
const AtomicString& selectorValue = selector.value();
bool caseInsensitive = selector.attributeMatchType() == CSSSelector::CaseInsensitive;
- AttributeCollection attributes = element.attributes();
+ AttributeCollection attributes = element.attributesWithoutUpdate();
AttributeCollection::const_iterator end = attributes.end();
for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
const Attribute& attributeItem = *it;
« no previous file with comments | « Source/core/css/SelectorChecker.h ('k') | Source/core/dom/AttributeCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698