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

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: Try to be nicer to MSVC. Created 7 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 | « Source/core/dom/CustomElementUpgradeCandidateMap.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CustomElementUpgradeCandidateMap.cpp
diff --git a/Source/core/dom/CustomElementUpgradeCandidateMap.cpp b/Source/core/dom/CustomElementUpgradeCandidateMap.cpp
index 6b9c5439c990538815ba523fc8921fc9e2ea047e..6d9e766b158edddd329923bc680204d3dd93436d 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,36 +44,31 @@ 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)
+Vector<Element*> CustomElementUpgradeCandidateMap::takeUpgradeCandidatesFor(CustomElementDefinition* definition)
{
UnresolvedDefinitionMap::iterator it = m_unresolvedDefinitions.find(definition->type());
if (it == m_unresolvedDefinitions.end())
- return ElementSet();
+ return Vector<Element*>();
const ElementSet& candidatesForThisType = it->value;
- ElementSet matchingCandidates;
+ Vector<Element*> matchingCandidates;
// Filter the set based on whether the definition matches
for (ElementSet::const_iterator candidate = candidatesForThisType.begin(); candidate != candidatesForThisType.end(); ++candidate) {
if (matches(definition, *candidate)) {
- matchingCandidates.add(*candidate);
- m_unresolvedElements.remove(*candidate);
+ matchingCandidates.append(*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();
}
« no previous file with comments | « Source/core/dom/CustomElementUpgradeCandidateMap.h ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698