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

Unified Diff: sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp

Issue 843063005: Remove custom element upgrades. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
diff --git a/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp b/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
index af6c9b290e0411343d6f122a51156028740a03fb..97a3ca747f1cda121e01d12fe7607380ea23d25e 100644
--- a/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
+++ b/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
@@ -44,25 +44,12 @@
namespace blink {
CustomElementRegistrationContext::CustomElementRegistrationContext()
- : m_candidates(CustomElementUpgradeCandidateMap::create())
{
}
void CustomElementRegistrationContext::registerElement(Document* document, CustomElementConstructorBuilder* constructorBuilder, const AtomicString& type, CustomElement::NameSet validNames, ExceptionState& exceptionState)
{
- CustomElementDefinition* definition = m_registry.registerElement(document, constructorBuilder, type, validNames, exceptionState);
-
- if (!definition)
- return;
-
- // Upgrade elements that were waiting for this definition.
- OwnPtr<CustomElementUpgradeCandidateMap::ElementSet> upgradeCandidates = m_candidates->takeUpgradeCandidatesFor(definition->descriptor());
-
- if (!upgradeCandidates)
- return;
-
- for (CustomElementUpgradeCandidateMap::ElementSet::const_iterator it = upgradeCandidates->begin(); it != upgradeCandidates->end(); ++it)
- CustomElement::define(*it, definition);
+ m_registry.registerElement(document, constructorBuilder, type, validNames, exceptionState);
}
PassRefPtr<Element> CustomElementRegistrationContext::createCustomTagElement(Document& document, const QualifiedName& tagName)
@@ -85,13 +72,8 @@ void CustomElementRegistrationContext::resolveOrScheduleResolution(Element* elem
void CustomElementRegistrationContext::resolve(Element* element, const CustomElementDescriptor& descriptor)
{
- CustomElementDefinition* definition = m_registry.find(descriptor);
- if (definition) {
+ if (CustomElementDefinition* definition = m_registry.find(descriptor))
CustomElement::define(element, definition);
- } else {
- ASSERT(element->customElementState() == Element::WaitingForUpgrade);
- m_candidates->add(descriptor, element);
- }
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698