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

Unified Diff: Source/core/dom/Element.h

Issue 387413003: Drop findAttribute*ByName() API from Element (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 | « no previous file | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.h
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index c80686971fb8641e7e8c0d9db065e3dd8e55a0f9..c7381fad51967a617097a425d67c9e524aba9316 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -168,13 +168,10 @@ public:
// so this function is not suitable for non-style uses.
const AtomicString& idForStyleResolution() const;
- // Internal methods that assume the existence of attribute storage, one should use hasAttributes()
- // before calling them. This is not a trivial getter and its return value should be cached for
+ // Internal method that assumes the existence of attribute storage, one should use hasAttributes()
+ // before calling it. This is not a trivial getter and its return value should be cached for
// performance.
AttributeCollection attributes() const;
- const Attribute* findAttributeByName(const QualifiedName&) const;
- size_t findAttributeIndexByName(const QualifiedName& name) const { return elementData()->attributes().findIndex(name); }
- size_t findAttributeIndexByName(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->attributes().findIndex(name, shouldIgnoreAttributeCase); }
void scrollIntoView(bool alignToTop = true);
void scrollIntoViewIfNeeded(bool centerIfNeeded = true);
@@ -699,14 +696,14 @@ inline Element* Node::parentElement() const
inline bool Element::fastHasAttribute(const QualifiedName& name) const
{
ASSERT(fastAttributeLookupAllowed(name));
- return elementData() && findAttributeByName(name);
+ return elementData() && attributes().findIndex(name) != kNotFound;
}
inline const AtomicString& Element::fastGetAttribute(const QualifiedName& name) const
{
ASSERT(fastAttributeLookupAllowed(name));
if (elementData()) {
- if (const Attribute* attribute = findAttributeByName(name))
+ if (const Attribute* attribute = attributes().find(name))
return attribute->value();
}
return nullAtom;
@@ -769,12 +766,6 @@ inline const SpaceSplitString& Element::classNames() const
return elementData()->classNames();
}
-inline const Attribute* Element::findAttributeByName(const QualifiedName& name) const
-{
- ASSERT(elementData());
- return elementData()->attributes().find(name);
-}
-
inline bool Element::hasID() const
{
return elementData() && elementData()->hasID();
« no previous file with comments | « no previous file | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698