void CustomElementRegistry::deliverAllLifecycleCallbacks() { while (!activeCustomElementRegistries().isEmpty()) { Vector<RefPtr<CustomElementRegistry> > registries; copyToVector(activeCustomElementRegistries(), registries); activeCustomElementRegistries().clear(); for (size_t i = 0; i < registries.size(); ++i) registries[i]->deliverLifecycleCallbacks(); } }
void CustomElementRegistry::activate(const CustomElementInvocation& invocation) { bool wasInactive = m_invocations.isEmpty(); m_invocations.append(invocation); if (wasInactive) activeCustomElementRegistries().add(this); }
void CustomElementRegistry::enqueueReadyCallback(CustomElementCallback* callback, Element* element) { if (!callback->hasReady()) return; bool wasInactive = m_invocations.isEmpty(); m_invocations.append(CustomElementInvocation(callback, element)); if (wasInactive) activeCustomElementRegistries().add(this); }
void CustomElementRegistry::deactivate() { ASSERT(m_invocations.isEmpty()); if (activeCustomElementRegistries().contains(this)) activeCustomElementRegistries().remove(this); }