Index: Source/core/dom/CustomElementRegistry.cpp |
diff --git a/Source/core/dom/CustomElementRegistry.cpp b/Source/core/dom/CustomElementRegistry.cpp |
index da3dff370b898eeb32951a16936ffb5a94f9087e..6d8517bf6bba8041611c8ebb4f8746a8e599493d 100644 |
--- a/Source/core/dom/CustomElementRegistry.cpp |
+++ b/Source/core/dom/CustomElementRegistry.cpp |
@@ -138,7 +138,7 @@ void CustomElementRegistry::registerElement(CustomElementConstructorBuilder* con |
for (CustomElementUpgradeCandidateMap::ElementSet::iterator it = upgradeCandidates.begin(); it != upgradeCandidates.end(); ++it) { |
(*it)->setNeedsStyleRecalc(); // :unresolved has changed |
- CustomElementCallbackDispatcher::instance().enqueueReadyCallback(lifecycleCallbacks.get(), *it); |
+ CustomElementCallbackDispatcher::instance().enqueueCreationCallbacks(lifecycleCallbacks.get(), *it, false); |
} |
} |
@@ -182,7 +182,7 @@ PassRefPtr<CustomElementDefinition> CustomElementRegistry::findAndCheckNamespace |
return it->value; |
} |
-PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const QualifiedName& tagName) |
+PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const QualifiedName& tagName, bool createdByParser) |
{ |
if (!document()) |
return 0; |
@@ -206,13 +206,13 @@ PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const Qualifie |
// custom tag element will be unresolved in perpetuity. |
didCreateUnresolvedElement(CustomElementDefinition::CustomTag, tagName.localName(), element.get()); |
} else { |
- didCreateCustomTagElement(definition.get(), element.get()); |
+ didCreateCustomTagElement(definition.get(), element.get(), createdByParser); |
} |
return element.release(); |
} |
-void CustomElementRegistry::didGiveTypeExtension(Element* element, const AtomicString& type) |
+void CustomElementRegistry::didGiveTypeExtension(Element* element, const AtomicString& type, bool byParser) |
dglazkov
2013/06/25 18:04:31
givenByParser? or just createdByParser for consist
|
{ |
if (!element->isHTMLElement() && !element->isSVGElement()) |
return; |
@@ -223,13 +223,13 @@ void CustomElementRegistry::didGiveTypeExtension(Element* element, const AtomicS |
// extension element will be unresolved in perpetuity. |
didCreateUnresolvedElement(CustomElementDefinition::TypeExtension, type, element); |
} else { |
- CustomElementCallbackDispatcher::instance().enqueueReadyCallback(definition->callback(), element); |
+ CustomElementCallbackDispatcher::instance().enqueueCreationCallbacks(definition->callback(), element, byParser); |
} |
} |
-void CustomElementRegistry::didCreateCustomTagElement(CustomElementDefinition* definition, Element* element) |
+void CustomElementRegistry::didCreateCustomTagElement(CustomElementDefinition* definition, Element* element, bool createdByParser) |
{ |
- CustomElementCallbackDispatcher::instance().enqueueReadyCallback(definition->callback(), element); |
+ CustomElementCallbackDispatcher::instance().enqueueCreationCallbacks(definition->callback(), element, createdByParser); |
} |
void CustomElementRegistry::didCreateUnresolvedElement(CustomElementDefinition::CustomElementKind kind, const AtomicString& type, Element* element) |
@@ -237,6 +237,24 @@ void CustomElementRegistry::didCreateUnresolvedElement(CustomElementDefinition:: |
m_candidates.add(kind, type, element); |
} |
+void CustomElementRegistry::customElementWasInsertedIntoDocument(Element* element) |
+{ |
+ ASSERT(element->isCustomElement()); |
+ ASSERT(element->inDocument()); |
+ |
+ if (RefPtr<CustomElementDefinition> definition = findFor(element)) |
+ CustomElementCallbackDispatcher::instance().enqueueInsertedCallback(definition->callback(), element); |
+} |
+ |
+void CustomElementRegistry::customElementWasRemovedFromDocument(Element* element) |
+{ |
+ ASSERT(element->isCustomElement()); |
+ ASSERT(!element->inDocument()); |
+ |
+ if (RefPtr<CustomElementDefinition> definition = findFor(element)) |
+ CustomElementCallbackDispatcher::instance().enqueueRemovedCallback(definition->callback(), element); |
+} |
+ |
void CustomElementRegistry::customElementWasDestroyed(Element* element) |
{ |
ASSERT(element->isCustomElement()); |