void CustomElementRegistrationContext::setIsAttributeAndTypeExtension(Element* element, const AtomicString& type)
{
    ASSERT(element);
    ASSERT(!type.isEmpty());
    element->setAttribute(HTMLNames::isAttr, type);
    setTypeExtension(element, type);
}
Exemplo n.º 2
0
PassRefPtr<Element> CustomElementRegistry::createElement(const QualifiedName& localName, const AtomicString& typeExtension) const
{
    const QualifiedName& typeName = QualifiedName(nullAtom, typeExtension, localName.namespaceURI());
    if (RefPtr<CustomElementConstructor> found = find(typeName, localName)) {
        RefPtr<Element> created = found->createElement();
        if (!typeName.localName().isEmpty() && localName != typeName)
            return setTypeExtension(created, typeExtension);
        return created.release();
    }

    return 0;
}