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

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

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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/dom/Element.h ('k') | Source/core/dom/EventListenerMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 1b732d9a730f504018f5922695261281638c2e33..38e67b70942a40af6a4ace09322dac6b4ff272d8 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -361,7 +361,7 @@ void Element::removeAttribute(const QualifiedName& name)
return;
size_t index = elementData()->getAttributeItemIndex(name);
- if (index == notFound)
+ if (index == kNotFound)
return;
removeAttributeInternal(index, NotInSynchronizationOfLazyAttribute);
@@ -838,33 +838,33 @@ void Element::setAttribute(const AtomicString& localName, const AtomicString& va
synchronizeAttribute(localName);
const AtomicString& caseAdjustedLocalName = shouldIgnoreAttributeCase(this) ? localName.lower() : localName;
- size_t index = elementData() ? elementData()->getAttributeItemIndex(caseAdjustedLocalName, false) : notFound;
- const QualifiedName& qName = index != notFound ? attributeItem(index)->name() : QualifiedName(nullAtom, caseAdjustedLocalName, nullAtom);
+ size_t index = elementData() ? elementData()->getAttributeItemIndex(caseAdjustedLocalName, false) : kNotFound;
+ const QualifiedName& qName = index != kNotFound ? attributeItem(index)->name() : QualifiedName(nullAtom, caseAdjustedLocalName, nullAtom);
setAttributeInternal(index, qName, value, NotInSynchronizationOfLazyAttribute);
}
void Element::setAttribute(const QualifiedName& name, const AtomicString& value)
{
synchronizeAttribute(name);
- size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : notFound;
+ size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : kNotFound;
setAttributeInternal(index, name, value, NotInSynchronizationOfLazyAttribute);
}
void Element::setSynchronizedLazyAttribute(const QualifiedName& name, const AtomicString& value)
{
- size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : notFound;
+ size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : kNotFound;
setAttributeInternal(index, name, value, InSynchronizationOfLazyAttribute);
}
inline void Element::setAttributeInternal(size_t index, const QualifiedName& name, const AtomicString& newValue, SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute)
{
if (newValue.isNull()) {
- if (index != notFound)
+ if (index != kNotFound)
removeAttributeInternal(index, inSynchronizationOfLazyAttribute);
return;
}
- if (index == notFound) {
+ if (index == kNotFound) {
addAttributeInternal(name, newValue, inSynchronizationOfLazyAttribute);
return;
}
@@ -1833,7 +1833,7 @@ PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionState& es)
UniqueElementData* elementData = ensureUniqueElementData();
size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName(), shouldIgnoreAttributeCase(this));
- if (index != notFound) {
+ if (index != kNotFound) {
if (oldAttrNode)
detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->attributeItem(index)->value());
else
@@ -1870,7 +1870,7 @@ PassRefPtr<Attr> Element::removeAttributeNode(Attr* attr, ExceptionState& es)
synchronizeAttribute(attr->qualifiedName());
size_t index = elementData()->getAttrIndex(attr);
- if (index == notFound) {
+ if (index == kNotFound) {
es.throwDOMException(NotFoundError);
return 0;
}
@@ -1945,7 +1945,7 @@ void Element::removeAttribute(const AtomicString& name)
AtomicString localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
size_t index = elementData()->getAttributeItemIndex(localName, false);
- if (index == notFound) {
+ if (index == kNotFound) {
if (UNLIKELY(localName == styleAttr) && elementData()->m_styleAttributeIsDirty && isStyledElement())
removeAllInlineStyleProperties();
return;
@@ -3611,7 +3611,7 @@ size_t ElementData::getAttrIndex(Attr* attr) const
if (attributeItem(i)->name() == attr->qualifiedName())
return i;
}
- return notFound;
+ return kNotFound;
}
size_t ElementData::getAttributeItemIndexSlowCase(const AtomicString& name, bool shouldIgnoreAttributeCase) const
@@ -3630,7 +3630,7 @@ size_t ElementData::getAttributeItemIndexSlowCase(const AtomicString& name, bool
return i;
}
}
- return notFound;
+ return kNotFound;
}
Attribute* UniqueElementData::getAttributeItem(const QualifiedName& name)
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/EventListenerMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698