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

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

Issue 18258003: Pow __proto__, sock :unresolved, and clunk the created callback at once. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
Index: Source/core/dom/CustomElementUpgradeCandidateMap.cpp
diff --git a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
index 6b9c5439c990538815ba523fc8921fc9e2ea047e..9fa07058d4ff6d6e2a4176d508332f9b3b856260 100644
--- a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
+++ b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
@@ -36,7 +36,7 @@ namespace WebCore {
void CustomElementUpgradeCandidateMap::add(CustomElementDefinition::CustomElementKind kind, const AtomicString& type, Element* element)
{
- m_unresolvedElements.add(element, RequiredDefinition(kind, type));
+ m_upgradeCandidates.add(element, RequiredDefinition(kind, type));
UnresolvedDefinitionMap::iterator it = m_unresolvedDefinitions.find(type);
if (it == m_unresolvedDefinitions.end())
@@ -44,20 +44,15 @@ void CustomElementUpgradeCandidateMap::add(CustomElementDefinition::CustomElemen
it->value.add(element);
}
-bool CustomElementUpgradeCandidateMap::contains(Element* element) const
-{
- return m_unresolvedElements.contains(element);
-}
-
void CustomElementUpgradeCandidateMap::remove(Element* element)
{
- UnresolvedElementMap::iterator it = m_unresolvedElements.find(element);
- if (it == m_unresolvedElements.end())
+ UpgradeCandidateMap::iterator it = m_upgradeCandidates.find(element);
+ if (it == m_upgradeCandidates.end())
return;
const AtomicString& type = it->value.second;
m_unresolvedDefinitions.get(type).remove(element);
- m_unresolvedElements.remove(it);
+ m_upgradeCandidates.remove(it);
}
CustomElementUpgradeCandidateMap::ElementSet CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor(CustomElementDefinition* definition)
@@ -73,7 +68,7 @@ CustomElementUpgradeCandidateMap::ElementSet CustomElementUpgradeCandidateMap::t
for (ElementSet::const_iterator candidate = candidatesForThisType.begin(); candidate != candidatesForThisType.end(); ++candidate) {
if (matches(definition, *candidate)) {
matchingCandidates.add(*candidate);
- m_unresolvedElements.remove(*candidate);
+ m_upgradeCandidates.remove(*candidate);
}
}
@@ -83,8 +78,8 @@ CustomElementUpgradeCandidateMap::ElementSet CustomElementUpgradeCandidateMap::t
bool CustomElementUpgradeCandidateMap::matches(CustomElementDefinition* definition, Element* element)
{
- ASSERT(m_unresolvedElements.contains(element));
- const RequiredDefinition& requirement = m_unresolvedElements.get(element);
+ ASSERT(m_upgradeCandidates.contains(element));
+ const RequiredDefinition& requirement = m_upgradeCandidates.get(element);
return definition->kind() == requirement.first && definition->type() == requirement.second && definition->namespaceURI() == element->namespaceURI() && definition->name() == element->localName();
}

Powered by Google App Engine
This is Rietveld 408576698