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

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

Issue 180723006: Have ElementData::attributeItem() 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/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 61c1310fb1fb3c3c4298b76433f86dcf48536365..3fc552e4cba3aaa4d8a168bb8228fd9fc76918f3 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -363,9 +363,9 @@ static inline bool containsHTMLSpace(const AtomicString& string)
return false;
}
-static bool attributeValueMatches(const Attribute* attributeItem, CSSSelector::Match match, const AtomicString& selectorValue, bool caseSensitive)
+static bool attributeValueMatches(const Attribute& attributeItem, CSSSelector::Match match, const AtomicString& selectorValue, bool caseSensitive)
{
- const AtomicString& value = attributeItem->value();
+ const AtomicString& value = attributeItem.value();
if (value.isNull())
return false;
@@ -442,9 +442,9 @@ static bool anyAttributeMatches(Element& element, CSSSelector::Match match, cons
unsigned attributeCount = element.attributeCount();
for (size_t i = 0; i < attributeCount; ++i) {
- const Attribute* attributeItem = element.attributeItem(i);
+ const Attribute& attributeItem = element.attributeItem(i);
- if (!attributeItem->matches(selectorAttr))
+ if (!attributeItem.matches(selectorAttr))
continue;
if (attributeValueMatches(attributeItem, match, selectorValue, true))
« 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