/*
 * 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 "JSHTMLAudioElement.h"
#include "JSHTMLBaseElement.h"
#include "JSHTMLBaseFontElement.h"
#include "JSHTMLBlockquoteElement.h"
#include "JSHTMLBodyElement.h"
#include "JSHTMLBRElement.h"
#include "JSHTMLButtonElement.h"
#include "JSHTMLCanvasElement.h"
#include "JSHTMLTableCaptionElement.h"
#include "JSHTMLTableColElement.h"
#include "JSHTMLDataGridElement.h"
#include "JSHTMLDataListElement.h"
#include "JSHTMLDataGridCellElement.h"
#include "JSHTMLDataGridColElement.h"
#include "JSHTMLModElement.h"
#include "JSHTMLDirectoryElement.h"
#include "JSHTMLDivElement.h"
#include "JSHTMLDListElement.h"
#include "JSHTMLDataGridRowElement.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 "JSHTMLIsIndexElement.h"
#include "JSHTMLSelectElement.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 "JSHTMLMeterElement.h"
#include "JSHTMLObjectElement.h"
#include "JSHTMLOListElement.h"
#include "JSHTMLOptGroupElement.h"
#include "JSHTMLOptionElement.h"
#include "JSHTMLParagraphElement.h"
#include "JSHTMLParamElement.h"
#include "JSHTMLProgressElement.h"
#include "JSHTMLQuoteElement.h"
#include "JSHTMLScriptElement.h"
#include "JSHTMLSourceElement.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 "JSHTMLVideoElement.h"

#include "HTMLNames.h"

#include "HTMLAnchorElement.h"
#include "HTMLElement.h"
#include "HTMLAppletElement.h"
#include "HTMLAreaElement.h"
#include "HTMLAudioElement.h"
#include "HTMLBaseElement.h"
#include "HTMLBaseFontElement.h"
#include "HTMLBlockquoteElement.h"
#include "HTMLBodyElement.h"
#include "HTMLBRElement.h"
#include "HTMLButtonElement.h"
#include "HTMLCanvasElement.h"
#include "HTMLTableCaptionElement.h"
#include "HTMLTableColElement.h"
#include "HTMLDataGridElement.h"
#include "HTMLDataListElement.h"
#include "HTMLDataGridCellElement.h"
#include "HTMLDataGridColElement.h"
#include "HTMLModElement.h"
#include "HTMLDirectoryElement.h"
#include "HTMLDivElement.h"
#include "HTMLDListElement.h"
#include "HTMLDataGridRowElement.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 "HTMLIsIndexElement.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 "HTMLMeterElement.h"
#include "HTMLObjectElement.h"
#include "HTMLOListElement.h"
#include "HTMLOptGroupElement.h"
#include "HTMLOptionElement.h"
#include "HTMLParagraphElement.h"
#include "HTMLParamElement.h"
#include "HTMLProgressElement.h"
#include "HTMLQuoteElement.h"
#include "HTMLScriptElement.h"
#include "HTMLSelectElement.h"
#include "HTMLSourceElement.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 "HTMLVideoElement.h"
#include <wtf/StdLibExtras.h>

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

using namespace JSC;

namespace WebCore {

using namespace HTMLNames;

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

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

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

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

#if ENABLE(VIDEO)

static JSNode* createHTMLAudioElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    Settings* settings = element->document()->settings();
    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
        return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLAudioElement, element.get());
}

#endif

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

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

static JSNode* createHTMLBlockquoteElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLBlockquoteElement, element.get());
}

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

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

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

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

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

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

#if ENABLE(DATAGRID)

static JSNode* createHTMLDataGridElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLDataGridElement, element.get());
}

#endif

#if ENABLE(DATALIST)

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

#endif

#if ENABLE(DATAGRID)

static JSNode* createHTMLDataGridCellElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLDataGridCellElement, element.get());
}

#endif

#if ENABLE(DATAGRID)

static JSNode* createHTMLDataGridColElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLDataGridColElement, element.get());
}

#endif

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

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

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

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

#if ENABLE(DATAGRID)

static JSNode* createHTMLDataGridRowElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLDataGridRowElement, element.get());
}

#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

static JSNode* createHTMLIsIndexElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLIsIndexElement, element.get());
}

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

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

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

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

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

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

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

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

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

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

#if ENABLE(METER_TAG)

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

#endif

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

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

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

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

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

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

#if ENABLE(PROGRESS_TAG)

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

#endif

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

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

#if ENABLE(VIDEO)

static JSNode* createHTMLSourceElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    Settings* settings = element->document()->settings();
    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
        return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLSourceElement, element.get());
}

#endif

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

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

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

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

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

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

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

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

#if ENABLE(VIDEO)

static JSNode* createHTMLVideoElementWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    Settings* settings = element->document()->settings();
    if (!MediaPlayer::isAvailable() || (settings && !settings->isMediaEnabled()))
        return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLElement, element.get());
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLVideoElement, element.get());
}

#endif

JSNode* createJSHTMLWrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> element)
{
    typedef HashMap<WebCore::AtomicStringImpl*, CreateHTMLElementWrapperFunction> FunctionMap;
    DEFINE_STATIC_LOCAL(FunctionMap, map, ());
    if (map.isEmpty()) {
       map.set(aTag.localName().impl(), createHTMLAnchorElementWrapper);
       map.set(appletTag.localName().impl(), createHTMLAppletElementWrapper);
       map.set(areaTag.localName().impl(), createHTMLAreaElementWrapper);
#if ENABLE(VIDEO)
       map.set(audioTag.localName().impl(), createHTMLAudioElementWrapper);
#endif
       map.set(baseTag.localName().impl(), createHTMLBaseElementWrapper);
       map.set(basefontTag.localName().impl(), createHTMLBaseFontElementWrapper);
       map.set(blockquoteTag.localName().impl(), createHTMLBlockquoteElementWrapper);
       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(colTag.localName().impl(), createHTMLTableColElementWrapper);
       map.set(colgroupTag.localName().impl(), createHTMLTableColElementWrapper);
#if ENABLE(DATAGRID)
       map.set(datagridTag.localName().impl(), createHTMLDataGridElementWrapper);
#endif
#if ENABLE(DATALIST)
       map.set(datalistTag.localName().impl(), createHTMLDataListElementWrapper);
#endif
#if ENABLE(DATAGRID)
       map.set(dcellTag.localName().impl(), createHTMLDataGridCellElementWrapper);
#endif
#if ENABLE(DATAGRID)
       map.set(dcolTag.localName().impl(), createHTMLDataGridColElementWrapper);
#endif
       map.set(delTag.localName().impl(), createHTMLModElementWrapper);
       map.set(dirTag.localName().impl(), createHTMLDirectoryElementWrapper);
       map.set(divTag.localName().impl(), createHTMLDivElementWrapper);
       map.set(dlTag.localName().impl(), createHTMLDListElementWrapper);
#if ENABLE(DATAGRID)
       map.set(drowTag.localName().impl(), createHTMLDataGridRowElementWrapper);
#endif
       map.set(embedTag.localName().impl(), createHTMLEmbedElementWrapper);
       map.set(fieldsetTag.localName().impl(), createHTMLFieldSetElementWrapper);
       map.set(fontTag.localName().impl(), createHTMLFontElementWrapper);
       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(hrTag.localName().impl(), createHTMLHRElementWrapper);
       map.set(htmlTag.localName().impl(), createHTMLHtmlElementWrapper);
       map.set(iframeTag.localName().impl(), createHTMLIFrameElementWrapper);
       map.set(imageTag.localName().impl(), createHTMLImageElementWrapper);
       map.set(imgTag.localName().impl(), createHTMLImageElementWrapper);
       map.set(inputTag.localName().impl(), createHTMLInputElementWrapper);
       map.set(insTag.localName().impl(), createHTMLModElementWrapper);
       map.set(isindexTag.localName().impl(), createHTMLIsIndexElementWrapper);
       map.set(keygenTag.localName().impl(), createHTMLSelectElementWrapper);
       map.set(labelTag.localName().impl(), createHTMLLabelElementWrapper);
       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(mapTag.localName().impl(), createHTMLMapElementWrapper);
       map.set(marqueeTag.localName().impl(), createHTMLMarqueeElementWrapper);
       map.set(menuTag.localName().impl(), createHTMLMenuElementWrapper);
       map.set(metaTag.localName().impl(), createHTMLMetaElementWrapper);
#if ENABLE(METER_TAG)
       map.set(meterTag.localName().impl(), createHTMLMeterElementWrapper);
#endif
       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(pTag.localName().impl(), createHTMLParagraphElementWrapper);
       map.set(paramTag.localName().impl(), createHTMLParamElementWrapper);
       map.set(preTag.localName().impl(), createHTMLPreElementWrapper);
#if ENABLE(PROGRESS_TAG)
       map.set(progressTag.localName().impl(), createHTMLProgressElementWrapper);
#endif
       map.set(qTag.localName().impl(), createHTMLQuoteElementWrapper);
       map.set(scriptTag.localName().impl(), createHTMLScriptElementWrapper);
       map.set(selectTag.localName().impl(), createHTMLSelectElementWrapper);
#if ENABLE(VIDEO)
       map.set(sourceTag.localName().impl(), createHTMLSourceElementWrapper);
#endif
       map.set(styleTag.localName().impl(), createHTMLStyleElementWrapper);
       map.set(tableTag.localName().impl(), createHTMLTableElementWrapper);
       map.set(tbodyTag.localName().impl(), createHTMLTableSectionElementWrapper);
       map.set(tdTag.localName().impl(), createHTMLTableCellElementWrapper);
       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);
       map.set(ulTag.localName().impl(), createHTMLUListElementWrapper);
#if ENABLE(VIDEO)
       map.set(videoTag.localName().impl(), createHTMLVideoElementWrapper);
#endif
       map.set(xmpTag.localName().impl(), createHTMLPreElementWrapper);
    }
    CreateHTMLElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
    if (createWrapperFunction)
        return createWrapperFunction(exec, globalObject, element);
    return CREATE_DOM_NODE_WRAPPER(exec, globalObject, HTMLElement, element.get());
}

}

