/*
 * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
 *
 * This file was generated by the dom/make_names.pl script.
 *
 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "config.h"
#include "JSHTMLElementWrapperFactory.h"
#include "JSHTMLAnchorElement.h"
#include "JSHTMLAppletElement.h"
#include "JSHTMLAreaElement.h"
#include "JSHTMLBaseElement.h"
#include "JSHTMLBaseFontElement.h"
#include "JSHTMLQuoteElement.h"
#include "JSHTMLBodyElement.h"
#include "JSHTMLBRElement.h"
#include "JSHTMLButtonElement.h"
#include "JSHTMLCanvasElement.h"
#include "JSHTMLTableCaptionElement.h"
#include "JSHTMLTableColElement.h"
#include "JSHTMLModElement.h"
#include "JSHTMLDirectoryElement.h"
#include "JSHTMLDivElement.h"
#include "JSHTMLDListElement.h"
#include "JSHTMLEmbedElement.h"
#include "JSHTMLFieldSetElement.h"
#include "JSHTMLFontElement.h"
#include "JSHTMLFormElement.h"
#include "JSHTMLFrameElement.h"
#include "JSHTMLFrameSetElement.h"
#include "JSHTMLHeadingElement.h"
#include "JSHTMLHeadElement.h"
#include "JSHTMLHRElement.h"
#include "JSHTMLHtmlElement.h"
#include "JSHTMLIFrameElement.h"
#include "JSHTMLImageElement.h"
#include "JSHTMLInputElement.h"
#include "JSHTMLUnknownElement.h"
#include "JSHTMLKeygenElement.h"
#include "JSHTMLLabelElement.h"
#include "JSHTMLLegendElement.h"
#include "JSHTMLLIElement.h"
#include "JSHTMLLinkElement.h"
#include "JSHTMLPreElement.h"
#include "JSHTMLMapElement.h"
#include "JSHTMLMarqueeElement.h"
#include "JSHTMLMenuElement.h"
#include "JSHTMLMetaElement.h"
#include "JSHTMLObjectElement.h"
#include "JSHTMLOListElement.h"
#include "JSHTMLOptGroupElement.h"
#include "JSHTMLOptionElement.h"
#include "JSHTMLOutputElement.h"
#include "JSHTMLParagraphElement.h"
#include "JSHTMLParamElement.h"
#include "JSHTMLScriptElement.h"
#include "JSHTMLSelectElement.h"
#include "JSHTMLSpanElement.h"
#include "JSHTMLStyleElement.h"
#include "JSHTMLTableElement.h"
#include "JSHTMLTableSectionElement.h"
#include "JSHTMLTableCellElement.h"
#include "JSHTMLTextAreaElement.h"
#include "JSHTMLTitleElement.h"
#include "JSHTMLTableRowElement.h"
#include "JSHTMLUListElement.h"
#include "JSHTMLUnknownElement.h"

#include "HTMLNames.h"

#include "HTMLAnchorElement.h"
#include "HTMLElement.h"
#include "HTMLAppletElement.h"
#include "HTMLAreaElement.h"
#include "HTMLBaseElement.h"
#include "HTMLBaseFontElement.h"
#include "HTMLBDIElement.h"
#include "HTMLQuoteElement.h"
#include "HTMLBodyElement.h"
#include "HTMLBRElement.h"
#include "HTMLButtonElement.h"
#include "HTMLCanvasElement.h"
#include "HTMLTableCaptionElement.h"
#include "HTMLTableColElement.h"
#include "HTMLModElement.h"
#include "HTMLDirectoryElement.h"
#include "HTMLDivElement.h"
#include "HTMLDListElement.h"
#include "HTMLEmbedElement.h"
#include "HTMLFieldSetElement.h"
#include "HTMLFontElement.h"
#include "HTMLFormElement.h"
#include "HTMLFrameElement.h"
#include "HTMLFrameSetElement.h"
#include "HTMLHeadingElement.h"
#include "HTMLHeadElement.h"
#include "HTMLHRElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLIFrameElement.h"
#include "HTMLImageElement.h"
#include "HTMLInputElement.h"
#include "HTMLUnknownElement.h"
#include "HTMLKeygenElement.h"
#include "HTMLLabelElement.h"
#include "HTMLLegendElement.h"
#include "HTMLLIElement.h"
#include "HTMLLinkElement.h"
#include "HTMLPreElement.h"
#include "HTMLMapElement.h"
#include "HTMLMarqueeElement.h"
#include "HTMLMenuElement.h"
#include "HTMLMetaElement.h"
#include "HTMLObjectElement.h"
#include "HTMLOListElement.h"
#include "HTMLOptGroupElement.h"
#include "HTMLOptionElement.h"
#include "HTMLOutputElement.h"
#include "HTMLParagraphElement.h"
#include "HTMLParamElement.h"
#include "HTMLScriptElement.h"
#include "HTMLSelectElement.h"
#include "HTMLSpanElement.h"
#include "HTMLStyleElement.h"
#include "HTMLTableElement.h"
#include "HTMLTableSectionElement.h"
#include "HTMLTableCellElement.h"
#include "HTMLTextAreaElement.h"
#include "HTMLTitleElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLUListElement.h"
#include "HTMLUnknownElement.h"

#include <wtf/StdLibExtras.h>

#if ENABLE(DATALIST_ELEMENT)
#include "HTMLDataListElement.h"
#include "JSHTMLDataListElement.h"
#endif

#if ENABLE(DETAILS_ELEMENT)
#include "HTMLDetailsElement.h"
#include "HTMLSummaryElement.h"
#include "JSHTMLDetailsElement.h"
#endif

#if ENABLE(DIALOG_ELEMENT)
#include "HTMLDialogElement.h"
#include "JSHTMLDialogElement.h"
#endif

#if ENABLE(METER_ELEMENT)
#include "HTMLMeterElement.h"
#include "JSHTMLMeterElement.h"
#endif

#if ENABLE(PROGRESS_ELEMENT)
#include "HTMLProgressElement.h"
#include "JSHTMLProgressElement.h"
#endif

#if ENABLE(SHADOW_DOM)
#include "HTMLContentElement.h"
#include "JSHTMLContentElement.h"
#endif

#if ENABLE(TEMPLATE_ELEMENT)
#include "HTMLTemplateElement.h"
#include "JSHTMLTemplateElement.h"
#endif

#if ENABLE(VIDEO)
#include "HTMLAudioElement.h"
#include "HTMLSourceElement.h"
#include "HTMLVideoElement.h"
#include "JSHTMLAudioElement.h"
#include "JSHTMLSourceElement.h"
#include "JSHTMLVideoElement.h"
#endif

#if ENABLE(VIDEO_TRACK)
#include "HTMLTrackElement.h"
#include "JSHTMLTrackElement.h"
#endif

#include "ContextFeatures.h"
#include "RuntimeEnabledFeatures.h"

#if ENABLE(VIDEO)
#include "Document.h"
#include "Settings.h"
#endif

using namespace JSC;

namespace WebCore {

using namespace HTMLNames;

typedef JSDOMWrapper* (*CreateHTMLElementWrapperFunction)(ExecState*, JSDOMGlobalObject*, PassRefPtr<HTMLElement>);

static JSDOMWrapper* createHTMLAnchorElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLAnchorElement, element.get());
}

static JSDOMWrapper* createHTMLElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLElement, element.get());
}

static JSDOMWrapper* createHTMLAppletElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLAppletElement, element.get());
}

static JSDOMWrapper* createHTMLAreaElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLAreaElement, element.get());
}

#if ENABLE(VIDEO)

static JSDOMWrapper* createHTMLAudioElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    if (element->isHTMLUnknownElement())
        return CREATE_DOM_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLAudioElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLBaseElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLBaseElement, element.get());
}

static JSDOMWrapper* createHTMLBaseFontElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLBaseFontElement, element.get());
}

static JSDOMWrapper* createHTMLQuoteElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLQuoteElement, element.get());
}

static JSDOMWrapper* createHTMLBodyElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLBodyElement, element.get());
}

static JSDOMWrapper* createHTMLBRElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLBRElement, element.get());
}

static JSDOMWrapper* createHTMLButtonElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLButtonElement, element.get());
}

static JSDOMWrapper* createHTMLCanvasElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLCanvasElement, element.get());
}

static JSDOMWrapper* createHTMLTableCaptionElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTableCaptionElement, element.get());
}

static JSDOMWrapper* createHTMLTableColElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTableColElement, element.get());
}

#if ENABLE(SHADOW_DOM)

static JSDOMWrapper* createHTMLContentElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    if (!RuntimeEnabledFeatures::shadowDOMEnabled()) {
        ASSERT(!element || element->isHTMLUnknownElement());
        return CREATE_DOM_WRAPPER(exec, globalObject, HTMLUnknownElement, element.get());
    }

    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLContentElement, element.get());
}
#endif

#if ENABLE(DATALIST_ELEMENT)

static JSDOMWrapper* createHTMLDataListElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLDataListElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLModElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLModElement, element.get());
}

#if ENABLE(DETAILS_ELEMENT)

static JSDOMWrapper* createHTMLDetailsElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLDetailsElement, element.get());
}

#endif

#if ENABLE(DIALOG_ELEMENT)

static JSDOMWrapper* createHTMLDialogElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    if (!ContextFeatures::dialogElementEnabled(element->document())) {
        ASSERT(!element || element->isHTMLUnknownElement());
        return CREATE_DOM_WRAPPER(exec, globalObject, HTMLUnknownElement, element.get());
    }

    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLDialogElement, element.get());
}
#endif

static JSDOMWrapper* createHTMLDirectoryElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLDirectoryElement, element.get());
}

static JSDOMWrapper* createHTMLDivElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLDivElement, element.get());
}

static JSDOMWrapper* createHTMLDListElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLDListElement, element.get());
}

static JSDOMWrapper* createHTMLEmbedElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLEmbedElement, element.get());
}

static JSDOMWrapper* createHTMLFieldSetElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLFieldSetElement, element.get());
}

static JSDOMWrapper* createHTMLFontElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLFontElement, element.get());
}

static JSDOMWrapper* createHTMLFormElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLFormElement, element.get());
}

static JSDOMWrapper* createHTMLFrameElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLFrameElement, element.get());
}

static JSDOMWrapper* createHTMLFrameSetElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLFrameSetElement, element.get());
}

static JSDOMWrapper* createHTMLHeadingElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLHeadingElement, element.get());
}

static JSDOMWrapper* createHTMLHeadElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLHeadElement, element.get());
}

static JSDOMWrapper* createHTMLHRElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLHRElement, element.get());
}

static JSDOMWrapper* createHTMLHtmlElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLHtmlElement, element.get());
}

static JSDOMWrapper* createHTMLIFrameElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLIFrameElement, element.get());
}

static JSDOMWrapper* createHTMLImageElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLImageElement, element.get());
}

static JSDOMWrapper* createHTMLInputElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLInputElement, element.get());
}

static JSDOMWrapper* createHTMLUnknownElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLUnknownElement, element.get());
}

static JSDOMWrapper* createHTMLKeygenElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLKeygenElement, element.get());
}

static JSDOMWrapper* createHTMLLabelElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLLabelElement, element.get());
}

static JSDOMWrapper* createHTMLLegendElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLLegendElement, element.get());
}

static JSDOMWrapper* createHTMLLIElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLLIElement, element.get());
}

static JSDOMWrapper* createHTMLLinkElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLLinkElement, element.get());
}

static JSDOMWrapper* createHTMLPreElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLPreElement, element.get());
}

static JSDOMWrapper* createHTMLMapElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLMapElement, element.get());
}

static JSDOMWrapper* createHTMLMarqueeElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLMarqueeElement, element.get());
}

static JSDOMWrapper* createHTMLMenuElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLMenuElement, element.get());
}

static JSDOMWrapper* createHTMLMetaElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLMetaElement, element.get());
}

#if ENABLE(METER_ELEMENT)

static JSDOMWrapper* createHTMLMeterElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLMeterElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLObjectElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLObjectElement, element.get());
}

static JSDOMWrapper* createHTMLOListElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLOListElement, element.get());
}

static JSDOMWrapper* createHTMLOptGroupElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLOptGroupElement, element.get());
}

static JSDOMWrapper* createHTMLOptionElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLOptionElement, element.get());
}

static JSDOMWrapper* createHTMLOutputElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLOutputElement, element.get());
}

static JSDOMWrapper* createHTMLParagraphElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLParagraphElement, element.get());
}

static JSDOMWrapper* createHTMLParamElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLParamElement, element.get());
}

#if ENABLE(PROGRESS_ELEMENT)

static JSDOMWrapper* createHTMLProgressElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLProgressElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLScriptElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLScriptElement, element.get());
}

static JSDOMWrapper* createHTMLSelectElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLSelectElement, element.get());
}

#if ENABLE(VIDEO)

static JSDOMWrapper* createHTMLSourceElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    if (element->isHTMLUnknownElement())
        return CREATE_DOM_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLSourceElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLSpanElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLSpanElement, element.get());
}

static JSDOMWrapper* createHTMLStyleElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLStyleElement, element.get());
}

static JSDOMWrapper* createHTMLTableElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTableElement, element.get());
}

static JSDOMWrapper* createHTMLTableSectionElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTableSectionElement, element.get());
}

static JSDOMWrapper* createHTMLTableCellElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTableCellElement, element.get());
}

#if ENABLE(TEMPLATE_ELEMENT)

static JSDOMWrapper* createHTMLTemplateElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTemplateElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLTextAreaElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTextAreaElement, element.get());
}

static JSDOMWrapper* createHTMLTitleElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTitleElement, element.get());
}

static JSDOMWrapper* createHTMLTableRowElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTableRowElement, element.get());
}

#if ENABLE(VIDEO_TRACK)

static JSDOMWrapper* createHTMLTrackElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    if (element->isHTMLUnknownElement())
        return CREATE_DOM_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLTrackElement, element.get());
}

#endif

static JSDOMWrapper* createHTMLUListElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLUListElement, element.get());
}

#if ENABLE(VIDEO)

static JSDOMWrapper* createHTMLVideoElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    if (element->isHTMLUnknownElement())
        return CREATE_DOM_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLVideoElement, element.get());
}

#endif

JSDOMWrapper* createJSHTMLWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    typedef HashMap<WTF::AtomicStringImpl*, CreateHTMLElementWrapperFunction> FunctionMap;
    DEFINE_STATIC_LOCAL(FunctionMap, map, ());
    if (map.isEmpty()) {
       map.set(aTag.localName().impl(), createHTMLAnchorElementWrapper);
       map.set(abbrTag.localName().impl(), createHTMLElementWrapper);
       map.set(acronymTag.localName().impl(), createHTMLElementWrapper);
       map.set(addressTag.localName().impl(), createHTMLElementWrapper);
       map.set(appletTag.localName().impl(), createHTMLAppletElementWrapper);
       map.set(areaTag.localName().impl(), createHTMLAreaElementWrapper);
       map.set(articleTag.localName().impl(), createHTMLElementWrapper);
       map.set(asideTag.localName().impl(), createHTMLElementWrapper);
#if ENABLE(VIDEO)
       map.set(audioTag.localName().impl(), createHTMLAudioElementWrapper);
#endif
       map.set(bTag.localName().impl(), createHTMLElementWrapper);
       map.set(baseTag.localName().impl(), createHTMLBaseElementWrapper);
       map.set(basefontTag.localName().impl(), createHTMLBaseFontElementWrapper);
       map.set(bdiTag.localName().impl(), createHTMLElementWrapper);
       map.set(bdoTag.localName().impl(), createHTMLElementWrapper);
       map.set(bgsoundTag.localName().impl(), createHTMLElementWrapper);
       map.set(bigTag.localName().impl(), createHTMLElementWrapper);
       map.set(blockquoteTag.localName().impl(), createHTMLQuoteElementWrapper);
       map.set(bodyTag.localName().impl(), createHTMLBodyElementWrapper);
       map.set(brTag.localName().impl(), createHTMLBRElementWrapper);
       map.set(buttonTag.localName().impl(), createHTMLButtonElementWrapper);
       map.set(canvasTag.localName().impl(), createHTMLCanvasElementWrapper);
       map.set(captionTag.localName().impl(), createHTMLTableCaptionElementWrapper);
       map.set(centerTag.localName().impl(), createHTMLElementWrapper);
       map.set(citeTag.localName().impl(), createHTMLElementWrapper);
       map.set(codeTag.localName().impl(), createHTMLElementWrapper);
       map.set(colTag.localName().impl(), createHTMLTableColElementWrapper);
       map.set(colgroupTag.localName().impl(), createHTMLTableColElementWrapper);
       map.set(commandTag.localName().impl(), createHTMLElementWrapper);
#if ENABLE(SHADOW_DOM)
       map.set(contentTag.localName().impl(), createHTMLContentElementWrapper);
#endif
#if ENABLE(DATALIST_ELEMENT)
       map.set(datalistTag.localName().impl(), createHTMLDataListElementWrapper);
#endif
       map.set(ddTag.localName().impl(), createHTMLElementWrapper);
       map.set(delTag.localName().impl(), createHTMLModElementWrapper);
#if ENABLE(DETAILS_ELEMENT)
       map.set(detailsTag.localName().impl(), createHTMLDetailsElementWrapper);
#endif
       map.set(dfnTag.localName().impl(), createHTMLElementWrapper);
#if ENABLE(DIALOG_ELEMENT)
       map.set(dialogTag.localName().impl(), createHTMLDialogElementWrapper);
#endif
       map.set(dirTag.localName().impl(), createHTMLDirectoryElementWrapper);
       map.set(divTag.localName().impl(), createHTMLDivElementWrapper);
       map.set(dlTag.localName().impl(), createHTMLDListElementWrapper);
       map.set(dtTag.localName().impl(), createHTMLElementWrapper);
       map.set(emTag.localName().impl(), createHTMLElementWrapper);
       map.set(embedTag.localName().impl(), createHTMLEmbedElementWrapper);
       map.set(fieldsetTag.localName().impl(), createHTMLFieldSetElementWrapper);
       map.set(figcaptionTag.localName().impl(), createHTMLElementWrapper);
       map.set(figureTag.localName().impl(), createHTMLElementWrapper);
       map.set(fontTag.localName().impl(), createHTMLFontElementWrapper);
       map.set(footerTag.localName().impl(), createHTMLElementWrapper);
       map.set(formTag.localName().impl(), createHTMLFormElementWrapper);
       map.set(frameTag.localName().impl(), createHTMLFrameElementWrapper);
       map.set(framesetTag.localName().impl(), createHTMLFrameSetElementWrapper);
       map.set(h1Tag.localName().impl(), createHTMLHeadingElementWrapper);
       map.set(h2Tag.localName().impl(), createHTMLHeadingElementWrapper);
       map.set(h3Tag.localName().impl(), createHTMLHeadingElementWrapper);
       map.set(h4Tag.localName().impl(), createHTMLHeadingElementWrapper);
       map.set(h5Tag.localName().impl(), createHTMLHeadingElementWrapper);
       map.set(h6Tag.localName().impl(), createHTMLHeadingElementWrapper);
       map.set(headTag.localName().impl(), createHTMLHeadElementWrapper);
       map.set(headerTag.localName().impl(), createHTMLElementWrapper);
       map.set(hgroupTag.localName().impl(), createHTMLElementWrapper);
       map.set(hrTag.localName().impl(), createHTMLHRElementWrapper);
       map.set(htmlTag.localName().impl(), createHTMLHtmlElementWrapper);
       map.set(iTag.localName().impl(), createHTMLElementWrapper);
       map.set(iframeTag.localName().impl(), createHTMLIFrameElementWrapper);
       map.set(imageTag.localName().impl(), createHTMLElementWrapper);
       map.set(imgTag.localName().impl(), createHTMLImageElementWrapper);
       map.set(inputTag.localName().impl(), createHTMLInputElementWrapper);
       map.set(insTag.localName().impl(), createHTMLModElementWrapper);
       map.set(isindexTag.localName().impl(), createHTMLUnknownElementWrapper);
       map.set(kbdTag.localName().impl(), createHTMLElementWrapper);
       map.set(keygenTag.localName().impl(), createHTMLKeygenElementWrapper);
       map.set(labelTag.localName().impl(), createHTMLLabelElementWrapper);
       map.set(layerTag.localName().impl(), createHTMLElementWrapper);
       map.set(legendTag.localName().impl(), createHTMLLegendElementWrapper);
       map.set(liTag.localName().impl(), createHTMLLIElementWrapper);
       map.set(linkTag.localName().impl(), createHTMLLinkElementWrapper);
       map.set(listingTag.localName().impl(), createHTMLPreElementWrapper);
       map.set(mainTag.localName().impl(), createHTMLElementWrapper);
       map.set(mapTag.localName().impl(), createHTMLMapElementWrapper);
       map.set(markTag.localName().impl(), createHTMLElementWrapper);
       map.set(marqueeTag.localName().impl(), createHTMLMarqueeElementWrapper);
       map.set(menuTag.localName().impl(), createHTMLMenuElementWrapper);
       map.set(metaTag.localName().impl(), createHTMLMetaElementWrapper);
#if ENABLE(METER_ELEMENT)
       map.set(meterTag.localName().impl(), createHTMLMeterElementWrapper);
#endif
       map.set(navTag.localName().impl(), createHTMLElementWrapper);
       map.set(nobrTag.localName().impl(), createHTMLElementWrapper);
       map.set(noembedTag.localName().impl(), createHTMLElementWrapper);
       map.set(noframesTag.localName().impl(), createHTMLElementWrapper);
       map.set(nolayerTag.localName().impl(), createHTMLElementWrapper);
       map.set(noscriptTag.localName().impl(), createHTMLElementWrapper);
       map.set(objectTag.localName().impl(), createHTMLObjectElementWrapper);
       map.set(olTag.localName().impl(), createHTMLOListElementWrapper);
       map.set(optgroupTag.localName().impl(), createHTMLOptGroupElementWrapper);
       map.set(optionTag.localName().impl(), createHTMLOptionElementWrapper);
       map.set(outputTag.localName().impl(), createHTMLOutputElementWrapper);
       map.set(pTag.localName().impl(), createHTMLParagraphElementWrapper);
       map.set(paramTag.localName().impl(), createHTMLParamElementWrapper);
       map.set(plaintextTag.localName().impl(), createHTMLElementWrapper);
       map.set(preTag.localName().impl(), createHTMLPreElementWrapper);
#if ENABLE(PROGRESS_ELEMENT)
       map.set(progressTag.localName().impl(), createHTMLProgressElementWrapper);
#endif
       map.set(qTag.localName().impl(), createHTMLQuoteElementWrapper);
       map.set(rpTag.localName().impl(), createHTMLElementWrapper);
       map.set(rtTag.localName().impl(), createHTMLElementWrapper);
       map.set(rubyTag.localName().impl(), createHTMLElementWrapper);
       map.set(sTag.localName().impl(), createHTMLElementWrapper);
       map.set(sampTag.localName().impl(), createHTMLElementWrapper);
       map.set(scriptTag.localName().impl(), createHTMLScriptElementWrapper);
       map.set(sectionTag.localName().impl(), createHTMLElementWrapper);
       map.set(selectTag.localName().impl(), createHTMLSelectElementWrapper);
       map.set(smallTag.localName().impl(), createHTMLElementWrapper);
#if ENABLE(VIDEO)
       map.set(sourceTag.localName().impl(), createHTMLSourceElementWrapper);
#endif
       map.set(spanTag.localName().impl(), createHTMLSpanElementWrapper);
       map.set(strikeTag.localName().impl(), createHTMLElementWrapper);
       map.set(strongTag.localName().impl(), createHTMLElementWrapper);
       map.set(styleTag.localName().impl(), createHTMLStyleElementWrapper);
       map.set(subTag.localName().impl(), createHTMLElementWrapper);
#if ENABLE(DETAILS_ELEMENT)
       map.set(summaryTag.localName().impl(), createHTMLElementWrapper);
#endif
       map.set(supTag.localName().impl(), createHTMLElementWrapper);
       map.set(tableTag.localName().impl(), createHTMLTableElementWrapper);
       map.set(tbodyTag.localName().impl(), createHTMLTableSectionElementWrapper);
       map.set(tdTag.localName().impl(), createHTMLTableCellElementWrapper);
#if ENABLE(TEMPLATE_ELEMENT)
       map.set(templateTag.localName().impl(), createHTMLTemplateElementWrapper);
#endif
       map.set(textareaTag.localName().impl(), createHTMLTextAreaElementWrapper);
       map.set(tfootTag.localName().impl(), createHTMLTableSectionElementWrapper);
       map.set(thTag.localName().impl(), createHTMLTableCellElementWrapper);
       map.set(theadTag.localName().impl(), createHTMLTableSectionElementWrapper);
       map.set(titleTag.localName().impl(), createHTMLTitleElementWrapper);
       map.set(trTag.localName().impl(), createHTMLTableRowElementWrapper);
#if ENABLE(VIDEO_TRACK)
       map.set(trackTag.localName().impl(), createHTMLTrackElementWrapper);
#endif
       map.set(ttTag.localName().impl(), createHTMLElementWrapper);
       map.set(uTag.localName().impl(), createHTMLElementWrapper);
       map.set(ulTag.localName().impl(), createHTMLUListElementWrapper);
       map.set(varTag.localName().impl(), createHTMLElementWrapper);
#if ENABLE(VIDEO)
       map.set(videoTag.localName().impl(), createHTMLVideoElementWrapper);
#endif
       map.set(wbrTag.localName().impl(), createHTMLElementWrapper);
       map.set(webkitShadowContentTag.localName().impl(), createHTMLElementWrapper);
       map.set(xmpTag.localName().impl(), createHTMLPreElementWrapper);
    }
    CreateHTMLElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
    if (createWrapperFunction)
        return createWrapperFunction(exec, globalObject, element);
    return CREATE_DOM_WRAPPER(exec, globalObject, HTMLUnknownElement, element.get());
}
}

