#include "config.h"
#include "core/dom/custom/CustomElement.h"
-#include "HTMLNames.h"
-#include "MathMLNames.h"
-#include "SVGNames.h"
+#include "core/HTMLNames.h"
+#include "core/MathMLNames.h"
+#include "core/SVGNames.h"
+#include "core/dom/Document.h"
#include "core/dom/Element.h"
+#include "core/dom/custom/CustomElementMicrotaskRunQueue.h"
#include "core/dom/custom/CustomElementObserver.h"
#include "core/dom/custom/CustomElementScheduler.h"
-namespace WebCore {
+namespace blink {
CustomElementMicrotaskImportStep* CustomElement::didCreateImport(HTMLImportChild* import)
{
return CustomElementScheduler::scheduleImport(import);
}
+void CustomElement::didFinishLoadingImport(Document& master)
+{
+ master.customElementMicrotaskRunQueue()->requestDispatchIfNeeded();
+}
+
Vector<AtomicString>& CustomElement::embedderCustomElementNames()
{
DEFINE_STATIC_LOCAL(Vector<AtomicString>, names, ());
DEFINE_STATIC_LOCAL(Vector<AtomicString>, reservedNames, ());
if (reservedNames.isEmpty()) {
reservedNames.append(MathMLNames::annotation_xmlTag.localName());
- // In principle, "color-profile" should exist in the SVGNames
- // namespace, but we don't implement the color-profile element.
- reservedNames.append("color-profile");
+#if ENABLE(SVG_FONTS)
reservedNames.append(SVGNames::font_faceTag.localName());
reservedNames.append(SVGNames::font_face_srcTag.localName());
reservedNames.append(SVGNames::font_face_uriTag.localName());
reservedNames.append(SVGNames::font_face_formatTag.localName());
reservedNames.append(SVGNames::font_face_nameTag.localName());
reservedNames.append(SVGNames::missing_glyphTag.localName());
+#endif
}
if (kNotFound == reservedNames.find(name))
case Element::WaitingForUpgrade:
element->setCustomElementDefinition(definition);
- CustomElementScheduler::scheduleCreatedCallback(definition->callbacks(), element);
+ CustomElementScheduler::scheduleCallback(definition->callbacks(), element, CustomElementLifecycleCallbacks::CreatedCallback);
break;
}
}
CustomElementScheduler::scheduleAttributeChangedCallback(element->customElementDefinition()->callbacks(), element, name, oldValue, newValue);
}
-void CustomElement::didEnterDocument(Element* element, const Document& document)
+void CustomElement::didAttach(Element* element, const Document& document)
{
ASSERT(element->customElementState() == Element::Upgraded);
if (!document.domWindow())
return;
- CustomElementScheduler::scheduleAttachedCallback(element->customElementDefinition()->callbacks(), element);
+ CustomElementScheduler::scheduleCallback(element->customElementDefinition()->callbacks(), element, CustomElementLifecycleCallbacks::AttachedCallback);
}
-void CustomElement::didLeaveDocument(Element* element, const Document& document)
+void CustomElement::didDetach(Element* element, const Document& document)
{
ASSERT(element->customElementState() == Element::Upgraded);
if (!document.domWindow())
return;
- CustomElementScheduler::scheduleDetachedCallback(element->customElementDefinition()->callbacks(), element);
+ CustomElementScheduler::scheduleCallback(element->customElementDefinition()->callbacks(), element, CustomElementLifecycleCallbacks::DetachedCallback);
}
void CustomElement::wasDestroyed(Element* element)
}
}
-} // namespace WebCore
+} // namespace blink